]> Raphaƫl G. Git Repositories - ihttpd/blob - SOURCES/httpd-2.4.25-ab_source_address.patch
Version 2.4.62
[ihttpd] / SOURCES / httpd-2.4.25-ab_source_address.patch
1 --- httpd-2.4.35/docs/man/ab.1.bak 2018-10-21 16:10:11.161024133 +0000
2 +++ httpd-2.4.35/docs/man/ab.1 2018-10-21 16:11:25.689793452 +0000
3 @@ -130,6 +130,9 @@
4 \fB-X \fIproxy\fR[:\fIport\fR]\fR
5 Use a proxy server for the requests\&.
6 .TP
7 +\fB-o \fIsrc_address\fR\fR
8 +Set the local source address\&.
9 +.TP
10 \fB-y \fI<tr>-attributes\fR\fR
11 String to use as attributes for \fB<tr>\fR\&.
12 .TP
13 --- httpd-2.4.33/support/ab.c.ab_source_address.droplet 2018-03-16 01:02:58.000000000 +0200
14 +++ httpd-2.4.33/support/ab.c 2018-03-27 10:39:44.792971820 +0300
15 @@ -313,6 +313,7 @@
16 const char *connecthost;
17 const char *myhost;
18 apr_port_t connectport;
19 +char *src_address;
20 const char *gnuplot; /* GNUplot file */
21 const char *csvperc; /* CSV Percentile file */
22 const char *fullurl;
23 @@ -1299,6 +1300,7 @@
24 static void start_connect(struct connection * c)
25 {
26 apr_status_t rv;
27 + apr_sockaddr_t *from;
28
29 if (!(started < requests))
30 return;
31 @@ -1348,6 +1350,14 @@
32 }
33 }
34
35 + if (src_address) {
36 + if ((rv = apr_sockaddr_info_get(&from, src_address, destsa->family,
37 + 0, 0, c->ctx)) != APR_SUCCESS)
38 + apr_err("src_address get", rv);
39 + if ((rv = apr_socket_bind(c->aprsock, from)) != APR_SUCCESS)
40 + apr_err("src_address bind", rv);
41 + }
42 +
43 c->start = lasttime = apr_time_now();
44 #ifdef USE_SSL
45 if (is_ssl) {
46 @@ -2085,6 +2095,7 @@
47 fprintf(stderr, " -P attribute Add Basic Proxy Authentication, the attributes\n");
48 fprintf(stderr, " are a colon separated username and password.\n");
49 fprintf(stderr, " -X proxy:port Proxyserver and port number to use\n");
50 + fprintf(stderr, " -o src_address Set the local source address\n");
51 fprintf(stderr, " -V Print version number and exit\n");
52 fprintf(stderr, " -k Use HTTP KeepAlive feature\n");
53 fprintf(stderr, " -d Do not show percentiles served table.\n");
54 @@ -2351,7 +2351,7 @@
55 myhost = NULL; /* 0.0.0.0 or :: */
56
57 apr_getopt_init(&opt, cntxt, argc, argv);
58 - while ((status = apr_getopt(opt, "n:c:t:s:b:T:p:u:v:lrkVhwiIx:y:z:C:H:P:A:g:X:de:SqB:m:"
59 + while ((status = apr_getopt(opt, "o:n:c:t:s:b:T:p:u:v:lrkVhwiIx:y:z:C:H:P:A:g:X:de:SqB:m:"
60 #ifdef USE_SSL
61 "Z:f:E:"
62 #endif
63 @@ -2305,6 +2316,9 @@
64 case 'k':
65 keepalive = 1;
66 break;
67 + case 'o':
68 + src_address = strdup(optarg);
69 + break;
70 case 'q':
71 heartbeatres = 0;
72 break;