aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_handshake_io.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-09-04 20:43:35 +0000
committerlloyd <[email protected]>2012-09-04 20:43:35 +0000
commite2d844d3dbea46a54a86a03126772956b715b9c9 (patch)
tree59c48e5346f506996733eae28d275ce02ff53de3 /src/tls/tls_handshake_io.cpp
parent7f888f4bbcf8d11ff5916b1056ab181962da5b90 (diff)
Use a std::function so handshake_io only has access Record_Writer's
send function.
Diffstat (limited to 'src/tls/tls_handshake_io.cpp')
-rw-r--r--src/tls/tls_handshake_io.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/tls/tls_handshake_io.cpp b/src/tls/tls_handshake_io.cpp
index cc2e4f7d1..b1f6a0eb5 100644
--- a/src/tls/tls_handshake_io.cpp
+++ b/src/tls/tls_handshake_io.cpp
@@ -106,12 +106,12 @@ std::vector<byte> Stream_Handshake_IO::send(const Handshake_Message& msg)
if(msg.type() == HANDSHAKE_CCS)
{
- m_writer.send(CHANGE_CIPHER_SPEC, msg_bits);
+ m_writer(CHANGE_CIPHER_SPEC, msg_bits);
return std::vector<byte>(); // not included in handshake hashes
}
const std::vector<byte> buf = format(msg_bits, msg.type());
- m_writer.send(HANDSHAKE, buf);
+ m_writer(HANDSHAKE, buf);
return buf;
}
@@ -323,7 +323,7 @@ Datagram_Handshake_IO::send(const Handshake_Message& msg)
if(msg.type() == HANDSHAKE_CCS)
{
- m_writer.send(CHANGE_CIPHER_SPEC, msg_bits);
+ m_writer(CHANGE_CIPHER_SPEC, msg_bits);
return std::vector<byte>(); // not included in handshake hashes
}
@@ -333,7 +333,7 @@ Datagram_Handshake_IO::send(const Handshake_Message& msg)
m_mtu = 64;
if(no_fragment.size() + DTLS_HEADER_SIZE <= m_mtu)
- m_writer.send(HANDSHAKE, no_fragment);
+ m_writer(HANDSHAKE, no_fragment);
else
{
const size_t parts = split_for_mtu(m_mtu, msg_bits.size());
@@ -348,13 +348,13 @@ Datagram_Handshake_IO::send(const Handshake_Message& msg)
std::min<size_t>(msg_bits.size() - frag_offset,
parts_size);
- m_writer.send(HANDSHAKE,
- format_fragment(&msg_bits[frag_offset],
- frag_len,
- frag_offset,
- msg_bits.size(),
- msg.type(),
- m_out_message_seq));
+ m_writer(HANDSHAKE,
+ format_fragment(&msg_bits[frag_offset],
+ frag_len,
+ frag_offset,
+ msg_bits.size(),
+ msg.type(),
+ m_out_message_seq));
frag_offset += frag_len;
}