summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2023-04-17 01:31:01 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2023-05-03 23:11:33 -0400
commit4d04833fa8813cf2e1272d94524da774aa902f6c (patch)
tree4916c52fc3f8cb0b5eedc0280e34cc25c1663989
parent3915129e10cc0920ba9a9e1156108496bfcaa19a (diff)
downloadlighttpd-git-4d04833fa8813cf2e1272d94524da774aa902f6c.tar.gz
[multiple] optimistic client read only if HTTP/1.x
skip optimistic client read if http version >= HTTP/2
-rw-r--r--src/gw_backend.c3
-rw-r--r--src/mod_cgi.c3
-rw-r--r--src/mod_echo.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/src/gw_backend.c b/src/gw_backend.c
index 84b5f504..cb563ce3 100644
--- a/src/gw_backend.c
+++ b/src/gw_backend.c
@@ -2054,7 +2054,8 @@ static handler_t gw_write_request(gw_handler_ctx * const hctx, request_st * cons
& FDEVENT_STREAM_REQUEST_POLLIN)) {
r->conf.stream_request_body |=
FDEVENT_STREAM_REQUEST_POLLIN;
- r->con->is_readable = 1; /* trigger optimistic client read */
+ if (r->http_version <= HTTP_VERSION_1_1)
+ r->con->is_readable = 1;/*trigger optimistic client rd*/
}
}
if (0 == wblen) {
diff --git a/src/mod_cgi.c b/src/mod_cgi.c
index a245a076..6cc7b5af 100644
--- a/src/mod_cgi.c
+++ b/src/mod_cgi.c
@@ -728,7 +728,8 @@ static int cgi_write_request(handler_ctx *hctx, int fd) {
/*(r->conf.stream_request_body & FDEVENT_STREAM_REQUEST)*/
if (!(r->conf.stream_request_body & FDEVENT_STREAM_REQUEST_POLLIN)) {
r->conf.stream_request_body |= FDEVENT_STREAM_REQUEST_POLLIN;
- r->con->is_readable = 1; /* trigger optimistic read from client */
+ if (r->http_version <= HTTP_VERSION_1_1)
+ r->con->is_readable = 1;/* trigger optimistic client read */
}
}
struct fdevents * const ev = hctx->ev;
diff --git a/src/mod_echo.c b/src/mod_echo.c
index 97e51962..919b0f98 100644
--- a/src/mod_echo.c
+++ b/src/mod_echo.c
@@ -62,7 +62,8 @@ static handler_t mod_echo_request_body(request_st * const r) {
/*(r->conf.stream_request_body & FDEVENT_STREAM_REQUEST)*/
if (!(r->conf.stream_request_body & FDEVENT_STREAM_REQUEST_POLLIN)) {
r->conf.stream_request_body |= FDEVENT_STREAM_REQUEST_POLLIN;
- r->con->is_readable = 1; /* trigger optimistic read from client */
+ if (r->http_version <= HTTP_VERSION_1_1)
+ r->con->is_readable = 1; /*trigger optimistic client read */
}
}
return HANDLER_WAIT_FOR_EVENT;