summaryrefslogtreecommitdiff
path: root/src/bw.c
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2011-08-05 18:44:14 -0400
committerJorge Arellano Cid <jcid@dillo.org>2011-08-05 18:44:14 -0400
commita096c90f4a10c92ba55d8f34ad01266d05e47196 (patch)
tree9649bdb0b385ebe289bcc77187717441c96c7432 /src/bw.c
parent9eff7b30b70ee13501dba6e6061cd312b3a7186e (diff)
Added an API to access the expected URL resource
This fixes a segfault bug introduced by changeset 350af350b840. By mistake the expected URL got inside the parallel handling of CCC, into a race condition with a segfault path.
Diffstat (limited to 'src/bw.c')
-rw-r--r--src/bw.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/bw.c b/src/bw.c
index 7f4785bb..1dfc5a08 100644
--- a/src/bw.c
+++ b/src/bw.c
@@ -55,7 +55,6 @@ BrowserWindow *a_Bw_new()
bw->nav_stack_ptr = -1;
/* Init expect */
- bw->nav_expecting = FALSE;
bw->nav_expect_url = NULL;
bw->redirect_level = 0;
@@ -313,3 +312,27 @@ BrowserWindow *a_Bw_get(int i)
return NULL;
}
+/* expect API ------------------------------------------------------------- */
+
+void a_Bw_expect(BrowserWindow *bw, const DilloUrl *url)
+{
+ a_Url_free(bw->nav_expect_url);
+ bw->nav_expect_url = a_Url_dup(url);
+}
+
+void a_Bw_cancel_expect(BrowserWindow *bw)
+{
+ a_Url_free(bw->nav_expect_url);
+ bw->nav_expect_url = NULL;
+}
+
+bool_t a_Bw_expecting(BrowserWindow *bw)
+{
+ return (bw->nav_expect_url != NULL);
+}
+
+const DilloUrl *a_Bw_expected_url(BrowserWindow *bw)
+{
+ return bw->nav_expect_url;
+}
+