Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP, event connection processing tests #281

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions mod_http2/h2_c1.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ apr_status_t h2_c1_setup(conn_rec *c, request_rec *r, server_rec *s)
return rv;
}

apr_status_t h2_c1_run(conn_rec *c)
int h2_c1_run(conn_rec *c)
{
apr_status_t status;
apr_status_t status, rc = OK;
int mpm_state = 0, keepalive = 0;
h2_conn_ctx_t *conn_ctx = h2_conn_ctx_get(c);

Expand Down Expand Up @@ -152,14 +152,24 @@ apr_status_t h2_c1_run(conn_rec *c)
case H2_SESSION_ST_IDLE:
case H2_SESSION_ST_BUSY:
case H2_SESSION_ST_WAIT:
#ifdef AGAIN
if (!keepalive) {
c->cs->state = CONN_STATE_PROCESS;
rc = AGAIN;
}
else {
c->cs->state = CONN_STATE_KEEPALIVE;
}
#else
c->cs->state = CONN_STATE_WRITE_COMPLETION;
if (!keepalive) {
/* let the MPM know that we are not done and want
* the Timeout behaviour instead of a KeepAliveTimeout
* See PR 63534.
* See PR 63534.
*/
c->cs->sense = CONN_SENSE_WANT_READ;
}
#endif
break;
case H2_SESSION_ST_CLEANUP:
case H2_SESSION_ST_DONE:
Expand All @@ -169,7 +179,7 @@ apr_status_t h2_c1_run(conn_rec *c)
}
}

return APR_SUCCESS;
return rc;
}

apr_status_t h2_c1_pre_close(struct h2_conn_ctx_t *ctx, conn_rec *c)
Expand Down Expand Up @@ -275,8 +285,7 @@ static int h2_c1_hook_process_connection(conn_rec* c)
return !OK;
}
}
h2_c1_run(c);
return OK;
return h2_c1_run(c);

declined:
ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c, "h2_h2, declined");
Expand Down
22 changes: 22 additions & 0 deletions test/modules/http2/test_700_load_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def _class_scope(self, env):
conf = H2Conf(env).add_vhost_cgi().add_vhost_test1()
conf.add('LogLevel mpm_event:debug')
conf.add(f"StartServers 1")
conf.add(f"MaxRequestWorkers 25")
conf.install()
assert env.apache_restart() == 0

Expand Down Expand Up @@ -91,3 +92,24 @@ def test_h2_700_20(self, env, connbits, streambits):
]
r = env.run(args)
self.check_h2load_ok(env, r, n)

# test window sizes and many connections
def test_h2_700_21(self, env):
assert env.is_live()
n = 2000
conns = 300
parallel = 5
connbits = 10
streambits = 30
args = [
env.h2load,
'-n', f'{n}', '-t', '1',
'-c', f'{conns}', '-m', f'{parallel}',
'-W', f'{connbits}', # connection window bits
'-w', f'{streambits}', # stream window bits
f'--connect-to=localhost:{env.https_port}',
f'--base-uri={env.mkurl("https", "test1", "/")}',
"/data-100k"
]
r = env.run(args)
self.check_h2load_ok(env, r, n)