From d4b50d79152c7ceead63342e0465a6d4c1518e7e Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Sun, 10 Nov 2019 21:19:09 +0100 Subject: [PATCH] souphttpsrc: don't update the size on error Any data corresponding length in the message is not part of the requested file. Part-of: --- ext/soup/gstsouphttpsrc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index e8c63de246..6547291b3d 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -1173,8 +1173,9 @@ gst_soup_http_src_got_headers (GstSoupHTTPSrc * src, SoupMessage * msg) gst_event_unref (http_headers_event); /* Parse Content-Length. */ - if (soup_message_headers_get_encoding (msg->response_headers) == - SOUP_ENCODING_CONTENT_LENGTH) { + if (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code) && + (soup_message_headers_get_encoding (msg->response_headers) == + SOUP_ENCODING_CONTENT_LENGTH)) { newsize = src->request_position + soup_message_headers_get_content_length (msg->response_headers); if (!src->have_size || (src->content_size != newsize)) {