2007-05-07 Alexey Shchepin <alexey@sevcom.net>
+ * src/ejabberd_receiver.erl: Workaround for inet_drv bug
+
+ * src/web/ejabberd_http_poll.erl: Added sockname/1 and peername/1
+ stubs
+
* src/web/ejabberd_http.hrl: Added "ip" field in the "request"
- record
+ record (thanks to Jerome Sautret and Mickael Remond)
* src/web/ejabberd_http.erl: Likewise
2007-05-03 Alexey Shchepin <alexey@sevcom.net>
activate_socket(#state{socket = Socket,
sock_mod = SockMod}) ->
- case SockMod of
- gen_tcp ->
- inet:setopts(Socket, [{active, once}]);
- _ ->
- SockMod:setopts(Socket, [{active, once}])
+ PeerName =
+ case SockMod of
+ gen_tcp ->
+ inet:setopts(Socket, [{active, once}]),
+ inet:peername(Socket);
+ _ ->
+ SockMod:setopts(Socket, [{active, once}]),
+ SockMod:peername(Socket)
+ end,
+ case PeerName of
+ {error, _Reason} ->
+ self() ! {tcp_closed, Socket};
+ {ok, _} ->
+ ok
end.
process_data(Data,
terminate/3,
send/2,
setopts/2,
+ sockname/1, peername/1,
controlling_process/2,
close/1,
process/2]).
ok
end.
+sockname(_Socket) ->
+ {ok, {{0, 0, 0, 0}, 0}}.
+
+peername(_Socket) ->
+ {ok, {{0, 0, 0, 0}, 0}}.
+
controlling_process(_Socket, _Pid) ->
ok.