mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
v08v13 add support v13 default
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
25a56b0ac3
commit
d85cb2083d
4 changed files with 14 additions and 4 deletions
|
@ -252,6 +252,8 @@ libwebsocket_client_connect(struct libwebsocket_context *context,
|
|||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 13:
|
||||
wsi->xor_mask = xor_mask_05;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -699,6 +699,8 @@ libwebsocket_read(struct libwebsocket_context *context, struct libwebsocket *wsi
|
|||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 13:
|
||||
wsi->xor_mask = xor_mask_05;
|
||||
debug("libwebsocket_parse calling handshake_04\n");
|
||||
if (handshake_0405(context, wsi))
|
||||
|
|
|
@ -297,7 +297,7 @@ libwebsocket_rx_sm(struct libwebsocket *wsi, unsigned char c)
|
|||
case LWS_RXPS_NEW:
|
||||
|
||||
switch (wsi->ietf_spec_revision) {
|
||||
/* Firefox 4.0b6 likes this as of 30 Oct */
|
||||
/* Firefox 4.0b6 likes this as of 30 Oct 2010 */
|
||||
case 0:
|
||||
if (c == 0xff)
|
||||
wsi->lws_rx_parse_state = LWS_RXPS_SEEN_76_FF;
|
||||
|
@ -317,6 +317,8 @@ libwebsocket_rx_sm(struct libwebsocket *wsi, unsigned char c)
|
|||
wsi->lws_rx_parse_state = LWS_RXPS_04_MASK_NONCE_1;
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
case 13:
|
||||
/*
|
||||
* no prepended frame key any more
|
||||
*/
|
||||
|
@ -847,6 +849,8 @@ int libwebsocket_client_rx_sm(struct libwebsocket *wsi, unsigned char c)
|
|||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 13:
|
||||
/*
|
||||
* 04 logical framing from the spec (all this is masked when
|
||||
* incoming and has to be unmasked)
|
||||
|
@ -1573,8 +1577,8 @@ int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf,
|
|||
return -1;
|
||||
|
||||
switch (wsi->ietf_spec_revision) {
|
||||
/* chrome likes this as of 30 Oct */
|
||||
/* Firefox 4.0b6 likes this as of 30 Oct */
|
||||
/* chrome likes this as of 30 Oct 2010 */
|
||||
/* Firefox 4.0b6 likes this as of 30 Oct 2010 */
|
||||
case 0:
|
||||
if ((protocol & 0xf) == LWS_WRITE_BINARY) {
|
||||
/* in binary mode we send 7-bit used length blocks */
|
||||
|
@ -1607,6 +1611,8 @@ int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf,
|
|||
break;
|
||||
|
||||
case 7:
|
||||
case 8:
|
||||
case 13:
|
||||
if (masked7) {
|
||||
pre += 4;
|
||||
dropmask = &buf[0 - pre];
|
||||
|
|
|
@ -114,7 +114,7 @@ void debug(const char *format, ...)
|
|||
#define MAX_BROADCAST_PAYLOAD 2048
|
||||
#define LWS_MAX_PROTOCOLS 10
|
||||
#define LWS_MAX_EXTENSIONS_ACTIVE 10
|
||||
#define SPEC_LATEST_SUPPORTED 7
|
||||
#define SPEC_LATEST_SUPPORTED 13
|
||||
|
||||
#define MAX_WEBSOCKET_04_KEY_LEN 128
|
||||
#define SYSTEM_RANDOM_FILEPATH "/dev/urandom"
|
||||
|
|
Loading…
Add table
Reference in a new issue