Skip to content

Commit 9c54b72

Browse files
committed
fix(websocket): Fixed to use int return value in Tx functions
1 parent 1617447 commit 9c54b72

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

components/esp_websocket_client/esp_websocket_client.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,26 +1208,24 @@ int esp_websocket_client_send_fin(esp_websocket_client_handle_t client, TickType
12081208

12091209
int esp_websocket_client_send_with_opcode(esp_websocket_client_handle_t client, ws_transport_opcodes_t opcode, const uint8_t *data, int len, TickType_t timeout)
12101210
{
1211-
int ret = ESP_OK;
1211+
int ret = -1;
12121212
if (client == NULL || len < 0 || (data == NULL && len > 0)) {
12131213
ESP_LOGE(TAG, "Invalid arguments");
1214-
return ESP_FAIL;
1214+
return -1;
12151215
}
12161216

12171217
if (xSemaphoreTakeRecursive(client->lock, timeout) != pdPASS) {
12181218
ESP_LOGE(TAG, "Could not lock ws-client within %" PRIu32 " timeout", timeout);
1219-
return ESP_FAIL;
1219+
return -1;
12201220
}
12211221

12221222
if (!esp_websocket_client_is_connected(client)) {
12231223
ESP_LOGE(TAG, "Websocket client is not connected");
1224-
ret = ESP_FAIL;
12251224
goto unlock_and_return;
12261225
}
12271226

12281227
if (client->transport == NULL) {
12291228
ESP_LOGE(TAG, "Invalid transport");
1230-
ret = ESP_FAIL;
12311229
goto unlock_and_return;
12321230
}
12331231

0 commit comments

Comments
 (0)