diff options
Diffstat (limited to 'src/examples/http_chunked_compression.c')
-rw-r--r-- | src/examples/http_chunked_compression.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/examples/http_chunked_compression.c b/src/examples/http_chunked_compression.c index aa7bd2e5..6c52f60a 100644 --- a/src/examples/http_chunked_compression.c +++ b/src/examples/http_chunked_compression.c | |||
@@ -88,7 +88,7 @@ compress_buf (z_stream *strm, const void *src, size_t src_size, size_t *offset, | |||
88 | { | 88 | { |
89 | strm->avail_out = CHUNK; | 89 | strm->avail_out = CHUNK; |
90 | strm->next_out = tmp; | 90 | strm->next_out = tmp; |
91 | ret = deflate (strm, flush); | 91 | ret = (Z_OK == deflate (strm, flush)) ? MHD_YES : MHD_NO; |
92 | have = CHUNK - strm->avail_out; | 92 | have = CHUNK - strm->avail_out; |
93 | *dest_size += have; | 93 | *dest_size += have; |
94 | tmp_dest = realloc (*dest, *dest_size); | 94 | tmp_dest = realloc (*dest, *dest_size); |
@@ -104,7 +104,7 @@ compress_buf (z_stream *strm, const void *src, size_t src_size, size_t *offset, | |||
104 | while (0 == strm->avail_out); | 104 | while (0 == strm->avail_out); |
105 | } | 105 | } |
106 | while (flush != Z_SYNC_FLUSH); | 106 | while (flush != Z_SYNC_FLUSH); |
107 | return (Z_OK == ret) ? MHD_YES : MHD_NO; | 107 | return ret; |
108 | } | 108 | } |
109 | 109 | ||
110 | 110 | ||
@@ -183,8 +183,7 @@ ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const | |||
183 | holder->file = fopen (__FILE__, "rb"); | 183 | holder->file = fopen (__FILE__, "rb"); |
184 | if (NULL == holder->file) | 184 | if (NULL == holder->file) |
185 | goto file_error; | 185 | goto file_error; |
186 | ret = deflateInit (&holder->stream, Z_BEST_COMPRESSION); | 186 | if (Z_OK != deflateInit (&holder->stream, Z_BEST_COMPRESSION)) |
187 | if (ret != Z_OK) | ||
188 | goto stream_error; | 187 | goto stream_error; |
189 | holder->buf = malloc (CHUNK); | 188 | holder->buf = malloc (CHUNK); |
190 | if (NULL == holder->buf) | 189 | if (NULL == holder->buf) |