summaryrefslogtreecommitdiffstats
path: root/support/ab.c
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2023-07-21 16:51:24 +0200
committerYann Ylavic <ylavic@apache.org>2023-07-21 16:51:24 +0200
commita2305b40f408f11c5fe6af5c3c3d3062751e2c26 (patch)
tree0ec32e71bb86937ead1c6b936430c3d21127bebd /support/ab.c
parentSteal some APLOGNOs for PR #367. (diff)
downloadapache2-a2305b40f408f11c5fe6af5c3c3d3062751e2c26.tar.xz
apache2-a2305b40f408f11c5fe6af5c3c3d3062751e2c26.zip
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
Diffstat (limited to '')
-rw-r--r--support/ab.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/support/ab.c b/support/ab.c
index 6a617edca1..4a2ef2ba42 100644
--- a/support/ab.c
+++ b/support/ab.c
@@ -304,7 +304,6 @@ struct connection {
apr_pool_t *ctx;
apr_socket_t *aprsock;
apr_pollfd_t pollfd;
- apr_int16_t events;
int state;
apr_time_t delay;
apr_size_t read; /* amount of bytes read */
@@ -650,6 +649,7 @@ static int set_polled_events(struct connection *c, apr_int16_t new_reqevents)
rv = apr_pollset_add(c->worker->pollset, &c->pollfd);
if (rv != APR_SUCCESS) {
graceful_strerror("apr_pollset_add()", rv);
+ c->pollfd.reqevents = 0;
return 0;
}
c->worker->polls++;
@@ -661,19 +661,17 @@ static int set_polled_events(struct connection *c, apr_int16_t new_reqevents)
static void set_conn_state(struct connection *c, conn_state_e state,
apr_int16_t events)
{
- struct worker *worker = c->worker;
+ int (*const counters)[2] = c->worker->counters;
- assert(worker->counters[c->state][(c->events & APR_POLLOUT) != 0] > 0);
- worker->counters[c->state][(c->events & APR_POLLOUT) != 0]--;
+ assert(counters[c->state][(c->pollfd.reqevents & APR_POLLOUT) != 0] > 0);
+ counters[c->state][(c->pollfd.reqevents & APR_POLLOUT) != 0]--;
c->state = state;
- c->events = events;
if (!set_polled_events(c, events) && state != STATE_DISCONNECTED) {
close_connection(c);
- c->events = 0;
}
- worker->counters[c->state][(c->events & APR_POLLOUT) != 0]++;
+ counters[c->state][(c->pollfd.reqevents & APR_POLLOUT) != 0]++;
}
/* --------------------------------------------------------- */