-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ws: curl_ws_recv does not return from PING auto-responder #10615
Comments
Thanks for your report! I am not convinced your proposed fix is the best one here. If libcurl has received more data into its buffer than just PING, returning CURLE_AGAIN might then make the application go back and wait for socket activity rather than also acting on the additional websocket frames already drained from the socket. You say "the outer loop does not terminate" without this, which of course is a bug but I'm curious on what makes it possible to keep looping and I was hoping maybe you can help me understand this is if you can reproduce this problem? When the autoping is handled, and it goes back to the outer loop, what makes it stick in the loop? Line 432 Line 449: what next? how does it get stuck? |
Thank you for your swift reply! Being focused on the application code, I didn't step through the debug build of libcurl yet, relying so far on the verbose logs to try to resolve the problem. Therefore I'm just speculating and returning After connecting to
Whenever the client gets stuck in
Perhaps the underlying Let me know how else I could help you to resolve this problem. |
Reported-by: marski on github Fixes #10615
You are right. I made it blocking for the connect_only-mode but I forget why... I need to get rid of that and I'm sure your case will work differently! Try #10625 if you can. |
I confirm that applying your patch from #10625 fixes the problem, and |
Excellent, thanks for confirming! |
Reported-by: marski on github Fixes curl#10615 Closes curl#10625
I use libcurl 7.88.1 with multi interface and epoll to run a WebSocket client. When
EPOLLIN
is signalled for an associated fd, I call thecurl_ws_recv
function. It works correctly in typical cases, however after auto-responding to aPING
frame, it does not return. Looking into the branch at lib/ws.c:485, the issue seems to be that the outer loop does not terminate. Returning withCURLE_AGAIN
seems to solve the problem. Subsequent frames are also received correctly.The text was updated successfully, but these errors were encountered: