1109 Commits

Author SHA1 Message Date
ffeacdcc52 Fix typo in code comments; dependancies -> dependencies
Submitted by: John Bampton <jbampton gmail.com>
Github: closes #520


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924446 13f79535-47bb-0310-9956-ffa450edef68
2025-03-18 09:54:15 +00:00
e1e8624e29 ab: Map -c0 to -c<number of workers>. PR 69383
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1921256 13f79535-47bb-0310-9956-ffa450edef68
2024-10-11 11:43:36 +00:00
2ae427e697 optarg is from unistd.h, use opt_arg from apr_getopt().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916148 13f79535-47bb-0310-9956-ffa450edef68
2024-03-06 12:14:46 +00:00
aa1476072e * support/htcacheclean.c (list_urls): Continue rather than stopping
after listing a file for each subdirectory.

PR: 65091
Submitted by: Artem Egorenkov <aegorenkov.91 gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1915508 13f79535-47bb-0310-9956-ffa450edef68
2024-02-01 08:39:48 +00:00
cf5e1a0601 Add an option to specify a source address.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1914045 13f79535-47bb-0310-9956-ffa450edef68
2023-11-22 17:19:49 +00:00
0dc7adf950 ab: apr_pool_clear() closes the socket already.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911177 13f79535-47bb-0310-9956-ffa450edef68
2023-07-21 14:56:05 +00:00
cc71b51730 ab: Disable nagle algorithm on sockets, it's not telnet.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911176 13f79535-47bb-0310-9956-ffa450edef68
2023-07-21 14:54:51 +00:00
a2305b40f4 ab: Follow up to r1910912: No need for the "events" member.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1911175 13f79535-47bb-0310-9956-ffa450edef68
2023-07-21 14:51:24 +00:00
1aa10d984c ab: Add -D for a watchdog that prints counters on polled connections.
This prints lines like the below (one per worker thread) every 5 seconds:
Worker 0: requests 264484/12500, polls 2500, DISCONNECTED 0/0, CONNECTING 0/35, HANDSHAKE 0/0, WRITE 0/0, READ 2465/0
Worker 3: requests 248779/12500, polls 2500, DISCONNECTED 0/0, CONNECTING 0/25, HANDSHAKE 0/0, WRITE 0/0, READ 2475/0
Worker 1: requests 246151/12500, polls 2500, DISCONNECTED 0/0, CONNECTING 0/39, HANDSHAKE 0/0, WRITE 0/0, READ 2461/0
Worker 2: requests 257491/12500, polls 2500, DISCONNECTED 0/0, CONNECTING 0/44, HANDSHAKE 0/0, WRITE 0/0, READ 2456/0



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910912 13f79535-47bb-0310-9956-ffa450edef68
2023-07-10 09:17:51 +00:00
53f429b9f4 ab: Check and handle POLLOUT before POLLIN.
connect() failures can return POLLOUT|POLLHUP and the polling loop should
take the POLLOUT branch in this case, not the POLLIN|POLLHUP one, so move
the check for POLLOUT first.

While at it, add some assert()ions to avoid infinite loops.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910911 13f79535-47bb-0310-9956-ffa450edef68
2023-07-10 09:08:14 +00:00
cca42ea3a4 ab: Follow up to r1910871: s/bind_num/bind_rr/g
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910872 13f79535-47bb-0310-9956-ffa450edef68
2023-07-08 10:56:58 +00:00
4d73727237 ab: Allow to bind multiple addresses with -Baddr1,addr2,...
By using multiple source addresses, it helps with ports exhaustion where the
ones of connections in TIME_WAIT cannot be reused.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910871 13f79535-47bb-0310-9956-ffa450edef68
2023-07-08 10:51:02 +00:00
03f6e86ec2 ab: Stop worker at end of -t in any case, not only interruption.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910870 13f79535-47bb-0310-9956-ffa450edef68
2023-07-08 10:43:44 +00:00
661e50cf22 ab: Ignore the delay if it's larger than the timeout.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910862 13f79535-47bb-0310-9956-ffa450edef68
2023-07-07 15:57:32 +00:00
a9b1f10156 ab: Fix accounting of started connections.
Revert when a kept alive connection is aborted on read.
Stop the polling loop when there is nothing to poll anymore, it's simpler.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910861 13f79535-47bb-0310-9956-ffa450edef68
2023-07-07 15:52:45 +00:00
0fc26087e9 * support/ab.c (ssl_proceed_handshake): Fix X509 * leak.
PR: 64264


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910847 13f79535-47bb-0310-9956-ffa450edef68
2023-07-07 11:02:38 +00:00
21e6989f8d apxs: Fix -i for some cases where -n is not used.
The $base was already stripped of suffix in typical case.

