aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMickaël Rémond <mickael.remond@process-one.net>2006-05-15 15:45:52 +0000
committerMickaël Rémond <mickael.remond@process-one.net>2006-05-15 15:45:52 +0000
commit21b912a375ed6d53f8e93bde83bff7c8e468c97b (patch)
tree8858f14705d5c58259540a99230db51f07824dde /src
parent* src/ejabberd_ctl.erl: Added a way to delete the older message (diff)
* src/web/ejabberd_http_poll.erl: Timeout disconnection were not
properly handled after "active once" migration. This is now fixed. SVN Revision: 566
Diffstat (limited to 'src')
-rw-r--r--src/web/ejabberd_http_poll.erl15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/web/ejabberd_http_poll.erl b/src/web/ejabberd_http_poll.erl
index 09d4555f8..b16735a55 100644
--- a/src/web/ejabberd_http_poll.erl
+++ b/src/web/ejabberd_http_poll.erl
@@ -37,6 +37,7 @@
output = "",
input = "",
waiting_input = false,
+ last_receiver,
timer}).
%-define(DBGFSM, true).
@@ -205,7 +206,9 @@ handle_sync_event(activate, From, StateName, StateData) ->
Input ->
From ! {tcp, {http_poll, self()}, list_to_binary(Input)},
{reply, ok, StateName, StateData#state{input = "",
- waiting_input = false}}
+ waiting_input = false,
+ last_receiver = From
+ }}
end;
handle_sync_event(stop, From, StateName, StateData) ->
@@ -243,6 +246,7 @@ handle_sync_event({http_put, Key, NewKey, Packet},
Reply = ok,
{reply, Reply, StateName,
StateData#state{waiting_input = false,
+ last_receiver = Receiver,
key = NewKey,
timer = Timer}}
end;
@@ -287,9 +291,12 @@ terminate(Reason, StateName, StateData) ->
end),
case StateData#state.waiting_input of
false ->
- ok;
- Receiver ->
- gen_fsm:reply(Receiver, {error, closed})
+ case StateData#state.last_receiver of
+ undefined -> ok;
+ Receiver -> Receiver ! {tcp_closed, {http_poll, self()}}
+ end;
+ {Receiver, _Tag} ->
+ Receiver ! {tcp_closed, {http_poll, self()}}
end,
ok.