forked from espressif/esp-protocols
fix(websocket): esp_websocket_client client allow sending 0 byte packets
This commit is contained in:
1 parent
a50f91f422
commit
b5177cb23a
2 files changed
+4
-2
No files matched your search
@@ -1100,8 +1100,7 @@ int esp_websocket_client_send_with_opcode(esp_websocket_client_handle_t client,
|
||||
int wlen = 0, widx = 0;
|
||||
int ret = ESP_FAIL;
|
||||
|
||||
if (client == NULL || len < 0 ||
|
||||
(opcode != WS_TRANSPORT_OPCODES_CLOSE && (data == NULL || len <= 0))) {
|
||||
if (client == NULL || len < 0 || (data == NULL && len > 0)) {
|
||||
ESP_LOGE(TAG, "Invalid arguments");
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user