aboutsummaryrefslogtreecommitdiff
path: root/src/capi.c
diff options
context:
space:
mode:
authorcorvid <devnull@localhost>2014-07-17 03:24:01 +0000
committercorvid <devnull@localhost>2014-07-17 03:24:01 +0000
commite75e4a0217096ebd7f425278403ab687911b0bb6 (patch)
treedb0a7f268471e8388e982a8fc363221b73802fa8 /src/capi.c
parentf626a943944d0184491bab2c75a09788986b0d04 (diff)
http persistent connections initial patch
Diffstat (limited to 'src/capi.c')
-rw-r--r--src/capi.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/capi.c b/src/capi.c
index 531ae34d..1f4de0d9 100644
--- a/src/capi.c
+++ b/src/capi.c
@@ -714,7 +714,10 @@ void a_Capi_ccc(int Op, int Branch, int Dir, ChainLink *Info,
Capi_conn_ref(conn);
Info->LocalKey = conn;
conn->InfoRecv = Info;
- a_Chain_link_new(Info, a_Capi_ccc, BCK, a_Dpi_ccc, 2, 2);
+ if (strcmp(conn->server, "http") == 0)
+ a_Chain_link_new(Info, a_Capi_ccc, BCK, a_Http_ccc, 2, 2);
+ else
+ a_Chain_link_new(Info, a_Capi_ccc, BCK, a_Dpi_ccc, 2, 2);
a_Chain_bcb(OpStart, Info, NULL, Data2);
break;
case OpSend:
@@ -744,7 +747,10 @@ void a_Capi_ccc(int Op, int Branch, int Dir, ChainLink *Info,
if (strcmp(Data2, "send_page_2eof") == 0) {
/* Data1 = dbuf */
DataBuf *dbuf = Data1;
- a_Cache_process_dbuf(IORead, dbuf->Buf, dbuf->Size, conn->url);
+ bool_t finished = a_Cache_process_dbuf(IORead, dbuf->Buf,
+ dbuf->Size, conn->url);
+ if (finished)
+ a_Chain_bcb(OpSend, Info, 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) {