aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/asio
diff options
context:
space:
mode:
authorHannes Rantzsch <[email protected]>2019-02-27 15:34:46 +0100
committerHannes Rantzsch <[email protected]>2019-04-16 10:48:06 +0200
commit4f419f83f208555a1ffbbacf32e7550725e63005 (patch)
tree9e4545d8c5d9d3bd2e4958732308aa781e716b71 /src/lib/tls/asio
parent6fbe96914279f6d84faa43672bc263a28b1fdb2a (diff)
review: minor changes
Diffstat (limited to 'src/lib/tls/asio')
-rw-r--r--src/lib/tls/asio/asio_stream.h5
-rw-r--r--src/lib/tls/asio/asio_stream_core.h7
2 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/tls/asio/asio_stream.h b/src/lib/tls/asio/asio_stream.h
index 8a28fc68e..ab4d39d05 100644
--- a/src/lib/tls/asio/asio_stream.h
+++ b/src/lib/tls/asio/asio_stream.h
@@ -38,7 +38,7 @@ namespace TLS {
* boost::asio compatible SSL/TLS stream based on TLS::Client or TLS::Server.
*/
template <class StreamLayer, class Channel>
-class Stream final : public StreamBase<Channel>
+class Stream : public StreamBase<Channel>
{
public:
using next_layer_type = typename std::remove_reference<StreamLayer>::type;
@@ -50,7 +50,7 @@ class Stream final : public StreamBase<Channel>
public:
template <typename... Args>
- Stream(StreamLayer&& nextLayer, Args&& ... args)
+ explicit Stream(StreamLayer&& nextLayer, Args&& ... args)
: StreamBase<Channel>(std::forward<Args>(args)...),
m_nextLayer(std::forward<StreamLayer>(nextLayer)) {}
@@ -444,7 +444,6 @@ class Stream final : public StreamBase<Channel>
return writtenBytes;
}
- protected:
StreamLayer m_nextLayer;
};
diff --git a/src/lib/tls/asio/asio_stream_core.h b/src/lib/tls/asio/asio_stream_core.h
index cfe44731d..f062db53c 100644
--- a/src/lib/tls/asio/asio_stream_core.h
+++ b/src/lib/tls/asio/asio_stream_core.h
@@ -40,10 +40,9 @@ struct StreamCore : public Botan::TLS::Callbacks
void tls_emit_data(const uint8_t data[], size_t size) override
{
- auto buffer = m_send_buffer.dynamicBuffer.prepare(size);
- auto copySize =
- boost::asio::buffer_copy(buffer, boost::asio::const_buffer(data, size));
- m_send_buffer.dynamicBuffer.commit(copySize);
+ m_send_buffer.dynamicBuffer.commit(boost::asio::buffer_copy(
+ m_send_buffer.dynamicBuffer.prepare(size),
+ boost::asio::buffer(data, size)));
}
void tls_record_received(uint64_t, const uint8_t data[],