Skip to content

Commit a94c1be

Browse files
committed
First pass compiles, but broke some tests
1 parent 0a8731b commit a94c1be

22 files changed

+128
-326
lines changed

UnitTest1/unittest1.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,12 +2417,6 @@ namespace UnitTest1
24172417
Assert::AreEqual(ret, 0);
24182418
}
24192419

2420-
TEST_METHOD(monopath_unique) {
2421-
int ret = monopath_unique_test();
2422-
2423-
Assert::AreEqual(ret, 0);
2424-
}
2425-
24262420
TEST_METHOD(monopath_0rtt) {
24272421
int ret = monopath_0rtt_test();
24282422

@@ -2434,7 +2428,7 @@ namespace UnitTest1
24342428

24352429
Assert::AreEqual(ret, 0);
24362430
}
2437-
2431+
#if 0
24382432
TEST_METHOD(multipath_aead) {
24392433
int ret = multipath_aead_test();
24402434

@@ -2560,7 +2554,7 @@ namespace UnitTest1
25602554

25612555
Assert::AreEqual(ret, 0);
25622556
}
2563-
2557+
#endif
25642558
TEST_METHOD(m_unip_basic) {
25652559
int ret = m_unip_basic_test();
25662560

picoquic/bbr.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,16 +2005,8 @@ static picoquic_packet_context_t* BBRAccessEcnPacketContext(picoquic_path_t* pat
20052005
/* TODO: ECN counts should be a function of path, not number space! */
20062006
picoquic_packet_context_t* pkt_ctx = &path_x->cnx->pkt_ctx[picoquic_packet_context_application];
20072007

2008-
if (path_x->cnx->is_multipath_enabled) {
2009-
/* TODO: if the RCID index has changed, reset the counters. */
2010-
picoquic_remote_cnxid_t* r_cid = path_x->p_remote_cnxid;
2011-
2012-
if (r_cid != NULL) {
2013-
pkt_ctx = &r_cid->pkt_ctx;
2014-
}
2015-
else {
2016-
pkt_ctx = NULL;
2017-
}
2008+
if (path_x->cnx->is_unique_path_id_enabled) {
2009+
pkt_ctx = &path_x->pkt_ctx;
20182010
}
20192011
else if (path_x != path_x->cnx->path[0]) {
20202012
/* When doing simple multipath, or when preparing transitions,

picoquic/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static int config_set_option(option_table_line_t* option_desc, option_param_t* p
375375
}
376376
case picoquic_option_MULTIPATH: {
377377
int v = config_atoi(params, nb_params, 0, &ret);
378-
if (ret != 0 || v < 0 || v > 7) {
378+
if (ret != 0 || v < 0 || v > 3) {
379379
fprintf(stderr, "Invalid multipath option: %s\n", config_optval_param_string(opval_buffer, 256, params, nb_params, 0));
380380
ret = (ret == 0) ? -1 : ret;
381381
}

picoquic/frames.c

Lines changed: 30 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ uint8_t* picoquic_format_available_stream_frames(picoquic_cnx_t* cnx, picoquic_p
17741774
{
17751775
uint8_t* bytes_previous = bytes_next;
17761776
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);
17781778
int more_stream_data = 0;
17791779

17801780
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
17831783

17841784
if (*ret == 0) {
17851785
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);
17871787
if (stream != NULL && bytes_next + 17 >= bytes_max) {
17881788
more_stream_data = 1;
17891789
break;
@@ -2444,7 +2444,7 @@ picoquic_packet_t* picoquic_check_spurious_retransmission(picoquic_cnx_t* cnx,
24442444
old_path->path_packet_acked_time_sent = p->send_time;
24452445
old_path->path_packet_acked_received = current_time;
24462446
if (old_path->nb_retransmit > 0 &&
2447-
((!cnx->is_multipath_enabled &&
2447+
((!cnx->is_unique_path_id_enabled &&
24482448
!cnx->is_simple_multipath_enabled) ||
24492449
(old_path->path_packet_last == NULL ||
24502450
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
26992699
ack_gap = ack_gap_min;
27002700
}
27012701
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 ||
27032703
cnx->congestion_alg == NULL ||
27042704
cnx->congestion_alg->congestion_algorithm_number == PICOQUIC_CC_ALGO_NUMBER_NEW_RENO ||
27052705
cnx->congestion_alg->congestion_algorithm_number == PICOQUIC_CC_ALGO_NUMBER_FAST
@@ -3525,7 +3525,7 @@ static int picoquic_process_ack_range(
35253525
old_path->path_packet_acked_time_sent = p->send_time;
35263526
old_path->path_packet_acked_received = current_time;
35273527
if (old_path->nb_retransmit > 0 &&
3528-
((!cnx->is_multipath_enabled &&
3528+
((!cnx->is_unique_path_id_enabled &&
35293529
!cnx->is_simple_multipath_enabled) ||
35303530
(old_path->path_packet_last == NULL ||
35313531
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
35943594
else
35953595
{
35963596
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) {
36103598
int path_index = picoquic_find_path_by_unique_id(cnx, path_id);
36113599
if (path_index < 0) {
36123600
/* 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
39023890
}
39033891
return bytes;
39043892
}
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-
}
39343893
else {
39353894
bytes = picoquic_format_ack_frame_in_context(cnx, bytes, bytes_max, more_data,
39363895
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
39403899
}
39413900

39423901
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)
39443903
{
39453904
if (pc == picoquic_packet_context_application &&
3946-
cnx->is_multipath_enabled) {
3905+
cnx->is_unique_path_id_enabled) {
39473906
/* 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;
39543913
}
39553914
}
39563915
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
39623921
}
39633922
}
39643923

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)
39663925
{
39673926
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;
39813934
}
39823935
}
39833936
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
40003953
}
40013954

40023955
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)
40043957
{
40053958
int ret = 0;
40063959

@@ -4017,7 +3970,7 @@ int picoquic_is_ack_needed_in_ctx(picoquic_cnx_t* cnx, picoquic_ack_context_t* a
40173970
}
40183971
else
40193972
{
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);
40213974

40223975
if (ack_ctx->act[is_opportunistic].highest_ack_sent + ack_gap <= picoquic_sack_list_last(&ack_ctx->sack_list) ||
40233976
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*
40524005
pc, is_opportunistic);
40534006

40544007
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) {
40654009
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,
40674011
next_wake_time, pc, is_opportunistic);
40684012
}
40694013
}
@@ -5220,7 +5164,7 @@ const uint8_t* picoquic_decode_immediate_ack_frame(const uint8_t* bytes, const u
52205164
else {
52215165
/* set the immediate ACK requested flag */
52225166
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);
52245168
}
52255169
}
52265170
return bytes;
@@ -5324,7 +5268,7 @@ const uint8_t* picoquic_decode_path_abandon_frame(const uint8_t* bytes, const ui
53245268

53255269
/* This code assumes that the frame type is already skipped */
53265270

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) {
53285272
/* Frame is unexpected */
53295273
picoquic_connection_error_ex(cnx, PICOQUIC_TRANSPORT_FRAME_FORMAT_ERROR,
53305274
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
54485392

54495393
/* This code assumes that the frame type is already skipped */
54505394

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) {
54525396
/* Frame is unexpected */
54535397
picoquic_connection_error_ex(cnx, PICOQUIC_TRANSPORT_FRAME_FORMAT_ERROR,
54545398
frame_id64, "multipath not negotiated");
@@ -6030,7 +5974,7 @@ int picoquic_decode_frames(picoquic_cnx_t* cnx, picoquic_path_t * path_x, const
60305974

60315975
if (ack_needed) {
60325976
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);
60345978
}
60355979

60365980
if (epoch == picoquic_epoch_1rtt && !is_path_probing_packet && pn64 > path_x->last_non_path_probing_pn) {

picoquic/logwriter.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ static uint64_t binlog_get_path_id(picoquic_cnx_t* cnx, picoquic_path_t* path_x)
650650
{
651651
uint64_t path_id = 0;
652652

653-
if ((cnx->is_multipath_enabled || cnx->is_simple_multipath_enabled) && path_x != NULL && path_x->p_remote_cnxid != NULL) {
653+
if (cnx->is_simple_multipath_enabled && path_x != NULL && path_x->p_remote_cnxid != NULL) {
654654
if (path_x->p_remote_cnxid->cnx_id.id_len > 0) {
655655
path_id = path_x->p_remote_cnxid->sequence;
656656
}
@@ -1132,16 +1132,14 @@ void binlog_cc_dump(picoquic_cnx_t* cnx, uint64_t current_time)
11321132

11331133
bytestream_buf stream_msg;
11341134
bytestream* ps_msg = bytestream_buf_init(&stream_msg, BYTESTREAM_MAX_BUFFER_SIZE);
1135-
int path_max = (cnx->is_multipath_enabled || cnx->is_simple_multipath_enabled || cnx->is_unique_path_id_enabled) ? cnx->nb_paths : 1;
1135+
int path_max = (cnx->is_simple_multipath_enabled || cnx->is_unique_path_id_enabled) ? cnx->nb_paths : 1;
11361136

11371137
for (int path_id = 0; path_id < path_max; path_id++)
11381138
{
11391139
picoquic_path_t* path = cnx->path[path_id];
11401140
picoquic_packet_context_t* pkt_ctx = &cnx->pkt_ctx[picoquic_packet_context_application];
1141-
if (cnx->is_multipath_enabled && cnx->path[path_id]->p_remote_cnxid != NULL) {
1142-
pkt_ctx = &cnx->path[path_id]->p_remote_cnxid->pkt_ctx;
1143-
}
1144-
else if (cnx->is_unique_path_id_enabled) {
1141+
1142+
if (cnx->is_unique_path_id_enabled) {
11451143
pkt_ctx = &cnx->path[path_id]->pkt_ctx;
11461144
}
11471145

@@ -1179,7 +1177,7 @@ void binlog_cc_dump(picoquic_cnx_t* cnx, uint64_t current_time)
11791177
bytewrite_vint(ps_msg, path->receive_rate_estimate);
11801178
bytewrite_vint(ps_msg, path->send_mtu);
11811179
bytewrite_vint(ps_msg, path->pacing_packet_time_microsec);
1182-
if (cnx->is_multipath_enabled || cnx->is_simple_multipath_enabled || cnx->is_unique_path_id_enabled) {
1180+
if (cnx->is_simple_multipath_enabled || cnx->is_unique_path_id_enabled) {
11831181
bytewrite_vint(ps_msg, path->nb_losses_found);
11841182
bytewrite_vint(ps_msg, path->nb_spurious);
11851183
}

0 commit comments

Comments
 (0)