Submitted by: Jan Pazdziora <jpazdziora redhat.com>
Github: closes #359


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910841 13f79535-47bb-0310-9956-ffa450edef68
2023-07-07 07:57:35 +00:00
2c0068adbe ab: Don't print the banner/copyright when -Q is specified.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910520 13f79535-47bb-0310-9956-ffa450edef68
2023-06-20 16:05:31 +00:00
b82e99aadd ab: Add POLLERR and POLLHUP to reqevents for implementations that use/need it.
Also, apr_pollset_remove() might return APR_NOTFOUND if a connection is reset
while being poll()ed, don't treat it as an error.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910519 13f79535-47bb-0310-9956-ffa450edef68
2023-06-20 16:04:12 +00:00
162a66654d ab: Increase MAX_CONCURRENCY hard limit (from 20K to 200K).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910518 13f79535-47bb-0310-9956-ffa450edef68
2023-06-20 15:59:38 +00:00
5d22e551c5 ab: More accurate stats for time limited (-t) runs.
When ab runs for a limited time, the number of requests configured (or the
default MAX_REQUESTS if not configured) may be lower than than the number
of requests actually/finally achieved, in which case the stats per request
is a window of the actual stats since we can't store all the results.

Rather than taking the last N requests of the run for the stats, do the mean
of all the requests reusing the same window slot, and print that.

If no number of requests is configured for a time limited run, it will stop
only at the end of the time (i.e. MAX_REQUESTS is ignored for the end of
test condition). So MAX_REQUESTS is renamed to TIMED_REQUESTS while at it.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910517 13f79535-47bb-0310-9956-ffa450edef68
2023-06-20 15:53:11 +00:00
1768d59891 ab: Follow up to r1910515: Update global counter too..
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910516 13f79535-47bb-0310-9956-ffa450edef68
2023-06-20 15:20:39 +00:00
c995f9cd23 ab: Count keepalive aborted connections separately.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910515 13f79535-47bb-0310-9956-ffa450edef68
2023-06-20 15:15:30 +00:00
5e82b94b07 ab: Don't (doubly) count errors as err_length if not actually reading.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910514 13f79535-47bb-0310-9956-ffa450edef68
2023-06-20 15:11:25 +00:00
2eb505fdb7 ab: Fix crash with -W when exiting earlya on fatal error.
When multiple threads are failing (e.g. read/write timeout) it's not
thread-safe to simply/concurrently print the stats and exit. This can
result in garbage being printed or a crash.

