lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lynx-dev] ANN: lynx2.9.0dev.5


From: Gisle Vanem
Subject: Re: [Lynx-dev] ANN: lynx2.9.0dev.5
Date: Tue, 3 Mar 2020 12:51:43 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

Thomas Dickey wrote:

I've no idea why; GnuTls works fine in e.g. Wget2 and
libcurl. Some issue with tidy_tls.c on Windows?

I don't know - how is GnuTls built for your configuration?

With this patch, it works:

--- a/src/tidy_tls.c 2020-01-21 22:26:43
+++ b/src/tidy_tls.c 2020-03-03 11:46:07
@@ -499,12 +499,32 @@
     return rc;
 }

+#ifdef _WINDOWS
+static int Lynx_gtls_push(void *s, const void *buf, size_t len)
+{
+  return NETWRITE ((SOCKET)s, buf, len);
+}
+
+/* This calls 'recv()' in a thread for every GnuTls pull. Maybe too much 
overhead?
+ */
+static int Lynx_gtls_pull(void *s, void *buf, size_t len)
+{
+  return NETREAD ((SOCKET)s, buf, len);
+}
+#endif
+
 /*
  * Connect the SSL object with a file descriptor.
  * This always returns 1 (success) since GNU TLS does not check for errors.
  */
 int SSL_set_fd(SSL * ssl, int fd)
 {
+#ifdef _WINDOWS
+   /* register callback functions to send and receive data. */
+   gnutls_transport_set_push_function(ssl->gnutls_state, Lynx_gtls_push);
+   gnutls_transport_set_pull_function(ssl->gnutls_state, Lynx_gtls_pull);
+#endif
+
     gnutls_transport_set_ptr(ssl->gnutls_state,
                             (gnutls_transport_ptr_t) (intptr_t) (fd));
     return 1;

----------

Tested with:
  lynx https://clienttest.ssllabs.com:8443/ssltest/viewMyClient.html

etc.

--
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]