Change --server to --servers.

Prior to this commit --server took a list of servers, so making it
plural makes sense.
This commit is contained in:
Joseph Kong 2016-01-22 12:36:40 -08:00
bovenliggende df070fe2c3
commit 83fef49f59
4 gewijzigde bestanden met toevoegingen van 15 en 13 verwijderingen

Bestand weergeven

@ -61,13 +61,13 @@ conn_add_servers(void)
struct stat st;
int fd, len;
fd = open(param.server, O_RDONLY, 0);
fd = open(param.servers, O_RDONLY, 0);
if (fd == -1)
panic("%s: can't open %s\n", prog_name, param.server);
panic("%s: can't open %s\n", prog_name, param.servers);
fstat(fd, &st);
if (st.st_size == 0)
panic("%s: file %s is empty\n", prog_name, param.server);
panic("%s: file %s is empty\n", prog_name, param.servers);
srvbase = (char *)mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (srvbase == (char *)-1)

Bestand weergeven

@ -963,7 +963,7 @@ core_init(void)
printf("%s: maximum number of open descriptors = %ld\n",
prog_name, rlimit.rlim_max);
if (param.server)
if (param.servers)
conn_add_servers();
if (param.runtime) {
arg.l = 0;

Bestand weergeven

@ -136,7 +136,7 @@ static struct option longopts[] = {
{"retry-on-failure", no_argument, &param.retry_on_failure, 1},
{"runtime", required_argument, (int *) &param.runtime, 0},
{"send-buffer", required_argument, (int *) &param.send_buffer_size, 0},
{"server", required_argument, (int *) &param.server, 0},
{"servers", required_argument, (int *) &param.servers, 0},
{"uri", required_argument, (int *) &param.uri, 0},
{"session-cookies", no_argument, (int *) &param.session_cookies, 1},
#ifdef HAVE_SSL
@ -177,7 +177,7 @@ usage(void)
"\t[--print-reply [header|body]] [--print-request [header|body]]\n"
"\t[--rate X] [--recv-buffer N] [--retry-on-failure] "
"[--send-buffer N]\n"
"\t<--server file> [--port N] [--uri S] [--myaddr S]\n"
"\t<--servers file> [--port N] [--uri S] [--myaddr S]\n"
#ifdef HAVE_SSL
"\t[--ssl] [--ssl-ciphers L] [--ssl-no-reuse]\n"
"\t[--ssl-certificate file] [--ssl-key file]\n"
@ -635,8 +635,8 @@ main(int argc, char **argv)
prog_name, optarg);
exit(1);
}
} else if (flag == &param.server)
param.server = optarg;
} else if (flag == &param.servers)
param.servers = optarg;
#ifdef HAVE_SSL
else if (flag == &param.ssl_cipher_list)
param.ssl_cipher_list = optarg;
@ -974,9 +974,9 @@ main(int argc, char **argv)
}
}
if (param.server == NULL) {
if (param.servers == NULL) {
fprintf(stderr,
"%s: must specify --server\n",
"%s: must specify --servers\n",
prog_name);
exit(-1);
}
@ -1131,8 +1131,8 @@ main(int argc, char **argv)
if (param.runtime > 0)
printf(" --runtime=%g", param.runtime);
printf(" --client=%u/%u", param.client.id, param.client.num_clients);
if (param.server)
printf(" --server=%s", param.server);
if (param.servers)
printf(" --servers=%s", param.servers);
if (param.port)
printf(" --port=%d", param.port);
if (param.uri)

Bestand weergeven

@ -91,7 +91,9 @@ Rate_Info;
typedef struct Cmdline_Params
{
int http_version; /* (default) HTTP protocol version */
const char *server;
const char *server; /* (default) hostname */
const char *server_name; /* fully qualified server name */
const char *servers;
int port; /* (default) server port */
const char *uri; /* (default) uri */
const char *myaddr;