Revert "Merge branch 'bugfix/fix_ws_handle_big_messages_error_v4.2' into 'release/v4.2'"

This reverts commit 5ca91eb54e, reversing
changes made to 192d42c8b8.
This commit is contained in:
yuanjm 2021-08-31 14:12:24 +08:00
parent 436517fb7f
commit f6d2932953

View File

@ -250,15 +250,9 @@ esp_err_t httpd_ws_recv_frame(httpd_req_t *req, httpd_ws_frame_t *frame, size_t
return ESP_FAIL;
}
int read_len = 0, left_len = frame->len;
while (left_len > 0) {
if ((read_len = httpd_recv_with_opt(req, (char *)frame->payload + read_len, left_len, false)) <= 0) {
ESP_LOGW(TAG, LOG_FMT("Failed to receive payload"));
return ESP_FAIL;
}
if (left_len -= read_len) {
ESP_LOGD(TAG, "recv data length is less than the data length we want. Read again!");
}
if (httpd_recv_with_opt(req, (char *)frame->payload, frame->len, false) <= 0) {
ESP_LOGW(TAG, LOG_FMT("Failed to receive payload"));
return ESP_FAIL;
}
/* Unmask payload */