gstcurlhttpsink: Set 'Expect: 100-continue'-header
authorMats Lindestam <matslm@axis.com>
Sun, 17 May 2020 08:27:03 +0000 (10:27 +0200)
committerMats Lindestam <matslm@axis.com>
Mon, 18 May 2020 11:46:24 +0000 (13:46 +0200)
In the upgrade of libcurl from 7.64.1 to 7.69.1 the
EXPECT_100_THRESHOLD has been increased from 1 Kb to 1 Mb
(see https://curl.haxx.se/mail/lib-2020-01/0050.html).
This caused the gstcurlhttpsink to not being able to rewind
and resend in the case, e.g. response '401 Unauthorized'.
Now the 'Expect: 100-continue'-header is explicitly set in
the gstcurlhttpsink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1276>

ext/curl/gstcurlhttpsink.c

index 4c32dcca2103c2f57c402c714c4251ddce842635..2d81034e1d4fb2b49b50e421691966ab92387691 100644 (file)
@@ -363,6 +363,13 @@ set_headers:
     sink->header_list = curl_slist_append (sink->header_list, tmp);
     g_free (tmp);
   }
+
+  /* set 'Expect: 100-continue'-header explicitly */
+  if (sink->use_content_length) {
+    sink->header_list =
+        curl_slist_append (sink->header_list, "Expect: 100-continue");
+  }
+
   res = curl_easy_setopt (bcsink->curl, CURLOPT_HTTPHEADER, sink->header_list);
   if (res != CURLE_OK) {
     bcsink->error = g_strdup_printf ("failed to set HTTP headers: %s",