Skip to content

Commit

Permalink
Add -A option to specify congestion control algorithm for tools (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
iyangsj authored Jan 4, 2024
1 parent 612a868 commit 9d9cde9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions bin/prog.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ prog_print_common_options (const struct prog *prog, FILE *out)
" sndbuf=12345 # Sets SO_SNDBUF\n"
" rcvbuf=12345 # Sets SO_RCVBUF\n"
" -W Use stock PMI (malloc & free)\n"
" -A CC_ALGO Congestion control algorithm. The following algorithms are\n"
" supported.\n"
" 1: Cubic\n"
" 2: BBRv1\n"
" 3: Adaptive congestion control (this is the default).\n"
);

#if HAVE_SENDMMSG
Expand Down Expand Up @@ -266,6 +271,9 @@ prog_set_opt (struct prog *prog, int opt, const char *arg)
case 'W':
prog->prog_use_stock_pmi = 1;
return 0;
case 'A':
prog->prog_settings.es_cc_algo = atoi(optarg);
return 0;
case 'c':
if (prog->prog_engine_flags & LSENG_SERVER)
{
Expand Down
2 changes: 1 addition & 1 deletion bin/prog.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ prog_init (struct prog *, unsigned lsquic_engine_flags, struct sport_head *,
# define IP_DONTFRAG_FLAG ""
#endif

#define PROG_OPTS "i:km:c:y:L:l:o:H:s:S:Y:z:G:W" RECVMMSG_FLAG SENDMMSG_FLAG \
#define PROG_OPTS "i:km:c:y:L:l:o:H:s:S:Y:z:G:WA:" RECVMMSG_FLAG SENDMMSG_FLAG \
IP_DONTFRAG_FLAG

/* Returns:
Expand Down

0 comments on commit 9d9cde9

Please sign in to comment.