Permalink
Browse files

Correctly send a timeout response

  • Loading branch information...
1 parent d10ee18 commit 8d60b45a3f2d3b805565123ab6ab7cd44a2adbf7 @jhs jhs committed Dec 1, 2010
Showing with 4 additions and 9 deletions.
  1. +4 −9 src/somdune_net.erl
View
@@ -184,15 +184,10 @@ collectHttpHeaders(Sock, UntilTS, BalancerModule, Headers) ->
Msg ->
io:format("Invalid message received: ~p~nAfter: ~p~n", [Msg, lists:reverse(Headers)])
- after Timeout ->
- log_info("timeout", []),
- reply(Sock, Headers,
- fun(_) -> [{status, 408, "Request Timeout"},
- {header, {<<"Content-Type: ">>, <<"text/html">>}},
- {html, "<html><title>Request timeout</title>"
- "<body><h1>Request timeout</h1></body></html>"}]
- end)
- end.
+ after Timeout ->
+ log_info("timeout; so far: ~p", [Headers]),
+ reply(#request{socket=Sock}, {408, "Timeout"}, [{'Content-Type', <<"text/html">>}], "<html><title>Request timeout</title><body><h1>Request timeout</h1></body></html>")
+ end.
reply(Request, Status) ->

0 comments on commit 8d60b45

Please sign in to comment.