2010-05-07 Giuseppe Scrivano <gscrivano@gnu.org>
+ * gnutls.c (wgnutls_close): Use always `close', not `closesocket'.
+
+ * openssl.c (openssl_close): Use always `close', not `closesocket'.
+ (ssl_connect_wget): Get the real socket handle by FD_TO_SOCKET.
+ Define FD_TO_SOCKET if it is not yet defined.
+
* Makefile.am (libunittest_a_CPPFLAGS): Add -I$(top_builddir)/lib.
* mswindows.h: Always include <winsock2.h> and <ws2tcpip.h>. Do not
/*gnutls_bye (ctx->session, GNUTLS_SHUT_RDWR);*/
gnutls_deinit (ctx->session);
xfree (ctx);
-#ifndef WINDOWS
close (fd);
-#else
- closesocket (fd);
-#endif
}
/* gnutls_transport is the singleton that describes the SSL transport
xfree_null (ctx->last_error);
xfree (ctx);
-#if defined(WINDOWS) || defined(USE_WATT32)
- closesocket (fd);
-#else
close (fd);
-#endif
DEBUGP (("Closed %d/SSL 0x%0*lx\n", fd, PTR_FORMAT (conn)));
}
conn = SSL_new (ssl_ctx);
if (!conn)
goto error;
- if (!SSL_set_fd (conn, fd))
+#ifndef FD_TO_SOCKET
+# define FD_TO_SOCKET(x) (x)
+#endif
+ if (!SSL_set_fd (conn, FD_TO_SOCKET (fd)))
goto error;
SSL_set_connect_state (conn);
if (SSL_connect (conn) <= 0 || conn->state != SSL_ST_OK)