protoverse

A metaverse protocol
git clone git://jb55.com/protoverse
Log | Files | Refs | README | LICENSE

commit a88ccafe609445e92c2496c7d7d3fde0d372393f
parent de64904413fb7823b841d9bc0f64b182e3932a80
Author: William Casarin <jb55@jb55.com>
Date:   Wed, 23 Sep 2020 23:36:15 -0700

misc

Diffstat:
Mprotoverse.c | 1-
Mserve.h | 10+++++++++-
Mtest.c | 2+-
3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/protoverse.c b/protoverse.c @@ -161,7 +161,6 @@ int main(int argc, const char *argv[]) space = argv[2]; printf("serving protoverse on port 1988...\n"); - server.path = ""; server.port = 1988; server.bind = "127.0.0.1"; diff --git a/serve.h b/serve.h @@ -2,11 +2,19 @@ #ifndef PROTOVERSE_SERVE_H #define PROTOVERSE_SERVE_H +/*typedef int (*handle_packet_fn)(void *closure, + int sockfd, + struct sockaddr_in *from, + struct packet *packet); + */ + struct protoverse_server { const char *bind; int port; - const char *path; + /* + void *closure; + handle_packet_fn handle_packet;*/ }; diff --git a/test.c b/test.c @@ -31,7 +31,7 @@ static void test_packet_serialization(struct packet packet) pushed[0] = push_packet(bufs[0], sizeof(bufs[0]), &packet); assert(pushed[0]); - pulled = pull_packet(&cursors[0], &cursors[1], &packet_out); + pulled = pull_packet(&cursors[0], &cursors[1], &packet_out, pushed[0]); assert(pulled); pushed[1] = push_packet(bufs[2], sizeof(bufs[2]), &packet_out);