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:
Daniel Stenberg
2006-05-04 22:39:47 +00:00
parent 758f6eed51
commit e85e30546c
18 changed files with 46 additions and 51 deletions

View File

@@ -582,7 +582,7 @@ CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done)
conn->ip_addr->ai_addrlen);
if(rc) {
failf(conn->data, "bind() failed; %s\n",
Curl_strerror(conn,Curl_ourerrno()));
Curl_strerror(conn, Curl_sockerrno()));
return CURLE_COULDNT_CONNECT;
}
@@ -645,7 +645,7 @@ CURLcode Curl_tftp(struct connectdata *conn, bool *done)
if(rc == -1) {
/* bail out */
int error = Curl_ourerrno();
int error = Curl_sockerrno();
failf(data, "%s\n", Curl_strerror(conn, error));
event = TFTP_EVENT_ERROR;
}