gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-twister] branch master updated: keep the ":<portnumb


From: gnunet
Subject: [GNUnet-SVN] [taler-twister] branch master updated: keep the ":<portnumber>" in the host header.
Date: Fri, 07 Jun 2019 19:24:35 +0200

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

marcello pushed a commit to branch master
in repository twister.

The following commit(s) were added to refs/heads/master by this push:
     new d690ce3  keep the ":<portnumber>" in the host header.
d690ce3 is described below

commit d690ce32b5d0a2044840bcacc9619b1c0ce858c2
Author: Marcello Stanisci <address@hidden>
AuthorDate: Fri Jun 7 19:24:01 2019 +0200

    keep the ":<portnumber>" in the host header.
---
 src/test/test_twister.sh            |  2 +-
 src/twister/taler-twister-service.c | 41 +++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/src/test/test_twister.sh b/src/test/test_twister.sh
index 52a38a6..0347f66 100755
--- a/src/test/test_twister.sh
+++ b/src/test/test_twister.sh
@@ -48,7 +48,7 @@ twister_service_pid=$!
 echo Twister launched.
 
 sleep 1
-if ! ps xo pid | grep ${twister_service_pid}; then
+if ! ps xo pid | grep -q ${twister_service_pid}; then
   echo Twister did not start correctly
   return 77
 fi
diff --git a/src/twister/taler-twister-service.c 
b/src/twister/taler-twister-service.c
index d147d96..30dee63 100644
--- a/src/twister/taler-twister-service.c
+++ b/src/twister/taler-twister-service.c
@@ -662,6 +662,40 @@ curl_upload_cb (void *buf,
 }
 
 
+/* ************** helper functions ************* */
+
+/**
+ * Extract the hostname from a complete URL.
+ *
+ * @param url full fledged URL
+ *
+ * @return pointer to the 0-terminated hostname, to be freed
+ *         by the caller.
+ */
+static char *
+build_host_header (const char *url)
+{
+  #define MARKER "://"
+
+  char *header;
+  char *end;
+  char *hostname;
+  char *dup = GNUNET_strdup (url);
+
+  hostname = strstr (dup, MARKER);
+  hostname+=3;
+
+  end = strchrnul (hostname, '/');
+  *end = '\0';
+
+  GNUNET_asprintf (&header,
+                   "Host: %s",
+                   hostname);
+
+  GNUNET_free (dup);
+  return header;
+}
+
 /* ************** main loop of cURL interaction ************* */
 
 
@@ -1607,6 +1641,7 @@ create_response (void *cls,
                       hr);
     {
       char *curlurl;
+      char *host_hdr;
 
       GNUNET_asprintf (&curlurl,
                       "%s%s",
@@ -1619,6 +1654,12 @@ create_response (void *cls,
                   "Forwarding request to: %s\n",
                   curlurl);
       GNUNET_free (curlurl);
+
+      host_hdr = build_host_header (target_server_base_url);
+       
+      curl_slist_append (hr->headers,
+                         host_hdr);
+      GNUNET_free (host_hdr);
     }
 
     if (0 == strcasecmp (meth,

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



reply via email to

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