mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-26 12:14:56 +00:00
Restored void * parameter for iterate_over_connections()
This commit is contained in:
1 parent
367f5df328
commit
94f63787bb
3 files changed
+13
-11
No files matched your search
@@ -9,10 +9,10 @@
|
||||
extern const char *find_embedded_file(const char *, size_t *);
|
||||
|
||||
static int iterate_callback(struct mg_connection *c, enum mg_event ev) {
|
||||
static int counter = 0;
|
||||
if (ev == MG_POLL && c->is_websocket) {
|
||||
char buf[20];
|
||||
int len = snprintf(buf, sizeof(buf), "%d", counter++);
|
||||
int len = snprintf(buf, sizeof(buf), "%lu",
|
||||
(unsigned long) * (time_t *) c->callback_param);
|
||||
mg_websocket_write(c, 1, buf, len);
|
||||
}
|
||||
return MG_TRUE;
|
||||
@@ -58,7 +58,7 @@ int main(void) {
|
||||
current_timer = time(NULL);
|
||||
if (current_timer - last_timer > 0) {
|
||||
last_timer = current_timer;
|
||||
mg_iterate_over_connections(server, iterate_callback);
|
||||
mg_iterate_over_connections(server, iterate_callback, ¤t_timer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user