Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Changes to the unreleased Beast facade.
* Fixed browser HTTP and WebSocket transfers with shared Wasm memory.
* Added current application coverage and shared Release parser measurements.
* Added a WebSocket client layer that bounds the handshake response it reads.
* Changed set_server_name to `+[[nodiscard]]+`, so a dropped refusal of a server name is diagnosed.
// end::unreleased[]

[#beast-changelog-0-1-0]
Expand Down
5 changes: 3 additions & 2 deletions include/webcpp/beast/browser/ssl_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ class ssl_stream {
@param host Hostname to match against the recorded destination authority.
@return Success, or invalid_argument for an invalid server-name record.
*/
boost::system::result<void> set_server_name(std::string_view host) {
[[nodiscard]] boost::system::result<void> set_server_name(std::string_view host) {
if (host.empty() || host.size() > 255 || host.find('\0') != std::string_view::npos) {
return ::webcpp::asio_backend::error::invalid_argument;
}
Expand All @@ -299,7 +299,8 @@ class ssl_stream {
@return Success, or invalid_argument for an invalid server-name record.
*/
template <class NextLayer>
boost::system::result<void> set_server_name(ssl_stream<NextLayer>& stream, std::string_view host) {
[[nodiscard]] boost::system::result<void> set_server_name(ssl_stream<NextLayer>& stream,
std::string_view host) {
return stream.set_server_name(host);
}
}
Expand Down
3 changes: 3 additions & 0 deletions meta/lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"nodiscard-results": "a dropped result, a server name's, would pass as a name the handshake checks"
}
Loading