summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2009-08-12 21:25:19 -0400
committerJorge Arellano Cid <jcid@dillo.org>2009-08-12 21:25:19 -0400
commit8e9290c517ce09ab83cf786a5ba424fc9e5c3f52 (patch)
treed92b024d957de43f69b0edecf1d9eedd451205ba
parentb4885050a417b18a3a0185fc1f44b7cb75c35069 (diff)
Bugfix: remove the empty cache entry lingering after connection abort
-rw-r--r--ChangeLog1
-rw-r--r--src/capi.c24
-rw-r--r--src/nav.c9
-rw-r--r--src/nav.h1
4 files changed, 33 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 62aa345c..5990b746 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@ dillo-2.2 [??]
is simpler and helps to avoid race conditions.
- Updated CCCwork.txt to the new scheme.
- Fixed a bug with OPTION element (it was parsing entities twice).
+ - Bugfix: remove the empty cache entry lingering after connection abort.
Patches: Jorge Arellano Cid
+- Fix segfault from AREA when MAP is missing name attribute.
- Fix image map coordinates when margin/border/padding present.
diff --git a/src/capi.c b/src/capi.c
index 5da85fce..5e5eadb2 100644
--- a/src/capi.c
+++ b/src/capi.c
@@ -103,6 +103,21 @@ static capi_conn_t *
}
/*
+ * Validate a capi_conn_t pointer.
+ * Return value: NULL if not valid, conn otherwise.
+ */
+static capi_conn_t *Capi_conn_valid(capi_conn_t *conn)
+{
+ int i;
+
+ for (i = 0; i < DpiConnSize; ++i)
+ if (conn == DpiConn[i])
+ return conn;
+
+ return NULL;
+}
+
+/*
* Increment the reference count and add to the list if not present
*/
static void Capi_conn_ref(capi_conn_t *conn)
@@ -310,9 +325,9 @@ static char *Capi_dpi_build_cmd(DilloWeb *web, char *server)
*/
int a_Capi_open_url(DilloWeb *web, CA_Callback_t Call, void *CbData)
{
- capi_conn_t *conn;
int reload;
char *cmd, *server;
+ capi_conn_t *conn = NULL;
const char *scheme = URL_SCHEME(web->url);
int safe = 0, ret = 0, use_cache = 0;
@@ -380,7 +395,10 @@ int a_Capi_open_url(DilloWeb *web, CA_Callback_t Call, void *CbData)
}
if (use_cache) {
- ret = a_Cache_open_url(web, Call, CbData);
+ if (!conn || (conn && Capi_conn_valid(conn))) {
+ /* not aborted, let's continue... */
+ ret = a_Cache_open_url(web, Call, CbData);
+ }
} else {
a_Web_free(web);
}
@@ -593,6 +611,8 @@ void a_Capi_ccc(int Op, int Branch, int Dir, ChainLink *Info,
a_Capi_ccc(OpAbort, 2, BCK, conn->InfoRecv, NULL, NULL);
}
}
+ /* if URL == expect-url */
+ a_Nav_cancel_expect_if_eq(conn->bw, conn->url);
/* finish conn */
Capi_conn_unref(conn);
dFree(Info);
diff --git a/src/nav.c b/src/nav.c
index 1be1ba98..441d5997 100644
--- a/src/nav.c
+++ b/src/nav.c
@@ -258,6 +258,15 @@ void a_Nav_cancel_expect(BrowserWindow *bw)
}
/*
+ * Cancel the expect if 'url' matches.
+ */
+void a_Nav_cancel_expect_if_eq(BrowserWindow *bw, const DilloUrl *url)
+{
+ if (bw->nav_expecting && a_Url_cmp(url, bw->nav_expect_url) == 0)
+ a_Nav_cancel_expect(bw);
+}
+
+/*
* We have an answer! Set things accordingly.
* This function is called for root URLs only.
* Beware: this function is much more complex than it looks
diff --git a/src/nav.h b/src/nav.h
index a37d012c..65c603b5 100644
--- a/src/nav.h
+++ b/src/nav.h
@@ -25,6 +25,7 @@ void a_Nav_reload(BrowserWindow *bw);
void a_Nav_jump(BrowserWindow *bw, int offset, int new_bw);
void a_Nav_free(BrowserWindow *bw);
void a_Nav_cancel_expect (BrowserWindow *bw);
+void a_Nav_cancel_expect_if_eq(BrowserWindow *bw, const DilloUrl *url);
void a_Nav_expect_done(BrowserWindow *bw);
int a_Nav_stack_ptr(BrowserWindow *bw);
int a_Nav_stack_size(BrowserWindow *bw);