From 8e2d15b222a1b4ccb5d7115cf23d88864933a724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Br=C3=BCnig?= Date: Sat, 18 Apr 2020 17:07:52 +0700 Subject: [PATCH] update quicly and adapt client and server to new quicly_decode_packet function signature --- client.c | 5 +---- extern/quicly | 2 +- server.c | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/client.c b/client.c index 2f8165c..f0175a3 100644 --- a/client.c +++ b/client.c @@ -57,7 +57,7 @@ void client_read_cb(EV_P_ ev_io *w, int revents) while((bytes_received = recvfrom(w->fd, buf, sizeof(buf), MSG_DONTWAIT, &sa, &salen)) != -1) { for(ssize_t offset = 0; offset < bytes_received; ) { - size_t packet_len = quicly_decode_packet(&client_ctx, &packet, buf + offset, bytes_received - offset); + size_t packet_len = quicly_decode_packet(&client_ctx, &packet, buf, bytes_received, &offset); if(packet_len == SIZE_MAX) { break; } @@ -75,9 +75,6 @@ void client_read_cb(EV_P_ ev_io *w, int revents) int64_t establish_time = connect_time - start_time; printf("connection establishment time: %lums\n", establish_time); } - // ---------------------------------------------------------------- - - offset += packet_len; } } diff --git a/extern/quicly b/extern/quicly index 01869ac..0bf020a 160000 --- a/extern/quicly +++ b/extern/quicly @@ -1 +1 @@ -Subproject commit 01869ac2090edc73c8a6e028f535f4f1cb1f8ea8 +Subproject commit 0bf020a84b71741241b4ccd270971e5897c47eb5 diff --git a/server.c b/server.c index 9bd75af..973913c 100644 --- a/server.c +++ b/server.c @@ -136,12 +136,11 @@ static void server_read_cb(EV_P_ ev_io *w, int revents) while((bytes_received = recvfrom(w->fd, buf, sizeof(buf), MSG_DONTWAIT, &sa, &salen)) != -1) { for(ssize_t offset = 0; offset < bytes_received; ) { - size_t packet_len = quicly_decode_packet(&server_ctx, &packet, buf + offset, bytes_received - offset); + size_t packet_len = quicly_decode_packet(&server_ctx, &packet, buf, bytes_received, &offset); if(packet_len == SIZE_MAX) { break; } server_handle_packet(&packet, &sa, salen); - offset += packet_len; } }