summaryrefslogtreecommitdiff
path: root/netcore.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 /netcore.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--netcore.cpp21
1 files changed, 19 insertions, 2 deletions
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();
+ }
}
}