mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
adaptivedemux2/downloadhelper: Don't mark transfer as complete/error if cancelled.
If the state of the download request was reset to UNSENT, it was cancelled. Don't update the state to COMPLETE or ERRORED in on_read_ready(). Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3314>
This commit is contained in:
parent
46517d5aca
commit
d1ae35f08a
1 changed files with 7 additions and 5 deletions
|
@ -353,12 +353,14 @@ finish_transfer:
|
||||||
G_GINT64_FORMAT, status_code, request->uri,
|
G_GINT64_FORMAT, status_code, request->uri,
|
||||||
request->range_start, request->range_end);
|
request->range_start, request->range_end);
|
||||||
|
|
||||||
|
if (request->state != DOWNLOAD_REQUEST_STATE_UNSENT) {
|
||||||
if (SOUP_STATUS_IS_SUCCESSFUL (status_code)
|
if (SOUP_STATUS_IS_SUCCESSFUL (status_code)
|
||||||
|| SOUP_STATUS_IS_REDIRECTION (status_code))
|
|| SOUP_STATUS_IS_REDIRECTION (status_code))
|
||||||
request->state = DOWNLOAD_REQUEST_STATE_COMPLETE;
|
request->state = DOWNLOAD_REQUEST_STATE_COMPLETE;
|
||||||
else
|
else
|
||||||
request->state = DOWNLOAD_REQUEST_STATE_ERROR;
|
request->state = DOWNLOAD_REQUEST_STATE_ERROR;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
request->download_end_time = now;
|
request->download_end_time = now;
|
||||||
|
|
||||||
g_free (transfer->read_buffer);
|
g_free (transfer->read_buffer);
|
||||||
|
|
Loading…
Reference in a new issue