Buffer only needs to be 0.1% larger than input +12 bytes, was larger. Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
@@ -2741,7 +2741,6 @@ void HttpHelper::parseRequestHeaders(const char *headers)
val = queryRequestHeader("Authorization");
if (val && !strncmp(val, "Basic ", 6))
setAuthToken(val+6);
-
}
void HttpHelper::parseURL()
@@ -1108,7 +1108,7 @@ void zlib_deflate(MemoryBuffer &mb, const char* inputBuffer, unsigned int inputS
// Create output memory buffer for compressed data. The zlib documentation states that
// destination buffer size must be at least 0.1% larger than avail_in plus 12 bytes.
- const unsigned long outsize = (unsigned long)floorf((float)inputSize * 1.01f) + 12;
+ const unsigned long outsize = (unsigned long) inputSize + inputSize / 1000 + 13;
Bytef* outbuf = (Bytef*) mb.reserveTruncate(outsize);
do