浏览代码

Changing API: callback doesnt get mg_request_info pointer anymore, but it is possible to get it using mg_get_request_info()

Sergey Lyubka 13 年之前
父节点
当前提交
e26a993f2a
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 2 2
      examples/chat.c
  2. 3 2
      examples/hello.c

+ 2 - 2
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) {

+ 3 - 2
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),