1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

h2 client: no close callback for network stream

This commit is contained in:
Andy Green 2018-05-24 11:26:09 +08:00
parent c4f4b5c3c4
commit 0a1d54a3c4

View file

@ -826,7 +826,15 @@ just_kill_connection:
if (!wsi->protocol)
pro = &wsi->vhost->protocols[0];
pro->callback(wsi,
if (!wsi->upgraded_to_http2 || !lwsi_role_client(wsi))
/*
* The network wsi for a client h2 connection shouldn't
* call back for its role: the child stream connections
* own the role. Otherwise h2 will call back closed
* one too many times as the children do it and then
* the closing network stream.
*/
pro->callback(wsi,
wsi->role_ops->close_cb[lwsi_role_server(wsi)],
wsi->user_space, NULL, 0);
wsi->told_user_closed = 1;