mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-24 17:29:28 +01:00
* src/web/ejabberd_http.erl: Added a workaround for inet:peername
returning 'ebadf' SVN Revision: 1910
This commit is contained in:
parent
e6324f8a02
commit
b6208955f3
@ -1,3 +1,8 @@
|
||||
2009-02-23 Alexey Shchepin <alexey@process-one.net>
|
||||
|
||||
* src/web/ejabberd_http.erl: Added a workaround for inet:peername
|
||||
returning 'ebadf'
|
||||
|
||||
2009-02-20 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/ejabberd_listener.erl: When stopping a listener, don't stop
|
||||
|
@ -381,6 +381,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}]);
|
||||
@ -400,13 +407,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,
|
||||
|
Loading…
Reference in New Issue
Block a user