diff --git a/plugin/protocol/http2/src/http2_common.cpp b/plugin/protocol/http2/src/http2_common.cpp index b8b2a2c..0eb2521 100644 --- a/plugin/protocol/http2/src/http2_common.cpp +++ b/plugin/protocol/http2/src/http2_common.cpp @@ -151,7 +151,8 @@ int inflate_init(struct z_stream_st **strm, int gzip) (*strm)->zst.avail_in = 0; (*strm)->zst.next_in = Z_NULL; - int ret = 0; + // Z_OK stand for 0; Z_ERRNO stand for -1. + int ret = Z_ERRNO; if (gzip == HTTP2_CONTENT_ENCODING_GZIP) ret = inflateInit2(&((*strm)->zst), MAX_WBITS + 16); else if (gzip == HTTP2_CONTENT_ENCODING_DEFLATE) @@ -168,7 +169,7 @@ int inflate_init(struct z_stream_st **strm, int gzip) return ret; } -int inflate_br_read(struct z_stream_st **strm, const uint8_t *source, int len, +static int inflate_br_read(struct z_stream_st **strm, const uint8_t *source, int len, char **dest, int *outlen) { #define CHUNK (1024 * 1024 * 4) @@ -210,7 +211,7 @@ finish: return ret; } -int inflate_gzip_read(struct z_stream_st **strm, char **dest, int *outlen) +static int inflate_gzip_read(struct z_stream_st **strm, char **dest, int *outlen) { #define CHUNK (1024 * 1024 * 4) int ret = -1; @@ -269,7 +270,7 @@ int deflate_init(struct z_stream_st **strm, int gzip) if (*strm != NULL) return Z_OK; - int ret = 0; + int ret = 0; // 0 stand for Z_OK *strm = ALLOC(struct z_stream_st, 1); assert(*strm); @@ -304,7 +305,7 @@ int deflate_init(struct z_stream_st **strm, int gzip) return ret; } -int deflate_br_write(struct z_stream_st **strm, +static int deflate_br_write(struct z_stream_st **strm, const unsigned char * source, size_t slen, struct evbuffer * evbuf, int end) { @@ -353,7 +354,7 @@ int deflate_br_write(struct z_stream_st **strm, } -int defalta_gzip_write(struct z_stream_st **strm, const uint8_t *source, int slen, +static int defalta_gzip_write(struct z_stream_st **strm, const uint8_t *source, int slen, struct evbuffer * evbuf, int end) { #define SZ_IOVEC 2 @@ -440,7 +441,7 @@ void deflate_finished(struct z_stream_st **strm) BrotliEncoderDestroyInstance((*strm)->brenc_state); (*strm)->brenc_state = NULL; goto finish; - + } (void) deflateEnd(&((*strm)->zst)); finish: