- 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);
- }
+ int rc;
+
+ do {
+ rc = StrBufStreamTranscode(eZLibEncode, &WriteBuffer, &ReadBuffer, NULL, -1, SC, done);
+
+ 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);