From eaec1c216c02e58362c0cb4e52973a1c6c91b46f Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 10 Jun 2014 15:07:58 +0200 Subject: [PATCH] httpc: fix for the previous commit --- src/httpc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/httpc.c b/src/httpc.c index d6b6129a..1e1f2060 100644 --- a/src/httpc.c +++ b/src/httpc.c @@ -470,12 +470,13 @@ http_client_send_partial( http_client_t *hc ) if (hc->hc_einprogress) { /* this seems like OSX specific issue */ /* send() in the EINPROGRESS state closes the file-descriptor */ - int err; + int err = 0; socklen_t errlen = sizeof(err); - r = 0; getsockopt(hc->hc_fd, SOL_SOCKET, SO_ERROR, (void *)&err, &errlen); - if (err == EINPROGRESS) + if (err == EINPROGRESS) { + r = err; goto skip; + } hc->hc_einprogress = 0; } if (hc->hc_ssl)