mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
More correct handling of inflate result.
This commit is contained in:
parent
e0d0fd72b3
commit
1ed189e421
1 changed files with 3 additions and 1 deletions
|
@ -142,6 +142,7 @@ int lws_extension_callback_deflate_frame(
|
|||
n = inflate(&conn->zs_in, Z_SYNC_FLUSH);
|
||||
switch (n) {
|
||||
case Z_NEED_DICT:
|
||||
case Z_STREAM_ERROR:
|
||||
case Z_DATA_ERROR:
|
||||
case Z_MEM_ERROR:
|
||||
/*
|
||||
|
@ -153,10 +154,11 @@ int lws_extension_callback_deflate_frame(
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (conn->zs_in.avail_in > 0) {
|
||||
if (!conn->zs_in.avail_in) {
|
||||
size_t len_so_far = (conn->zs_in.next_out -
|
||||
(conn->buf_in + LWS_SEND_BUFFER_PRE_PADDING));
|
||||
unsigned char *new_buf;
|
||||
|
||||
conn->buf_in_length *= 2;
|
||||
new_buf = (unsigned char *)
|
||||
malloc(LWS_SEND_BUFFER_PRE_PADDING +
|
||||
|
|
Loading…
Add table
Reference in a new issue