changeset 1270:aee7a2cccb71

Interim bugfix patch for the new CCC OpAbort
author Jorge Arellano Cid <jcid@dillo.org>
date Thu, 06 Aug 2009 18:05:39 -0400
parents 3be98dfb084c
children 3e784a367043
files src/IO/http.c src/capi.c src/chain.c
diffstat 3 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/IO/http.c	Wed Aug 05 23:30:26 2009 -0400
+++ b/src/IO/http.c	Thu Aug 06 18:05:39 2009 -0400
@@ -495,7 +495,8 @@
          MSG_BW(S->web, 0, "ERROR: Dns can't resolve %s",
             (S->use_proxy) ? URL_HOST_(HTTP_Proxy) : URL_HOST_(S->web->url));
          a_Chain_bcb(OpAbort, S->Info, NULL, NULL);
-         a_Chain_fcb(OpAbort, S->Info, NULL, NULL);
+         S->Info->Flags &= ~CCC_Aborted;
+         a_Chain_fcb(OpAbort, S->Info, NULL, "Both");
          dFree(S->Info);
          Http_socket_free(SKey);
       }
--- a/src/capi.c	Wed Aug 05 23:30:26 2009 -0400
+++ b/src/capi.c	Thu Aug 06 18:05:39 2009 -0400
@@ -582,11 +582,17 @@
             conn->InfoSend = NULL;
             /* remove the cache entry for this URL */
             a_Cache_entry_remove_by_url(conn->url);
-            if (Data2 && !strcmp(Data2, "DpidERROR"))
-               a_UIcmd_set_msg(conn->bw,
-                               "ERROR: can't start dpid daemon "
-                               "(URL scheme = '%s')!",
-                               conn->url ? URL_SCHEME(conn->url) : "");
+            if (Data2) {
+               if (!strcmp(Data2, "DpidERROR")) {
+                  a_UIcmd_set_msg(conn->bw,
+                                  "ERROR: can't start dpid daemon "
+                                  "(URL scheme = '%s')!",
+                                  conn->url ? URL_SCHEME(conn->url) : "");
+               } else if (!strcmp(Data2, "Both") && conn->InfoRecv) {
+                  /* abort the other branch too */
+                  a_Capi_ccc(OpAbort, 2, BCK, conn->InfoRecv, NULL, NULL);
+               }
+            }
             /* finish conn */
             Capi_conn_unref(conn);
             dFree(Info);
--- a/src/chain.c	Wed Aug 05 23:30:26 2009 -0400
+++ b/src/chain.c	Thu Aug 06 18:05:39 2009 -0400
@@ -104,6 +104,7 @@
    if (Info->Flags & (CCC_Ended + CCC_Aborted)) {
       /* CCC is not operative */
    } else if (Info->Fcb) {
+      /* flag the caller */
       if (Op == OpEnd)
          Info->Flags |= CCC_Ended;
       else if (Op == OpAbort)
@@ -126,6 +127,7 @@
    if (Info->Flags & (CCC_Ended + CCC_Aborted)) {
       /* CCC is not operative */
    } else if (Info->Bcb) {
+      /* flag the caller */
       if (Op == OpEnd)
          Info->Flags |= CCC_Ended;
       else if (Op == OpAbort)
@@ -166,7 +168,9 @@
 
    if (Info->Flags & (CCC_Ended + CCC_Aborted)) {
       /* CCC is not operative */
-      MSG_WARN("CCC: call on already finished chain.\n");
+      MSG_WARN("CCC: call on already finished chain. Flags=%s%s\n",
+               Info->Flags & CCC_Ended ? "CCC_Ended " : "",
+               Info->Flags & CCC_Aborted ? "CCC_Aborted" : "");
    } else {
       ret = 1;
    }