1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

introduce 06 close status codes

Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
Andy Green 2011-02-26 10:40:02 +00:00
parent 6274baf8c0
commit 06de513612

View file

@ -93,6 +93,44 @@ static inline void debug(const char *format, ...)
#define MAX_WEBSOCKET_04_KEY_LEN 128
#define SYSTEM_RANDOM_FILEPATH "/dev/urandom"
/*
* From 06 sped
1000
1000 indicates a normal closure, meaning whatever purpose the
connection was established for has been fulfilled.
1001
1001 indicates that an endpoint is "going away", such as a server
going down, or a browser having navigated away from a page.
1002
1002 indicates that an endpoint is terminating the connection due
to a protocol error.
1003
1003 indicates that an endpoint is terminating the connection
because it has received a type of data it cannot accept (e.g. an
endpoint that understands only text data may send this if it
receives a binary message.)
1004
1004 indicates that an endpoint is terminating the connection
because it has received a message that is too large.
*/
enum lws_close_status {
LWS_CLOSE_STATUS_NORMAL = 1000,
LWS_CLOSE_STATUS_GOINGAWAY = 1001,
LWS_CLOSE_STATUS_PROTOCOL_ERR = 1002,
LWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003,
LWS_CLOSE_STATUS_PAYLOAD_TOO_LARGE = 1004,
};
enum lws_websocket_opcodes_04 {
LWS_WS_OPCODE_04__CONTINUATION = 0,
LWS_WS_OPCODE_04__CLOSE = 1,