diff --git a/examples/chat.c b/examples/chat.c index dd886289..a2f85f87 100644 --- a/examples/chat.c +++ b/examples/chat.c @@ -326,8 +326,8 @@ static void redirect_to_ssl(struct mg_connection *conn, } static void *event_handler(enum mg_event event, - struct mg_connection *conn, - const struct mg_request_info *request_info) { + struct mg_connection *conn) { + const struct mg_request_info *request_info = mg_get_request_info(conn); void *processed = "yes"; if (event == MG_NEW_REQUEST) { diff --git a/examples/hello.c b/examples/hello.c index 89c3be49..5eee899c 100644 --- a/examples/hello.c +++ b/examples/hello.c @@ -3,8 +3,9 @@ #include "mongoose.h" static void *callback(enum mg_event event, - struct mg_connection *conn, - const struct mg_request_info *request_info) { + struct mg_connection *conn) { + const struct mg_request_info *request_info = mg_get_request_info(conn); + if (event == MG_NEW_REQUEST) { char content[1024]; int content_length = snprintf(content, sizeof(content),