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: exchange-lib: disab


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: exchange-lib: disable 'Expect: 100-continue'
Date: Thu, 18 Oct 2018 21:42:54 +0200

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

dold pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 9114794b exchange-lib: disable 'Expect: 100-continue'
9114794b is described below

commit 9114794bee49af5d7c38d7f69a31808e4dedb6b1
Author: Florian Dold <address@hidden>
AuthorDate: Thu Oct 18 21:33:37 2018 +0200

    exchange-lib: disable 'Expect: 100-continue'
---
 src/exchange-lib/curl_defaults.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/exchange-lib/curl_defaults.c b/src/exchange-lib/curl_defaults.c
index ccadffa2..b46507b9 100644
--- a/src/exchange-lib/curl_defaults.c
+++ b/src/exchange-lib/curl_defaults.c
@@ -49,5 +49,26 @@ TEL_curl_easy_get (char *url)
                                    CURLOPT_TCP_FASTOPEN,
                                    1L));
 
+  {
+    /* Unfortunately libcurl needs chunk to be alive until after
+    curl_easy_perform.  To avoid manual cleanup, we keep
+    one static list here.  */
+    static struct curl_slist *chunk = NULL;
+    if (NULL == chunk)
+    {
+      /* With POST requests, we do not want to wait for the
+      "100 Continue" response, as our request bodies are usually
+      small and directy sending them saves us a round trip.  
+
+      Clearing the expect header like this disables libcurl's
+      default processing of the header.
+
+      Disabling this header is safe for other HTTP methods, thus
+      we don't distinguish further before setting it.  */
+      chunk = curl_slist_append (chunk, "Expect:");
+    }
+    GNUNET_assert (CURLE_OK == curl_easy_setopt (eh, CURLOPT_HTTPHEADER, 
chunk));
+  }
+
   return eh;
 }

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



reply via email to

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