diff options
| author | cashmere <cashmere@autistici.org> | 2026-06-30 23:28:01 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-06-30 23:28:01 +0200 |
| commit | 1e6a829cbcb3a308bf78be8714e6c2a10fcf3248 (patch) | |
| tree | 2c3a65fb5d0b345a57c1e83fdbc3ddb2b57a9a41 /src/main.c | |
| parent | eb050ea4a53d750125eedb27ec3e84356cb1b88d (diff) | |
| download | telnet-1e6a829cbcb3a308bf78be8714e6c2a10fcf3248.tar.gz | |
src/main.c: include struct client into `process_message`
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -48,7 +48,7 @@ int handle_new_connection(int sfd, struct pollfd *fds, nfds_t *nfds, // process message to all the connected clients. // returns 0 on success and -1 on failure. // TODO: add struct client *clients -int process_message(struct pollfd *fds, nfds_t *nfds) { +int process_message(struct pollfd *fds, nfds_t *nfds, struct client *clients) { for (nfds_t i = 1; i < *nfds; i++) { /* if client has something to say */ if (fds[i].revents & POLLIN) { @@ -112,7 +112,7 @@ int main() { continue; } } - if (process_message(fds, &nfds) == -1) { + if (process_message(fds, &nfds, clients) == -1) { perror("could not process message"); continue; } |
