From b3c8e1b37d874d06d60edd0427505e74f8ae189b Mon Sep 17 00:00:00 2001
From: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
Date: Mon, 14 Mar 2016 17:49:18 -0400
Subject: [PATCH] tls: always accept send request from application

Even if the session is closed (shutdown) accept messages
as they will be cancel anyway when the thread stops.
This permits a good behavior of application level, like pjsip.

Change-Id: I324e00d0b607a24e5cbf82c9466f65fa8f6ae4cb
Tuleap: #466
---
 src/security/tls_session.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/security/tls_session.cpp b/src/security/tls_session.cpp
index 742c042ef8..0c53b45cbc 100644
--- a/src/security/tls_session.cpp
+++ b/src/security/tls_session.cpp
@@ -292,8 +292,6 @@ TlsSession::getCurrentCipherSuiteId(std::array<uint8_t, 2>& cs_id) const
 ssize_t
 TlsSession::async_send(void* data, std::size_t size, TxDataCompleteFunc on_send_complete)
 {
-    if (state_ == TlsSessionState::SHUTDOWN)
-        return GNUTLS_E_INVALID_SESSION;
     std::lock_guard<std::mutex> lk {ioMutex_};
     txQueue_.emplace_back(TxData {data, size, on_send_complete});
     ioCv_.notify_one();
-- 
GitLab