Merge branch 'stable'
This commit is contained in:
		
						commit
						12899f4c03
					
				|  | @ -86,20 +86,25 @@ code_change(_OldVsn, State, _Extra) -> | ||||||
| %% since we are now using Cowboy, a few small parts had to change. | %% since we are now using Cowboy, a few small parts had to change. | ||||||
| %% This is one such part. The code is however equivalent to Webmachine's. | %% This is one such part. The code is however equivalent to Webmachine's. | ||||||
| 
 | 
 | ||||||
| format_req({Status0, Body, Req}) -> | format_req({Status0, Body, Req0}) -> | ||||||
|     User = "-", |     User = "-", | ||||||
|     Time = webmachine_log:fmtnow(), |     Time = webmachine_log:fmtnow(), | ||||||
|     Status = integer_to_list(Status0), |     Status = integer_to_list(Status0), | ||||||
|     Length = integer_to_list(iolist_size(Body)), |     Length = integer_to_list(iolist_size(Body)), | ||||||
|     {Method, _} = cowboy_req:method(Req), |     {Method, Req1} = cowboy_req:method(Req0), | ||||||
|     {Path, _} = cowboy_req:path(Req), |     {Path, Req2} = cowboy_req:path(Req1), | ||||||
|     {{Peer, _}, _} = cowboy_req:peer(Req), |     {Peer, Req3} = case cowboy_req:peer(Req2) of | ||||||
|     Version = case cowboy_req:version(Req) of |                        {{Peer0, _Port}, R} -> | ||||||
|  |                            {Peer0, R}; | ||||||
|  |                        {Other, R} -> | ||||||
|  |                            {Other, R} | ||||||
|  |                    end, | ||||||
|  |     Version = case cowboy_req:version(Req3) of | ||||||
|         {'HTTP/1.1', _} -> {1, 1}; |         {'HTTP/1.1', _} -> {1, 1}; | ||||||
|         {'HTTP/1.0', _} -> {1, 0} |         {'HTTP/1.0', _} -> {1, 0} | ||||||
|     end, |     end, | ||||||
|     {Referer, _} = cowboy_req:header(<<"referer">>, Req, <<>>), |     {Referer, Req4} = cowboy_req:header(<<"referer">>, Req3, <<>>), | ||||||
|     {UserAgent, _} = cowboy_req:header(<<"user-agent">>, Req, <<>>), |     {UserAgent, _Req5} = cowboy_req:header(<<"user-agent">>, Req4, <<>>), | ||||||
|     fmt_alog(Time, Peer, User, Method, Path, Version, |     fmt_alog(Time, Peer, User, Method, Path, Version, | ||||||
|              Status, Length, Referer, UserAgent). |              Status, Length, Referer, UserAgent). | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue