Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a370594
Run clang-tidy with all checks.
deanberris Oct 28, 2015
44bd36b
Manual changes to update style and fix breakages
deanberris Oct 28, 2015
5f6e9ee
Changes to make things build
deanberris Oct 31, 2015
7b88a41
Reintroduce missing code for parsing query maps
deanberris Oct 31, 2015
6349c11
clang-tidy modernize-.* all the things
deanberris Nov 2, 2015
6d8879c
Upgrade travis config
deanberris Nov 2, 2015
65a0e6e
Fix typo in URL
deanberris Nov 2, 2015
feec209
Fix another typo on the URL.
deanberris Nov 2, 2015
4847865
Make travis wait for a Boost build to finish
deanberris Nov 2, 2015
e19af74
Change level of travis_wait call; chmod +x .sh files
deanberris Nov 2, 2015
abe68b4
Only support Boost 1.59 for now.
deanberris Nov 2, 2015
b10dfbb
Only produce shared+multithreaded debug & release boost libs
deanberris Nov 2, 2015
8cb4c16
Looks like we need static libs too
deanberris Nov 2, 2015
198dd07
Integrate travis; Use Boost 1.57 at least; Always use shared libs fro…
deanberris Nov 2, 2015
f6c7ee6
Use the dynamic version of Boost.Test always.
deanberris Nov 2, 2015
de7c710
Use v4 again instead of just address
deanberris Nov 4, 2015
39a2705
v4() for real this time
deanberris Nov 4, 2015
2e3340f
Change test to fetch different targets
deanberris Nov 12, 2015
7e0f93e
Simplify http test
deanberris Nov 12, 2015
552401b
Use ninja-build
deanberris Nov 12, 2015
19beafb
Update cmake
deanberris Nov 12, 2015
99f6168
Use updated cmake to support ninja-build
deanberris Nov 12, 2015
937d589
Travis cannot handle ninja builds yet, probably to lack of resources …
deanberris Nov 12, 2015
d5ec24e
j4 is too much. :(
deanberris Nov 12, 2015
d661fcc
Check with the sanitizers
deanberris Nov 12, 2015
5751338
Honor the CMAKE_CXX_FLAGS environment variable
deanberris Nov 12, 2015
511dd04
Print latest log properly
deanberris Nov 12, 2015
9fbc300
Fix some issues with the (deprecated) synchronous client implementati…
deanberris Nov 16, 2015
2f2239c
Only use libc++ if in OS X
deanberris Nov 16, 2015
4be4eae
Issue identified with memory sanitizer
deanberris Nov 16, 2015
600daff
Fix unsafe usage of boost::as_literal, caught by memory sanitiser
deanberris Nov 16, 2015
03870ca
Force use of size_t in distance calculation
deanberris Nov 16, 2015
9bad07c
Removing noexcept from defaulted move constructor
deanberris Nov 18, 2015
2f2c021
Track origins for memsan runs
deanberris Nov 18, 2015
7f70dac
Exclude msan builds from g++
deanberris Nov 18, 2015
8a8279a
Do not use msan yet; Boost seems to be not msan-clean
deanberris Nov 18, 2015
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
Prev Previous commit
Next Next commit
clang-tidy modernize-.* all the things
  • Loading branch information
deanberris committed Nov 2, 2015
commit 6349c11994c7a136bbea54b4693df642364376d9
2 changes: 1 addition & 1 deletion boost/network/message/directives/remove_header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ template <class T>
struct remove_header_directive {

explicit remove_header_directive(T header_name)
: header_name_(header_name) {};
: header_name_(std::move(header_name)) {};

template <class MessageTag>
void operator()(basic_message<MessageTag>& msg) const {
Expand Down
20 changes: 10 additions & 10 deletions boost/network/protocol/http/client/async_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ struct async_client
async_client(bool cache_resolved, bool follow_redirect,
bool always_verify_peer, int timeout,
boost::shared_ptr<boost::asio::io_service> service,
optional<string_type> const& certificate_filename,
optional<string_type> const& verify_path,
optional<string_type> const& certificate_file,
optional<string_type> const& private_key_file,
optional<string_type> const& ciphers, long ssl_options)
optional<string_type> certificate_filename,
optional<string_type> verify_path,
optional<string_type> certificate_file,
optional<string_type> private_key_file,
optional<string_type> ciphers, long ssl_options)
: connection_base(cache_resolved, follow_redirect, timeout),
service_ptr(service.get()
? service
: boost::make_shared<boost::asio::io_service>()),
service_(*service_ptr),
resolver_(service_),
sentinel_(new boost::asio::io_service::work(service_)),
certificate_filename_(certificate_filename),
verify_path_(verify_path),
certificate_file_(certificate_file),
private_key_file_(private_key_file),
ciphers_(ciphers),
certificate_filename_(std::move(certificate_filename)),
verify_path_(std::move(verify_path)),
certificate_file_(std::move(certificate_file)),
private_key_file_(std::move(private_key_file)),
ciphers_(std::move(ciphers)),
ssl_options_(ssl_options),
always_verify_peer_(always_verify_peer) {
connection_base::resolver_strand_.reset(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ struct http_async_connection
is_timedout_(false),
follow_redirect_(follow_redirect),
resolver_(resolver),
resolve_(resolve),
resolve_(std::move(resolve)),
request_strand_(resolver.get_io_service()),
delegate_(delegate) {}
delegate_(std::move(delegate)) {}

// This is the main entry point for the connection/request pipeline.
// We're
Expand Down
33 changes: 17 additions & 16 deletions boost/network/protocol/http/client/connection/normal_delegate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,29 @@ namespace impl {
struct normal_delegate : connection_delegate {
explicit normal_delegate(asio::io_service &service);

void connect(asio::ip::tcp::endpoint &endpoint, std::string host, boost::uint16_t source_port,
function<void(system::error_code const &)> handler) override;
void write(
asio::streambuf &command_streambuf,
function<void(system::error_code const &, size_t)> handler) override;
void read_some(
asio::mutable_buffers_1 const &read_buffer,
function<void(system::error_code const &, size_t)> handler) override;
void connect(asio::ip::tcp::endpoint &endpoint, std::string host,
boost::uint16_t source_port,
function<void(system::error_code const &)> handler) override;
void write(asio::streambuf &command_streambuf,
function<void(system::error_code const &, size_t)> handler)
override;
void read_some(asio::mutable_buffers_1 const &read_buffer,
function<void(system::error_code const &, size_t)> handler)
override;
void disconnect() override;
~normal_delegate() override;
~normal_delegate() override = default;

normal_delegate(normal_delegate const &) = delete;
normal_delegate &operator=(normal_delegate) = delete;

private:
asio::io_service &service_;
std::unique_ptr<asio::ip::tcp::socket> socket_;

normal_delegate(normal_delegate const &); // = delete
normal_delegate &operator=(normal_delegate); // = delete
};

} // namespace impl
} // namespace http
} // namespace impl
} // namespace http
} // namespace network
} // namespace boost
} // namespace boost

