diff --git a/ChangeLog b/ChangeLog index aaa915b62..1a04d8a30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-02-27 Badlop + * src/web/ejabberd_http.erl: Added a workaround for inet:peername + returning 'ebadf' + * src/tls/tls_drv.c: S2S connection with STARTTLS fails to Gtalk and recent Openfire (thanks to Philipp Hancke)(EJAB-877) diff --git a/src/web/ejabberd_http.erl b/src/web/ejabberd_http.erl index 14fa5054f..71895bf3f 100644 --- a/src/web/ejabberd_http.erl +++ b/src/web/ejabberd_http.erl @@ -384,6 +384,13 @@ process_request(#state{request_method = Method, request_headers = RequestHeaders, request_handlers = RequestHandlers} = State) when (Method=:='POST' orelse Method=:='PUT') andalso is_integer(Len) -> + {ok, IP} = + case SockMod of + gen_tcp -> + inet:peername(Socket); + _ -> + SockMod:peername(Socket) + end, case SockMod of gen_tcp -> inet:setopts(Socket, [{packet, 0}]); @@ -403,13 +410,6 @@ process_request(#state{request_method = Method, LQ -> LQ end, - {ok, IP} = - case SockMod of - gen_tcp -> - inet:peername(Socket); - _ -> - SockMod:peername(Socket) - end, Request = #request{method = Method, path = LPath, q = LQuery,