mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-07 16:01:30 +00:00
moved status_code, user_data, log_message out of struct mg_request_info
This commit is contained in:
1 parent
4408083b4d
commit
05b2a04267
5 files changed
+52
-40
No files matched your search
+3
-2
@@ -119,9 +119,10 @@ static void test_get_request_info(struct mg_connection *conn,
|
||||
|
||||
static void test_error(struct mg_connection *conn,
|
||||
const struct mg_request_info *ri) {
|
||||
(void) ri;
|
||||
mg_printf(conn, "HTTP/1.1 %d XX\r\n"
|
||||
"Conntection: close\r\n\r\n", ri->status_code);
|
||||
mg_printf(conn, "Error: [%d]", ri->status_code);
|
||||
"Conntection: close\r\n\r\n", mg_get_reply_status_code(conn));
|
||||
mg_printf(conn, "Error: [%d]", mg_get_reply_status_code(conn));
|
||||
}
|
||||
|
||||
static void test_post(struct mg_connection *conn,
|
||||
|
||||
+3
-3
@@ -64,10 +64,10 @@ static void test_should_keep_alive(void) {
|
||||
parse_http_request(req4, sizeof(req4), &conn.request_info);
|
||||
ASSERT(should_keep_alive(&conn) == 1);
|
||||
|
||||
conn.request_info.status_code = 401;
|
||||
conn.status_code = 401;
|
||||
ASSERT(should_keep_alive(&conn) == 0);
|
||||
|
||||
conn.request_info.status_code = 200;
|
||||
conn.status_code = 200;
|
||||
conn.must_close = 1;
|
||||
ASSERT(should_keep_alive(&conn) == 0);
|
||||
}
|
||||
@@ -138,7 +138,7 @@ static void *event_handler(enum mg_event event,
|
||||
"%s", (int) strlen(fetch_data), fetch_data);
|
||||
return "";
|
||||
} else if (event == MG_EVENT_LOG) {
|
||||
printf("%s\n", request_info->log_message);
|
||||
printf("%s\n", mg_get_log_message(conn));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
Reference in new issue
Block a user