- StrBufPrintf(BufHeader, "%s%x\r\n",
- (first)?"":"\r\n",
- StrLength (WCC->WBuf));
- first = 0;
- client_con_state = send_http(BufHeader);
+ int done = (bytes_read == total_len);
+ while ((IOBufferStrLength(&ReadBuffer) > 0) && (client_con_state == 0)) {
+ StrBufStreamTranscode(eZLibEncode, &WriteBuffer, &ReadBuffer, NULL, -1, SC, done);
+
+ StrBufPrintf(BufHeader, "%s%x\r\n",
+ (first)?"":"\r\n",
+ StrLength (pBuf));
+ first = 0;
+ client_con_state = send_http(BufHeader);
+ if (client_con_state == 0) {
+ client_con_state = send_http(pBuf);
+ }
+ }
+ FlushStrBuf(WCC->WBuf);