summaryrefslogtreecommitdiff
path: root/client.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2014-01-23 23:42:54 +0100
committerTreeki <treeki@gmail.com>2014-01-23 23:42:54 +0100
commitf923cd4beaf1c97f5873a9549b216c67520a8cca (patch)
treecacc1560bab125b3c849560d0d03c3c5b099e869 /client.cpp
parent57f49f495d799a435b95d72021c004752628994b (diff)
downloadbounce4-f923cd4beaf1c97f5873a9549b216c67520a8cca.tar.gz
bounce4-f923cd4beaf1c97f5873a9549b216c67520a8cca.zip
add build_static.sh, make gnutls usage a define
Diffstat (limited to '')
-rw-r--r--client.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/client.cpp b/client.cpp
index 9cbb889..4fa0a12 100644
--- a/client.cpp
+++ b/client.cpp
@@ -39,6 +39,7 @@ void Client::startService(int _sock, bool withTls) {
return;
}
+#ifdef USE_GNUTLS
if (withTls) {
int initRet = gnutls_init(&tls, GNUTLS_SERVER);
if (initRet != GNUTLS_E_SUCCESS) {
@@ -75,7 +76,9 @@ void Client::startService(int _sock, bool withTls) {
state = CS_TLS_HANDSHAKE;
printf("[fd=%d] preparing for TLS handshake\n", sock);
- } else {
+ } else
+#endif
+ {
state = CS_CONNECTED;
}
}
@@ -260,14 +263,19 @@ void Client::resumeSession(Client *other, int lastReceivedByClient) {
outputBuf.append(other->outputBuf.data(), other->outputBuf.size());
sock = other->sock;
+ state = other->state;
+#ifdef USE_GNUTLS
tls = other->tls;
tlsActive = other->tlsActive;
- state = other->state;
+#endif
other->sock = -1;
+ other->state = CS_DISCONNECTED;
+#ifdef USE_GNUTLS
other->tls = 0;
other->tlsActive = false;
- other->state = CS_DISCONNECTED;
+#endif
+
other->close();
// Now send them everything we've got!