mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
Callback with reason LWS_CALLBACK_CLOSED_HTTP when HTTP closed before serve.
If the remote HTTP client closes the connection before serving commences, the only notification client code receives is LWS_CALLBACK_WSI_DESTROY. This commit gives LWS_CALLBACK_CLOSED_HTTP as well, as would happen if HTTP serving had already commenced.
This commit is contained in:
parent
ba3c75c065
commit
6a779771f4
1 changed files with 4 additions and 0 deletions
|
@ -92,6 +92,10 @@ libwebsocket_close_and_free_session(struct libwebsocket_context *context,
|
|||
goto just_kill_connection;
|
||||
}
|
||||
|
||||
if (wsi->mode == LWS_CONNMODE_HTTP_SERVING)
|
||||
context->protocols[0].callback(context, wsi,
|
||||
LWS_CALLBACK_CLOSED_HTTP, wsi->user_space, NULL, 0);
|
||||
|
||||
if (wsi->mode == LWS_CONNMODE_HTTP_SERVING_ACCEPTED) {
|
||||
if (wsi->u.http.fd != LWS_INVALID_FILE) {
|
||||
lwsl_debug("closing http file\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue