diff options
author | Micael Karlberg <[email protected]> | 2011-11-23 16:22:50 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-11-23 16:22:50 +0100 |
commit | 473c6308bbfed958ab04f45f53305e5d82d733fa (patch) | |
tree | f1f40409c955cb367aca433c1e1c8ddbb391bf9a /lib/inets/src/http_server | |
parent | a41174d5ef937a22455f8cc52428fee313ae156e (diff) | |
download | otp-473c6308bbfed958ab04f45f53305e5d82d733fa.tar.gz otp-473c6308bbfed958ab04f45f53305e5d82d733fa.tar.bz2 otp-473c6308bbfed958ab04f45f53305e5d82d733fa.zip |
Fixed acceptor exit warnings (detected by dialyzer).
Also fixed cookie_header/3 and updated documented
accordingly. Also added documentation for undocumented
URI parse option.
Diffstat (limited to 'lib/inets/src/http_server')
-rw-r--r-- | lib/inets/src/http_server/httpd_acceptor.erl | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/inets/src/http_server/httpd_acceptor.erl b/lib/inets/src/http_server/httpd_acceptor.erl index 1c954106c1..046e491bbf 100644 --- a/lib/inets/src/http_server/httpd_acceptor.erl +++ b/lib/inets/src/http_server/httpd_acceptor.erl @@ -139,11 +139,11 @@ acceptor_loop(Manager, SocketType, ListenSocket, ConfigDb, AcceptTimeout) -> handle_error(Reason, ConfigDb), ?MODULE:acceptor_loop(Manager, SocketType, ListenSocket, ConfigDb, AcceptTimeout); - {'EXIT', _Reason} = EXIT -> - ?hdri("accept exited", [{reason, _Reason}]), - handle_error(EXIT, ConfigDb), - ?MODULE:acceptor_loop(Manager, SocketType, ListenSocket, - ConfigDb, AcceptTimeout) + {'EXIT', Reason} -> + ?hdri("accept exited", [{reason, Reason}]), + ReasonString = + lists:flatten(io_lib:format("Accept exit: ~p", [Reason])), + accept_failed(ConfigDb, ReasonString) end. @@ -152,9 +152,6 @@ handle_connection(Manager, ConfigDb, AcceptTimeout, SocketType, Socket) -> http_transport:controlling_process(SocketType, Socket, Pid), httpd_request_handler:socket_ownership_transfered(Pid, SocketType, Socket). - --spec handle_error(Error::timeout|emfile|closed|econnreset|econnaborted|esslaccept|{enfile, _}|{'EXIT', Reason::any()}|any(), ConfigDB::any()) -> ok | no_return(). - handle_error(timeout, _) -> ok; @@ -192,16 +189,13 @@ handle_error(esslaccept, _) -> %% not write an error message. ok; -handle_error({'EXIT', Reason}, ConfigDb) -> - String = lists:flatten(io_lib:format("Accept exit: ~p", [Reason])), - accept_failed(ConfigDb, String); - handle_error(Reason, ConfigDb) -> String = lists:flatten(io_lib:format("Accept error: ~p", [Reason])), accept_failed(ConfigDb, String). --spec accept_failed(_, string()) -> no_return(). +-spec accept_failed(ConfigDB :: term(), + ReasonString :: string()) -> no_return(). accept_failed(ConfigDb, String) -> error_logger:error_report(String), |