File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 88#include < zlib.h>
99namespace SL {
1010namespace WS_LITE {
11- const size_t LARGE_BUFFER_SIZE = 4 * 1024 * 1024 ; // 4 MB temp buffer
11+ const size_t LARGE_BUFFER_SIZE = 1024 * 1024 ; // 1 MB temp buffer
1212 class IWebSocket ;
1313 struct HttpHeader ;
1414 struct WSMessage ;
@@ -27,10 +27,14 @@ namespace WS_LITE {
2727 public:
2828 WebSocketContext ()
2929 {
30- TempInflateBuffer = std::make_unique<unsigned char []>(MaxPayload );
30+ TempInflateBuffer = std::make_unique<unsigned char []>(LARGE_BUFFER_SIZE );
3131 inflateInit2 (&InflationStream, -MAX_WBITS);
3232 }
33- ~WebSocketContext () { inflateEnd (&InflationStream); }
33+ ~WebSocketContext ()
34+ {
35+ inflateEnd (&InflationStream);
36+ free (InflateBuffer);
37+ }
3438 auto beginInflate ()
3539 {
3640 InflateBufferSize = 0 ;
You can’t perform that action at this time.
0 commit comments