\fB-X \fIproxy\fR[:\fIport\fR]\fR
Use a proxy server for the requests\&.
.TP
+\fB-o \fIsrc_address\fR\fR
+Set the local source address\&.
+.TP
\fB-y \fI<tr>-attributes\fR\fR
String to use as attributes for \fB<tr>\fR\&.
.TP
const char **bind_hosts;
apr_sockaddr_t **bind_addrs;
apr_port_t connectport;
+char *src_address;
const char *gnuplot; /* GNUplot file */
const char *csvperc; /* CSV Percentile file */
const char *fullurl;
{
struct worker *worker = c->worker;
apr_status_t rv;
+ apr_sockaddr_t *from;
if (!worker_can_connect(worker)) {
return;
}
}
+ if (src_address) {
+ if ((rv = apr_sockaddr_info_get(&from, src_address, destsa->family,
+ 0, 0, c->ctx)) != APR_SUCCESS)
+ graceful_strerror("src_address get", rv);
+ if ((rv = apr_socket_bind(c->aprsock, from)) != APR_SUCCESS)
+ graceful_strerror("src_address bind", rv);
+ }
+
c->read = 0;
c->bread = 0;
c->length = 0;
fprintf(stderr, " -P attribute Add Basic Proxy Authentication, the attributes\n");
fprintf(stderr, " are a colon separated username and password.\n");
fprintf(stderr, " -X proxy:port Proxyserver and port number to use\n");
+ fprintf(stderr, " -o src_address Set the local source address\n");
fprintf(stderr, " -V Print version number and exit\n");
fprintf(stderr, " -k Use HTTP KeepAlive feature\n");
fprintf(stderr, " -d Do not show percentiles served table.\n");
#endif
apr_getopt_init(&opt, cntxt, argc, argv);
- while ((status = apr_getopt(opt, "n:c:t:s:b:T:p:u:v:lrkVhwiIx:y:z:C:H:P:A:g:X:de:SqQDB:m:R:"
+ while ((status = apr_getopt(opt, "n:c:t:s:b:T:p:u:v:lrkVhwiIx:y:z:C:H:P:A:g:X:de:SqQDB:m:R:o:"
#if APR_HAS_THREADS
"W:"
#endif
case 'k':
keepalive = 1;
break;
+ case 'o':
+ src_address = strdup(optarg);
+ break;
case 'q':
heartbeatres = 0;
break;