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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1276>
This commit is contained in:
Mats Lindestam 2020-05-17 10:27:03 +02:00
parent d0776faf47
commit bf004227ec

View 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",