[svn] dirmngr - r255 - trunk/src

svn author marcus cvs at cvs.gnupg.org
Tue Jul 31 00:03:58 CEST 2007


Author: marcus
Date: 2007-07-31 00:03:27 +0200 (Tue, 31 Jul 2007)
New Revision: 255

Modified:
   trunk/src/ChangeLog
   trunk/src/http.c
Log:
2007-07-31  Marcus Brinkmann  <marcus at g10code.de>

	* http.c: Include <pth.h>.
	(http_wait_response) [HAVE_W32_SYSTEM]: Use DuplicateHandle.
	(cookie_read): Use pth_read instead read.
	(cookie_write): Use pth_write instead write.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2007-07-30 21:33:28 UTC (rev 254)
+++ trunk/src/ChangeLog	2007-07-30 22:03:27 UTC (rev 255)
@@ -1,3 +1,10 @@
+2007-07-31  Marcus Brinkmann  <marcus at g10code.de>
+
+	* http.c: Include <pth.h>.
+	(http_wait_response) [HAVE_W32_SYSTEM]: Use DuplicateHandle.
+	(cookie_read): Use pth_read instead read.
+	(cookie_write): Use pth_write instead write.
+
 2007-07-30  Marcus Brinkmann  <marcus at g10code.de>
 
 	* ldap-url.c (ldap_str2charray): Fix buglet in ldap_utf8_strchr invocation.

Modified: trunk/src/http.c
===================================================================
--- trunk/src/http.c	2007-07-30 21:33:28 UTC (rev 254)
+++ trunk/src/http.c	2007-07-30 22:03:27 UTC (rev 255)
@@ -59,6 +59,8 @@
 # include <netdb.h>
 #endif /*!HAVE_W32_SYSTEM*/
 
+#include <pth.h>
+
 #ifdef HTTP_USE_GNUTLS
 # include <gnutls/gnutls.h>
 /* For non-understandable reasons GNUTLS dropped the _t suffix from
@@ -398,7 +400,14 @@
   else
 #endif /*HTTP_USE_ESTREAM*/
     {
+#ifndef HAVE_W32_SYSTEM
       hd->sock = dup (hd->sock);
+#else
+      if (!DuplicateHandle (GetCurrentProcess(), hd->sock,
+			    GetCurrentProcess(), &hd->sock, 0,
+			    TRUE, DUPLICATE_SAME_ACCESS ))
+	return gpg_error_from_syserror ();
+#endif
       if (hd->sock == -1)
         return gpg_error_from_syserror ();
     }
@@ -1767,7 +1776,7 @@
     {
       do
         {
-          nread = read (c->fd, buffer, size);
+          nread = pth_read (c->fd, buffer, size);
         }
       while (nread == -1 && errno == EINTR);
     }
@@ -1814,15 +1823,13 @@
   else
 #endif /*HTTP_USE_GNUTLS*/
     {
-      if ( write_server (c->fd, buffer, size) )
+      do
         {
-          errno = EIO;
-          nwritten = -1;
+          nwritten = pth_write (c->fd, buffer, size);
         }
-      else
-        nwritten = size;
+      while (nwritten == -1 && errno == EINTR);
     }
-
+  
   return nwritten;
 }
 




More information about the Gnupg-commits mailing list