diff options
| author | fengweihao <[email protected]> | 2019-07-31 13:45:08 +0800 |
|---|---|---|
| committer | fengweihao <[email protected]> | 2019-07-31 13:45:08 +0800 |
| commit | aa88471f2564da19e2f6a1b8e01fc5393316be99 (patch) | |
| tree | 1becbfb08a3207439e4286b87d9944a6c90e3c6d /plugin/protocol/http2/src/http2_common.cpp | |
| parent | 92e8759bada6e3e65f0aa8a91470426b35483ee1 (diff) | |
修复残留数据,造成select_padding函数段错误
Diffstat (limited to 'plugin/protocol/http2/src/http2_common.cpp')
| -rw-r--r-- | plugin/protocol/http2/src/http2_common.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/plugin/protocol/http2/src/http2_common.cpp b/plugin/protocol/http2/src/http2_common.cpp index c58eb9c..2847ce5 100644 --- a/plugin/protocol/http2/src/http2_common.cpp +++ b/plugin/protocol/http2/src/http2_common.cpp @@ -372,38 +372,33 @@ int deflate_write(struct z_stream_st **strm, const uint8_t *source, void inflate_finished(struct z_stream_st **strm) { if (*strm != NULL){ - if ((*strm)->brdec_state){ + if ((*strm)->brdec_state) + { BrotliDecoderDestroyInstance((*strm)->brdec_state); - (*strm)->brdec_state = NULL; - return; + (*strm)->brdec_state = NULL; + goto finish; } (void)inflateEnd(&((*strm)->zst)); +finish: free(*strm); *strm = NULL; } } void deflate_finished(struct z_stream_st **strm) { - if (*strm != NULL){ + if (*strm != NULL) + { + if ((*strm)->brenc_state) + { + BrotliEncoderDestroyInstance((*strm)->brenc_state); + (*strm)->brenc_state = NULL; + goto finish; + + } (void) deflateEnd(&((*strm)->zst)); +finish: free(*strm); *strm = NULL; } } -void frame_display(const uint8_t *payload, uint16_t payload_len) -{ - int i = 0; - - printf("context:(%d)\n", payload_len); - for(i=0; i < (int)payload_len; ++i){ - printf(" 0x%02x,", payload[i]); - if( (i + 1) % 16 == 0) - printf("\n"); - if ( i > 500) - break; - } - printf("\n\n"); -} - - |
