diff options
author | Micael Karlberg <[email protected]> | 2011-11-16 15:15:58 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-11-16 15:15:58 +0100 |
commit | 20199ca88ef233a2661d680f0749d1f57a34ba65 (patch) | |
tree | 926cb5bb8940eb3ca3dbd4c1fd8abdd2bcca890e /lib/inets | |
parent | 2c1ef7d09629bc4cf644c7c985989c60e22b3f64 (diff) | |
parent | 166f4ccad9a1f7ecc9b0934faff8b9e913dc0fc5 (diff) | |
download | otp-20199ca88ef233a2661d680f0749d1f57a34ba65.tar.gz otp-20199ca88ef233a2661d680f0749d1f57a34ba65.tar.bz2 otp-20199ca88ef233a2661d680f0749d1f57a34ba65.zip |
[httpd] Fix logging of content length in mod_log.
Garrett Smith
OTP-9715
Merge branch 'gs/mod_log-fix' into bmk/inets/httpd/content_len_in_mod_log/OTP-9715
Diffstat (limited to 'lib/inets')
-rw-r--r-- | lib/inets/doc/src/notes.xml | 11 | ||||
-rw-r--r-- | lib/inets/src/http_server/mod_log.erl | 10 |
2 files changed, 13 insertions, 8 deletions
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml index 59c2f8a2df..7f0f61148c 100644 --- a/lib/inets/doc/src/notes.xml +++ b/lib/inets/doc/src/notes.xml @@ -55,19 +55,18 @@ </section> <section><title>Fixed Bugs and Malfunctions</title> +<!-- <p>-</p> +--> -<!-- <list> <item> - <p>[httpc] Remove unnecessary usage of iolist_to_binary when - processing body (for PUT and POST). </p> - <p>Filipe David Manana</p> - <p>Own Id: OTP-9317</p> + <p>[httpd] Fix logging of content length in mod_log. </p> + <p>Garrett Smith</p> + <p>Own Id: OTP-9715</p> </item> </list> ---> </section> diff --git a/lib/inets/src/http_server/mod_log.erl b/lib/inets/src/http_server/mod_log.erl index c8a2ec0dc4..62faa285df 100644 --- a/lib/inets/src/http_server/mod_log.erl +++ b/lib/inets/src/http_server/mod_log.erl @@ -100,7 +100,7 @@ do(Info) -> transfer_log(Info,"-",AuthUser,Date,StatusCode,Size), {proceed,Info#mod.data}; {response, Head, _Body} -> - Size = proplists:get_value(content_length,Head,unknown), + Size = content_length(Head), Code = proplists:get_value(code,Head,unknown), transfer_log(Info, "-", AuthUser, Date, Code, Size), {proceed, Info#mod.data}; @@ -254,4 +254,10 @@ auth_user(Data) -> RemoteUser end. - +content_length(Head) -> + case proplists:get_value(content_length, Head) of + undefined -> + unknown; + Size -> + list_to_integer(Size) + end. |