diff --git a/examples/embedded_c/embedded_c.c b/examples/embedded_c/embedded_c.c index 78b533fe..375eb381 100644 --- a/examples/embedded_c/embedded_c.c +++ b/examples/embedded_c/embedded_c.c @@ -63,6 +63,9 @@ ExampleHandler(struct mg_connection *conn, void *cbdata) mg_printf(conn, "
To see a page from the *.foo handler click xy.foo
"); + mg_printf( + conn, + "To see a page from the close handler click close
"); mg_printf(conn, "To see a page from the FileHandler handler click form (this is the form test page)
"); @@ -144,6 +147,34 @@ FooHandler(struct mg_connection *conn, void *cbdata) } +int +CloseHandler(struct mg_connection *conn, void *cbdata) +{ + /* Handler may access the request info using mg_get_request_info */ + 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, ""); + mg_printf(conn, "