diff options
-rw-r--r-- | toxcore/TCP_server.c | 7 | ||||
-rw-r--r-- | toxcore/TCP_server.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c index fdab4870..2dcd6f50 100644 --- a/toxcore/TCP_server.c +++ b/toxcore/TCP_server.c | |||
@@ -1031,6 +1031,13 @@ static void do_TCP_unconfirmed(TCP_Server *TCP_server) | |||
1031 | 1031 | ||
1032 | static void do_TCP_confirmed(TCP_Server *TCP_server) | 1032 | static void do_TCP_confirmed(TCP_Server *TCP_server) |
1033 | { | 1033 | { |
1034 | #ifdef TCP_SERVER_USE_EPOLL | ||
1035 | |||
1036 | if (TCP_server->last_run_pinged == unix_time()) | ||
1037 | return; | ||
1038 | |||
1039 | TCP_server->last_run_pinged = unix_time(); | ||
1040 | #endif | ||
1034 | uint32_t i; | 1041 | uint32_t i; |
1035 | 1042 | ||
1036 | for (i = 0; i < TCP_server->size_accepted_connections; ++i) { | 1043 | for (i = 0; i < TCP_server->size_accepted_connections; ++i) { |
diff --git a/toxcore/TCP_server.h b/toxcore/TCP_server.h index e2856726..1573d212 100644 --- a/toxcore/TCP_server.h +++ b/toxcore/TCP_server.h | |||
@@ -110,6 +110,7 @@ typedef struct { | |||
110 | 110 | ||
111 | #ifdef TCP_SERVER_USE_EPOLL | 111 | #ifdef TCP_SERVER_USE_EPOLL |
112 | int efd; | 112 | int efd; |
113 | uint64_t last_run_pinged; | ||
113 | #endif | 114 | #endif |
114 | sock_t *socks_listening; | 115 | sock_t *socks_listening; |
115 | unsigned int num_listening_socks; | 116 | unsigned int num_listening_socks; |