commit fbc6024ac5b1e2cb04c968555cc9360de1c12bc8 from: florian date: Sun Dec 22 13:51:42 2024 UTC Set correct request timeout once we found the correct server block. On accept(2), httpd(8) sets the timeout based on ip:port. Once we have parsed the http headers we can find the name-based server block and apply its request timeout. Problem identified and fix from Nick Owens, thanks! OK tb commit - 78044f5e33d9650ea644a1c64770dd318e39e1f5 commit + fbc6024ac5b1e2cb04c968555cc9360de1c12bc8 blob - 0a814e7a65629c5857d37212c692525236f4154e blob + aef4e4567fc7544b0d99f5a54799b5a171bd7734 --- server_http.c +++ server_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_http.c,v 1.154 2024/02/13 14:00:24 claudio Exp $ */ +/* $OpenBSD: server_http.c,v 1.155 2024/12/22 13:51:42 florian Exp $ */ /* * Copyright (c) 2020 Matthias Pressfreund @@ -1368,6 +1368,11 @@ server_response(struct httpd *httpd, struct client *cl srv_conf = clt->clt_srv_conf; } + + /* Set request timeout from matching host configuration. */ + bufferevent_settimeout(clt->clt_bev, + srv_conf->requesttimeout.tv_sec, srv_conf->requesttimeout.tv_sec); + if (clt->clt_persist >= srv_conf->maxrequests) clt->clt_persist = 0;