mirror of
https://github.com/lammertb/libhttp.git
synced 2025-07-29 21:01:13 +03:00
Clean usage of const/not const mg_context* and mg_connection* handles in the API.
The API had an inconsistant usage of `const mg_connection *` and `mg_connection *`, that may cause warnings (e.g., #109). Now all non-const `mg_connection *` is only required to read/write the connection.
This commit is contained in:
@ -70,7 +70,7 @@ int ABHandler(struct mg_connection *conn, void *cbdata)
|
||||
int FooHandler(struct mg_connection *conn, void *cbdata)
|
||||
{
|
||||
/* Handler may access the request info using mg_get_request_info */
|
||||
struct mg_request_info * req_info = mg_get_request_info(conn);
|
||||
const struct mg_request_info * req_info = mg_get_request_info(conn);
|
||||
|
||||
mg_printf(conn, "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n");
|
||||
mg_printf(conn, "<html><body>");
|
||||
|
Reference in New Issue
Block a user