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
Hi, looking at line 1004/1005 of esp_websocket_client.c it strikes me that there might be an error situation not correctly reflected in the the return value of esp_websocket_client_send_with_opcode() (see my comment in the snippet):
When 0 is returned from esp_transport_ws_send_raw() while there was data to send (need_write != 0), the return value is set to 0, which is also ESP_OK. If and only if the transport layer can indeed return 0 in this case, I would suggest:
ret = (wlen < 0) ? wlen : ESP_FAIL;
Before filing a pull request, I would like to know if I am right or if there is more to this...
Thanks for the great components BTW !
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Error handling in esp_websocket_client_send_with_opcode()
Error handling in esp_websocket_client_send_with_opcode() (IDFGH-8053)
Aug 13, 2022
Or better yet, remove those incorrect types and conversions and return ESP_FAIL;'s :
Good point. BTW returning ESP_FAIL is exactly what I proposed for this particular line indeed. widx is already returned on happy flow as it is. I was just not sure if the transport layer could return 0 (in stead of an error) in this case. If not, the whole condition for this case could simply be trimmed.
Hi, looking at line 1004/1005 of esp_websocket_client.c it strikes me that there might be an error situation not correctly reflected in the the return value of
esp_websocket_client_send_with_opcode()
(see my comment in the snippet):When 0 is returned from
esp_transport_ws_send_raw()
while there was data to send (need_write != 0
), the return value is set to 0, which is alsoESP_OK
. If and only if the transport layer can indeed return 0 in this case, I would suggest:ret = (wlen < 0) ? wlen : ESP_FAIL;
Before filing a pull request, I would like to know if I am right or if there is more to this...
Thanks for the great components BTW !
The text was updated successfully, but these errors were encountered: