dont close in user callback wrapper let ancestor do it
Signed-off-by: Andy Green <andy.green@linaro.org>
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index c96f751..619b008 100644
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -1382,8 +1382,7 @@
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)
@@ -1495,15 +1494,10 @@
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;
- }
+ if (!n)
+ n = _libwebsocket_rx_flow_control(wsi);
- _libwebsocket_rx_flow_control(wsi);
-
- return 0;
+ return n;
}