Skip to content

Commit

Permalink
fix uint16_t fields that cause truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuho committed Jan 22, 2025
1 parent a83a482 commit a35cc66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/quicly.h
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ struct st_quicly_stream_t {
*/
struct {
quicly_sender_state_t sender_state;
uint16_t error_code;
uint64_t error_code;
} stop_sending;
/**
* reset_stream
Expand All @@ -846,7 +846,7 @@ struct st_quicly_stream_t {
* STATE_NONE until RST is generated
*/
quicly_sender_state_t sender_state;
uint16_t error_code;
uint64_t error_code;
} reset_stream;
/**
* sends receive window updates to remote peer
Expand Down
4 changes: 2 additions & 2 deletions lib/quicly.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ struct st_quicly_conn_t {
* valid if state is CLOSING
*/
struct {
uint16_t error_code;
uint64_t error_code;
uint64_t frame_type; /* UINT64_MAX if application close */
const char *reason_phrase;
unsigned long num_packets_received;
Expand Down Expand Up @@ -5783,7 +5783,7 @@ static quicly_error_t enter_close(quicly_conn_t *conn, int local_is_initiating,

quicly_error_t initiate_close(quicly_conn_t *conn, quicly_error_t err, uint64_t frame_type, const char *reason_phrase)
{
uint16_t quic_error_code;
uint64_t quic_error_code;

if (conn->super.state >= QUICLY_STATE_CLOSING)
return 0;
Expand Down

0 comments on commit a35cc66

Please sign in to comment.