mirror of
https://github.com/curl/curl.git
synced 2026-04-15 03:51:41 +03:00
Curl_send/recv_plain: return errno on failure
When send() and recv() fail, we now store the errno value to allow the app to access it. Bug: http://curl.haxx.se/bug/view.cgi?id=3128121 Reported by: Yuri
This commit is contained in:
parent
63598059cd
commit
c2bfe60086
1 changed files with 2 additions and 0 deletions
|
|
@ -301,6 +301,7 @@ ssize_t Curl_send_plain(struct connectdata *conn, int num,
|
|||
} else {
|
||||
failf(conn->data, "Send failure: %s",
|
||||
Curl_strerror(conn, err));
|
||||
conn->data->state.os_errno = err;
|
||||
*code = CURLE_SEND_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
@ -355,6 +356,7 @@ ssize_t Curl_recv_plain(struct connectdata *conn, int num, char *buf,
|
|||
} else {
|
||||
failf(conn->data, "Recv failure: %s",
|
||||
Curl_strerror(conn, err));
|
||||
conn->data->state.os_errno = err;
|
||||
*code = CURLE_RECV_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue