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

This commit is contained in:
Sergey Lyubka committed 2012-08-03 11:15:38 +01:00
1 parent e8f3132aa8
commit 0e0091e1c0
6 files changed
+24 -17

No files matched your search

+7 -3
View File
@@ -68,7 +68,6 @@ enum mg_event {
// event: which event has been triggered.
// conn: opaque connection handler. Could be used to read, write data to the
// client, etc. See functions below that have "mg_connection *" arg.
// request_info: Information about HTTP request.
//
// Return:
// If handler returns non-NULL, that means that handler has processed the
@@ -78,8 +77,7 @@ enum mg_event {
// the request. Handler must not send any data to the client in this case.
// Mongoose proceeds with request handling as if nothing happened.
typedef void * (*mg_callback_t)(enum mg_event event,
struct mg_connection *conn,
const struct mg_request_info *request_info);
struct mg_connection *conn);
// Start web server.
@@ -151,6 +149,12 @@ int mg_modify_passwords_file(const char *passwords_file_name,
const char *user,
const char *password);
// Return mg_request_info structure associated with the request.
// Always succeeds.
const struct mg_request_info *mg_get_request_info(struct mg_connection *);
// Send data to the client.
int mg_write(struct mg_connection *, const void *buf, size_t len);