mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
souphttpsrc: report a useful error message when soup_session_send fails
This helps to understand cases where libsoup doesn't set the message status code after running soup_session_send. https://bugzilla.gnome.org/show_bug.cgi?id=777222
This commit is contained in:
parent
c4cf67cfe5
commit
c08a0493ff
1 changed files with 15 additions and 9 deletions
|
@ -1413,34 +1413,40 @@ static GstFlowReturn
|
|||
gst_soup_http_src_send_message (GstSoupHTTPSrc * src)
|
||||
{
|
||||
GstFlowReturn ret;
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_val_if_fail (src->msg != NULL, GST_FLOW_ERROR);
|
||||
|
||||
/* FIXME We are ignoring the GError here, might be useful to debug */
|
||||
src->input_stream =
|
||||
soup_session_send (src->session, src->msg, src->cancellable, NULL);
|
||||
soup_session_send (src->session, src->msg, src->cancellable, &error);
|
||||
|
||||
if (g_cancellable_is_cancelled (src->cancellable))
|
||||
return GST_FLOW_FLUSHING;
|
||||
if (g_cancellable_is_cancelled (src->cancellable)) {
|
||||
ret = GST_FLOW_FLUSHING;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = gst_soup_http_src_got_headers (src, src->msg);
|
||||
if (ret != GST_FLOW_OK) {
|
||||
return ret;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!src->input_stream) {
|
||||
GST_DEBUG_OBJECT (src, "Didn't get an input stream");
|
||||
return GST_FLOW_ERROR;
|
||||
GST_DEBUG_OBJECT (src, "Didn't get an input stream: %s", error->message);
|
||||
ret = GST_FLOW_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (SOUP_STATUS_IS_SUCCESSFUL (src->msg->status_code)) {
|
||||
GST_DEBUG_OBJECT (src, "Successfully got a reply");
|
||||
} else {
|
||||
/* FIXME - be more helpful to people debugging */
|
||||
return GST_FLOW_ERROR;
|
||||
ret = GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
return GST_FLOW_OK;
|
||||
done:
|
||||
if (error)
|
||||
g_error_free (error);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
|
Loading…
Reference in a new issue