fix: ports - netsurf renders pages (mmap, resources, error loop)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NQRTGoYgnZQsh7uCh6Jsxm
This commit is contained in:
2026-08-08 14:44:53 +02:00
co-authored by Claude Opus 5
parent f4dce0cdd6
commit 15f508d003
6 changed files with 250 additions and 24 deletions
@@ -0,0 +1,29 @@
diff --git a/desktop/browser_window.c b/desktop/browser_window.c
index 226741be5..57da7d56e 100644
--- a/desktop/browser_window.c
+++ b/desktop/browser_window.c
@@ -1338,6 +1338,24 @@ browser_window__handle_fetcherror(struct browser_window *bw,
memset(&params, 0, sizeof(params));
+ /* If it is the error page itself that failed, navigating to the error
+ * page again lands straight back here. Nothing bounds that: the pair
+ * recurses, allocating a content per turn, until the heap is gone and
+ * the real failure is buried under hundreds of retries. Report the
+ * reason and stop instead. */
+ if (nsurl_compare(url, corestring_nsurl_about_query_fetcherror,
+ NSURL_COMPLETE)) {
+ NSLOG(netsurf, WARNING,
+ "error page itself failed: %s -- not retrying", reason);
+ fprintf(stderr,
+ "netsurf: error page failed (%s); giving up\n", reason);
+ browser_window_set_status(bw, reason);
+ return browser_window_stop_throbber(bw);
+ }
+
+ fprintf(stderr, "netsurf: fetch of '%s' failed: %s\n",
+ nsurl_access(url), reason);
+
params.url = nsurl_ref(corestring_nsurl_about_query_fetcherror);
params.referrer = nsurl_ref(url);
params.flags = BW_NAVIGATE_HISTORY | BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE | BW_NAVIGATE_INTERNAL;