From f923cd4beaf1c97f5873a9549b216c67520a8cca Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 23 Jan 2014 23:42:54 +0100 Subject: add build_static.sh, make gnutls usage a define --- netcore.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'netcore.cpp') diff --git a/netcore.cpp b/netcore.cpp index 7082f9b..dee6ef7 100644 --- a/netcore.cpp +++ b/netcore.cpp @@ -93,8 +93,10 @@ int NetCore::execute() { time_t now = time(NULL); for (int i = 0; i < clientCount; i++) { +#ifdef USE_GNUTLS if (clients[i]->state == Client::CS_TLS_HANDSHAKE) clients[i]->tryTLSHandshake(); +#endif if (clients[i]->sock != -1) { if (clients[i]->sock > maxFD) @@ -134,10 +136,12 @@ int NetCore::execute() { for (int i = 0; i < serverCount; i++) { if (servers[i]->state == Server::CS_WAITING_DNS) servers[i]->tryConnectPhase(); +#ifdef USE_GNUTLS else if (servers[i]->state == Server::CS_TLS_HANDSHAKE) { if (servers[i]->tryTLSHandshake()) servers[i]->connectedEvent(); } +#endif if (servers[i]->sock != -1) { if (servers[i]->sock > maxFD) @@ -163,8 +167,15 @@ int NetCore::execute() { if (clients[i]->sock != -1) { if (FD_ISSET(clients[i]->sock, &writeSet)) clients[i]->writeAction(); - if (FD_ISSET(clients[i]->sock, &readSet) || clients[i]->hasTlsPendingData()) + + if (FD_ISSET(clients[i]->sock, &readSet) +#ifdef USE_GNUTLS + || clients[i]->hasTlsPendingData() +#endif + ) + { clients[i]->readAction(); + } } } @@ -203,8 +214,14 @@ int NetCore::execute() { } - if (FD_ISSET(servers[i]->sock, &readSet) || servers[i]->hasTlsPendingData()) + if (FD_ISSET(servers[i]->sock, &readSet) +#ifdef USE_GNUTLS + || servers[i]->hasTlsPendingData() +#endif + ) + { servers[i]->readAction(); + } } } -- cgit v1.2.3