From 8a49eed9476fa14431d5cd5cbaa9b696199aed8b Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 7 May 2017 17:33:03 -0700 Subject: [PATCH] Set version to 39 --- CHANGELOG.md | 8 +++++++- include/beast/version.hpp | 19 ++++++++++++------- include/beast/websocket/impl/stream.ipp | 15 ++++++++------- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af77b0b0..9217227d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -1.0.0-b39 +Version 39 + +Beast versions are now identified by a single integer which +is incremented on each merge. The macro BEAST_VERSION +identifies the version number, currently at 39. A version +setting commit will always be at the tip of the master +and develop branches. * Use beast::string_view alias * Fixed braced-init error with older gcc diff --git a/include/beast/version.hpp b/include/beast/version.hpp index ba9a352f..009aaca8 100644 --- a/include/beast/version.hpp +++ b/include/beast/version.hpp @@ -10,14 +10,19 @@ #include -// follows http://semver.org +#define BEAST_QUOTE(arg) #arg +#define BEAST_STR(arg) BEAST_QUOTE(arg) -// BEAST_VERSION % 100 is the patch level -// BEAST_VERSION / 100 % 1000 is the minor version -// BEAST_VERSION / 100000 is the major version -// -#define BEAST_VERSION 100000 +/** @def BEAST_API_VERSION -#define BEAST_VERSION_STRING "1.0.0-b38" + Identifies the API version of Beast. + + This is a simple integer that is incremented by one every time + a set of code changes is merged to the master or develop branch. +*/ +#define BEAST_VERSION 39 + +#define BEAST_VERSION_STRING "Beast/" BEAST_STR(BEAST_VERSION) #endif + diff --git a/include/beast/websocket/impl/stream.ipp b/include/beast/websocket/impl/stream.ipp index 401e914f..e3acceaa 100644 --- a/include/beast/websocket/impl/stream.ipp +++ b/include/beast/websocket/impl/stream.ipp @@ -185,10 +185,11 @@ build_request(detail::sec_ws_key_type& key, req.fields, config); } decorator(req); - // VFALCO Use static_string here if(! req.fields.exists("User-Agent")) - req.fields.insert("User-Agent", - std::string("Beast/") + BEAST_VERSION_STRING); + { + static_string<20> s(BEAST_VERSION_STRING); + req.fields.insert("User-Agent", s); + } return req; } @@ -203,11 +204,11 @@ build_response(request_type const& req, [&decorator](response_type& res) { decorator(res); - // VFALCO Use static_string here if(! res.fields.exists("Server")) - res.fields.insert("Server", - std::string("Beast/") + - BEAST_VERSION_STRING); + { + static_string<20> s(BEAST_VERSION_STRING); + res.fields.insert("Server", s); + } }; auto err = [&](std::string const& text)