aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_channel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tls/tls_channel.cpp')
-rw-r--r--src/tls/tls_channel.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/tls/tls_channel.cpp b/src/tls/tls_channel.cpp
index 28cc8a0a4..d0f5ab1e2 100644
--- a/src/tls/tls_channel.cpp
+++ b/src/tls/tls_channel.cpp
@@ -173,19 +173,10 @@ void TLS_Channel::read_handshake(byte rec_type,
void TLS_Channel::queue_for_sending(const byte buf[], size_t buf_size)
{
- if(handshake_completed)
- {
- while(!pre_handshake_write_queue.end_of_data())
- {
- SecureVector<byte> q_buf(1024);
- const size_t got = pre_handshake_write_queue.read(&q_buf[0], q_buf.size());
- writer.send(APPLICATION_DATA, &q_buf[0], got);
- }
+ if(!handshake_completed)
+ throw std::invalid_state("Application data cannot be queued before handshake");
- writer.send(APPLICATION_DATA, buf, buf_size);
- }
- else
- pre_handshake_write_queue.write(buf, buf_size);
+ writer.send(APPLICATION_DATA, buf, buf_size);
}
void TLS_Channel::alert(Alert_Level alert_level, Alert_Type alert_code)