mirror of
https://github.com/lammertb/libhttp.git
synced 2025-07-03 06:22:34 +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:
@ -89,7 +89,7 @@ class FooHandler: public CivetHandler
|
||||
public:
|
||||
bool handleGet(CivetServer *server, struct mg_connection *conn) {
|
||||
/* 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