From 73ead92c2d37d5d091992ef617c4abdfe9907a18 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 29 Sep 2024 22:38:43 -0400 Subject: project: Massive fixups - Fix client handling - Add multithreading - Fixup bad values Signed-off-by: Ian Moffett --- ostp.d/init/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'ostp.d') diff --git a/ostp.d/init/main.c b/ostp.d/init/main.c index 08e020e..9b2a836 100644 --- a/ostp.d/init/main.c +++ b/ostp.d/init/main.c @@ -33,7 +33,7 @@ #include static int -blah(struct ostp_session *s, const char *buf, size_t len) +handle_data(struct ostp_client *s, const char *buf, size_t len) { printf("Got data!\n"); return 0; @@ -43,16 +43,15 @@ int main(void) { struct ostp_listener l; - struct ostp_session s; int error; listener_init(&l); - l.on_recv = blah; + l.on_recv = handle_data; - if ((error = listener_bind(&s, &l)) < 0) { + if ((error = listener_bind(&l)) < 0) { return error; } - if ((error = listener_poll(&s, &l)) < 0) { + if ((error = listener_poll(&l)) < 0) { return error; } -- cgit v1.2.3