control when not first chunk.
[citadel.git] / webcit / tcp_sockets.c
index 04c648a29bc275ab06a34d48cd6b9b868298be71..730bb8c69cc2e217af0ed2061d6a18e88fb7b794 100644 (file)
@@ -554,7 +554,7 @@ void serv_read_binary_to_http(StrBuf *MimeType, size_t total_len, int is_static,
        size_t bytes_read = 0;
        int first = 1;
        int chunked = 0;
-       StrBuf *BufHeader;
+       StrBuf *BufHeader = NULL;
        StrBuf *Buf;
 
        Buf = NewStrBuf();
@@ -644,6 +644,7 @@ void serv_read_binary_to_http(StrBuf *MimeType, size_t total_len, int is_static,
                        StrBufPrintf(BufHeader, "%s%x\r\n", 
                                     (first)?"":"\r\n",
                                     StrLength (WCC->WBuf));
+                       first = 0;
                        if (send_http(BufHeader) < 0)
                                break;
                }