Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9a7f1d9

Browse files
committed
Updated linearize function because of a compilation failure on MSVC 2010.
1 parent5a34648 commit9a7f1d9

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
typedeftypename 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-
Requestconst & request,
53+
Requestconst & request,
5454
typename 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
{
6060
typedeftypename Request::tag Tag;
6161
typedef constants<Tag> consts;
6262
typedeftypename 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
typedeftypename headers_range<Request>::type headers_range;
119-
typedeftypename 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+
typedeftypename 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
returnboost::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)

[8]ページ先頭

©2009-2025 Movatter.jp