--- gvpe/src/vpn_tcp.C 2004/01/17 01:18:36 1.11 +++ gvpe/src/vpn_tcp.C 2005/03/23 20:07:56 1.13 @@ -1,8 +1,10 @@ /* vpn_tcp.C -- handle the tcp part of the protocol. - Copyright (C) 2003-2004 Marc Lehmann + Copyright (C) 2003-2005 Marc Lehmann - This program is free software; you can redistribute it and/or modify + This file is part of GVPE. + + GVPE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -13,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software + along with gvpe; if not, write to the Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -61,10 +63,9 @@ void cleaner_cb (time_watcher &w); time_watcher cleaner; tcp_si_map () - : cleaner(this, &tcp_si_map::cleaner_cb) - { - cleaner.start (0); - } + : cleaner(this, &tcp_si_map::cleaner_cb) + { } + } tcp_si; struct tcp_connection : io_watcher { @@ -93,9 +94,9 @@ void error (); // abort conenction && cleanup operator tcp_si_map::value_type() - { - return tcp_si_map::value_type (&si, this); - } + { + return tcp_si_map::value_type (&si, this); + } tcp_connection (int fd_, const sockinfo &si_, vpn &v_); ~tcp_connection (); @@ -448,6 +449,9 @@ tcp_connection::tcp_connection (int fd_, const sockinfo &si_, vpn &v_) : v(v_), si(si_), io_watcher(this, &tcp_connection::tcpv4_ev) { + if (!tcp_si.cleaner.active) + tcp_si.cleaner.start (0); + last_activity = NOW; r_pkt = 0; w_pkt = 0;