@@ -545,7 +545,7 @@ static esp_err_t esp_websocket_client_create_transport(esp_websocket_client_hand
545
545
return ESP_OK ;
546
546
}
547
547
548
- static bool esp_websocket_client_send_with_exact_opcode (esp_websocket_client_handle_t client , ws_transport_opcodes_t opcode , const uint8_t * data , int len , TickType_t timeout )
548
+ static int esp_websocket_client_send_with_exact_opcode (esp_websocket_client_handle_t client , ws_transport_opcodes_t opcode , const uint8_t * data , int len , TickType_t timeout )
549
549
{
550
550
int ret = -1 ;
551
551
int need_write = len ;
@@ -571,14 +571,14 @@ static bool esp_websocket_client_send_with_exact_opcode(esp_websocket_client_han
571
571
esp_websocket_client_error (client , "esp_transport_write() returned %d, errno=%d" , ret , errno );
572
572
}
573
573
esp_websocket_client_abort_connection (client , WEBSOCKET_ERROR_TYPE_TCP_TRANSPORT );
574
- return false ;
574
+ return ret ;
575
575
}
576
576
opcode = 0 ;
577
577
widx += wlen ;
578
578
need_write = len - widx ;
579
579
}
580
580
esp_websocket_free_buf (client , true);
581
- return true ;
581
+ return widx ;
582
582
}
583
583
584
584
esp_websocket_client_handle_t esp_websocket_client_init (const esp_websocket_client_config_t * config )
@@ -1227,9 +1227,9 @@ int esp_websocket_client_send_with_opcode(esp_websocket_client_handle_t client,
1227
1227
ret = ESP_FAIL ;
1228
1228
goto unlock_and_return ;
1229
1229
}
1230
- if (esp_websocket_client_send_with_exact_opcode (client , opcode | WS_TRANSPORT_OPCODES_FIN , data , len , timeout ) != true) {
1230
+ ret = esp_websocket_client_send_with_exact_opcode (client , opcode | WS_TRANSPORT_OPCODES_FIN , data , len , timeout );
1231
+ if (ret <= 0 ) {
1231
1232
ESP_LOGE (TAG , "Failed to send the buffer" );
1232
- ret = ESP_FAIL ;
1233
1233
goto unlock_and_return ;
1234
1234
}
1235
1235
unlock_and_return :
0 commit comments