Skip to content

Commit

Permalink
update quicly and adapt client and server to new quicly_decode_packet…
Browse files Browse the repository at this point in the history
… function signature
  • Loading branch information
Robert Brünig committed Apr 18, 2020
1 parent 749ce3e commit 8e2d15b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
5 changes: 1 addition & 4 deletions client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
}

Expand Down
3 changes: 1 addition & 2 deletions server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 8e2d15b

Please sign in to comment.