From 593b35997be58bc67690481162d02b6abf802fea Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 21 Feb 2011 21:47:55 +0000 Subject: Slightly more useful behaviour if we can't handle an URL when downloading svn path=/trunk/netsurf/; revision=11750 --- desktop/browser.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'desktop/browser.c') diff --git a/desktop/browser.c b/desktop/browser.c index 1f536fe17..04bbc3ac7 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -370,18 +370,22 @@ void browser_window_go_post(struct browser_window *bw, const char *url, error = llcache_handle_retrieve(url2, fetch_flags, referer, fetch_is_post ? &post : NULL, NULL, NULL, &l); - if (error != NSERROR_OK) + if (error == NSERROR_NO_FETCH_HANDLER) { + gui_launch_url(url2); + } else if (error != NSERROR_OK) { LOG(("Failed to fetch download: %d", error)); + } else { + error = download_context_create(l, bw->window); + if (error != NSERROR_OK) { + LOG(("Failed creating download context: %d", + error)); + llcache_handle_abort(l); + llcache_handle_release(l); + } + } free(url2); - error = download_context_create(l, bw->window); - if (error != NSERROR_OK) { - LOG(("Failed creating download context: %d", error)); - llcache_handle_abort(l); - llcache_handle_release(l); - } - return; } -- cgit v1.2.3