summaryrefslogtreecommitdiff
path: root/content/fetchers/fetch_curl.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2008-06-14 21:43:52 +0000
committerJames Bursa <james@netsurf-browser.org>2008-06-14 21:43:52 +0000
commit3d590b1efa75ab53b57f56972c4893823340ca40 (patch)
treea4cda5f96cc12b4cfa0a74bc4b50e6189b7738ed /content/fetchers/fetch_curl.c
parent5fa68a06c2de954f1035ef72b56eceb018c3ca64 (diff)
downloadnetsurf-3d590b1efa75ab53b57f56972c4893823340ca40.tar.gz
netsurf-3d590b1efa75ab53b57f56972c4893823340ca40.tar.bz2
Handle errors returned by curl_multi_perform(), such as out of memory, instead of exiting.
svn path=/trunk/netsurf/; revision=4329
Diffstat (limited to 'content/fetchers/fetch_curl.c')
-rw-r--r--content/fetchers/fetch_curl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/content/fetchers/fetch_curl.c b/content/fetchers/fetch_curl.c
index 1bbe9d26f..a88038205 100644
--- a/content/fetchers/fetch_curl.c
+++ b/content/fetchers/fetch_curl.c
@@ -718,7 +718,12 @@ void fetch_curl_poll(const char *scheme_ignored)
/* do any possible work on the current fetches */
do {
codem = curl_multi_perform(fetch_curl_multi, &running);
- assert(codem == CURLM_OK || codem == CURLM_CALL_MULTI_PERFORM);
+ if (codem != CURLM_OK && codem != CURLM_CALL_MULTI_PERFORM) {
+ LOG(("curl_multi_perform: %i %s",
+ codem, curl_multi_strerror(codem)));
+ warn_user("MiscError", curl_multi_strerror(codem));
+ return;
+ }
} while (codem == CURLM_CALL_MULTI_PERFORM);
/* process curl results */
@@ -1138,7 +1143,7 @@ bool fetch_curl_process_headers(struct curl_fetch_info *f)
/* file: URL and file exists */
/* create etag */
char etag_buf[20];
- snprintf(etag_buf, sizeof etag_buf,
+ snprintf(etag_buf, sizeof etag_buf,
"ETag: \"%10d\"", (int) s.st_mtime);
/* And send it to the header handler */
fetch_send_callback(FETCH_HEADER, f->fetch_handle, etag_buf,