@@ -38,8 +38,8 @@ namespace boost { namespace network { namespace http {
3838typedef typename ostringstream<Tag>::type output_stream;
3939typedef constants<Tag> consts;
4040 output_stream header_line;
41- header_line <<name (header)
42- <<consts::colon () <<consts::space ()
41+ header_line <<name (header)
42+ <<consts::colon () <<consts::space ()
4343 <<value (header) <<consts::crlf ();
4444return header_line.str ();
4545 }
@@ -50,17 +50,17 @@ namespace boost { namespace network { namespace http {
5050 ((ClientRequest<Request>)),
5151 (OutputIterator)
5252 ) linearize(
53- Requestconst & request,
53+ Requestconst & request,
5454typename Request::string_typeconst & method,
55- unsigned version_major,
56- unsigned version_minor,
55+ unsigned version_major,
56+ unsigned version_minor,
5757 OutputIterator oi
58- )
58+ )
5959 {
6060typedef typename Request::tag Tag;
6161typedef constants<Tag> consts;
6262typedef typename string<Tag>::type string_type;
63- static string_type
63+ static string_type
6464 http_slash =consts::http_slash ()
6565 , accept =consts::accept ()
6666 , accept_mime =consts::default_accept_mime ()
@@ -73,7 +73,7 @@ namespace boost { namespace network { namespace http {
7373 ;
7474boost::copy (method, oi);
7575 *oi =consts::space_char ();
76- if (request.path ().empty () || request.path ()[0 ] !=consts::slash_char ())
76+ if (request.path ().empty () || request.path ()[0 ] !=consts::slash_char ())
7777 *oi =consts::slash_char ();
7878boost::copy (request.path (), oi);
7979if (!request.query ().empty ()) {
@@ -116,13 +116,11 @@ namespace boost { namespace network { namespace http {
116116boost::copy (crlf, oi);
117117 }
118118typedef typename headers_range<Request>::type headers_range;
119- typedef typename range_iterator<headers_range>::type headers_iterator;
120- headers_range request_headers =headers (request);
121- headers_iterator iterator =boost::begin (request_headers),
122- end =boost::end (request_headers);
123- for (; iterator != end; ++iterator) {
124- string_type header_name =name (*iterator),
125- header_value =value (*iterator);
119+ typedef typename range_value<headers_range>::type headers_value;
120+ BOOST_FOREACH (const headers_value &header,headers (request))
121+ {
122+ string_type header_name =name (header),
123+ header_value =value (header);
126124boost::copy (header_name, oi);
127125 *oi =consts::colon_char ();
128126 *oi =consts::space_char ();
@@ -140,11 +138,11 @@ namespace boost { namespace network { namespace http {
140138typename body_range<Request>::type body_data =body (request).range ();
141139return boost::copy (body_data, oi);
142140 }
143-
141+
144142}/* http*/
145-
143+
146144}/* net*/
147-
145+
148146}/* boost*/
149147
150148#endif /* BOOST_NETWORK_PROTOCOL_HTTP_ALGORITHMS_LINEARIZE_HPP_20101028*/