mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
souphttpsrc: Add mapping for NOT_FOUND and NOT_AUTHORIZED errors
This commit is contained in:
parent
5514bc2785
commit
cf31a4284b
1 changed files with 20 additions and 5 deletions
|
@ -1184,11 +1184,26 @@ gst_soup_http_src_parse_status (SoupMessage * msg, GstSoupHTTPSrc * src)
|
||||||
|
|
||||||
/* FIXME: reason_phrase is not translated and not suitable for user
|
/* FIXME: reason_phrase is not translated and not suitable for user
|
||||||
* error dialog according to libsoup documentation.
|
* error dialog according to libsoup documentation.
|
||||||
* FIXME: error code (OPEN_READ vs. READ) should depend on http status? */
|
*/
|
||||||
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
if (msg->status_code == SOUP_STATUS_NOT_FOUND) {
|
||||||
("%s", msg->reason_phrase),
|
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
|
||||||
("%s (%d), URL: %s", msg->reason_phrase, msg->status_code,
|
("%s", msg->reason_phrase),
|
||||||
src->location));
|
("%s (%d), URL: %s", msg->reason_phrase, msg->status_code,
|
||||||
|
src->location));
|
||||||
|
} else if (msg->status_code == SOUP_STATUS_UNAUTHORIZED ||
|
||||||
|
msg->status_code == SOUP_STATUS_PAYMENT_REQUIRED ||
|
||||||
|
msg->status_code == SOUP_STATUS_FORBIDDEN ||
|
||||||
|
msg->status_code == SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED) {
|
||||||
|
GST_ELEMENT_ERROR (src, RESOURCE, NOT_AUTHORIZED,
|
||||||
|
("%s", msg->reason_phrase),
|
||||||
|
("%s (%d), URL: %s", msg->reason_phrase, msg->status_code,
|
||||||
|
src->location));
|
||||||
|
} else {
|
||||||
|
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
|
||||||
|
("%s", msg->reason_phrase),
|
||||||
|
("%s (%d), URL: %s", msg->reason_phrase, msg->status_code,
|
||||||
|
src->location));
|
||||||
|
}
|
||||||
src->ret = GST_FLOW_ERROR;
|
src->ret = GST_FLOW_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue