From 41434fad532edf6df6913994299f72ea0035dbdd Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 28 Dec 2015 12:45:52 +0800 Subject: [PATCH] autobahn report final frag only on final rx bufload If the final message fragment contains a payload that has to be handled in multiple RX callbacks, until now we reported the ws fragment header FIN state in lws_is_final_fragment(). That was correct, but it's kind of not useful to hear that the intermediate bufferloads are "final". So now we delay reporting the logical ws fragment FIN until the final part of his payload is delivered. This gets us Autobahn 1.1.6 working. Signed-off-by: Andy Green --- lib/libwebsockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 6e4d2309..380f2277 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -763,7 +763,7 @@ lws_get_protocol(struct lws *wsi) LWS_VISIBLE int lws_is_final_fragment(struct lws *wsi) { - return wsi->u.ws.final; + return wsi->u.ws.final && !wsi->u.ws.rx_packet_length; } LWS_VISIBLE unsigned char