From c2bfe60086078f1dc079bdcc989bf03bd6b2ee22 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 5 Dec 2010 22:59:56 +0100 Subject: 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 --- lib/sendf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/sendf.c b/lib/sendf.c index b73c22438..d04371f84 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -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; } } -- cgit v1.2.3