Commit e26a993f authored by Sergey Lyubka's avatar Sergey Lyubka

Changing API: callback doesnt get mg_request_info pointer anymore, but it is...

Changing API: callback doesnt get mg_request_info pointer anymore, but it is possible to get it using mg_get_request_info()
parent 0e0091e1
...@@ -326,8 +326,8 @@ static void redirect_to_ssl(struct mg_connection *conn, ...@@ -326,8 +326,8 @@ static void redirect_to_ssl(struct mg_connection *conn,
} }
static void *event_handler(enum mg_event event, static void *event_handler(enum mg_event event,
struct mg_connection *conn, struct mg_connection *conn) {
const struct mg_request_info *request_info) { const struct mg_request_info *request_info = mg_get_request_info(conn);
void *processed = "yes"; void *processed = "yes";
if (event == MG_NEW_REQUEST) { if (event == MG_NEW_REQUEST) {
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
#include "mongoose.h" #include "mongoose.h"
static void *callback(enum mg_event event, static void *callback(enum mg_event event,
struct mg_connection *conn, struct mg_connection *conn) {
const struct mg_request_info *request_info) { const struct mg_request_info *request_info = mg_get_request_info(conn);
if (event == MG_NEW_REQUEST) { if (event == MG_NEW_REQUEST) {
char content[1024]; char content[1024];
int content_length = snprintf(content, sizeof(content), int content_length = snprintf(content, sizeof(content),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment