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

client: allow pipelined http to call LWS_CALLBACK_CLOSED_CLIENT_HTTP

This commit is contained in:
Andy Green 2018-08-15 12:49:32 +08:00
parent 956bb4e255
commit 8de6e5fcf0
2 changed files with 8 additions and 5 deletions

View file

@ -888,7 +888,9 @@ just_kill_connection:
/* tell the user it's all over for this guy */
if (lwsi_state_est_PRE_CLOSE(wsi) && !wsi->told_user_closed &&
if ((lwsi_state_est_PRE_CLOSE(wsi) ||
lwsi_state_PRE_CLOSE(wsi) == LRS_WAITING_SERVER_REPLY) &&
!wsi->told_user_closed &&
wsi->role_ops->close_cb[lwsi_role_server(wsi)]) {
const struct lws_protocols *pro = wsi->protocol;

View file

@ -549,11 +549,12 @@ lws_http_transaction_completed_client(struct lws *wsi)
{
struct lws *wsi_eff = lws_client_wsi_effective(wsi);
lwsl_info("%s: wsi: %p, wsi_eff: %p\n", __func__, wsi, wsi_eff);
lwsl_info("%s: wsi: %p, wsi_eff: %p (%s)\n", __func__, wsi, wsi_eff,
wsi_eff->protocol->name);
if (user_callback_handle_rxflow(wsi_eff->protocol->callback,
wsi_eff, LWS_CALLBACK_COMPLETED_CLIENT_HTTP,
wsi_eff->user_space, NULL, 0)) {
if (user_callback_handle_rxflow(wsi_eff->protocol->callback, wsi_eff,
LWS_CALLBACK_COMPLETED_CLIENT_HTTP,
wsi_eff->user_space, NULL, 0)) {
lwsl_debug("%s: Completed call returned nonzero (role 0x%x)\n",
__func__, lwsi_role(wsi_eff));
return -1;