GitLab will be down for maintenance this Sunday 13th June, from approx 7-11am UTC. This is for a PostgreSQL migration. See the tracker issue for more informations.

Commit 8586150a authored by Edward Hervey's avatar Edward Hervey 🤘 Committed by Edward Hervey
Browse files

souphttpsrc: Make more usage of error macro

And make sure we actually use the provided soup_msg argument in the macro
parent b7434f8d
...@@ -1248,7 +1248,7 @@ gst_soup_http_src_alloc_buffer (GstSoupHTTPSrc * src) ...@@ -1248,7 +1248,7 @@ gst_soup_http_src_alloc_buffer (GstSoupHTTPSrc * src)
GST_ELEMENT_ERROR_WITH_DETAILS ((src), cat, code, ("%s", error_message), \ GST_ELEMENT_ERROR_WITH_DETAILS ((src), cat, code, ("%s", error_message), \
("%s (%d), URL: %s, Redirect to: %s", (soup_msg)->reason_phrase, \ ("%s (%d), URL: %s, Redirect to: %s", (soup_msg)->reason_phrase, \
(soup_msg)->status_code, (src)->location, GST_STR_NULL ((src)->redirection_uri)), \ (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)); \ "http-redirect-uri", G_TYPE_STRING, GST_STR_NULL ((src)->redirection_uri), NULL)); \
} while(0) } while(0)
...@@ -1323,33 +1323,14 @@ gst_soup_http_src_parse_status (SoupMessage * msg, GstSoupHTTPSrc * src) ...@@ -1323,33 +1323,14 @@ gst_soup_http_src_parse_status (SoupMessage * msg, GstSoupHTTPSrc * src)
* error dialog according to libsoup documentation. * error dialog according to libsoup documentation.
*/ */
if (msg->status_code == SOUP_STATUS_NOT_FOUND) { if (msg->status_code == SOUP_STATUS_NOT_FOUND) {
GST_ELEMENT_ERROR_WITH_DETAILS (src, RESOURCE, NOT_FOUND, SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, NOT_FOUND, (reason_phrase));
("%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));
} else if (msg->status_code == SOUP_STATUS_UNAUTHORIZED } else if (msg->status_code == SOUP_STATUS_UNAUTHORIZED
|| msg->status_code == SOUP_STATUS_PAYMENT_REQUIRED || msg->status_code == SOUP_STATUS_PAYMENT_REQUIRED
|| msg->status_code == SOUP_STATUS_FORBIDDEN || msg->status_code == SOUP_STATUS_FORBIDDEN
|| msg->status_code == SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED) { || msg->status_code == SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED) {
GST_ELEMENT_ERROR_WITH_DETAILS (src, RESOURCE, NOT_AUTHORIZED, ("%s", SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, NOT_AUTHORIZED, (reason_phrase));
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));
} else { } else {
GST_ELEMENT_ERROR_WITH_DETAILS (src, RESOURCE, OPEN_READ, SOUP_HTTP_SRC_ERROR (src, msg, RESOURCE, OPEN_READ, (reason_phrase));
("%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));
} }
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment