Page MenuHome GnuPG

05-w32-http.patch
No OneTemporary

05-w32-http.patch

#! /bin/sh
cd common && patch -p0 -f $* < $0
exit $?
2008-04-21 Werner Koch <wk@g10code.com>
* http.c (http_wait_response) [W32]: Use DuplicateHandle because
it is a socket.
(cookie_read) [W32]: Use recv in place of read.
Index: http.c
===================================================================
--- http.c (revision 4748)
+++ http.c (working copy)
@@ -396,7 +396,16 @@
else
#endif /*HTTP_USE_ESTREAM*/
{
+#ifdef HAVE_W32_SYSTEM
+ HANDLE handle = (HANDLE)hd->sock;
+ if (!DuplicateHandle (GetCurrentProcess(), handle,
+ GetCurrentProcess(), &handle, 0,
+ TRUE, DUPLICATE_SAME_ACCESS ))
+ return gpg_error_from_syserror ();
+ hd->sock = (int)handle;
+#else
hd->sock = dup (hd->sock);
+#endif
if (hd->sock == -1)
return gpg_error_from_syserror ();
}
@@ -1490,7 +1499,7 @@
}
#endif
-/* Actually connect to a server. Returns the file descripto or -1 on
+/* Actually connect to a server. Returns the file descriptor or -1 on
error. ERRNO is set on error. */
static int
connect_server (const char *server, unsigned short port,
@@ -1765,7 +1774,12 @@
{
do
{
+#ifdef HAVE_W32_SYSTEM
+ /* Under Windows we need to use recv for a socket. */
+ nread = recv (c->fd, buffer, size, 0);
+#else
nread = read (c->fd, buffer, size);
+#endif
}
while (nread == -1 && errno == EINTR);
}

File Metadata

Mime Type
text/x-shellscript
Expires
Mon, Dec 23, 1:43 PM (1 d, 7 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8c/9e/fafdf3e67b72d4d617d046d775bb

Event Timeline