summaryrefslogtreecommitdiff
path: root/socketcommon.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2014-01-21 01:01:43 +0100
committerTreeki <treeki@gmail.com>2014-01-21 01:01:43 +0100
commit26ad55851febe624145ac807dbf59376ba669eaf (patch)
tree4746daf7d106a18f17f9d96966800b04b6d148bc /socketcommon.cpp
parent8b32f42df825a03284f5c340499394b93dc1a65d (diff)
downloadbounce4-26ad55851febe624145ac807dbf59376ba669eaf.tar.gz
bounce4-26ad55851febe624145ac807dbf59376ba669eaf.zip
refactoring: add event handling functions to the Server/IRCServer interface
Diffstat (limited to '')
-rw-r--r--socketcommon.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/socketcommon.cpp b/socketcommon.cpp
index b419c93..e98b837 100644
--- a/socketcommon.cpp
+++ b/socketcommon.cpp
@@ -32,13 +32,13 @@ bool SocketRWCommon::hasTlsPendingData() const {
return false;
}
-void SocketRWCommon::tryTLSHandshake() {
+bool SocketRWCommon::tryTLSHandshake() {
int hsRet = gnutls_handshake(tls);
if (gnutls_error_is_fatal(hsRet)) {
printf("[SocketRWCommon::tryTLSHandshake] gnutls_handshake borked\n");
gnutls_perror(hsRet);
close();
- return;
+ return false;
}
if (hsRet == GNUTLS_E_SUCCESS) {
@@ -49,7 +49,10 @@ void SocketRWCommon::tryTLSHandshake() {
outputBuf.clear();
printf("[SocketRWCommon connected via SSL!]\n");
+ return true;
}
+
+ return false;
}
void SocketRWCommon::close() {