mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/check_for_eof' into 'master'
esp_http_server, protocomm: Close the connection when recv() returns 0 Closes IDFGH-4735 See merge request espressif/esp-idf!12747
This commit is contained in:
commit
3a65e38bfa
@ -802,7 +802,7 @@ esp_err_t httpd_req_delete(struct httpd_data *hd)
|
||||
char dummy[CONFIG_HTTPD_PURGE_BUF_LEN];
|
||||
int recv_len = MIN(sizeof(dummy), ra->remaining_len);
|
||||
recv_len = httpd_req_recv(r, dummy, recv_len);
|
||||
if (recv_len < 0) {
|
||||
if (recv_len <= 0) {
|
||||
httpd_req_cleanup(r);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ static esp_err_t common_post_handler(httpd_req_t *req)
|
||||
size_t recv_size = 0;
|
||||
while (recv_size < req->content_len) {
|
||||
ret = httpd_req_recv(req, req_body + recv_size, req->content_len - recv_size);
|
||||
if (ret < 0) {
|
||||
if (ret <= 0) {
|
||||
ret = ESP_FAIL;
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user