File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
boost/network/protocol/http/message Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -91,13 +91,15 @@ namespace boost { namespace network { namespace http {
91
91
destination_ = future;
92
92
}
93
93
94
- headers_container_type const headers () const {
94
+ headers_container_type const & headers () const {
95
+ if (retrieved_headers_) return *retrieved_headers_;
95
96
headers_container_type raw_headers = headers_.get ();
96
97
raw_headers.insert (added_headers.begin (), added_headers.end ());
97
98
BOOST_FOREACH (string_type const & key, removed_headers) {
98
99
raw_headers.erase (key);
99
100
}
100
- return raw_headers;
101
+ retrieved_headers_ = raw_headers;
102
+ return *retrieved_headers_;
101
103
}
102
104
103
105
void headers (boost::shared_future<headers_container_type> const & future) const {
@@ -144,6 +146,7 @@ namespace boost { namespace network { namespace http {
144
146
mutable headers_container_type added_headers;
145
147
mutable std::set<string_type> removed_headers;
146
148
mutable boost::shared_future<string_type> body_;
149
+ mutable boost::optional<headers_container_type> retrieved_headers_;
147
150
148
151
friend struct boost ::network::http::impl::ready_wrapper<Tag>;
149
152
};
You can’t perform that action at this time.
0 commit comments