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