diff options
author | Micael Karlberg <[email protected]> | 2013-11-13 14:23:30 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2013-11-13 14:23:30 +0100 |
commit | c01df2215ac3ddef82116abac5eaf236d3788f21 (patch) | |
tree | ecd7758513176262329afcb57f41400a06b583e9 /lib/inets/src/http_server/httpd_log.erl | |
parent | 4ed2425fa6e14693beac06ec176ffc918f11bc3f (diff) | |
parent | a589518053c2893dead28fd159ef3d9e48585cf4 (diff) | |
download | otp-c01df2215ac3ddef82116abac5eaf236d3788f21.tar.gz otp-c01df2215ac3ddef82116abac5eaf236d3788f21.tar.bz2 otp-c01df2215ac3ddef82116abac5eaf236d3788f21.zip |
Merge branch 'bmk/inets/httpd/fix_mod_head_response/OTP-11328' into maint
Diffstat (limited to 'lib/inets/src/http_server/httpd_log.erl')
-rw-r--r-- | lib/inets/src/http_server/httpd_log.erl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/inets/src/http_server/httpd_log.erl b/lib/inets/src/http_server/httpd_log.erl index a34435e0e8..7ff73669f9 100644 --- a/lib/inets/src/http_server/httpd_log.erl +++ b/lib/inets/src/http_server/httpd_log.erl @@ -39,14 +39,21 @@ Size :: 0 | pos_integer() | string()) -> {Log :: atom() | pid(), Entry :: string()} | term() . -access_entry(Log, NoLog, Info, RFC931, AuthUser, Date, StatusCode, SizeStr) - when is_list(SizeStr) -> +%% Somethime the size in the form of the content_length is put here, which +%% is actually in the form of a string +%% So it can either be the size as an integer, the size as a string +%% or, worst case scenario, bytes. +access_entry(Log, NoLog, Info, RFC931, AuthUser, Date, StatusCode, + SizeStrOrBytes) + when is_list(SizeStrOrBytes) -> Size = - case (catch list_to_integer(SizeStr)) of + case (catch list_to_integer(SizeStrOrBytes)) of I when is_integer(I) -> + %% This is from using the content_length (which is a string) I; _ -> - SizeStr % This is better then nothing + %% This is better than nothing + httpd_util:flatlength(SizeStrOrBytes) end, access_entry(Log, NoLog, Info, RFC931, AuthUser, Date, StatusCode, Size); access_entry(Log, NoLog, |