Added MG_WS_CONNECT

This commit is contained in:
Sergey Lyubka 2014-06-09 16:32:56 +01:00
parent 50a889dac0
commit 64b51699f8
2 changed files with 2 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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);