-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Description
I did this
Our server’s WebSocket implementation usually splits long messages into multiple frames and sends them as a fragmented message. After all payload bytes are sent, the server sends one more frame with the FIN bit set but with a 0-byte payload (which seems to be allowed by the RFC).
On the client side (using libcurl), we receive all fragments with the CONT opcode and keep waiting for one more frame — but it never arrives. If the server then starts sending a new message, the client receives both messages combined into one.
I expected the following
libcurl should treat the 0-byte FIN frame as the end of the fragmented message, update its ws_meta state accordingly, and call the CURLOPT_WRITEFUNCTION callback (possibly with a 0-byte payload) to signal message completion.
I’m not sure if delivering an explicit 0-byte callback is the correct approach, but without some form of callback, there’s no way to detect message boundaries in this case.
curl/libcurl version
8.13.0
operating system
Android/Linux