Navigation Menu

Skip to content

Commit

Permalink
client: allow pipelined http to call LWS_CALLBACK_CLOSED_CLIENT_HTTP
Browse files Browse the repository at this point in the history
  • Loading branch information
lws-team committed Aug 15, 2018
1 parent 956bb4e commit 8de6e5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/core/libwebsockets.c
Expand Up @@ -888,7 +888,9 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, const char *

/* 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;

Expand Down
9 changes: 5 additions & 4 deletions lib/roles/http/client/client.c
Expand Up @@ -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;
Expand Down

0 comments on commit 8de6e5f

Please sign in to comment.