diff options
author | lloyd <[email protected]> | 2011-12-28 13:37:21 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-12-28 13:37:21 +0000 |
commit | 9ef53bc0f5d3d503633e8c8335a14c39a149b184 (patch) | |
tree | f07853919dd25480814622e8fcff366ed61b351e /src | |
parent | 83ebcf2351b6cf9c8320bbe6fe87e307e40577dc (diff) |
We wouldn't send an alert before handshaking was complete because
active == false, which made debugging hard and caused timeouts/hangs
in clients if (for instance) a ciphersuite couldn't be
negotiated. Always send alerts.
Diffstat (limited to 'src')
-rw-r--r-- | src/tls/tls_channel.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/tls/tls_channel.cpp b/src/tls/tls_channel.cpp index 8aa52a307..399568a44 100644 --- a/src/tls/tls_channel.cpp +++ b/src/tls/tls_channel.cpp @@ -169,15 +169,12 @@ void TLS_Channel::queue_for_sending(const byte buf[], size_t buf_size) void TLS_Channel::alert(Alert_Level level, Alert_Type alert_code) { - if(active && alert_code != NO_ALERT_TYPE) + try { - try - { - writer.alert(level, alert_code); - writer.flush(); - } - catch(...) { /* swallow it */ } + writer.alert(level, alert_code); + writer.flush(); } + catch(...) { /* swallow it */ } if(active && level == FATAL) { |