projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
788e7f6
)
Don't send an extra chunk for the gzip header.
author
Wilfried Goesgens
<dothebart@citadel.org>
Sun, 18 Jan 2015 19:12:40 +0000
(20:12 +0100)
committer
Wilfried Goesgens
<dothebart@citadel.org>
Sun, 18 Jan 2015 19:12:40 +0000
(20:12 +0100)
webcit/tcp_sockets.c
patch
|
blob
|
history
diff --git
a/webcit/tcp_sockets.c
b/webcit/tcp_sockets.c
index 33889f665ffc998f81037cbd928aa5232c6cc8ad..19fb7a258a464f81a0e1b5f4d863e43fca500f85 100644
(file)
--- a/
webcit/tcp_sockets.c
+++ b/
webcit/tcp_sockets.c
@@
-556,6
+556,7
@@
void serv_read_binary_to_http(StrBuf *MimeType, size_t total_len, int is_static,
int client_con_state = 0;
int chunked = 0;
int is_gzip = 0;
int client_con_state = 0;
int chunked = 0;
int is_gzip = 0;
+ int is_gzip_header = 1;
StrBuf *BufHeader = NULL;
StrBuf *Buf;
StrBuf *pBuf = NULL;
StrBuf *BufHeader = NULL;
StrBuf *Buf;
StrBuf *pBuf = NULL;
@@
-623,6
+624,7
@@
void serv_read_binary_to_http(StrBuf *MimeType, size_t total_len, int is_static,
}
else
{
}
else
{
+ is_gzip_header = 0;
pBuf = WCC->WBuf;
}
pBuf = WCC->WBuf;
}
@@
-687,6
+689,11
@@
void serv_read_binary_to_http(StrBuf *MimeType, size_t total_len, int is_static,
rc = StrBufStreamTranscode(eZLibEncode, &WriteBuffer, &ReadBuffer, NULL, -1, SC, done);
if (StrLength (pBuf) > 0) {
rc = StrBufStreamTranscode(eZLibEncode, &WriteBuffer, &ReadBuffer, NULL, -1, SC, done);
if (StrLength (pBuf) > 0) {
+ if (!done && is_gzip_header && (StrLength(pBuf) == 10)) {
+ /* we don't want to send the gzip header as single package... */
+ break;
+ }
+ is_gzip_header = 0;
StrBufPrintf(BufHeader, "%s%x\r\n",
(first)?"":"\r\n",
StrLength (pBuf));
StrBufPrintf(BufHeader, "%s%x\r\n",
(first)?"":"\r\n",
StrLength (pBuf));