mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-27 14:30:55 +02:00
HTTP Upload: put more info in log messages
This commit is contained in:
parent
0a40ab93c8
commit
9c82c2f6d0
@ -393,12 +393,12 @@ process(_LocalPath, #request{method = 'PUT', host = Host, ip = IP,
|
|||||||
http_response(500)
|
http_response(500)
|
||||||
end;
|
end;
|
||||||
{error, size_mismatch} ->
|
{error, size_mismatch} ->
|
||||||
?INFO_MSG("Rejecting file from ~s for ~s: Unexpected size (~B)",
|
?INFO_MSG("Rejecting file ~s from ~s for ~s: Unexpected size (~B)",
|
||||||
[?ADDR_TO_STR(IP), Host, Length]),
|
[lists:last(Slot), ?ADDR_TO_STR(IP), Host, Length]),
|
||||||
http_response(413);
|
http_response(413);
|
||||||
{error, invalid_slot} ->
|
{error, invalid_slot} ->
|
||||||
?INFO_MSG("Rejecting file from ~s for ~s: Invalid slot",
|
?INFO_MSG("Rejecting file ~s from ~s for ~s: Invalid slot",
|
||||||
[?ADDR_TO_STR(IP), Host]),
|
[lists:last(Slot), ?ADDR_TO_STR(IP), Host]),
|
||||||
http_response(403);
|
http_response(403);
|
||||||
Error ->
|
Error ->
|
||||||
?ERROR_MSG("Cannot handle PUT request from ~s for ~s: ~p",
|
?ERROR_MSG("Cannot handle PUT request from ~s for ~s: ~p",
|
||||||
@ -580,8 +580,8 @@ create_slot(#state{service_url = undefined,
|
|||||||
allow ->
|
allow ->
|
||||||
RandStr = randoms:get_alphanum_string(SecretLength),
|
RandStr = randoms:get_alphanum_string(SecretLength),
|
||||||
FileStr = make_file_string(File),
|
FileStr = make_file_string(File),
|
||||||
?INFO_MSG("Got HTTP upload slot for ~s (file: ~s)",
|
?INFO_MSG("Got HTTP upload slot for ~s (file: ~s, size: ~B)",
|
||||||
[jid:encode(JID), File]),
|
[jid:encode(JID), File, Size]),
|
||||||
{ok, [UserStr, RandStr, FileStr]};
|
{ok, [UserStr, RandStr, FileStr]};
|
||||||
deny ->
|
deny ->
|
||||||
{error, xmpp:err_service_unavailable()};
|
{error, xmpp:err_service_unavailable()};
|
||||||
@ -604,8 +604,8 @@ create_slot(#state{service_url = ServiceURL},
|
|||||||
case binary:split(Body, <<$\n>>, [global, trim]) of
|
case binary:split(Body, <<$\n>>, [global, trim]) of
|
||||||
[<<"http", _/binary>> = PutURL,
|
[<<"http", _/binary>> = PutURL,
|
||||||
<<"http", _/binary>> = GetURL] ->
|
<<"http", _/binary>> = GetURL] ->
|
||||||
?INFO_MSG("Got HTTP upload slot for ~s (file: ~s)",
|
?INFO_MSG("Got HTTP upload slot for ~s (file: ~s, size: ~B)",
|
||||||
[jid:encode(JID), File]),
|
[jid:encode(JID), File, Size]),
|
||||||
{ok, PutURL, GetURL};
|
{ok, PutURL, GetURL};
|
||||||
Lines ->
|
Lines ->
|
||||||
?ERROR_MSG("Can't parse data received for ~s from <~s>: ~p",
|
?ERROR_MSG("Can't parse data received for ~s from <~s>: ~p",
|
||||||
|
Loading…
Reference in New Issue
Block a user