Skip to content

Commit 3601eba

Browse files
authored
Merge pull request #1866 from private-octopus/detect-picoquic-ns-failure
Fix failure detection and failure in picoquic_ns
2 parents 0da5018 + 80fab81 commit 3601eba

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

picoquictest/picoquic_ns.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ int picoquic_ns_server_callback(picoquic_cnx_t* cnx,
143143
for (int i = 0; i < cc_ctx->nb_connections; i++) {
144144
if (cc_ctx->client_ctx[i] != NULL && cc_ctx->client_ctx[i]->cnx != NULL &&
145145
picoquic_compare_connection_id(&cnx->path[0]->first_tuple->p_remote_cnxid->cnx_id,
146-
&cc_ctx->client_ctx[i]->cnx->path[0]->first_tuple->p_remote_cnxid->cnx_id) == 0) {
146+
&cc_ctx->client_ctx[i]->cnx->path[0]->first_tuple->p_local_cnxid->cnx_id) == 0) {
147147
picoquic_set_congestion_algorithm_ex(cnx, cc_ctx->client_ctx[i]->cc_algo, cc_ctx->client_ctx[i]->cc_option_string);
148148
ret = 0;
149149
}
@@ -840,6 +840,14 @@ int picoquic_ns(picoquic_ns_spec_t* spec)
840840
}
841841
}
842842

843+
if (ret == 0 &&
844+
(cc_ctx->client_ctx[0]->cnx == NULL ||
845+
(cc_ctx->client_ctx[0]->cnx->cnx_state == picoquic_state_disconnected &&
846+
(cc_ctx->client_ctx[0]->cnx->local_error != 0 ||
847+
cc_ctx->client_ctx[0]->cnx->remote_error != 0)))) {
848+
ret = -1;
849+
}
850+
843851
/* TODO: check the completion. Should it be done there or inside each test? */
844852
if (ret == 0 && cc_ctx->simulated_time > spec->main_target_time) {
845853
ret = -1;

0 commit comments

Comments
 (0)