aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-12-05 22:59:56 +0100
committerDaniel Stenberg <daniel@haxx.se>2010-12-05 23:04:11 +0100
commitc2bfe60086078f1dc079bdcc989bf03bd6b2ee22 (patch)
treebacfbe9c0cd1b5ec823816d3add2b7d5ddf0f309 /lib
parent63598059cd1c558acf545e81625635f80e2b558f (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/sendf.c2
1 files changed, 2 insertions, 0 deletions
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;
}
}