mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-13 17:00:19 +00:00
remove fn_data from event handler signature
This commit is contained in:
1 parent
b8bfa5565b
commit
deca1aaf46
77 files changed
+2839
-2259
No files matched your search
@@ -25,7 +25,7 @@ uint64_t mg_millis(void) { // Let Mongoose use our uptime function
|
||||
// Simple HTTP server that runs on port 8000
|
||||
// Mongoose event handler function, gets called by the mg_mgr_poll()
|
||||
// See https://mongoose.ws/documentation/#2-minute-integration-guide
|
||||
static void simple_http_listener(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||
static void simple_http_listener(struct mg_connection *c, int ev, void *ev_data) {
|
||||
if (ev == MG_EV_HTTP_MSG) {
|
||||
// The MG_EV_HTTP_MSG event means HTTP request. `hm` holds parsed request,
|
||||
// see https://mongoose.ws/documentation/#struct-mg_http_message
|
||||
|
||||
@@ -38,7 +38,7 @@ void setup() {
|
||||
// Setup HTTP listener. Respond "ok" on any HTTP request
|
||||
mg_http_listen(
|
||||
&mgr, "http://0.0.0.0",
|
||||
[](struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||
[](struct mg_connection *c, int ev, void *ev_data) {
|
||||
if (ev == MG_EV_HTTP_MSG) mg_http_reply(c, 200, "", "ok\n");
|
||||
},
|
||||
&mgr);
|
||||
|
||||
@@ -15,7 +15,7 @@ void mqtt_publish(const char *message) {
|
||||
if (mqtt_connection) mg_mqtt_pub(mqtt_connection, &opts);
|
||||
}
|
||||
|
||||
static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
|
||||
static void fn(struct mg_connection *c, int ev, void *ev_data) {
|
||||
if (ev == MG_EV_MQTT_OPEN) {
|
||||
MG_INFO(("%lu CONNECTED to %s", c->id, MQTT_SERVER));
|
||||
struct mg_mqtt_opts opts = {};
|
||||
|
||||
Reference in new issue
Block a user