From 40b8d0befcd8b310a7a48e07df7d629153903cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 11 Feb 2013 09:03:13 +0100 Subject: Better handle socket closing with loop handlers We now read from the socket to be able to detect errors or TCP close events, and buffer the data if any. Once the data receive goes over a certain limit, which defaults to 5000 bytes, we simply close the connection with an {error, overflow} reason. --- test/http_handler_long_polling.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test/http_handler_long_polling.erl') diff --git a/test/http_handler_long_polling.erl b/test/http_handler_long_polling.erl index 763e1fe..e8cf610 100644 --- a/test/http_handler_long_polling.erl +++ b/test/http_handler_long_polling.erl @@ -19,4 +19,6 @@ info(timeout, Req, State) -> {loop, Req, State - 1, hibernate}. terminate({normal, shutdown}, _, _) -> + ok; +terminate({error, overflow}, _, _) -> ok. -- cgit v1.2.3