You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation has this to say about CURLWS_CONT:
CURLWS_CONT
This is not the final fragment of the message, it implies that there is another fragment coming as part of the same message.
This is neither the observed behaviour nor in accordance with RFC 6455.
RFC 6455 has this to say about fragmented messages:
A fragmented message consists of a single frame with the FIN bit
clear and an opcode other than 0, followed by zero or more frames
with the FIN bit clear and the opcode set to 0, and terminated by
a single frame with the FIN bit set and an opcode of 0.
A single text message split into three fragments, as received by the write callback, is reported by curl_ws_meta as follows:
Only CURLWS_TEXT set in flags, FIN bit not set.
Only CURLWS_CONT set in flags, FIN bit not set.
Only CURLWS_CONT set in flags, FIN bit set.
The third fragment has the FIN bit set, but this is not exposed by libcurl. It is thus not possible for an application to determine which frame is the final fragment of a message.
I expected the following
I expected the fragments to be received as follows, to conform to what the libcurl documentation states:
Both CURLWS_TEXT and CURLWS_CONT set.
Both CURLWS_TEXT and CURLWS_CONT set.
Only CURLWS_TEXT set.
curl/libcurl version
8.6.0
operating system
Fedora 40
The text was updated successfully, but these errors were encountered:
The following snippet appears to "work" as a temporary workaround, as well as adjusting the usage of flags in the WebSocket write callback and checking is_fin accordingly.
Now that curl 8.11.0 is out with WebSocket support no longer marked as experimental, will it be possible to fix this bug without an API change? Receiving fragmented messages is broken as it stands, an application has no way to reassemble fragments into a message without parsing the debug log.
I did this
The documentation has this to say about
CURLWS_CONT
:This is neither the observed behaviour nor in accordance with RFC 6455.
RFC 6455 has this to say about fragmented messages:
A single text message split into three fragments, as received by the write callback, is reported by
curl_ws_meta
as follows:CURLWS_TEXT
set in flags, FIN bit not set.CURLWS_CONT
set in flags, FIN bit not set.CURLWS_CONT
set in flags, FIN bit set.The third fragment has the
FIN
bit set, but this is not exposed by libcurl. It is thus not possible for an application to determine which frame is the final fragment of a message.I expected the following
I expected the fragments to be received as follows, to conform to what the libcurl documentation states:
CURLWS_TEXT
andCURLWS_CONT
set.CURLWS_TEXT
andCURLWS_CONT
set.CURLWS_TEXT
set.curl/libcurl version
8.6.0
operating system
Fedora 40
The text was updated successfully, but these errors were encountered: