src->ret = GST_FLOW_CUSTOM_ERROR;
} else if (G_UNLIKELY (src->session_io_status !=
GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_RUNNING)) {
- /* FIXME: reason_phrase is not translated, add proper error message */
- GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
- ("%s", msg->reason_phrase),
- ("libsoup status code %d", msg->status_code));
+ if (msg->method == SOUP_METHOD_HEAD) {
+ GST_DEBUG_OBJECT (src, "Ignoring error %d:%s during HEAD request",
+ msg->status_code, msg->reason_phrase);
+ } else {
+ /* FIXME: reason_phrase is not translated, add proper error message */
+ GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND,
+ ("%s", msg->reason_phrase),
+ ("libsoup status code %d", msg->status_code));
+ }
}
if (src->loop)
g_main_loop_quit (src->loop);
gst_soup_http_src_parse_status (SoupMessage * msg, GstSoupHTTPSrc * src)
{
if (SOUP_STATUS_IS_TRANSPORT_ERROR (msg->status_code)) {
- switch (msg->status_code) {
- case SOUP_STATUS_CANT_RESOLVE:
- case SOUP_STATUS_CANT_RESOLVE_PROXY:
- SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, NOT_FOUND,
- _("Could not resolve server name."));
- src->ret = GST_FLOW_ERROR;
- break;
- case SOUP_STATUS_CANT_CONNECT:
- case SOUP_STATUS_CANT_CONNECT_PROXY:
- SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, OPEN_READ,
- _("Could not establish connection to server."));
- src->ret = GST_FLOW_ERROR;
- break;
- case SOUP_STATUS_SSL_FAILED:
- SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, OPEN_READ,
- _("Secure connection setup failed."));
- src->ret = GST_FLOW_ERROR;
- break;
- case SOUP_STATUS_IO_ERROR:
- SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, READ,
- _("A network error occured, or the server closed the connection "
- "unexpectedly."));
- src->ret = GST_FLOW_ERROR;
- break;
- case SOUP_STATUS_MALFORMED:
- SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, READ,
- _("Server sent bad data."));
- src->ret = GST_FLOW_ERROR;
- break;
- case SOUP_STATUS_CANCELLED:
- /* No error message when interrupted by program. */
- break;
+ if (msg->method == SOUP_METHOD_HEAD) {
+ GST_DEBUG_OBJECT (src, "Ignoring error %d during HEAD request",
+ msg->status_code);
+ } else {
+ switch (msg->status_code) {
+ case SOUP_STATUS_CANT_RESOLVE:
+ case SOUP_STATUS_CANT_RESOLVE_PROXY:
+ SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, NOT_FOUND,
+ _("Could not resolve server name."));
+ src->ret = GST_FLOW_ERROR;
+ break;
+ case SOUP_STATUS_CANT_CONNECT:
+ case SOUP_STATUS_CANT_CONNECT_PROXY:
+ SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, OPEN_READ,
+ _("Could not establish connection to server."));
+ src->ret = GST_FLOW_ERROR;
+ break;
+ case SOUP_STATUS_SSL_FAILED:
+ SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, OPEN_READ,
+ _("Secure connection setup failed."));
+ src->ret = GST_FLOW_ERROR;
+ break;
+ case SOUP_STATUS_IO_ERROR:
+ SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, READ,
+ _("A network error occured, or the server closed the connection "
+ "unexpectedly."));
+ src->ret = GST_FLOW_ERROR;
+ break;
+ case SOUP_STATUS_MALFORMED:
+ SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, READ,
+ _("Server sent bad data."));
+ src->ret = GST_FLOW_ERROR;
+ break;
+ case SOUP_STATUS_CANCELLED:
+ /* No error message when interrupted by program. */
+ break;
+ }
}
} else if (SOUP_STATUS_IS_CLIENT_ERROR (msg->status_code) ||
SOUP_STATUS_IS_REDIRECTION (msg->status_code) ||