#endif // BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CONNECTION_NORMAL_DELEGATE_20110819
#endif // BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CONNECTION_NORMAL_DELEGATE_20110819
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,4 @@ void boost::network::http::impl::normal_delegate::disconnect() {
}
}

boost::network::http::impl::normal_delegate::~normal_delegate() {}

#endif // BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_CONNECTION_NORMAL_DELEGATE_IPP_20110819
10 changes: 5 additions & 5 deletions boost/network/protocol/http/client/connection/ssl_delegate.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ boost::network::http::impl::ssl_delegate::ssl_delegate(
optional<std::string> ciphers,
long ssl_options)
: service_(service),
certificate_filename_(certificate_filename),
verify_path_(verify_path),
certificate_file_(certificate_file),
private_key_file_(private_key_file),
ciphers_(ciphers),
certificate_filename_(std::move(certificate_filename)),
verify_path_(std::move(verify_path)),
certificate_file_(std::move(certificate_file)),
private_key_file_(std::move(private_key_file)),
ciphers_(std::move(ciphers)),
ssl_options_(ssl_options),
always_verify_peer_(always_verify_peer) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct http_sync_connection
timeout_(timeout),
timer_(resolver.get_io_service()),
resolver_(resolver),
resolve_(resolve),
resolve_(std::move(resolve)),
socket_(resolver.get_io_service()) {}

