@@ -1774,7 +1774,7 @@ uint8_t* picoquic_format_available_stream_frames(picoquic_cnx_t* cnx, picoquic_p
1774
1774
{
1775
1775
uint8_t * bytes_previous = bytes_next ;
1776
1776
picoquic_stream_head_t * stream = picoquic_find_ready_stream_path (cnx ,
1777
- (cnx -> is_multipath_enabled || cnx -> is_simple_multipath_enabled )?path_x : NULL );
1777
+ (cnx -> is_unique_path_id_enabled || cnx -> is_simple_multipath_enabled )?path_x : NULL );
1778
1778
int more_stream_data = 0 ;
1779
1779
1780
1780
while (* ret == 0 && stream != NULL && stream -> stream_priority <= current_priority && bytes_next < bytes_max ) {
@@ -1783,7 +1783,7 @@ uint8_t* picoquic_format_available_stream_frames(picoquic_cnx_t* cnx, picoquic_p
1783
1783
1784
1784
if (* ret == 0 ) {
1785
1785
stream = picoquic_find_ready_stream_path (cnx ,
1786
- (cnx -> is_multipath_enabled || cnx -> is_simple_multipath_enabled )?path_x : NULL );
1786
+ (cnx -> is_unique_path_id_enabled || cnx -> is_simple_multipath_enabled )?path_x : NULL );
1787
1787
if (stream != NULL && bytes_next + 17 >= bytes_max ) {
1788
1788
more_stream_data = 1 ;
1789
1789
break ;
@@ -2444,7 +2444,7 @@ picoquic_packet_t* picoquic_check_spurious_retransmission(picoquic_cnx_t* cnx,
2444
2444
old_path -> path_packet_acked_time_sent = p -> send_time ;
2445
2445
old_path -> path_packet_acked_received = current_time ;
2446
2446
if (old_path -> nb_retransmit > 0 &&
2447
- ((!cnx -> is_multipath_enabled &&
2447
+ ((!cnx -> is_unique_path_id_enabled &&
2448
2448
!cnx -> is_simple_multipath_enabled ) ||
2449
2449
(old_path -> path_packet_last == NULL ||
2450
2450
p -> path_packet_number >= old_path -> path_packet_last -> path_packet_number ))) {
@@ -2699,7 +2699,7 @@ static uint64_t picoquic_compute_ack_gap(picoquic_cnx_t* cnx, uint64_t data_rate
2699
2699
ack_gap = ack_gap_min ;
2700
2700
}
2701
2701
else if (ack_gap > 32 ) {
2702
- if (cnx -> is_simple_multipath_enabled || cnx -> is_multipath_enabled ||
2702
+ if (cnx -> is_simple_multipath_enabled || cnx -> is_unique_path_id_enabled ||
2703
2703
cnx -> congestion_alg == NULL ||
2704
2704
cnx -> congestion_alg -> congestion_algorithm_number == PICOQUIC_CC_ALGO_NUMBER_NEW_RENO ||
2705
2705
cnx -> congestion_alg -> congestion_algorithm_number == PICOQUIC_CC_ALGO_NUMBER_FAST
@@ -3525,7 +3525,7 @@ static int picoquic_process_ack_range(
3525
3525
old_path -> path_packet_acked_time_sent = p -> send_time ;
3526
3526
old_path -> path_packet_acked_received = current_time ;
3527
3527
if (old_path -> nb_retransmit > 0 &&
3528
- ((!cnx -> is_multipath_enabled &&
3528
+ ((!cnx -> is_unique_path_id_enabled &&
3529
3529
!cnx -> is_simple_multipath_enabled ) ||
3530
3530
(old_path -> path_packet_last == NULL ||
3531
3531
p -> path_packet_number >= old_path -> path_packet_last -> path_packet_number ))) {
@@ -3594,19 +3594,7 @@ const uint8_t* picoquic_decode_ack_frame(picoquic_cnx_t* cnx, const uint8_t* byt
3594
3594
else
3595
3595
{
3596
3596
if (pc == picoquic_packet_context_application ) {
3597
- if (cnx -> is_multipath_enabled ) {
3598
- picoquic_remote_cnxid_t * r_cid = picoquic_find_remote_cnxid_by_number (cnx , path_id );
3599
-
3600
- if (r_cid == NULL ) {
3601
- /* No such path ID. Ignore frame. TODO: error if never seen? */
3602
- bytes = picoquic_skip_ack_frame_maybe_ecn (bytes , bytes_max , is_ecn , has_path_id );
3603
- return bytes ;
3604
- }
3605
- else {
3606
- pkt_ctx = & r_cid -> pkt_ctx ;
3607
- }
3608
- }
3609
- else if (cnx -> is_unique_path_id_enabled ) {
3597
+ if (cnx -> is_unique_path_id_enabled ) {
3610
3598
int path_index = picoquic_find_path_by_unique_id (cnx , path_id );
3611
3599
if (path_index < 0 ) {
3612
3600
/* No such path ID. Ignore frame. TODO: error if never seen? */
@@ -3902,35 +3890,6 @@ uint8_t * picoquic_format_ack_frame(picoquic_cnx_t* cnx, uint8_t* bytes, uint8_t
3902
3890
}
3903
3891
return bytes ;
3904
3892
}
3905
- else if (cnx -> is_multipath_enabled && pc == picoquic_packet_context_application ) {
3906
- picoquic_local_cnxid_t * p_local_cnxid = cnx -> first_local_cnxid_list -> local_cnxid_first ;
3907
- int ack_still_needed = 0 ;
3908
- int ack_after_fin = 0 ;
3909
-
3910
- while (p_local_cnxid != NULL ) {
3911
- ack_ctx = & p_local_cnxid -> ack_ctx ;
3912
- if (bytes != NULL ) {
3913
- bytes = picoquic_format_ack_frame_in_context (cnx , bytes , bytes_max , more_data ,
3914
- current_time , ack_ctx , & need_time_stamp , p_local_cnxid -> sequence , is_opportunistic );
3915
- if (is_opportunistic ) {
3916
- ack_still_needed |= ack_ctx -> act [1 ].ack_needed ;
3917
- ack_after_fin |= ack_ctx -> act [1 ].ack_after_fin ;
3918
- } else {
3919
- ack_still_needed |= ack_ctx -> act [0 ].ack_needed ;
3920
- ack_after_fin |= ack_ctx -> act [0 ].ack_after_fin ;
3921
- }
3922
- }
3923
- p_local_cnxid = p_local_cnxid -> next ;
3924
- }
3925
- if (is_opportunistic ) {
3926
- cnx -> ack_ctx [pc ].act [1 ].ack_needed = ack_still_needed ;
3927
- cnx -> ack_ctx [pc ].act [1 ].ack_after_fin = ack_after_fin ;
3928
- }
3929
- else {
3930
- cnx -> ack_ctx [pc ].act [0 ].ack_needed = ack_still_needed ;
3931
- cnx -> ack_ctx [pc ].act [0 ].ack_after_fin = ack_after_fin ;
3932
- }
3933
- }
3934
3893
else {
3935
3894
bytes = picoquic_format_ack_frame_in_context (cnx , bytes , bytes_max , more_data ,
3936
3895
current_time , & cnx -> ack_ctx [pc ], & need_time_stamp , UINT64_MAX , is_opportunistic );
@@ -3940,17 +3899,17 @@ uint8_t * picoquic_format_ack_frame(picoquic_cnx_t* cnx, uint8_t* bytes, uint8_t
3940
3899
}
3941
3900
3942
3901
void picoquic_set_ack_needed (picoquic_cnx_t * cnx , uint64_t current_time , picoquic_packet_context_enum pc ,
3943
- picoquic_local_cnxid_t * l_cid , int is_immediate_ack_required )
3902
+ picoquic_path_t * path_x , int is_immediate_ack_required )
3944
3903
{
3945
3904
if (pc == picoquic_packet_context_application &&
3946
- cnx -> is_multipath_enabled ) {
3905
+ cnx -> is_unique_path_id_enabled ) {
3947
3906
/* TODO: this code seems wrong */
3948
- l_cid -> ack_ctx .act [0 ].is_immediate_ack_required |= is_immediate_ack_required ;
3949
- if (!l_cid -> ack_ctx .act [0 ].ack_needed ) {
3950
- l_cid -> ack_ctx .act [0 ].ack_needed = 1 ;
3951
- l_cid -> ack_ctx .act [0 ].time_oldest_unack_packet_received = current_time ;
3952
- l_cid -> ack_ctx .act [1 ].ack_needed = 1 ;
3953
- l_cid -> ack_ctx .act [1 ].time_oldest_unack_packet_received = current_time ;
3907
+ path_x -> ack_ctx .act [0 ].is_immediate_ack_required |= is_immediate_ack_required ;
3908
+ if (!path_x -> ack_ctx .act [0 ].ack_needed ) {
3909
+ path_x -> ack_ctx .act [0 ].ack_needed = 1 ;
3910
+ path_x -> ack_ctx .act [0 ].time_oldest_unack_packet_received = current_time ;
3911
+ path_x -> ack_ctx .act [1 ].ack_needed = 1 ;
3912
+ path_x -> ack_ctx .act [1 ].time_oldest_unack_packet_received = current_time ;
3954
3913
}
3955
3914
}
3956
3915
if (!cnx -> ack_ctx [pc ].act [0 ].ack_needed ) {
@@ -3962,22 +3921,16 @@ void picoquic_set_ack_needed(picoquic_cnx_t* cnx, uint64_t current_time, picoqui
3962
3921
}
3963
3922
}
3964
3923
3965
- uint64_t picoquic_ack_gap_override_if_needed (picoquic_cnx_t * cnx , uint64_t l_cid_sequence )
3924
+ uint64_t picoquic_ack_gap_override_if_needed (picoquic_cnx_t * cnx , int path_index )
3966
3925
{
3967
3926
uint64_t ack_gap = cnx -> ack_gap_remote ;
3968
- if (cnx -> is_multipath_enabled ) {
3969
- for (int path_id = 0 ; path_id < cnx -> nb_paths ; path_id ++ ) {
3970
- /* TODO: why look at all paths? This is in context of one path */
3971
- if (cnx -> path [path_id ]-> p_local_cnxid != NULL &&
3972
- cnx -> path [path_id ]-> p_local_cnxid -> sequence == l_cid_sequence &&
3973
- !cnx -> path [path_id ]-> path_is_demoted &&
3974
- !cnx -> path [path_id ]-> challenge_failed &&
3975
- !cnx -> path [path_id ]-> response_required &&
3976
- cnx -> path [path_id ]-> challenge_verified &&
3977
- cnx -> path [path_id ]-> received < 100 * PICOQUIC_MAX_PACKET_SIZE ) {
3978
- ack_gap = 2 ;
3979
- break ;
3980
- }
3927
+ if (cnx -> is_unique_path_id_enabled ) {
3928
+ if (!cnx -> path [path_index ]-> path_is_demoted &&
3929
+ !cnx -> path [path_index ]-> challenge_failed &&
3930
+ !cnx -> path [path_index ]-> response_required &&
3931
+ cnx -> path [path_index ]-> challenge_verified &&
3932
+ cnx -> path [path_index ]-> received < 100 * PICOQUIC_MAX_PACKET_SIZE ) {
3933
+ ack_gap = 2 ;
3981
3934
}
3982
3935
}
3983
3936
else if (cnx -> is_simple_multipath_enabled ) {
@@ -4000,7 +3953,7 @@ uint64_t picoquic_ack_gap_override_if_needed(picoquic_cnx_t* cnx, uint64_t l_cid
4000
3953
}
4001
3954
4002
3955
int picoquic_is_ack_needed_in_ctx (picoquic_cnx_t * cnx , picoquic_ack_context_t * ack_ctx , uint64_t current_time ,
4003
- uint64_t l_cid_sequence , uint64_t * next_wake_time , picoquic_packet_context_enum pc , int is_opportunistic )
3956
+ int path_index , uint64_t * next_wake_time , picoquic_packet_context_enum pc , int is_opportunistic )
4004
3957
{
4005
3958
int ret = 0 ;
4006
3959
@@ -4017,7 +3970,7 @@ int picoquic_is_ack_needed_in_ctx(picoquic_cnx_t* cnx, picoquic_ack_context_t* a
4017
3970
}
4018
3971
else
4019
3972
{
4020
- uint64_t ack_gap = picoquic_ack_gap_override_if_needed (cnx , l_cid_sequence );
3973
+ uint64_t ack_gap = picoquic_ack_gap_override_if_needed (cnx , path_index );
4021
3974
4022
3975
if (ack_ctx -> act [is_opportunistic ].highest_ack_sent + ack_gap <= picoquic_sack_list_last (& ack_ctx -> sack_list ) ||
4023
3976
ack_ctx -> act [is_opportunistic ].time_oldest_unack_packet_received + cnx -> ack_delay_remote <= current_time ) {
@@ -4052,18 +4005,9 @@ int picoquic_is_ack_needed(picoquic_cnx_t* cnx, uint64_t current_time, uint64_t*
4052
4005
pc , is_opportunistic );
4053
4006
4054
4007
if (pc == picoquic_packet_context_application ) {
4055
- if (cnx -> is_multipath_enabled ) {
4056
- picoquic_local_cnxid_t * l_cid = cnx -> first_local_cnxid_list -> local_cnxid_first ;
4057
-
4058
- while (ret == 0 && l_cid != NULL ) {
4059
- ret |= picoquic_is_ack_needed_in_ctx (cnx , & l_cid -> ack_ctx , current_time , l_cid -> sequence ,
4060
- next_wake_time , pc , is_opportunistic );
4061
- l_cid = l_cid -> next ;
4062
- }
4063
- }
4064
- else if (cnx -> is_unique_path_id_enabled ) {
4008
+ if (cnx -> is_unique_path_id_enabled ) {
4065
4009
for (int i = 0 ; ret == 0 && i < cnx -> nb_paths ; i ++ ) {
4066
- ret |= picoquic_is_ack_needed_in_ctx (cnx , & cnx -> path [i ]-> ack_ctx , current_time , 0 ,
4010
+ ret |= picoquic_is_ack_needed_in_ctx (cnx , & cnx -> path [i ]-> ack_ctx , current_time , i ,
4067
4011
next_wake_time , pc , is_opportunistic );
4068
4012
}
4069
4013
}
@@ -5220,7 +5164,7 @@ const uint8_t* picoquic_decode_immediate_ack_frame(const uint8_t* bytes, const u
5220
5164
else {
5221
5165
/* set the immediate ACK requested flag */
5222
5166
cnx -> is_immediate_ack_required = 1 ;
5223
- picoquic_set_ack_needed (cnx , current_time , picoquic_packet_context_application , path_x -> p_local_cnxid , 1 );
5167
+ picoquic_set_ack_needed (cnx , current_time , picoquic_packet_context_application , path_x , 1 );
5224
5168
}
5225
5169
}
5226
5170
return bytes ;
@@ -5324,7 +5268,7 @@ const uint8_t* picoquic_decode_path_abandon_frame(const uint8_t* bytes, const ui
5324
5268
5325
5269
/* This code assumes that the frame type is already skipped */
5326
5270
5327
- if (!cnx -> is_multipath_enabled && ! cnx -> is_simple_multipath_enabled && !cnx -> is_unique_path_id_enabled ) {
5271
+ if (!cnx -> is_simple_multipath_enabled && !cnx -> is_unique_path_id_enabled ) {
5328
5272
/* Frame is unexpected */
5329
5273
picoquic_connection_error_ex (cnx , PICOQUIC_TRANSPORT_FRAME_FORMAT_ERROR ,
5330
5274
picoquic_frame_type_path_abandon , "multipath not negotiated" );
@@ -5448,7 +5392,7 @@ const uint8_t* picoquic_decode_path_available_or_standby_frame(const uint8_t* by
5448
5392
5449
5393
/* This code assumes that the frame type is already skipped */
5450
5394
5451
- if (!cnx -> is_multipath_enabled && ! cnx -> is_simple_multipath_enabled && !cnx -> is_unique_path_id_enabled ) {
5395
+ if (!cnx -> is_simple_multipath_enabled && !cnx -> is_unique_path_id_enabled ) {
5452
5396
/* Frame is unexpected */
5453
5397
picoquic_connection_error_ex (cnx , PICOQUIC_TRANSPORT_FRAME_FORMAT_ERROR ,
5454
5398
frame_id64 , "multipath not negotiated" );
@@ -6030,7 +5974,7 @@ int picoquic_decode_frames(picoquic_cnx_t* cnx, picoquic_path_t * path_x, const
6030
5974
6031
5975
if (ack_needed ) {
6032
5976
cnx -> latest_receive_time = current_time ;
6033
- picoquic_set_ack_needed (cnx , current_time , pc , path_x -> p_local_cnxid , 0 );
5977
+ picoquic_set_ack_needed (cnx , current_time , pc , path_x , 0 );
6034
5978
}
6035
5979
6036
5980
if (epoch == picoquic_epoch_1rtt && !is_path_probing_packet && pn64 > path_x -> last_non_path_probing_pn ) {
0 commit comments