Skip to content

Commit 9a7f1d9

Browse files
committed
Updated linearize function because of a compilation failure on MSVC 2010.
1 parent 5a34648 commit 9a7f1d9

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

boost/network/protocol/http/algorithms/linearize.hpp

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ namespace boost { namespace network { namespace http {
3838
typedef typename ostringstream<Tag>::type output_stream;
3939
typedef 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();
4444
return header_line.str();
4545
}
@@ -50,17 +50,17 @@ namespace boost { namespace network { namespace http {
5050
((ClientRequest<Request>)),
5151
(OutputIterator)
5252
) linearize(
53-
Request const & request,
53+
Request const & request,
5454
typename Request::string_type const & method,
55-
unsigned version_major,
56-
unsigned version_minor,
55+
unsigned version_major,
56+
unsigned version_minor,
5757
OutputIterator oi
58-
)
58+
)
5959
{
6060
typedef typename Request::tag Tag;
6161
typedef constants<Tag> consts;
6262
typedef 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
;
7474
boost::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();
7878
boost::copy(request.path(), oi);
7979
if (!request.query().empty()) {
@@ -116,13 +116,11 @@ namespace boost { namespace network { namespace http {
116116
boost::copy(crlf, oi);
117117
}
118118
typedef 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);
126124
boost::copy(header_name, oi);
127125
*oi = consts::colon_char();
128126
*oi = consts::space_char();
@@ -140,11 +138,11 @@ namespace boost { namespace network { namespace http {
140138
typename body_range<Request>::type body_data = body(request).range();
141139
return 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 */

0 commit comments

Comments
 (0)