Skip to content

Commit

Permalink
esp_http_server: fix return values for httpd_socket_send() and `htt…
Browse files Browse the repository at this point in the history
…pd_socket_recv()` APIs

Closes #10658
  • Loading branch information
hmalpani committed Jan 31, 2023
1 parent 0d07f85 commit e1e46e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/esp_http_server/src/httpd_txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,10 @@ int httpd_socket_send(httpd_handle_t hd, int sockfd, const char *buf, size_t buf
{
struct sock_db *sess = httpd_sess_get(hd, sockfd);
if (!sess) {
return ESP_ERR_INVALID_ARG;
return HTTPD_SOCK_ERR_INVALID;
}
if (!sess->send_fn) {
return ESP_ERR_INVALID_STATE;
return HTTPD_SOCK_ERR_INVALID;
}
return sess->send_fn(hd, sockfd, buf, buf_len, flags);
}
Expand All @@ -634,10 +634,10 @@ int httpd_socket_recv(httpd_handle_t hd, int sockfd, char *buf, size_t buf_len,
{
struct sock_db *sess = httpd_sess_get(hd, sockfd);
if (!sess) {
return ESP_ERR_INVALID_ARG;
return HTTPD_SOCK_ERR_INVALID;
}
if (!sess->recv_fn) {
return ESP_ERR_INVALID_STATE;
return HTTPD_SOCK_ERR_INVALID;
}
return sess->recv_fn(hd, sockfd, buf, buf_len, flags);
}

0 comments on commit e1e46e5

Please sign in to comment.