Roland Blom filed bug report #1481217
(http://curl.haxx.se/bug/view.cgi?id=1481217), with follow-ups by Michele Bini and David Byron. libcurl previously wrongly used GetLastError() on windows to get error details after socket-related function calls, when it really should use WSAGetLastError() instead. When changing to this, the former function Curl_ourerrno() is now instead called Curl_sockerrno() as it is necessary to only use it to get errno from socket-related functions as otherwise it won't work as intended on Windows.
This commit is contained in:
@@ -335,7 +335,7 @@ CURLcode Curl_write(struct connectdata *conn,
|
||||
bytes_written = (ssize_t)swrite(sockfd, mem, len);
|
||||
|
||||
if(-1 == bytes_written) {
|
||||
int err = Curl_ourerrno();
|
||||
int err = Curl_sockerrno();
|
||||
|
||||
if(
|
||||
#ifdef WSAEWOULDBLOCK
|
||||
@@ -466,7 +466,7 @@ int Curl_read(struct connectdata *conn, /* connection data */
|
||||
nread = sread(sockfd, buf, buffersize);
|
||||
|
||||
if(-1 == nread) {
|
||||
int err = Curl_ourerrno();
|
||||
int err = Curl_sockerrno();
|
||||
#ifdef WIN32
|
||||
if(WSAEWOULDBLOCK == err)
|
||||
#else
|
||||
|
Reference in New Issue
Block a user