projects
/
m6w6
/
ext-http
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
3017eb8
)
- gcc didn't like those changes
author
Michael Wallner
<mike@php.net>
Fri, 23 Dec 2005 13:01:40 +0000
(13:01 +0000)
committer
Michael Wallner
<mike@php.net>
Fri, 23 Dec 2005 13:01:40 +0000
(13:01 +0000)
http_encoding_api.c
patch
|
blob
|
history
diff --git
a/http_encoding_api.c
b/http_encoding_api.c
index 46f44ce4ad771ef8895883fdfe8a4fdb86bef61d..d1b16c4f7547989a931ed8206a56f24e1ad16e3b 100644
(file)
--- a/
http_encoding_api.c
+++ b/
http_encoding_api.c
@@
-358,8
+358,10
@@
PHP_HTTP_API STATUS _http_encoding_deflate_stream_update(http_encoding_stream *s
s->stream.avail_in = PHPSTR_LEN(s->stream.opaque);
/* deflate */
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))
{
switch (status = deflate(&s->stream, Z_NO_FLUSH))
{
@@
-441,10
+443,13
@@
PHP_HTTP_API STATUS _http_encoding_deflate_stream_flush(http_encoding_stream *s,
{
int status;
{
int status;
+ *encoded_len = 0x800;
+ *encoded = emalloc(*encoded_len);
+
s->stream.avail_in = 0;
s->stream.next_in = NULL;
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))
{
switch (status = deflate(&s->stream, Z_SYNC_FLUSH))
{
@@
-467,10
+472,13
@@
PHP_HTTP_API STATUS _http_encoding_inflate_stream_flush(http_encoding_stream *s,
{
int status;
{
int status;
+ *decoded_len = 0x800;
+ *decoded = emalloc(*decoded_len);
+
s->stream.avail_in = 0;
s->stream.next_in = NULL;
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))
{
switch (status = inflate(&s->stream, Z_SYNC_FLUSH))
{
@@
-493,12
+501,15
@@
PHP_HTTP_API STATUS _http_encoding_deflate_stream_finish(http_encoding_stream *s
{
int status;
{
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);
/* 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);
do {
status = deflate(&s->stream, Z_FINISH);
@@
-525,12
+536,15
@@
PHP_HTTP_API STATUS _http_encoding_inflate_stream_finish(http_encoding_stream *s
{
int status;
{
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);
/* 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 */
if (Z_STREAM_END == (status = inflate(&s->stream, Z_FINISH))) {
/* cut processed input off */