diff options
author | Werner Koch <[email protected]> | 2002-05-04 16:49:25 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2002-05-04 16:49:25 +0000 |
commit | d89cf2662151570bdfc0615c6069e3d4b5761323 (patch) | |
tree | 33af3e686349c8456a54078c2d4599f2d7cd8bca | |
parent | reminder to change wording (diff) | |
download | gnupg-d89cf2662151570bdfc0615c6069e3d4b5761323.tar.gz gnupg-d89cf2662151570bdfc0615c6069e3d4b5761323.zip |
* http.c (write_server) [__MINGW32__]: Replaced WriteFile by send
because sockets don't work with WriteFile under NT anymore.
-rw-r--r-- | util/ChangeLog | 5 | ||||
-rw-r--r-- | util/http.c | 8 |
2 files changed, 9 insertions, 4 deletions
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 <[email protected]> + + * http.c (write_server) [__MINGW32__]: Replaced WriteFile by send + because sockets don't work with WriteFile under NT anymore. + 2002-05-03 David Shaw <[email protected]> * 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 |