summaryrefslogtreecommitdiff
path: root/thirdparty/libwebsockets/ext/extension-permessage-deflate.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-06-07 11:23:50 +0200
committerGitHub <noreply@github.com>2018-06-07 11:23:50 +0200
commit37d01b057d4c2108a786fd4e71e920d6c73191df (patch)
treeebb74de9c5c8c2b9eecb898121307755ca5ba0a7 /thirdparty/libwebsockets/ext/extension-permessage-deflate.h
parentb4c65093d72bf9b48cc3ddce50a0d913d3d75ed3 (diff)
parentd0811ed3f9604b2dab755ab6df0a2950fd1ccede (diff)
Merge pull request #19408 from akien-mga/3rdparty-copyright-unbundling
Update COPYRIGHT and allows unbundling libwebsockets and miniupnpc on Linux/BSD
Diffstat (limited to 'thirdparty/libwebsockets/ext/extension-permessage-deflate.h')
-rw-r--r--thirdparty/libwebsockets/ext/extension-permessage-deflate.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/thirdparty/libwebsockets/ext/extension-permessage-deflate.h b/thirdparty/libwebsockets/ext/extension-permessage-deflate.h
new file mode 100644
index 0000000000..8737736897
--- /dev/null
+++ b/thirdparty/libwebsockets/ext/extension-permessage-deflate.h
@@ -0,0 +1,41 @@
+
+#include <zlib.h>
+
+#define DEFLATE_FRAME_COMPRESSION_LEVEL_SERVER 1
+#define DEFLATE_FRAME_COMPRESSION_LEVEL_CLIENT Z_DEFAULT_COMPRESSION
+
+enum arg_indexes {
+ PMD_SERVER_NO_CONTEXT_TAKEOVER,
+ PMD_CLIENT_NO_CONTEXT_TAKEOVER,
+ PMD_SERVER_MAX_WINDOW_BITS,
+ PMD_CLIENT_MAX_WINDOW_BITS,
+ PMD_RX_BUF_PWR2,
+ PMD_TX_BUF_PWR2,
+ PMD_COMP_LEVEL,
+ PMD_MEM_LEVEL,
+
+ PMD_ARG_COUNT
+};
+
+struct lws_ext_pm_deflate_priv {
+ z_stream rx;
+ z_stream tx;
+
+ unsigned char *buf_rx_inflated; /* RX inflated output buffer */
+ unsigned char *buf_tx_deflated; /* TX deflated output buffer */
+
+ size_t count_rx_between_fin;
+
+ unsigned char args[PMD_ARG_COUNT];
+ unsigned char tx_held[5];
+ unsigned char rx_held;
+
+ unsigned char tx_init:1;
+ unsigned char rx_init:1;
+ unsigned char compressed_out:1;
+ unsigned char rx_held_valid:1;
+ unsigned char tx_held_valid:1;
+ unsigned char rx_append_trailer:1;
+ unsigned char pending_tx_trailer:1;
+};
+