Skip to content

fix(http) request->abort() was not firing onDisconnect() - #458

Closed
mathieucarbou wants to merge 2 commits into
mainfrom
fix/onDisconnect
Closed

fix(http) request->abort() was not firing onDisconnect()#458
mathieucarbou wants to merge 2 commits into
mainfrom
fix/onDisconnect

Conversation

@mathieucarbou

Copy link
Copy Markdown
Member

No description provided.

@mathieucarbou mathieucarbou self-assigned this Jul 19, 2026
@mathieucarbou mathieucarbou added the Type: Bug Something isn't working label Jul 19, 2026
@mathieucarbou mathieucarbou changed the title Fix: request->abort() was not firing onDisconnect() fix(http) request->abort() was not firing onDisconnect() Jul 19, 2026
@mathieucarbou
mathieucarbou marked this pull request as draft July 20, 2026 13:27
@mathieucarbou

Copy link
Copy Markdown
Member Author

@mathieucarbou

mathieucarbou commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

@me-no-dev @willmmiles : I am extracting in another PR (#459) the re-ordering that I will merge once #459 passes in order to leave in this PR only the onDisconnect(); call addition that might actually not be necessary.

@mathieucarbou

Copy link
Copy Markdown
Member Author

I am closing this PR.

As I commented here: ESP32Async/AsyncTCP#118 (comment) onDisconnect was indeed called.

Currently, it is called from the async task when the error event is processed (which can lead to a use after free).

PR ESP32Async/AsyncTCP#118 proposes to remove this use after free and process the callback during the abort call in the caller thread, exactly like it is done for close.

@mathieucarbou
mathieucarbou deleted the fix/onDisconnect branch July 20, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Pending Merge Type: Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants