diff options
author | Edward Hervey <edward@centricular.com> | 2017-04-13 08:00:30 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2017-04-13 08:00:30 +0200 |
commit | 8586150aec3becec63d5eb50230847853e82a996 (patch) | |
tree | a61e991e15ba4268a927b881a43a0aeaf2e0a41b /ext | |
parent | b7434f8d9c3d0c554a63c7a5843b3afa44b48b9f (diff) |
souphttpsrc: Make more usage of error macro
And make sure we actually use the provided soup_msg argument in the macro
Diffstat (limited to 'ext')
-rw-r--r-- | ext/soup/gstsouphttpsrc.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index 3abfc4071..2d08e135f 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -1248,7 +1248,7 @@ gst_soup_http_src_alloc_buffer (GstSoupHTTPSrc * src) GST_ELEMENT_ERROR_WITH_DETAILS ((src), cat, code, ("%s", error_message), \ ("%s (%d), URL: %s, Redirect to: %s", (soup_msg)->reason_phrase, \ (soup_msg)->status_code, (src)->location, GST_STR_NULL ((src)->redirection_uri)), \ - ("http-status-code", G_TYPE_UINT, msg->status_code, \ + ("http-status-code", G_TYPE_UINT, (soup_msg)->status_code, \ "http-redirect-uri", G_TYPE_STRING, GST_STR_NULL ((src)->redirection_uri), NULL)); \ } while(0) @@ -1323,33 +1323,14 @@ gst_soup_http_src_parse_status (SoupMessage * msg, GstSoupHTTPSrc * src) * error dialog according to libsoup documentation. */ if (msg->status_code == SOUP_STATUS_NOT_FOUND) { - GST_ELEMENT_ERROR_WITH_DETAILS (src, RESOURCE, NOT_FOUND, - ("%s", reason_phrase), - ("%s (%d), URL: %s, Redirect to: %s", reason_phrase, - msg->status_code, src->location, - GST_STR_NULL (src->redirection_uri)), - ("http-status-code", G_TYPE_UINT, msg->status_code, - "http-redirect-uri", G_TYPE_STRING, - GST_STR_NULL (src->redirection_uri), NULL)); + SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, NOT_FOUND, (reason_phrase)); } 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_WITH_DETAILS (src, RESOURCE, NOT_AUTHORIZED, ("%s", - reason_phrase), ("%s (%d), URL: %s, Redirect to: %s", - reason_phrase, msg->status_code, src->location, - GST_STR_NULL (src->redirection_uri)), ("http-status-code", - G_TYPE_UINT, msg->status_code, "http-redirect-uri", G_TYPE_STRING, - GST_STR_NULL (src->redirection_uri), NULL)); + SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, NOT_AUTHORIZED, (reason_phrase)); } else { - GST_ELEMENT_ERROR_WITH_DETAILS (src, RESOURCE, OPEN_READ, - ("%s", reason_phrase), - ("%s (%d), URL: %s, Redirect to: %s", reason_phrase, - msg->status_code, src->location, - GST_STR_NULL (src->redirection_uri)), - ("http-status-code", G_TYPE_UINT, msg->status_code, - "http-redirect-uri", G_TYPE_STRING, - GST_STR_NULL (src->redirection_uri), NULL)); + SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, OPEN_READ, (reason_phrase)); } return GST_FLOW_ERROR; } |