autobahn report final frag only on final rx bufload
authorAndy Green <andy.green@linaro.org>
Mon, 28 Dec 2015 04:45:52 +0000 (12:45 +0800)
committerAndy Green <andy.green@linaro.org>
Mon, 28 Dec 2015 04:45:52 +0000 (12:45 +0800)
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 <andy.green@linaro.org>
lib/libwebsockets.c

index 6e4d230..380f227 100644 (file)
@@ -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