diff --git a/util/ChangeLog b/util/ChangeLog index f70bf0a1e..d8553456f 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,8 @@ +2002-05-04 Werner Koch + + * http.c (write_server) [__MINGW32__]: Replaced WriteFile by send + because sockets don't work with WriteFile under NT anymore. + 2002-05-03 David Shaw * argparse.c (optfile_parse): Remove quotes only if they totally diff --git a/util/http.c b/util/http.c index de5aba946..23556b7bd 100644 --- a/util/http.c +++ b/util/http.c @@ -786,11 +786,11 @@ write_server( int sock, const char *data, size_t length ) nleft = length; while( nleft > 0 ) { #ifdef __MINGW32__ - unsigned long nwritten; - HANDLE sock_fd = (HANDLE)sock; + int nwritten; - if ( !WriteFile ( sock_fd, data, nleft, &nwritten, NULL)) { - log_info ("write failed: ec=%d\n", (int)GetLastError ()); + nwritten = send (sock, data, nleft, 0); + if ( nwritten == SOCKET_ERROR ) { + log_info ("write failed: ec=%d\n", (int)WSAGetLastError ()); return G10ERR_NETWORK; } #else