diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/IO/http.c | 3 | ||||
-rw-r--r-- | src/capi.c | 16 | ||||
-rw-r--r-- | src/chain.c | 6 |
3 files changed, 18 insertions, 7 deletions
diff --git a/src/IO/http.c b/src/IO/http.c index d1fb6622..32f370b3 100644 --- a/src/IO/http.c +++ b/src/IO/http.c @@ -495,7 +495,8 @@ void a_Http_dns_cb(int Status, Dlist *addr_list, void *data) 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); } @@ -582,11 +582,17 @@ void a_Capi_ccc(int Op, int Branch, int Dir, ChainLink *Info, 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); diff --git a/src/chain.c b/src/chain.c index 1045bb9c..04d97baa 100644 --- a/src/chain.c +++ b/src/chain.c @@ -104,6 +104,7 @@ int a_Chain_fcb(int Op, ChainLink *Info, void *Data1, void *Data2) 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 @@ int a_Chain_bcb(int Op, ChainLink *Info, void *Data1, void *Data2) 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 @@ int a_Chain_check(char *FuncStr, int Op, int Branch, int Dir, 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; } |