aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2025-02-06 12:18:59 +0100
committerLoïc Hoguin <[email protected]>2025-02-06 12:18:59 +0100
commit8e121d138c4f658cf0953eeeeea85d07c203a5b6 (patch)
tree59ae986ddeaa6cb0a73408553d8f4c25a2779081 /src
parent9d4912208e91c1cb3195bf86966a84e88e7c9ff9 (diff)
downloadcowboy-8e121d138c4f658cf0953eeeeea85d07c203a5b6.tar.gz
cowboy-8e121d138c4f658cf0953eeeeea85d07c203a5b6.tar.bz2
cowboy-8e121d138c4f658cf0953eeeeea85d07c203a5b6.zip
Fix request_timeout triggering when a request was in the buffer
The problem was that when a request immediately following another request with a large enough body, the data for the new request (including headers) would be buffered waiting for more data, instead of being processed immediately. If no more data came in on the socket the request_timeout would eventually trigger. Now the buffer is processed immediately.
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_http.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl
index c1c4b8d..bc4b528 100644
--- a/src/cowboy_http.erl
+++ b/src/cowboy_http.erl
@@ -436,8 +436,8 @@ after_parse({data, StreamID, IsFin, Data, State0=#state{opts=Opts, buffer=Buffer
end;
%% No corresponding stream. We must skip the body of the previous request
%% in order to process the next one.
-after_parse({data, _, IsFin, _, State}) ->
- loop(set_timeout(State, case IsFin of
+after_parse({data, StreamID, IsFin, _, State=#state{buffer=Buffer}}) ->
+ parse(Buffer, set_timeout(State, case IsFin of
fin -> request_timeout;
nofin -> idle_timeout
end));