aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>2018-06-29 09:58:33 +0300
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>2018-06-29 09:58:33 +0300
commit9c82c2f6d0b1d20f7dcc1108a7c31ae891be10c7 (patch)
tree2d69481f383e801924f654f3b31ee3fd8e188221
parentDon't crash when encoding {xmlcdata, _} (diff)
HTTP Upload: put more info in log messages
-rw-r--r--src/mod_http_upload.erl16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mod_http_upload.erl b/src/mod_http_upload.erl
index 3d4f3e56b..e6bd75d50 100644
--- a/src/mod_http_upload.erl
+++ b/src/mod_http_upload.erl
@@ -393,12 +393,12 @@ process(_LocalPath, #request{method = 'PUT', host = Host, ip = IP,
http_response(500)
end;
{error, size_mismatch} ->
- ?INFO_MSG("Rejecting file from ~s for ~s: Unexpected size (~B)",
- [?ADDR_TO_STR(IP), Host, Length]),
+ ?INFO_MSG("Rejecting file ~s from ~s for ~s: Unexpected size (~B)",
+ [lists:last(Slot), ?ADDR_TO_STR(IP), Host, Length]),
http_response(413);
{error, invalid_slot} ->
- ?INFO_MSG("Rejecting file from ~s for ~s: Invalid slot",
- [?ADDR_TO_STR(IP), Host]),
+ ?INFO_MSG("Rejecting file ~s from ~s for ~s: Invalid slot",
+ [lists:last(Slot), ?ADDR_TO_STR(IP), Host]),
http_response(403);
Error ->
?ERROR_MSG("Cannot handle PUT request from ~s for ~s: ~p",
@@ -580,8 +580,8 @@ create_slot(#state{service_url = undefined,
allow ->
RandStr = randoms:get_alphanum_string(SecretLength),
FileStr = make_file_string(File),
- ?INFO_MSG("Got HTTP upload slot for ~s (file: ~s)",
- [jid:encode(JID), File]),
+ ?INFO_MSG("Got HTTP upload slot for ~s (file: ~s, size: ~B)",
+ [jid:encode(JID), File, Size]),
{ok, [UserStr, RandStr, FileStr]};
deny ->
{error, xmpp:err_service_unavailable()};
@@ -604,8 +604,8 @@ create_slot(#state{service_url = ServiceURL},
case binary:split(Body, <<$\n>>, [global, trim]) of
[<<"http", _/binary>> = PutURL,
<<"http", _/binary>> = GetURL] ->
- ?INFO_MSG("Got HTTP upload slot for ~s (file: ~s)",
- [jid:encode(JID), File]),
+ ?INFO_MSG("Got HTTP upload slot for ~s (file: ~s, size: ~B)",
+ [jid:encode(JID), File, Size]),
{ok, PutURL, GetURL};
Lines ->
?ERROR_MSG("Can't parse data received for ~s from <~s>: ~p",