diff options
author | corvid <devnull@localhost> | 2014-09-05 08:57:00 +0000 |
---|---|---|
committer | corvid <devnull@localhost> | 2014-09-05 08:57:00 +0000 |
commit | 379c752f815d4e89174841041421136be3178283 (patch) | |
tree | a868e78b0b1f9f4f36696c31f358975c2d0adca3 /src/capi.c | |
parent | f69356b013d118f6f1e493a57bdc35bef6330cd1 (diff) |
persistent connections: reply complete only if cache didn't abort
I'm amazed that it took me something like six months to encounter this
case.
Diffstat (limited to 'src/capi.c')
-rw-r--r-- | src/capi.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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) { |