From 8a8264bc39b97bcce07933c0a5c3158208efcd6c Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Thu, 24 Sep 2015 17:33:25 -0400 Subject: Fixed their_fd closure bug --- netcon/NetconService.hpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'netcon/NetconService.hpp') diff --git a/netcon/NetconService.hpp b/netcon/NetconService.hpp index 451d10cb..5ff575dc 100644 --- a/netcon/NetconService.hpp +++ b/netcon/NetconService.hpp @@ -66,6 +66,7 @@ namespace ZeroTier { class NetconConnection { public: + int perceived_fd; int their_fd; unsigned char buf[DEFAULT_READ_BUFFER_SIZE]; int idx; @@ -113,7 +114,7 @@ namespace ZeroTier { NetconConnection *getConnectionByTheirFD(int fd) { for(size_t i=0; itheir_fd == fd) return connections[i]; + if(connections[i]->perceived_fd == fd) return connections[i]; } return NULL; } @@ -134,14 +135,6 @@ namespace ZeroTier { } return NULL; } - - void removeConnection(PhySocket *sock) - { - for(size_t i=0; isock == sock) - connections.erase(connections.begin() + i); - } - } }; } // namespace ZeroTier -- cgit v1.2.3