Skip to content

Commit

Permalink
Merge pull request #1657 from private-octopus/multipath_interop_issues
Browse files Browse the repository at this point in the history
Send abandon in response to abandon.
  • Loading branch information
huitema authored Mar 16, 2024
2 parents 0605c4d + 14417fb commit 18b8487
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
14 changes: 12 additions & 2 deletions picoquic/frames.c
Original file line number Diff line number Diff line change
Expand Up @@ -5345,11 +5345,21 @@ const uint8_t* picoquic_decode_path_abandon_frame(const uint8_t* bytes, const ui
int path_number = (cnx->is_unique_path_id_enabled)?
picoquic_find_path_by_unique_id(cnx, path_id):
picoquic_find_path_by_cnxid_id(cnx, 1, path_id);
if (path_number < 0 || cnx->path[path_number]->path_is_demoted) {
if (path_number < 0) {
/* Invalid path ID. Just ignore this frame. Add line in log for debug */
picoquic_log_app_message(cnx, "Ignore abandon path with invalid ID: %" PRIu64 ",%" PRIu64,
picoquic_log_app_message(cnx, "Ignore abandon path with invalid ID: %" PRIu64,
path_id);
}
else if (cnx->path[path_number]->path_is_demoted) {
if (!cnx->path[path_number]->path_abandon_received) {
cnx->path[path_number]->path_abandon_received = 1;
}
else {
/* Already abandoned... */
picoquic_log_app_message(cnx, "Ignore redundant abandon path with ID: %" PRIu64,
path_id);
}
}
else {
cnx->path[path_number]->path_abandon_received = 1;
picoquic_demote_path(cnx, path_number, current_time, 0, NULL);
Expand Down
1 change: 1 addition & 0 deletions picoquic/picoquic_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,7 @@ typedef struct st_picoquic_path_t {
unsigned int path_is_standby : 1;
unsigned int path_is_demoted : 1;
unsigned int path_abandon_received : 1;
unsigned int path_abandon_sent : 1;
unsigned int current_spin : 1;
unsigned int last_bw_estimate_path_limited : 1;
unsigned int path_cid_rotated : 1;
Expand Down
4 changes: 2 additions & 2 deletions picoquic/quicctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ void picoquic_demote_path(picoquic_cnx_t* cnx, int path_index, uint64_t current_
/* if in multipath, call "retransmit on path demoted" */
if (cnx->is_multipath_enabled || cnx->is_simple_multipath_enabled ||
cnx->is_unique_path_id_enabled) {
if (!cnx->path[path_index]->path_abandon_received) {
if (!cnx->path[path_index]->path_abandon_sent) {
uint8_t buffer[512];
uint8_t* end_bytes;
int more_data = 0;
Expand All @@ -1835,7 +1835,7 @@ void picoquic_demote_path(picoquic_cnx_t* cnx, int path_index, uint64_t current_
cnx->path[path_index]->unique_path_id);
}
}
picoquic_retransmit_demoted_path(cnx, cnx->path[path_index], current_time);
/* let's not retransmit immediately -- wait for normal processing instead */
}
}
}
Expand Down

0 comments on commit 18b8487

Please sign in to comment.