if ((wsi->u.ws.rxflow_change_to & 1) && wsi->u.ws.rxflow_buffer) {
n = libwebsocket_interpret_incoming_packet(wsi, NULL, 0);
if (n < 0) {
- lwsl_info("closing connection at libwebsocket_rx_flow_control:\n");
- libwebsocket_close_and_free_session(context, wsi, LWS_CLOSE_STATUS_NOSTATUS);
+ lwsl_info("returning that we want to close connection at libwebsocket_rx_flow_control:\n");
return -1;
}
if (n)
int n;
n = callback_function(context, wsi, reason, user, in, len);
- if (n) {
- libwebsocket_close_and_free_session(context, wsi,
- LWS_CLOSE_STATUS_NOSTATUS);
- return n;
- }
-
- _libwebsocket_rx_flow_control(wsi);
+ if (!n)
+ n = _libwebsocket_rx_flow_control(wsi);
- return 0;
+ return n;
}
if (wsi->protocol->callback)
ret = user_callback_handle_rxflow(wsi->protocol->callback, context, wsi, LWS_CALLBACK_HTTP_FILE_COMPLETION, wsi->user_space,
NULL, 0);
- /* user_callback_handle_rxflow did any close already */
- return 0;
+ return ret;
}
}
{
int n;
struct lws_tokens eff_buf;
+ int ret = 0;
#ifndef LWS_NO_EXTENSIONS
int handled;
int m;
}
#endif
if (eff_buf.token_len > 0) {
- eff_buf.token[eff_buf.token_len] = '\0';
+ eff_buf.token[eff_buf.token_len] = '\0';
- if (wsi->protocol->callback)
- user_callback_handle_rxflow(wsi->protocol->callback,
+ if (wsi->protocol->callback)
+ ret = user_callback_handle_rxflow(wsi->protocol->callback,
wsi->protocol->owning_server,
wsi, LWS_CALLBACK_RECEIVE,
wsi->user_space,
break;
}
- return 0;
+ return ret;
illegal_ctl_length: