Skip to content

Conversation

@gabsuren
Copy link
Collaborator

@gabsuren gabsuren commented Dec 15, 2025

Note

Prevents unintended disconnects when a send operation times out without an underlying socket error.

  • In esp_websocket_client_send_with_exact_opcode, set errno = 0 before esp_transport_ws_send_raw and, if it returns wlen == 0 on the first chunk with finite timeout and errno == 0, return early (no abort) instead of treating it as a fatal error.
  • Keeps connection intact and avoids calling esp_websocket_client_abort_connection on benign write timeouts; no API changes.

Written by Cursor Bugbot for commit 091324b. This will update automatically on new commits. Configure here.

@cursor
Copy link

cursor bot commented Dec 15, 2025

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.

@CLAassistant
Copy link

CLAassistant commented Dec 16, 2025

CLA assistant check
All committers have signed the CLA.

@gabsuren gabsuren force-pushed the fix/IDFGH-16792-websocket-write-timeout branch from 42601e2 to 7e8da1b Compare December 25, 2025 12:30
Copy link

@cursor cursor bot left a 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.

@gabsuren gabsuren force-pushed the fix/IDFGH-16792-websocket-write-timeout branch from 7e8da1b to 091324b Compare December 26, 2025 11:30
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) {
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants