Skip to content

Commit

Permalink
[+] update the client option
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanmei-Liu committed Nov 5, 2023
1 parent 5b58fad commit 67ff422
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions demo/demo_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ typedef struct xqc_demo_cli_quic_config_s {
uint8_t mp_version;

uint8_t send_path_standby;
xqc_msec_t path_status_timer_threshold;

} xqc_demo_cli_quic_config_t;

Expand Down Expand Up @@ -399,6 +400,8 @@ typedef struct xqc_demo_cli_user_conn_s {

int send_path_standby;
int path_status; /* 0:available 1:standby */
xqc_msec_t path_status_time;
xqc_msec_t path_status_timer_threshold;
} xqc_demo_cli_user_conn_t;

static void
Expand Down Expand Up @@ -1093,12 +1096,16 @@ xqc_demo_cli_h3_request_read_notify(xqc_h3_request_t *h3_request, xqc_request_no
{
xqc_conn_mark_path_standby(user_conn->ctx->engine, &user_conn->cid, 0);
user_conn->path_status = 1; /* 1:standby */
user_conn->path_status_time = xqc_demo_now();
printf("mark initial path standby\n");

} else if (user_conn->path_status == 1) {
xqc_conn_mark_path_available(user_conn->ctx->engine, &user_conn->cid, 0);
user_conn->path_status = 0; /* 0:available */
printf("mark initial path available\n");
xqc_msec_t ts_now = xqc_demo_now();
if (ts_now > user_conn->path_status_time + user_conn->path_status_timer_threshold) {
xqc_conn_mark_path_available(user_conn->ctx->engine, &user_conn->cid, 0);
user_conn->path_status = 0; /* 0:available */
printf("mark initial path available\n");
}
}
}

Expand Down Expand Up @@ -1739,7 +1746,7 @@ xqc_demo_cli_usage(int argc, char *argv[])
" -T Throttle recving rate (Bps)\n"
" -R Reinjection (1,2,4) \n"
" -V Multipath Version (4,5,6)\n"
" -B Set path B standby after 600ms\n"
" -B Set initial path standby after recvd first application data, and set initial path available after X ms\n"
" -I Idle interval between requests (ms)\n"
" -n Throttling the {1,2,...}xn-th requests\n"
" -e NAT rebinding on path 0\n"
Expand Down Expand Up @@ -1956,6 +1963,7 @@ xqc_demo_cli_parse_args(int argc, char *argv[], xqc_demo_cli_client_args_t *args
case 'B':
printf("option multipath set path status: %s\n", optarg);
args->quic_cfg.send_path_standby = 1;
args->quic_cfg.path_status_timer_threshold = atoi(optarg);
break;

case 'I':
Expand Down Expand Up @@ -2407,6 +2415,7 @@ xqc_demo_cli_init_xquic_connection(xqc_demo_cli_user_conn_t *user_conn,
{
user_conn->send_path_standby = 1;
user_conn->path_status = 0;
user_conn->path_status_timer_threshold = args->quic_cfg.path_status_timer_threshold;
}

return 0;
Expand Down

0 comments on commit 67ff422

Please sign in to comment.