Let's cleanly shutdown the threads and do the printing at a single point.
For the places where we want to fail but threads are not started yet we
can simply exit still, so to simplify the stats are not printed in an
atexit() handler.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910513 13f79535-47bb-0310-9956-ffa450edef68
2023-06-20 15:08:44 +00:00
b570a7f490 do not run strlen(3) on a NULL value
bz #66639


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910334 13f79535-47bb-0310-9956-ffa450edef68
2023-06-09 15:28:32 +00:00
82730c9545 ab: STATE_CONNECTED is not used anymore.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910136 13f79535-47bb-0310-9956-ffa450edef68
2023-05-30 09:36:19 +00:00
f8a55c2012 ab: Use new openssl-3 API when available.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908440 13f79535-47bb-0310-9956-ffa450edef68
2023-03-16 14:36:01 +00:00
d7ac6428db s/to to/to/
[skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907993 13f79535-47bb-0310-9956-ffa450edef68
2023-03-02 19:50:12 +00:00
d0eac89e98 add -T flag to truncate rotated logs only
for strftime formats that will loop back on themselves, like
day of month or weekday name.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1906433 13f79535-47bb-0310-9956-ffa450edef68
2023-01-06 23:46:35 +00:00
43f0c91fd0 minor tweak to -n with size rotation
Without -t, One line can be added to base "logfile" even when
it's over the size limit already.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1906428 13f79535-47bb-0310-9956-ffa450edef68
2023-01-06 20:45:16 +00:00
e7dfa99412 r1900362 followup: clang -Wexpansion-to-defined
ab.c:2056:5: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
#if USE_SIGMASK



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900571 13f79535-47bb-0310-9956-ffa450edef68
2022-05-05 02:03:27 +00:00
57e8cb5846 ab: Add the -W option to use worker threads.
This allows for multiple CPUs to handle the load, the number of requests and
concurrency level asked are distributed over the configured number of workers,
allowing for as much parallelism.

On unixes (only for now), -W0 will use all the CPUs available on the system.

To avoid synchronization during runtime, the stats and requests times are
gathered per worker and consolidated at the end of the run before being
printed.

Connection closes, keepalives and errors are now handled in a single place,
namely cleanup_connection(), which takes care of the good/bad state of each
request based on the response fully received or not.

When multiple workers are running, SIGINT is handled by the main thread only
and masked in workers, workers are asked to stop and woken up if waiting in
poll().

A single worker is started first to determine the connectivity with the peer,
if that fails (10 tries) ab will stop early still without starting the other
workers, otherwise the first worker will signal the main thread to start the
others.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900362 13f79535-47bb-0310-9956-ffa450edef68
2022-04-28 13:57:15 +00:00
63840edb44 ab: Allow for TLSv1.3 when the SSL library supports it.
When TLS1_3_VERSION is defined by the SSL library, bump the maximum TLS
protocol to that and use it for "-f ALL" or "-f TLSv1.3".

This mixes proposed patches from BZ 63594 and 64699.

BZ: 63594, 64699
Submitted by: abhilash <abhilash1232 gmail.com>
Submitted by: xiaolongx.jiang intel.com
Submitted & Reviewed by: ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900157 13f79535-47bb-0310-9956-ffa450edef68
2022-04-22 13:04:51 +00:00
b6c0306cec ab: apr_base64_encode already NUL-terminate the output.
And returns the length including the trailing \0, so setting it at that
length is off by +1.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900152 13f79535-47bb-0310-9956-ffa450edef68
2022-04-22 12:14:01 +00:00
2fa2794787 Fix alignment in an 'if' block.
[skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900064 13f79535-47bb-0310-9956-ffa450edef68
2022-04-20 06:52:58 +00:00
600072cf7c ab: Fix the detection for when the server performed a legitimate
connection close as per RFC7230 6.3.1. We must check whedther the
connection was previously kept alive, and not whether the current
closed request is keepalive.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897912 13f79535-47bb-0310-9956-ffa450edef68
2022-02-09 18:23:23 +00:00
5540d05c9f ab: Add an optional ramp delay when starting concurrent connections so
as to not trigger denial of service protection in the network. Report
levels of concurrency achieved in cases where the test completes before
full concurrency is achieved.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897866 13f79535-47bb-0310-9956-ffa450edef68
2022-02-08 12:34:52 +00:00
17f35eb66d Reinstate r1897458 accidentally reverted in r1897760.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897861 13f79535-47bb-0310-9956-ffa450edef68
2022-02-08 11:22:14 +00:00
b11e669f07 *) core/mod_ssl/mpm_event: reverting changes to nonblocing SSL handshakes
to stabilize CI tests again. Previous revision of trunk has been copied
     to branches/trunk-ssl-handshake-unblocking to make those into a PR where
     changes can be discussed and tested separately.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897760 13f79535-47bb-0310-9956-ffa450edef68
2022-02-04 12:22:26 +00:00
8a521a5832 check BIO_new(3) return values
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897662 13f79535-47bb-0310-9956-ffa450edef68
2022-02-01 15:00:20 +00:00
88ffb0ecd3 ab: Respond appropriately to SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE.
Previously the correct event was polled for, but the response to the poll
would call write instead of read, and read instead of write. PR 55952


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897458 13f79535-47bb-0310-9956-ffa450edef68
2022-01-25 15:54:22 +00:00
6fe2acda09 Revert stray modification in r1897336.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897408 13f79535-47bb-0310-9956-ffa450edef68
2022-01-24 11:20:55 +00:00
384b51f21f When failing, we need to explicitly set the connection state.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897336 13f79535-47bb-0310-9956-ffa450edef68
2022-01-22 12:09:12 +00:00
5be0a5fe0a As in r1877467 for mod_ssl, for OpenSSL 1.1.1+ require that OpenSSL is
configured with a suitable entropy source and don't try to seed it
from getpid etc.

* support/ab.c (main): Check RAND_status().
  (ssl_rand_seed, ssl_rand_choosenum): Drop for OpenSSL 1.1.1+.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895659 13f79535-47bb-0310-9956-ffa450edef68
2021-12-07 16:02:21 +00:00
d318188682 * support/ab.c (main): Check apr_getopt() returned APR_EOF, fixing clang
warning:

support/ab.c:2343:13: warning[deadcode.DeadStores]: Although the value stored to 'status' is used in the enclosing expression, the value is never actually read from 'status'


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895559 13f79535-47bb-0310-9956-ffa450edef68
2021-12-03 16:40:18 +00:00
2d84124e5c * server/mpm/event/event.c,
server/mpm/simple/simple_run.c,
  support/htcacheclean.c: Adjust use of APR_RING macros to
  ensure the APR_RING_HEAD is always embedded in a containing
  structure, to avoid warnings with GCC 11.  (apr_ring.h also
  suggests this is best practice)

See also: https://bugzilla.redhat.com/show_bug.cgi?id=1957353
          https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98503
          msgid <814cca2a-1992-3fae-bb0e-c84b3d09b73b@gmail.com>
Github: closes #186


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1889957 13f79535-47bb-0310-9956-ffa450edef68
2021-05-17 11:56:32 +00:00
5bebf977d6 * support/htpasswd.c: Fix typo. [skip ci]
Submitted by: Ikko Ashimine <eltociear gmail.com>
Github: closes #149


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884509 13f79535-47bb-0310-9956-ffa450edef68
2020-12-16 16:39:44 +00:00
542f66501b Fix misleading crypt vs hash terminology in ht* and dbmmanage tools.
What the htpasswd, htdbm and dbmmanage tools do is hashing passwords, not
encrypting them, so fix the terminology in manpages, docs, --help, comments
and function names.

Submitted by: Michele Preziuso <mpreziuso kaosdynamics.com>
Reviewed by: ylavic
Github: closes #153


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1884207 13f79535-47bb-0310-9956-ffa450edef68
2020-12-08 14:06:16 +00:00
75350541f0 * support/htpasswd.c (usage): Fix typo. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1878703 13f79535-47bb-0310-9956-ffa450edef68
2020-06-10 08:07:08 +00:00