mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
* src/web/ejabberd_http.hrl: Added "ip" field in the "request"
record * src/web/ejabberd_http.erl: Likewise SVN Revision: 762
This commit is contained in:
parent
372944df6c
commit
32613987a8
@ -1,3 +1,9 @@
|
||||
2007-05-07 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* src/web/ejabberd_http.hrl: Added "ip" field in the "request"
|
||||
record
|
||||
* src/web/ejabberd_http.erl: Likewise
|
||||
|
||||
2007-05-03 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* src/ejabberd_sm.erl: Added set_presence_hook
|
||||
|
@ -253,7 +253,9 @@ process_request(#state{request_method = 'GET',
|
||||
request_path = {abs_path, Path},
|
||||
request_auth = Auth,
|
||||
request_lang = Lang,
|
||||
request_handlers = RequestHandlers} = State) ->
|
||||
request_handlers = RequestHandlers,
|
||||
sockmod = SockMod,
|
||||
socket = Socket} = State) ->
|
||||
case (catch url_decode_q_split(Path)) of
|
||||
{'EXIT', _} ->
|
||||
process_request(false);
|
||||
@ -265,11 +267,19 @@ process_request(#state{request_method = 'GET',
|
||||
LQ
|
||||
end,
|
||||
LPath = string:tokens(NPath, "/"),
|
||||
{ok, {IP, _Port}} =
|
||||
case SockMod of
|
||||
gen_tcp ->
|
||||
inet:peername(Socket);
|
||||
_ ->
|
||||
SockMod:peername(Socket)
|
||||
end,
|
||||
Request = #request{method = 'GET',
|
||||
path = LPath,
|
||||
q = LQuery,
|
||||
auth = Auth,
|
||||
lang = Lang},
|
||||
lang = Lang,
|
||||
ip=IP},
|
||||
%% XXX bard: This previously passed control to
|
||||
%% ejabberd_web:process_get, now passes it to a local
|
||||
%% procedure (process) that handles dispatching based on
|
||||
@ -962,4 +972,3 @@ get_line("\r\n" ++ Tail, Cur) ->
|
||||
end;
|
||||
get_line([H|T], Cur) ->
|
||||
get_line(T, [H|Cur]).
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
us,
|
||||
auth,
|
||||
lang = "",
|
||||
data = ""
|
||||
data = "",
|
||||
ip
|
||||
}).
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user