aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2020-03-03 11:46:07 +0000
committerThomas E. Dickey <dickey@invisible-island.net>2020-03-03 11:46:07 +0000
commit9538904f8bff2e184b67db2f6ccf76d4e264f353 (patch)
treefc3f9f46bc2b93870bcc0684a2a22a39df6fe17d
parentc68108bc9bec4257e26a68dc5ed119d33182112d (diff)
downloadlynx-snapshots-9538904f8bff2e184b67db2f6ccf76d4e264f353.tar.gz
snapshot of project "lynx", label v2-9-0dev_5b
-rw-r--r--CHANGES5
-rw-r--r--src/tidy_tls.c22
2 files changed, 24 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index cd207d29..09a4ce64 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,9 +1,10 @@
--- $LynxId: CHANGES,v 1.1047 2020/03/01 13:59:22 tom Exp $
+-- $LynxId: CHANGES,v 1.1048 2020/03/03 11:46:07 tom Exp $
===============================================================================
Changes since Lynx 2.8 release
===============================================================================
-2020-02-27 (2.9.0dev.6)
+2020-03-03 (2.9.0dev.6)
+* add Windows-specific initialization in tidy_tls.c -GV
* update eo.po from
http://translationproject.org/latest/lynx
diff --git a/src/tidy_tls.c b/src/tidy_tls.c
index c9d78e45..b0288fb8 100644
--- a/src/tidy_tls.c
+++ b/src/tidy_tls.c
@@ -1,5 +1,5 @@
/*
- * $LynxId: tidy_tls.c,v 1.40 2020/01/21 22:26:43 tom Exp $
+ * $LynxId: tidy_tls.c,v 1.41 2020/03/03 11:46:07 Gisle.Vanem Exp $
* Copyright 2008-2019,2020 Thomas E. Dickey
* with fix Copyright 2008 by Thomas Viehmann
*
@@ -499,12 +499,32 @@ int SSL_read(SSL * ssl, void *buffer, int length)
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;