~singpolyma/biboumi

296a16fa75da5900395a7cf70f63a6ff266ef0cc — Florent Le Coz 7 years ago 0620c8e
Do not segfault when trying to send TLS data over a not-yet connected socket
1 files changed, 3 insertions(+), 1 deletions(-)

M louloulibs/network/tcp_socket_handler.cpp
M louloulibs/network/tcp_socket_handler.cpp => louloulibs/network/tcp_socket_handler.cpp +3 -1
@@ 410,7 410,9 @@ void TCPSocketHandler::tls_recv()

void TCPSocketHandler::tls_send(std::string&& data)
{
  if (this->tls->is_active())
  // We may not be connected yet, or the tls session has
  // not yet been negociated
  if (this->tls && this->tls->is_active())
    {
      const bool was_active = this->tls->is_active();
      if (!this->pre_buf.empty())