aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server/httpd_log.erl
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-11-14 09:14:16 +0100
committerFredrik Gustafsson <[email protected]>2013-11-14 09:14:16 +0100
commitae7ae7d734b980294073ea43923167904349347c (patch)
tree58bfa8abc6bbcf44d9b7e01f0ec383eb50dd35ef /lib/inets/src/http_server/httpd_log.erl
parent69eee1e3d93b353dc07ff6ea167f9ab636478126 (diff)
parentc46240c78fbce1b8b026f975d80b397209ac4968 (diff)
downloadotp-ae7ae7d734b980294073ea43923167904349347c.tar.gz
otp-ae7ae7d734b980294073ea43923167904349347c.tar.bz2
otp-ae7ae7d734b980294073ea43923167904349347c.zip
Merge branch 'maint'
Diffstat (limited to 'lib/inets/src/http_server/httpd_log.erl')
-rw-r--r--lib/inets/src/http_server/httpd_log.erl15
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,