From 83fef49f590ac2a1703e722b6675e1f896eec245 Mon Sep 17 00:00:00 2001 From: Joseph Kong Date: Fri, 22 Jan 2016 12:36:40 -0800 Subject: [PATCH] Change --server to --servers. Prior to this commit --server took a list of servers, so making it plural makes sense. --- src/conn.c | 6 +++--- src/core.c | 2 +- src/httperf.c | 16 ++++++++-------- src/httperf.h | 4 +++- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/conn.c b/src/conn.c index 938d1fc..a24c1fc 100755 --- a/src/conn.c +++ b/src/conn.c @@ -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) diff --git a/src/core.c b/src/core.c index 0993bb9..06b96ec 100755 --- a/src/core.c +++ b/src/core.c @@ -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; diff --git a/src/httperf.c b/src/httperf.c index 60d609e..7f455d8 100755 --- a/src/httperf.c +++ b/src/httperf.c @@ -136,7 +136,7 @@ static struct option longopts[] = { {"retry-on-failure", no_argument, ¶m.retry_on_failure, 1}, {"runtime", required_argument, (int *) ¶m.runtime, 0}, {"send-buffer", required_argument, (int *) ¶m.send_buffer_size, 0}, - {"server", required_argument, (int *) ¶m.server, 0}, + {"servers", required_argument, (int *) ¶m.servers, 0}, {"uri", required_argument, (int *) ¶m.uri, 0}, {"session-cookies", no_argument, (int *) ¶m.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 == ¶m.server) - param.server = optarg; + } else if (flag == ¶m.servers) + param.servers = optarg; #ifdef HAVE_SSL else if (flag == ¶m.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) diff --git a/src/httperf.h b/src/httperf.h index 37567d2..879c934 100755 --- a/src/httperf.h +++ b/src/httperf.h @@ -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;