s->stream.avail_in = PHPSTR_LEN(s->stream.opaque);
/* deflate */
- s->stream.avail_out = *encoded_len = HTTP_ENCODING_BUFLEN(data_len);
- s->stream.next_out = (Bytef *) *encoded = emalloc(*encoded_len);
+ *encoded_len = HTTP_ENCODING_BUFLEN(data_len);
+ *encoded = emalloc(*encoded_len);
+ s->stream.avail_out = *encoded_len;
+ s->stream.next_out = (Bytef *) *encoded;
switch (status = deflate(&s->stream, Z_NO_FLUSH))
{
{
int status;
+ *encoded_len = 0x800;
+ *encoded = emalloc(*encoded_len);
+
s->stream.avail_in = 0;
s->stream.next_in = NULL;
- s->stream.avail_out = *encoded_len = 0x800;
- s->stream.next_out = (Bytef *) *encoded = emalloc(*encoded_len);
+ s->stream.avail_out = *encoded_len;
+ s->stream.next_out = (Bytef *) *encoded;
switch (status = deflate(&s->stream, Z_SYNC_FLUSH))
{
{
int status;
+ *decoded_len = 0x800;
+ *decoded = emalloc(*decoded_len);
+
s->stream.avail_in = 0;
s->stream.next_in = NULL;
- s->stream.avail_out = *decoded_len = 0x800;
- s->stream.next_out = (Bytef *) *decoded = emalloc(*decoded_len);
+ s->stream.avail_out = *decoded_len;
+ s->stream.next_out = (Bytef *) *decoded;
switch (status = inflate(&s->stream, Z_SYNC_FLUSH))
{
{
int status;
+ *encoded_len = 0x800;
+ *encoded = emalloc(*encoded_len);
+
/* deflate remaining input */
s->stream.next_in = (Bytef *) PHPSTR_VAL(s->stream.opaque);
s->stream.avail_in = PHPSTR_LEN(s->stream.opaque);
- s->stream.avail_out = *encoded_len = 0x800;
- s->stream.next_out = (Bytef *) *encoded = emalloc(*encoded_len);
+ s->stream.avail_out = *encoded_len;
+ s->stream.next_out = (Bytef *) *encoded;
do {
status = deflate(&s->stream, Z_FINISH);
{
int status;
+ *decoded_len = s->stream.avail_in << 2;
+ *decoded = emalloc(*decoded_len);
+
/* inflate remaining input */
s->stream.next_in = (Bytef *) PHPSTR_VAL(s->stream.opaque);
s->stream.avail_in = PHPSTR_LEN(s->stream.opaque);
- s->stream.avail_out = *decoded_len = s->stream.avail_in << 2;
- s->stream.next_out = (Bytef *) *decoded = emalloc(*decoded_len);
+ s->stream.avail_out = *decoded_len;
+ s->stream.next_out = (Bytef *) *decoded;
if (Z_STREAM_END == (status = inflate(&s->stream, Z_FINISH))) {
/* cut processed input off */