]> sjero.net Git - wget/commitdiff
Fix GNU TLS backend under Windows.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 15 Jun 2010 11:03:13 +0000 (13:03 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 15 Jun 2010 11:03:13 +0000 (13:03 +0200)
src/ChangeLog
src/gnutls.c
src/openssl.c

index 283e2d28455d4de5d42fe656299c374ca3d6e723..856d81a310e89fb289dcff96d37f80d9ab18b8d6 100644 (file)
@@ -1,3 +1,10 @@
+2010-06-15  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * gnutls.c [WIN32]: Include "w32sock.h".
+       (FD_TO_SOCKET): Add definition.
+       (ssl_connect_wget): Get the real socket handle by FD_TO_SOCKET.
+       Define FD_TO_SOCKET if it is not yet defined.
+
 2010-06-14  Giuseppe Scrivano  <gscrivano@gnu.org>
 
        * gnutls.c: Include <stdlib.h>.
index 30ed5e17f7d81cabae04e6075f23935fa0eb4468..782c7486e5232769f55d23a3abcdfcdf33adc54a 100644 (file)
@@ -47,6 +47,10 @@ as that of the covered work.  */
 #include "url.h"
 #include "ssl.h"
 
+#ifdef WIN32
+# include "w32sock.h"
+#endif
+
 /* Note: some of the functions private to this file have names that
    begin with "wgnutls_" (e.g. wgnutls_read) so that they wouldn't be
    confused with actual gnutls functions -- such as the gnutls_read
@@ -196,7 +200,10 @@ ssl_connect_wget (int fd)
   gnutls_set_default_priority (session);
   gnutls_certificate_type_set_priority (session, cert_type_priority);
   gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, credentials);
-  gnutls_transport_set_ptr (session, (gnutls_transport_ptr) fd);
+#ifndef FD_TO_SOCKET
+# define FD_TO_SOCKET(X) (X)
+#endif
+  gnutls_transport_set_ptr (session, (gnutls_transport_ptr) FD_TO_SOCKET (fd));
   err = gnutls_handshake (session);
   if (err < 0)
     {
index e0a30fc722ee09c44388feda7c909ad3b0eae2ed..4be81cb2db2d4cdfcefb73f8b3507863c3b6ef35 100644 (file)
@@ -398,7 +398,7 @@ ssl_connect_wget (int fd)
   if (!conn)
     goto error;
 #ifndef FD_TO_SOCKET
-# define FD_TO_SOCKET(x) (x)
+# define FD_TO_SOCKET(X) (X)
 #endif
   if (!SSL_set_fd (conn, FD_TO_SOCKET (fd)))
     goto error;