mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-20 11:19:56 +00:00
Using mg_handler_t for iterate_over_connections()
This commit is contained in:
1 parent
7690f9e34b
commit
02f19fc05a
3 files changed
+12
-12
No files matched your search
@@ -1,13 +1,15 @@
|
||||
#include <string.h>
|
||||
#include "mongoose.h"
|
||||
|
||||
extern const char *find_embedded_file(const char *, size_t *);
|
||||
|
||||
static void iterate_callback(struct mg_connection *c, void *param) {
|
||||
static int iterate_callback(struct mg_connection *c) {
|
||||
if (c->is_websocket) {
|
||||
char buf[20];
|
||||
int len = snprintf(buf, sizeof(buf), "%d", * (int *) param);
|
||||
int len = snprintf(buf, sizeof(buf), "%d", * (int *) c->connection_param);
|
||||
mg_websocket_write(c, 1, buf, len);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// This handler is called for each incoming websocket frame, one or more
|
||||
|
||||
Reference in new issue
Block a user