Renamed to basic_fields::set (API Change):

* `replace` is renamed to `set`

Actions Required:

* Rename calls to `basic_fields::replace` to `basic_fields::set`
This commit is contained in:
Vinnie Falco
2017-06-15 06:55:43 -07:00
parent 6531a3c6d3
commit eb7e971c7a
6 changed files with 19 additions and 11 deletions

View File

@@ -5,6 +5,14 @@ Version 58:
* Reorganize examples
* Specification for http read
API Changes:
* `basic_fields::set` renamed from `basic_fields::replace`
Actions Required:
* Rename calls to `basic_fields::replace` to `basic_fields::set`
--------------------------------------------------------------------------------
Version 57:

View File

@@ -62,7 +62,7 @@ send_expect_100_continue(
"DynamicBuffer requirements not met");
// Insert or replace the Expect field
req.replace(field::expect, "100-continue");
req.set(field::expect, "100-continue");
// Create the serializer
auto sr = make_serializer(req);

View File

@@ -390,7 +390,7 @@ public:
insert(field name, string_view name_string,
string_param const& value);
/** Replace a field value.
/** Set a field value, removing any other instances of that field.
First removes any values with matching field names, then
inserts the new field value.
@@ -402,9 +402,9 @@ public:
@return The field value.
*/
void
replace(field name, string_param const& value);
set(field name, string_param const& value);
/** Replace a field value.
/** Set a field value, removing any other instances of that field.
First removes any values with matching field names, then
inserts the new field value.
@@ -414,7 +414,7 @@ public:
@param value The value of the field, as a @ref string_param
*/
void
replace(string_view name, string_param const& value);
set(string_view name, string_param const& value);
/** Remove a field.

View File

@@ -508,7 +508,7 @@ insert(field name,
template<class Allocator>
void
basic_fields<Allocator>::
replace(field name, string_param const& value)
set(field name, string_param const& value)
{
BOOST_ASSERT(name != field::unknown);
erase(name);
@@ -518,7 +518,7 @@ replace(field name, string_param const& value)
template<class Allocator>
void
basic_fields<Allocator>::
replace(string_view sname, string_param const& value)
set(string_view sname, string_param const& value)
{
auto const name = string_to_field(sname);
erase(sname);
@@ -780,7 +780,7 @@ set_chunked_impl(bool v)
if(it == end())
this->insert(field::transfer_encoding, "chunked");
else
this->replace(field::transfer_encoding,
this->set(field::transfer_encoding,
it->value().to_string() + ", chunked");
}

View File

@@ -236,7 +236,7 @@ pmd_write(Fields& fields, pmd_offer const& offer)
{
s += "; client_no_context_takeover";
}
fields.replace("Sec-WebSocket-Extensions", s);
fields.set(http::field::sec_websocket_extensions, s);
}
// Negotiate a permessage-deflate client offer
@@ -329,7 +329,7 @@ pmd_negotiate(
break;
}
if(config.accept)
fields.replace("Sec-WebSocket-Extensions", s);
fields.set(http::field::sec_websocket_extensions, s);
}
// Normalize the server's response

View File

@@ -124,7 +124,7 @@ public:
{
ec = {};
h.erase("Content-Length");
h.replace("Transfer-Encoding", "chunked");
h.set("Transfer-Encoding", "chunked");
});
BEAST_EXPECTS(! ec, ec.message());
BEAST_EXPECT(equal_body<true>(