From 34ef70ab007e48c0198252fcc901732d85736c12 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 18 Sep 2022 08:28:56 +0100 Subject: [PATCH] docs: compressed remaining_pack_payload case https://github.com/warmcat/libwebsockets/issues/2683 --- include/libwebsockets/lws-misc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/libwebsockets/lws-misc.h b/include/libwebsockets/lws-misc.h index 87f364f99..b988c0f08 100644 --- a/include/libwebsockets/lws-misc.h +++ b/include/libwebsockets/lws-misc.h @@ -763,8 +763,10 @@ lws_rx_flow_allow_all_protocol(const struct lws_context *context, * ws, it is legal to not know the length of the message before it completes. * * Additionally if the message is sent via the negotiated permessage-deflate - * extension, this number only tells the amount of **compressed** data left to - * be read, since that is the only information available at the ws layer. + * extension, zero is always reported. You should use lws_is_final_fragment() + * to find out if you have completed the message... in compressed case, it holds + * back reporting the final fragment until it's also the final decompressed + * block issued. */ LWS_VISIBLE LWS_EXTERN size_t lws_remaining_packet_payload(struct lws *wsi);