mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
souphttpsrc: retry request on early termination from the server
Fix a regression introduced by commit 183695c61a
(refactor to use
Soup's sync API). The code previously attempted to reconnect when the
server closed the connection early, for example when the stream was put
in pause for some time.
Reintroduce this feature by checking if EOS is received before the
expected content size is downloaded. In this case, do the request
starting at the previous read position.
https://bugzilla.gnome.org/show_bug.cgi?id=776720
This commit is contained in:
parent
a8eb0515f1
commit
03db374144
1 changed files with 3 additions and 2 deletions
|
@ -1467,7 +1467,7 @@ gst_soup_http_src_do_request (GstSoupHTTPSrc * src, const gchar * method)
|
|||
GST_LOG_OBJECT (src, "Running request for method: %s", method);
|
||||
|
||||
/* Update the position if we are retrying */
|
||||
if (src->msg && (src->request_position != src->read_position)) {
|
||||
if (src->msg && src->request_position > 0) {
|
||||
gst_soup_http_src_add_range_header (src, src->request_position,
|
||||
src->stop_position);
|
||||
}
|
||||
|
@ -1637,7 +1637,8 @@ gst_soup_http_src_read_buffer (GstSoupHTTPSrc * src, GstBuffer ** outbuf)
|
|||
}
|
||||
} else {
|
||||
gst_buffer_unref (*outbuf);
|
||||
if (read_bytes < 0) {
|
||||
if (read_bytes < 0 ||
|
||||
(src->have_size && src->read_position < src->content_size)) {
|
||||
/* Maybe the server disconnected, retry */
|
||||
ret = GST_FLOW_CUSTOM_ERROR;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue