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

Commite86a2fe

Browse files
committed
Merge branch 'bug-56-message-header-crash' into 0.9-devel
2 parents8643537 +922dcc1 commite86a2fe

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎boost/network/protocol/http/message/async_message.hpp‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
// Copyright 2010 (c) Dean Michael Berris
55
// Copyright 2010 (c) Sinefunc, Inc.
6+
// Copyright 2011 Dean Michael Berris (dberris@google.com).
7+
// Copyright 2011 Google, Inc.
68
// Distributed under the Boost Software License, Version 1.0.
79
// (See accompanying file LICENSE_1_0.txt or copy at
810
// http://www.boost.org/LICENSE_1_0.txt)
@@ -91,13 +93,15 @@ namespace boost { namespace network { namespace http {
9193
destination_ = future;
9294
}
9395

94-
headers_container_typeconstheaders()const {
96+
headers_container_typeconst &headers()const {
97+
if (retrieved_headers_)return *retrieved_headers_;
9598
headers_container_type raw_headers = headers_.get();
9699
raw_headers.insert(added_headers.begin(), added_headers.end());
97100
BOOST_FOREACH(string_typeconst & key, removed_headers) {
98101
raw_headers.erase(key);
99102
}
100-
return raw_headers;
103+
retrieved_headers_ = raw_headers;
104+
return *retrieved_headers_;
101105
}
102106

103107
voidheaders(boost::shared_future<headers_container_type>const & future)const {
@@ -144,6 +148,7 @@ namespace boost { namespace network { namespace http {
144148
mutable headers_container_type added_headers;
145149
mutable std::set<string_type> removed_headers;
146150
mutable boost::shared_future<string_type> body_;
151+
mutable boost::optional<headers_container_type> retrieved_headers_;
147152

148153
friendstructboost::network::http::impl::ready_wrapper<Tag>;
149154
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp