Skip to content

Commit 35f91bf

Browse files
committed
Restore some deleted multipath tests
1 parent cbff2fe commit 35f91bf

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

picoquic/loss_recovery.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,22 @@ int picoquic_retransmit_needed(picoquic_cnx_t* cnx,
177177
{
178178
size_t length = 0;
179179

180-
if (cnx->is_simple_multipath_enabled && cnx->cnx_state == picoquic_state_ready) {
180+
if (pc == picoquic_packet_context_application && cnx->is_unique_path_id_enabled) {
181+
/* If unique multipath is enabled, should check for retransmission on all paths */
182+
for (int i=0; i<cnx->nb_paths; i++) {
183+
if (length == 0) {
184+
length = picoquic_retransmit_needed_loop(cnx, &cnx->path[i]->pkt_ctx, pc, path_x, current_time,
185+
next_wake_time, packet, send_buffer_max, header_length);
186+
}
187+
else {
188+
/* If more retransmission are queued, set the timer appropriately */
189+
if (cnx->path[i]->pkt_ctx.pending_first != NULL) {
190+
picoquic_set_wake_up_from_packet_retransmit(cnx, cnx->path[i]->pkt_ctx.pending_first, current_time, next_wake_time);
191+
}
192+
}
193+
}
194+
}
195+
else if (cnx->is_simple_multipath_enabled && cnx->cnx_state == picoquic_state_ready) {
181196
/* The per-path algorithm excludes the packets that were sent on
182197
* a path now deleted. The path is set to NULL. */
183198
picoquic_packet_t* old_p;

picoquic/quicctx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,12 +1825,13 @@ void picoquic_demote_path(picoquic_cnx_t* cnx, int path_index, uint64_t current_
18251825
/* TODO: add suspended callback */
18261826

18271827
/* if in multipath, call "retransmit on path demoted" */
1828-
if (cnx->is_unique_path_id_enabled) {
1828+
if (cnx->is_unique_path_id_enabled || cnx->is_simple_multipath_enabled) {
18291829
if (!cnx->path[path_index]->path_abandon_sent) {
18301830
uint8_t buffer[512];
18311831
uint8_t* end_bytes;
18321832
int more_data = 0;
1833-
uint64_t path_id = cnx->path[path_index]->unique_path_id;
1833+
uint64_t path_id = (cnx->is_simple_multipath_enabled)?cnx->path[path_index]->p_remote_cnxid->sequence:
1834+
cnx->path[path_index]->unique_path_id;
18341835
end_bytes = picoquic_format_path_abandon_frame(buffer, buffer + sizeof(buffer), &more_data,
18351836
path_id, reason, phrase);
18361837
if (end_bytes != NULL && picoquic_queue_misc_frame(cnx, buffer, end_bytes - buffer, 0) == 0) {

picoquic/sender.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4370,7 +4370,7 @@ static int picoquic_select_next_path(picoquic_cnx_t * cnx, uint64_t current_time
43704370
{
43714371
int path_id = -1;
43724372

4373-
if (cnx->is_unique_path_id_enabled && cnx->cnx_state >= picoquic_state_ready) {
4373+
if ((cnx->is_simple_multipath_enabled || cnx->is_unique_path_id_enabled) && cnx->cnx_state >= picoquic_state_ready) {
43744374
return picoquic_select_next_path_mp(cnx, current_time, next_wake_time, p_addr_to, p_addr_from, if_index);
43754375
}
43764376

0 commit comments

Comments
 (0)