diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-06-24 10:31:13 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-06-24 10:31:13 +0100 |
commit | 73e45ff0246c2624b890bbbec0367eb1c450eec3 (patch) | |
tree | 644cbeeabe43a3b86c82bbbe8b722084c1c8f856 /content/fetch.h | |
parent | 5bd7606103182a824b530a24a1f4753e04c145ec (diff) | |
download | netsurf-73e45ff0246c2624b890bbbec0367eb1c450eec3.tar.gz netsurf-73e45ff0246c2624b890bbbec0367eb1c450eec3.tar.bz2 |
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.
Diffstat (limited to 'content/fetch.h')
-rw-r--r-- | content/fetch.h | 25 |
1 files changed, 18 insertions, 7 deletions
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. |