mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-05 21:18:32 +08:00
Added MG_WS_CONNECT
This commit is contained in:
parent
50a889dac0
commit
64b51699f8
@ -2734,6 +2734,7 @@ static void send_websocket_handshake_if_requested(struct mg_connection *conn) {
|
||||
if (call_user(MG_CONN_2_CONN(conn), MG_WS_HANDSHAKE) == MG_FALSE) {
|
||||
send_websocket_handshake(conn, key);
|
||||
}
|
||||
call_user(MG_CONN_2_CONN(conn), MG_WS_CONNECT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,7 @@ enum mg_event {
|
||||
MG_REPLY, // If callback returns MG_FALSE, Mongoose closes connection
|
||||
MG_CLOSE, // Connection is closed, callback return value is ignored
|
||||
MG_WS_HANDSHAKE, // New websocket connection, handshake request
|
||||
MG_WS_CONNECT, // New websocket connection established
|
||||
MG_HTTP_ERROR // If callback returns MG_FALSE, Mongoose continues with err
|
||||
};
|
||||
typedef int (*mg_handler_t)(struct mg_connection *, enum mg_event);
|
||||
|
Loading…
Reference in New Issue
Block a user