From bf004227ec9a9b86a8f77e6086bcfeae94afde96 Mon Sep 17 00:00:00 2001 From: Mats Lindestam Date: Sun, 17 May 2020 10:27:03 +0200 Subject: [PATCH] gstcurlhttpsink: Set 'Expect: 100-continue'-header 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: --- ext/curl/gstcurlhttpsink.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/curl/gstcurlhttpsink.c b/ext/curl/gstcurlhttpsink.c index 4c32dcca21..2d81034e1d 100644 --- a/ext/curl/gstcurlhttpsink.c +++ b/ext/curl/gstcurlhttpsink.c @@ -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", -- 2.34.1