mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_http_server: fix return values for httpd_socket_send()
and httpd_socket_recv()
APIs
Closes https://github.com/espressif/esp-idf/issues/10658
This commit is contained in:
parent
885e501d99
commit
935661ba4a
@ -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);
|
struct sock_db *sess = httpd_sess_get(hd, sockfd);
|
||||||
if (!sess) {
|
if (!sess) {
|
||||||
return ESP_ERR_INVALID_ARG;
|
return HTTPD_SOCK_ERR_INVALID;
|
||||||
}
|
}
|
||||||
if (!sess->send_fn) {
|
if (!sess->send_fn) {
|
||||||
return ESP_ERR_INVALID_STATE;
|
return HTTPD_SOCK_ERR_INVALID;
|
||||||
}
|
}
|
||||||
return sess->send_fn(hd, sockfd, buf, buf_len, flags);
|
return sess->send_fn(hd, sockfd, buf, buf_len, flags);
|
||||||
}
|
}
|
||||||
@ -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);
|
struct sock_db *sess = httpd_sess_get(hd, sockfd);
|
||||||
if (!sess) {
|
if (!sess) {
|
||||||
return ESP_ERR_INVALID_ARG;
|
return HTTPD_SOCK_ERR_INVALID;
|
||||||
}
|
}
|
||||||
if (!sess->recv_fn) {
|
if (!sess->recv_fn) {
|
||||||
return ESP_ERR_INVALID_STATE;
|
return HTTPD_SOCK_ERR_INVALID;
|
||||||
}
|
}
|
||||||
return sess->recv_fn(hd, sockfd, buf, buf_len, flags);
|
return sess->recv_fn(hd, sockfd, buf, buf_len, flags);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user