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 8
8
#include < zlib.h>
9
9
namespace SL {
10
10
namespace 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
12
12
class IWebSocket ;
13
13
struct HttpHeader ;
14
14
struct WSMessage ;
@@ -27,10 +27,14 @@ namespace WS_LITE {
27
27
public:
28
28
WebSocketContext ()
29
29
{
30
- TempInflateBuffer = std::make_unique<unsigned char []>(MaxPayload );
30
+ TempInflateBuffer = std::make_unique<unsigned char []>(LARGE_BUFFER_SIZE );
31
31
inflateInit2 (&InflationStream, -MAX_WBITS);
32
32
}
33
- ~WebSocketContext () { inflateEnd (&InflationStream); }
33
+ ~WebSocketContext ()
34
+ {
35
+ inflateEnd (&InflationStream);
36
+ free (InflateBuffer);
37
+ }
34
38
auto beginInflate ()
35
39
{
36
40
InflateBufferSize = 0 ;
You can’t perform that action at this time.
0 commit comments