diff options
author | Badlop <badlop@process-one.net> | 2008-05-17 11:44:25 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2008-05-17 11:44:25 +0000 |
commit | 4e77bae2066b0f4e8fbaa7101568fa6489c11903 (patch) | |
tree | 3b847101fd98fb9557a0381d7fdf796749e18d7b /src/extauth.erl | |
parent | * src/mod_muc/mod_muc_room.erl: Allow change_state of a room (diff) |
* src/extauth.erl: Log strange responses from extauth script. Use
timeout (EJAB-627)
SVN Revision: 1330
Diffstat (limited to 'src/extauth.erl')
-rw-r--r-- | src/extauth.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/extauth.erl b/src/extauth.erl index 052e95d7a..3819fcddf 100644 --- a/src/extauth.erl +++ b/src/extauth.erl @@ -32,6 +32,8 @@ -include("ejabberd.hrl"). +-define(CALL_TIMEOUT, 30000). % Timeout is in milliseconds: 30 seconds == 30000 + start(Host, ExtPrg) -> spawn(?MODULE, init, [Host, ExtPrg]). @@ -67,7 +69,13 @@ loop(Port) -> Port ! {self(), {command, encode(Msg)}}, receive {Port, {data, Data}} -> - Caller ! {eauth, decode(Data)} + ?DEBUG("extauth call '~p' received data response:~n~p", [Msg, Data]), + Caller ! {eauth, decode(Data)}; + {Port, Other} -> + ?ERROR_MSG("extauth call '~p' received strange response:~n~p", [Msg, Other]) + after + ?CALL_TIMEOUT -> + ?ERROR_MSG("extauth call '~p' didn't receive response~n", [Msg]) end, loop(Port); stop -> |