void init_socket(string_type /*unused*/const& hostname, string_type const& port) {
Expand Down
2 changes: 1 addition & 1 deletion boost/network/protocol/http/client/connection/sync_ssl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct https_sync_connection
timeout_(timeout),
timer_(resolver.get_io_service()),
resolver_(resolver),
resolve_(resolve),
resolve_(std::move(resolve)),
context_(resolver.get_io_service(),
boost::asio::ssl::context::sslv23_client),
socket_(resolver.get_io_service(), context_) {
Expand Down
20 changes: 10 additions & 10 deletions boost/network/protocol/http/client/sync_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@ struct sync_client
sync_client(
bool cache_resolved, bool follow_redirect, bool always_verify_peer,
int timeout, boost::shared_ptr<boost::asio::io_service> service,
optional<string_type> const& certificate_filename =
optional<string_type> certificate_filename =
optional<string_type>(),
optional<string_type> const& verify_path = optional<string_type>(),
optional<string_type> const& certificate_file = optional<string_type>(),
optional<string_type> const& private_key_file = optional<string_type>(),
optional<string_type> const& ciphers = optional<string_type>(),
optional<string_type> verify_path = optional<string_type>(),
optional<string_type> certificate_file = optional<string_type>(),
optional<string_type> private_key_file = optional<string_type>(),
optional<string_type> ciphers = optional<string_type>(),
long ssl_options = 0)
: connection_base(cache_resolved, follow_redirect, timeout),
service_ptr(service.get() ? service
: make_shared<boost::asio::io_service>()),
service_(*service_ptr),
resolver_(service_),
certificate_filename_(certificate_filename),
verify_path_(verify_path),
certificate_file_(certificate_file),
private_key_file_(private_key_file),
ciphers_(ciphers),
certificate_filename_(std::move(certificate_filename)),
verify_path_(std::move(verify_path)),
certificate_file_(std::move(certificate_file)),
private_key_file_(std::move(private_key_file)),
ciphers_(std::move(ciphers)),
ssl_options_(ssl_options),
always_verify_peer_(always_verify_peer) {}

Expand Down
3 changes: 1 addition & 2 deletions boost/network/protocol/http/impl/response.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ struct basic_response<tags::http_server> {
static const char crlf[] = {'\r', '\n'};
std::vector<const_buffer> buffers;
buffers.push_back(to_buffer(status));
for (std::size_t i = 0; i < headers.size(); ++i) {
header_type &h = headers[i];
for (auto & h : headers) {
buffers.push_back(buffer(h.name));
buffers.push_back(buffer(name_value_separator));
buffers.push_back(buffer(h.value));
Expand Down
2 changes: 1 addition & 1 deletion boost/network/protocol/http/policies/pooled_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct pooled_connection_policy : resolver_policy<Tag>::type {
ssl_options)),
resolver_(resolver),
connection_follow_redirect_(follow_redirect),
get_connection_(get_connection),
get_connection_(std::move(get_connection)),
certificate_filename_(certificate_filename),
verify_path_(verify_path),
certificate_file_(certificate_file),
Expand Down
2 changes: 1 addition & 1 deletion boost/network/protocol/http/server/async_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ struct async_connection
headers_buffer.consume(headers_buffer.size());
headers_already_sent = true;
thread_pool().post(callback);
pending_actions_list::iterator start = pending_actions.begin(),
auto start = pending_actions.begin(),
end = pending_actions.end();
while (start != end) {
thread_pool().post(*start++);
Expand Down
2 changes: 1 addition & 1 deletion boost/network/protocol/http/server/sync_connection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct sync_connection
if (done) {
if (request_.method[0] == 'P') {
// look for the content-length header
typename std::vector<typename request_header<Tag>::type>::iterator
auto
it = std::find_if(request_.headers.begin(),
request_.headers.end(), is_content_length());
if (it == request_.headers.end()) {
Expand Down
29 changes: 15 additions & 14 deletions boost/network/protocol/stream_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@
#pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include <cstddef>
#include <boost/asio/detail/throw_error.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio.hpp>
#ifdef BOOST_NETWORK_ENABLE_HTTPS
#include <boost/asio/ssl.hpp>
#endif
#include <boost/asio/detail/push_options.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/basic_socket.hpp>
#include <boost/asio/detail/config.hpp>
#include <boost/asio/detail/config.hpp>
#include <boost/asio/detail/handler_type_requirements.hpp>
#include <boost/asio/detail/push_options.hpp>
#include <boost/asio/detail/throw_error.hpp>
#include <boost/asio/error.hpp>
#include <boost/asio/stream_socket_service.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/make_shared.hpp>
#include <boost/asio/detail/config.hpp>
#include <boost/asio/async_result.hpp>
#include <boost/asio/basic_socket.hpp>
#include <cstddef>

#ifdef BOOST_NETWORK_ENABLE_HTTPS
#include <boost/asio/ssl.hpp>
#endif

namespace boost {
namespace network {
Expand All @@ -43,12 +44,12 @@ typedef boost::asio::ssl::context ssl_context;
struct stream_handler {
public:
stream_handler(boost::shared_ptr<tcp_socket> socket)
: tcp_sock_(socket), ssl_enabled(false) {}
: tcp_sock_(std::move(socket)), ssl_enabled(false) {}

~stream_handler() {}
~stream_handler() = default;

stream_handler(boost::shared_ptr<ssl_socket> socket)
: ssl_sock_(socket), ssl_enabled(true) {}
: ssl_sock_(std::move(socket)), ssl_enabled(true) {}

stream_handler(boost::asio::io_service& io,
boost::shared_ptr<ssl_context> ctx =
Expand Down
4 changes: 2 additions & 2 deletions boost/network/uri/directives/authority.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace uri {

struct authority_directive {

explicit authority_directive(const std::string &authority)
: authority_(authority) {}
explicit authority_directive(std::string authority)
: authority_(std::move(authority)) {}

template <class Uri>
void operator()(Uri &uri) const {
Expand Down
4 changes: 2 additions & 2 deletions boost/network/uri/directives/fragment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace network {
namespace uri {
struct fragment_directive {

explicit fragment_directive(const std::string &fragment)
: fragment_(fragment) {}
explicit fragment_directive(std::string fragment)
: fragment_(std::move(fragment)) {}

template <class Uri>
void operator()(Uri &uri) const {
Expand Down
2 changes: 1 addition & 1 deletion boost/network/uri/directives/host.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace network {
namespace uri {
struct host_directive {

explicit host_directive(const std::string & host) : host_(host) {}
explicit host_directive(std::string host) : host_(std::move(host)) {}

template <class Uri>
void operator()(Uri &uri) const {
Expand Down
4 changes: 2 additions & 2 deletions boost/network/uri/directives/path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace network {
namespace uri {
struct path_directive {

explicit path_directive(const std::string &path) : path_(path) {}
explicit path_directive(std::string path) : path_(std::move(path)) {}

template <class Uri>
void operator()(Uri &uri) const {
Expand All @@ -28,7 +28,7 @@ struct path_directive {

struct encoded_path_directive {

explicit encoded_path_directive(const std::string & path) : path_(path) {}
explicit encoded_path_directive(std::string path) : path_(std::move(path)) {}

void operator()(uri &uri_) const {
std::string encoded_path;
Expand Down
2 changes: 1 addition & 1 deletion boost/network/uri/directives/port.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace network {
namespace uri {
struct port_directive {

explicit port_directive(const std::string &port) : port_(port) {}
explicit port_directive(std::string port) : port_(std::move(port)) {}

explicit port_directive(boost::uint16_t port)
: port_(boost::lexical_cast<std::string>(port)) {}
Expand Down
6 changes: 3 additions & 3 deletions boost/network/uri/directives/query.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace network {
namespace uri {
struct query_directive {

explicit query_directive(const std::string & query) : query_(query) {}
explicit query_directive(std::string query) : query_(std::move(query)) {}

template <class Uri>
void operator()(Uri &uri) const {
Expand All @@ -34,8 +34,8 @@ inline query_directive query(const std::string &query) {

struct query_key_query_directive {

query_key_query_directive(const std::string & key, const std::string & query)
: key_(key), query_(query) {}
query_key_query_directive(std::string key, std::string query)
: key_(std::move(key)), query_(std::move(query)) {}

template <class Uri>
void operator()(Uri &uri) const {
Expand Down
2 changes: 1 addition & 1 deletion boost/network/uri/directives/scheme.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace network {
namespace uri {
struct scheme_directive {

explicit scheme_directive(const std::string &scheme) : scheme(scheme) {}
explicit scheme_directive(std::string scheme) : scheme(std::move(scheme)) {}

template <class Uri>
void operator()(Uri &uri) const {
Expand Down
4 changes: 2 additions & 2 deletions boost/network/uri/directives/user_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace network {
namespace uri {
struct user_info_directive {

explicit user_info_directive(const std::string &user_info)
: user_info_(user_info) {}
explicit user_info_directive(std::string user_info)
: user_info_(std::move(user_info)) {}

template <class Uri>
void operator()(Uri &uri) const {
Expand Down
2 changes: 1 addition & 1 deletion boost/network/uri/uri.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BOOST_URI_DECL uri {
// parse();
//}

uri(const string_type &str) : uri_(str), is_valid_(false) { parse(); }
uri(string_type str) : uri_(std::move(str)), is_valid_(false) { parse(); }

template <class FwdIter>
uri(const FwdIter &first, const FwdIter &last)
Expand Down
4 changes: 2 additions & 2 deletions boost/network/utils/thread_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ struct basic_thread_pool {
io_service_ptr io_service = io_service_ptr(),
worker_threads_ptr worker_threads = worker_threads_ptr())
: threads_(threads),
io_service_(io_service),
worker_threads_(worker_threads),
io_service_(std::move(io_service)),
worker_threads_(std::move(worker_threads)),
sentinel_() {
bool commit = false;
BOOST_SCOPE_EXIT_TPL(
Expand Down
2 changes: 1 addition & 1 deletion libs/mime/test/mime-roundtrip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ test_suite *init_unit_test_suite(int, char **)
#ifdef BOOST_TEST_DYN_LINK
true;
#else
0;
nullptr;
#endif
}

Expand Down
Loading