gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated: detect plain http s


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: detect plain http server
Date: Wed, 21 Aug 2019 18:28:30 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new dbea8baa detect plain http server
dbea8baa is described below

commit dbea8baaff1c84a8bb833fa5e1a4c9d0fb6a4c91
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Aug 21 18:28:26 2019 +0200

    detect plain http server
---
 src/util/util.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/src/util/util.c b/src/util/util.c
index 51726290..eea4c91a 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -431,10 +431,33 @@ TALER_url_absolute_mhd (struct MHD_Connection *connection,
   const char *prefix;
   va_list args;
   char *result;
-
+  
+  
   if (NULL != forwarded_proto)
+  {
     proto = forwarded_proto;
+  }
+  else
+  {
+    /* likely not reverse proxy, figure out if we are 
+       http by asking MHD */
+    const union MHD_ConnectionInfo *ci;
 
+    ci = MHD_get_connection_info (connection,
+                                  MHD_CONNECTION_INFO_DAEMON);
+    if (NULL != ci)
+    {
+      const union MHD_DaemonInfo *di;
+
+      di = MHD_get_daemon_info (ci->daemon,
+                                MHD_DAEMON_INFO_FLAGS);
+      if (NULL != di)
+      {
+        if (0 == (di->flags & MHD_USE_TLS))
+          proto = "http";
+      }
+    }
+  }
   host = MHD_lookup_connection_value (connection, MHD_HEADER_KIND, "Host");
   forwarded_host = MHD_lookup_connection_value (connection, MHD_HEADER_KIND, 
"X-Forwarded-Host");
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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