mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
Pass reply status code to MG_REQUEST_COMPLETE
This commit is contained in:
1 parent
5b786a5089
commit
8455742440
2 files changed
+4
-2
No files matched your search
@@ -4826,6 +4826,7 @@ static void process_new_connection(struct mg_connection *conn) {
|
|||||||
}
|
}
|
||||||
conn->birth_time = time(NULL);
|
conn->birth_time = time(NULL);
|
||||||
handle_request(conn);
|
handle_request(conn);
|
||||||
|
conn->request_info.ev_data = (void *) conn->status_code;
|
||||||
call_user(conn, MG_REQUEST_COMPLETE);
|
call_user(conn, MG_REQUEST_COMPLETE);
|
||||||
log_access(conn);
|
log_access(conn);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -47,7 +47,7 @@ struct mg_request_info {
|
|||||||
const char *name; // HTTP header name
|
const char *name; // HTTP header name
|
||||||
const char *value; // HTTP header value
|
const char *value; // HTTP header value
|
||||||
} http_headers[64]; // Maximum 64 headers
|
} http_headers[64]; // Maximum 64 headers
|
||||||
void *user_data; // User data pointer passed to the mg_start()
|
void *user_data; // User data pointer passed to mg_start()
|
||||||
void *ev_data; // Event-specific data pointer
|
void *ev_data; // Event-specific data pointer
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -61,7 +61,8 @@ enum mg_event {
|
|||||||
|
|
||||||
// Mongoose has finished handling the request.
|
// Mongoose has finished handling the request.
|
||||||
// Callback return value is ignored.
|
// Callback return value is ignored.
|
||||||
// ev_data contains NULL.
|
// ev_data contains integer HTTP status code:
|
||||||
|
// int http_reply_status_code = (long) request_info->ev_data;
|
||||||
MG_REQUEST_COMPLETE,
|
MG_REQUEST_COMPLETE,
|
||||||
|
|
||||||
// HTTP error must be returned to the client.
|
// HTTP error must be returned to the client.
|
||||||
|
|||||||
Reference in new issue
Block a user