aboutsummaryrefslogtreecommitdiff
path: root/src/capi.c
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-09-10 12:26:44 +0200
committerSebastian Geerken <devnull@localhost>2014-09-10 12:26:44 +0200
commit5b50f9e319263a730843be1aae5dfd7c549e1622 (patch)
treeec0ce2e00c11e7d6d95d187f5002219bb1b9296f /src/capi.c
parent02a6942a42619ad31ae0ea0b2f8b4f6e17ae3272 (diff)
parentafe572a3dcac774dd90684f1328dd480bfe7db97 (diff)
Merge with main repo.
Diffstat (limited to 'src/capi.c')
-rw-r--r--src/capi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/capi.c b/src/capi.c
index 71faf5b9..7524535b 100644
--- a/src/capi.c
+++ b/src/capi.c
@@ -750,8 +750,13 @@ void a_Capi_ccc(int Op, int Branch, int Dir, ChainLink *Info,
DataBuf *dbuf = Data1;
bool_t finished = a_Cache_process_dbuf(IORead, dbuf->Buf,
dbuf->Size, conn->url);
- if (finished)
- a_Chain_bcb(OpSend, Info, NULL, "reply_complete");
+ if (finished && Capi_conn_valid(conn) && conn->InfoRecv) {
+ /* If we have a persistent connection where cache tells us
+ * that we've received the full response, and cache didn't
+ * trigger an abort and tear everything down, tell upstream.
+ */
+ a_Chain_bcb(OpSend, conn->InfoRecv, NULL, "reply_complete");
+ }
} else if (strcmp(Data2, "send_status_message") == 0) {
a_UIcmd_set_msg(conn->bw, "%s", Data1);
} else if (strcmp(Data2, "chat") == 0) {