Skip to content
Browse files

Merge branch 'bmk/inets/httpd/content_len_in_mod_log/OTP-9715'

  • Loading branch information...
2 parents ac59f1f + 20199ca commit 448b0ce1af748594a9f1c708da491cbdcfeb3498 @bmk bmk committed Nov 18, 2011
Showing with 13 additions and 8 deletions.
  1. +5 −6 lib/inets/doc/src/notes.xml
  2. +8 −2 lib/inets/src/http_server/mod_log.erl
View
11 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>
View
10 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.

0 comments on commit 448b0ce

Please sign in to comment.
Something went wrong with that request. Please try again.