1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-10 23:49:50 +02:00

* http.c (write_server) [__MINGW32__]: Replaced WriteFile by send

because sockets don't work with WriteFile under NT anymore.
This commit is contained in:
Werner Koch 2002-05-04 16:49:25 +00:00
parent f67a0e6223
commit d89cf26621
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2002-05-04 Werner Koch <wk@gnupg.org>
* http.c (write_server) [__MINGW32__]: Replaced WriteFile by send
because sockets don't work with WriteFile under NT anymore.
2002-05-03 David Shaw <dshaw@jabberwocky.com>
* argparse.c (optfile_parse): Remove quotes only if they totally

View File

@ -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