diff options
author | Micael Karlberg <[email protected]> | 2011-11-22 12:33:01 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-11-22 12:33:01 +0100 |
commit | 8a269d8a78b0548a69958dfaecfd37a2c43d5a1c (patch) | |
tree | a3c14ded6587b01fd798c5f43ef8f1344407f72d /lib/inets | |
parent | b3a8ad925c72bc77d3509ef8dce155d65dc1548b (diff) | |
parent | a41174d5ef937a22455f8cc52428fee313ae156e (diff) | |
download | otp-8a269d8a78b0548a69958dfaecfd37a2c43d5a1c.tar.gz otp-8a269d8a78b0548a69958dfaecfd37a2c43d5a1c.tar.bz2 otp-8a269d8a78b0548a69958dfaecfd37a2c43d5a1c.zip |
Fixed various problems detected by Dialyzer.
OTP-9736
Merge branch 'bmk/inets/dialyzer_fixes/OTP-9736' into bmk/inets/inets58_integration2
Diffstat (limited to 'lib/inets')
-rw-r--r-- | lib/inets/src/http_client/httpc_manager.erl | 2 | ||||
-rw-r--r-- | lib/inets/src/http_server/httpd_acceptor.erl | 4 | ||||
-rw-r--r-- | lib/inets/src/http_server/httpd_request_handler.erl | 25 |
3 files changed, 26 insertions, 5 deletions
diff --git a/lib/inets/src/http_client/httpc_manager.erl b/lib/inets/src/http_client/httpc_manager.erl index ab575d867e..121562195f 100644 --- a/lib/inets/src/http_client/httpc_manager.erl +++ b/lib/inets/src/http_client/httpc_manager.erl @@ -37,7 +37,7 @@ delete_session/2, set_options/2, store_cookies/3, - which_cookies/1, which_cookies/2, + which_cookies/1, which_cookies/2, which_cookies/3, reset_cookies/1, session_type/1, info/1 diff --git a/lib/inets/src/http_server/httpd_acceptor.erl b/lib/inets/src/http_server/httpd_acceptor.erl index bcebb6a9e3..1c954106c1 100644 --- a/lib/inets/src/http_server/httpd_acceptor.erl +++ b/lib/inets/src/http_server/httpd_acceptor.erl @@ -152,6 +152,9 @@ 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; @@ -197,6 +200,7 @@ handle_error(Reason, ConfigDb) -> String = lists:flatten(io_lib:format("Accept error: ~p", [Reason])), accept_failed(ConfigDb, String). + -spec accept_failed(_, string()) -> no_return(). accept_failed(ConfigDb, String) -> diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl index d2f22fce93..b62c10bbc7 100644 --- a/lib/inets/src/http_server/httpd_request_handler.erl +++ b/lib/inets/src/http_server/httpd_request_handler.erl @@ -162,7 +162,14 @@ continue_init(Manager, ConfigDB, SocketType, Socket, TimeOut) -> %% {stop, Reason, State} %% Description: Handling call messages %%-------------------------------------------------------------------- -handle_call(Request, From, State) -> +handle_call(Request, From, #state{mod = ModData} = State) -> + Error = + lists:flatten( + io_lib:format("Unexpected request: " + "~n~p" + "~nto request handler (~p) from ~p" + "~n", [Request, self(), From])), + error_log(Error, ModData), {stop, {call_api_violation, Request, From}, State}. %%-------------------------------------------------------------------- @@ -171,8 +178,15 @@ handle_call(Request, From, State) -> %% {stop, Reason, State} %% Description: Handling cast messages %%-------------------------------------------------------------------- -handle_cast(Msg, State) -> - {reply, {cast_api_violation, Msg}, State}. +handle_cast(Msg, #state{mod = ModData} = State) -> + Error = + lists:flatten( + io_lib:format("Unexpected message: " + "~n~p" + "~nto request handler (~p)" + "~n", [Msg, self()])), + error_log(Error, ModData), + {noreply, State}. %%-------------------------------------------------------------------- %% handle_info(Info, State) -> {noreply, State} | @@ -253,7 +267,10 @@ handle_info(timeout, #state{mod = ModData} = State) -> %% Default case handle_info(Info, #state{mod = ModData} = State) -> Error = lists:flatten( - io_lib:format("Unexpected message received: ~n~p~n", [Info])), + io_lib:format("Unexpected info: " + "~n~p" + "~nto request handler (~p)" + "~n", [Info, self()])), error_log(Error, ModData), {noreply, State}. |