aboutsummaryrefslogtreecommitdiffstats
path: root/util/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/http.c')
-rw-r--r--util/http.c8
1 files changed, 4 insertions, 4 deletions
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