-
Notifications
You must be signed in to change notification settings - Fork 182
fix(websocket): prevent connection abort on write timeout (IDFGH-16792) #975
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
base: master
Are you sure you want to change the base?
fix(websocket): prevent connection abort on write timeout (IDFGH-16792) #975
Conversation
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 20. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
8add487 to
ee92baf
Compare
ee92baf to
42601e2
Compare
42601e2 to
7e8da1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on January 20
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
7e8da1b to
091324b
Compare
| wlen = esp_transport_ws_send_raw(client->transport, opcode, (char *)client->tx_buffer, need_write, | ||
| (timeout == portMAX_DELAY) ? -1 : timeout * portTICK_PERIOD_MS); | ||
| if (wlen < 0 || (wlen == 0 && need_write != 0)) { | ||
| if (wlen == 0 && widx == 0 && timeout != portMAX_DELAY && errno == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you double-check errno value when we time out on write? LWIP layer sets it to EINPROGRESS(119).
Another thing that I'm missing is the return of widx here, we are in between write but testing for zero. We're changing the return for partial write but why we don't have any update on the call site for the function? Does it impact user code after this change?
Note
Prevents unintended disconnects when a send operation times out without an underlying socket error.
esp_websocket_client_send_with_exact_opcode, seterrno = 0beforeesp_transport_ws_send_rawand, if it returnswlen == 0on the first chunk with finitetimeoutanderrno == 0, return early (no abort) instead of treating it as a fatal error.esp_websocket_client_abort_connectionon benign write timeouts; no API changes.Written by Cursor Bugbot for commit 091324b. This will update automatically on new commits. Configure here.