alibaba / xquic

XQUIC Library released by Alibaba is a cross-platform implementation of QUIC and HTTP/3 protocol.
Apache License 2.0
1.7k stars 327 forks source link

[Doc]: usage function has small mistake in test files #236

Closed adcen0107 closed 1 year ago

adcen0107 commented 2 years ago

What happened?

test_client.c和test_server.c的usage()实现中,参数说明不匹配main()中使用的参数。 比如,main()中有关于multipath相关的参数:M,R,i,而usage()提示内容则没有包含。

Steps To Reproduce

1、test_client.c的main()的相关代码如下: case 'M': printf("option enable multi-path: %s\n", optarg); g_enable_multipath = atoi(optarg); break; case 'R': printf("option enable reinjection: %s\n", "on"); g_enable_reinjection = 1; break; case 'i': printf("option multi-path interface: %s\n", optarg); memset(g_multi_interface[g_multi_interface_cnt], 0, XQC_DEMO_INTERFACE_MAX_LEN); snprintf(g_multi_interface[g_multi_interface_cnt], XQC_DEMO_INTERFACE_MAX_LEN, optarg); ++g_multi_interface_cnt; break; 2、usage()中参数说明如下: printf( "Usage: %s [Options]\n" "\n" "Options:\n" " -a Server addr.\n" " -p Server port.\n" " -P Number of Parallel requests per single connection. Default 1.\n" " -n Total number of requests to send. Defaults 1.\n" " -c Congestion Control Algorithm. r:reno b:bbr c:cubic B:bbr2 bbr+ bbr2+\n" " -C Pacing on.\n" " -t Connection timeout. Default 3 seconds.\n" " -T Transport layer. No HTTP3.\n" " -1 Force 1RTT.\n" " -s Body size to send.\n" " -w Write received body to file.\n" " -r Read sending body from file. priority s > r\n" " -l Log level. e:error d:debug.\n" " -E Echo check on. Compare sent data with received data.\n" " -d Drop rate 鈥?\n" " -u Url. default https://test.xquic.com/path/resource\n" " -H Header. eg. key:value\n" " -h Host & sni. eg. test.xquic.com\n" " -G GET on. Default is POST\n" " -x Test case ID\n" " -N No encryption\n" " -6 IPv6\n" " -V Force cert verification. 0: don't allow self-signed cert. 1: allow self-signed cert.\n" " -q name-value pair num of request header, default and larger than 6\n" " -o Output log file path, default ./clog\n" , prog);

很显然,两者不匹配。

Relevant log output

[root@localhost build]# ./test_client  --help
./test_client: invalid option -- '-'
other option :?
Usage: test_client [Options]

Options:
   -a    Server addr.
   -p    Server port.
   -P    Number of Parallel requests per single connection. Default 1.
   -n    Total number of requests to send. Defaults 1.
   -c    Congestion Control Algorithm. r:reno b:bbr c:cubic B:bbr2 bbr+ bbr2+
   -C    Pacing on.
   -t    Connection timeout. Default 3 seconds.
   -T    Transport layer. No HTTP3.
   -1    Force 1RTT.
   -s    Body size to send.
   -w    Write received body to file.
   -r    Read sending body from file. priority s > r
   -l    Log level. e:error d:debug.
   -E    Echo check on. Compare sent data with received data.
   -d    Drop rate ᾿
   -u    Url. default https://test.xquic.com/path/resource
   -H    Header. eg. key:value
   -h    Host & sni. eg. test.xquic.com
   -G    GET on. Default is POST
   -x    Test case ID
   -N    No encryption
   -6    IPv6
   -V    Force cert verification. 0: don't allow self-signed cert. 1: allow self-signed cert.
   -q    name-value pair num of request header, default and larger than 6
   -o    Output log file path, default ./clog