picoquic: fix frame comparison
Frame types are not only 1 byte long anymore
Warning:
/home/ivan/svnrepos/picoquic/picoquic/frames.c:2640:41: error: result of
comparison of constant 'picoquic_frame_type_ack_mp' (764832) with
expression of type 'uint8_t' (aka 'unsigned char') is always false
[-Werror,-Wtautological-constant-out-of-range-compare]
} else if (p->bytes[byte_index] == picoquic_frame_type_ack_mp) {
~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2629,7 +2629,7 @@ void picoquic_process_possible_ack_of_ack_frame(picoquic_cnx_t* cnx, picoquic_pa
break;
}
- if (p->bytes[byte_index] == picoquic_frame_type_ack) {
+ if (ftype == picoquic_frame_type_ack) {
ret = picoquic_process_ack_of_ack_frame(&cnx->ack_ctx[p->pc].first_sack_item,
&p->bytes[byte_index], p->length - byte_index, &frame_length, 0);
byte_index += frame_length;
@@ -2637,7 +2637,7 @@ void picoquic_process_possible_ack_of_ack_frame(picoquic_cnx_t* cnx, picoquic_pa
ret = picoquic_process_ack_of_ack_frame(&cnx->ack_ctx[p->pc].first_sack_item,
&p->bytes[byte_index], p->length - byte_index, &frame_length, 1);
byte_index += frame_length;
- } else if (p->bytes[byte_index] == picoquic_frame_type_ack_mp) {
+ } else if (ftype == picoquic_frame_type_ack_mp) {
ret = picoquic_process_ack_of_ack_mp_frame(cnx, &p->bytes[byte_index], p->length - byte_index, &frame_length, 0);
byte_index += frame_length;
}
@@ -2645,14 +2645,14 @@ void picoquic_process_possible_ack_of_ack_frame(picoquic_cnx_t* cnx, picoquic_pa
ret = picoquic_process_ack_of_ack_mp_frame(cnx, &p->bytes[byte_index], p->length - byte_index, &frame_length, 1);
byte_index += frame_length;
}
- else if (PICOQUIC_IN_RANGE(p->bytes[byte_index], picoquic_frame_type_stream_range_min, picoquic_frame_type_stream_range_max)) {
+ else if (PICOQUIC_IN_RANGE(ftype, picoquic_frame_type_stream_range_min, picoquic_frame_type_stream_range_max)) {
ret = picoquic_process_ack_of_stream_frame(cnx, &p->bytes[byte_index], p->length - byte_index, &frame_length);
byte_index += frame_length;
if (p->send_path != NULL && p->send_time > p->send_path->last_time_acked_data_frame_sent) {
p->send_path->last_time_acked_data_frame_sent = p->send_time;
}
} else {
- if (PICOQUIC_IN_RANGE(p->bytes[byte_index], picoquic_frame_type_datagram, picoquic_frame_type_datagram_l) &&
+ if (PICOQUIC_IN_RANGE(ftype, picoquic_frame_type_datagram, picoquic_frame_type_datagram_l) &&
p->send_path != NULL && p->send_time > p->send_path->last_time_acked_data_frame_sent) {
p->send_path->last_time_acked_data_frame_sent = p->send_time;
}
