diff options
author | Treeki <treeki@gmail.com> | 2014-01-23 23:42:54 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2014-01-23 23:42:54 +0100 |
commit | f923cd4beaf1c97f5873a9549b216c67520a8cca (patch) | |
tree | cacc1560bab125b3c849560d0d03c3c5b099e869 /client.cpp | |
parent | 57f49f495d799a435b95d72021c004752628994b (diff) | |
download | bounce4-f923cd4beaf1c97f5873a9549b216c67520a8cca.tar.gz bounce4-f923cd4beaf1c97f5873a9549b216c67520a8cca.zip |
add build_static.sh, make gnutls usage a define
Diffstat (limited to '')
-rw-r--r-- | client.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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! |