From 73e45ff0246c2624b890bbbec0367eb1c450eec3 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 24 Jun 2015 10:31:13 +0100 Subject: Fix error reporting from fetch_start Any fetch start error was being reported as "out of memory" which was clearly insufficient. Foe example bad urls (reported was file:// with a missing /) were causing a warn_user with out of memory. This change now at least causes a "bad url" message. --- content/fetch.h | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'content/fetch.h') diff --git a/content/fetch.h b/content/fetch.h index 37539ef2b..529a800fa 100644 --- a/content/fetch.h +++ b/content/fetch.h @@ -113,13 +113,24 @@ typedef void (*fetch_callback)(const fetch_msg *msg, void *p); * data contains an error message. FETCH_REDIRECT may replace the FETCH_HEADER, * FETCH_DATA, FETCH_FINISHED sequence if the server sends a replacement URL. * - */ -struct fetch *fetch_start(nsurl *url, nsurl *referer, - fetch_callback callback, - void *p, bool only_2xx, const char *post_urlenc, - const struct fetch_multipart_data *post_multipart, - bool verifiable, bool downgrade_tls, - const char *headers[]); + * \param url URL to fetch + * \param referer + * \param callback + * \param p + * \param only_2xx + * \param post_urlenc + * \param post_multipart + * \param verifiable + * \param downgrade_tls + * \param headers + * \param fetch_out ponter to recive new fetch object. + * \return NSERROR_OK and fetch_out updated else appropriate error code + */ +nserror fetch_start(nsurl *url, nsurl *referer, fetch_callback callback, + void *p, bool only_2xx, const char *post_urlenc, + const struct fetch_multipart_data *post_multipart, + bool verifiable, bool downgrade_tls, + const char *headers[], struct fetch **fetch_out); /** * Abort a fetch. -- cgit v1.2.3