souphttpsrc: do not emit error when connection with unknown size ends
authorBranislav Katreniak <bkatreniak@nuvotechnologies.com>
Wed, 19 Feb 2014 14:19:30 +0000 (15:19 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 19 Feb 2014 15:59:16 +0000 (16:59 +0100)
Commit 46fd12ae5ec53200b16dfd7f17048d6bc60fbfbc introduced connection
recovery. But when server does not specify content-size,
souphttpsrc tries to reconnect even after regular end of stream.
Http server replies  with SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE
but souphttpsrc still emits error instead of EOS.

https://bugzilla.gnome.org/show_bug.cgi?id=724717

Signed-off-by: Branislav Katreniak <bkatreniak@nuvotechnologies.com>
ext/soup/gstsouphttpsrc.c

index 3809a11..5fcf8bc 100644 (file)
@@ -1287,7 +1287,7 @@ gst_soup_http_src_parse_status (SoupMessage * msg, GstSoupHTTPSrc * src)
      * a body message, requests that go beyond the content limits will result
      * in an error. Here we convert those to EOS */
     if (msg->status_code == SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE &&
-        src->have_body && src->have_size) {
+        src->have_body && !src->have_size) {
       GST_DEBUG_OBJECT (src, "Requested range out of limits and received full "
           "body, returning EOS");
       src->ret = GST_FLOW_EOS;