ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/vpn_tcp.C
(Generate patch)

Comparing gvpe/src/vpn_tcp.C (file contents):
Revision 1.19 by pcg, Tue Nov 13 02:12:08 2007 UTC vs.
Revision 1.20 by pcg, Sat Dec 1 23:35:31 2007 UTC

104 ~tcp_connection (); 104 ~tcp_connection ();
105}; 105};
106 106
107void tcp_si_map::cleaner_cb (ev::timer &w, int revents) 107void tcp_si_map::cleaner_cb (ev::timer &w, int revents)
108{ 108{
109 tstamp to = ev::ev_now () - ::conf.keepalive - 30 - 60; 109 tstamp to = ev_now () - ::conf.keepalive - 30 - 60;
110 110
111 for (iterator i = begin (); i != end(); ) 111 for (iterator i = begin (); i != end(); )
112 if (i->second->last_activity >= to) 112 if (i->second->last_activity >= to)
113 ++i; 113 ++i;
114 else 114 else
201} 201}
202 202
203void 203void
204tcp_connection::tcpv4_ev (ev::io &w, int revents) 204tcp_connection::tcpv4_ev (ev::io &w, int revents)
205{ 205{
206 last_activity = ev::ev_now (); 206 last_activity = ev_now ();
207 207
208 if (revents & EV_WRITE) 208 if (revents & EV_WRITE)
209 { 209 {
210 if (state == CONNECTING) 210 if (state == CONNECTING)
211 { 211 {
346} 346}
347 347
348bool 348bool
349tcp_connection::send_packet (vpn_packet *pkt, int tos) 349tcp_connection::send_packet (vpn_packet *pkt, int tos)
350{ 350{
351 last_activity = ev::ev_now (); 351 last_activity = ev_now ();
352 352
353 if (state == IDLE) 353 if (state == IDLE)
354 { 354 {
355 // woaw, the first lost packet ;) 355 // woaw, the first lost packet ;)
356 fd = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); 356 fd = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
453} 453}
454 454
455tcp_connection::tcp_connection (int fd_, const sockinfo &si_, vpn &v_) 455tcp_connection::tcp_connection (int fd_, const sockinfo &si_, vpn &v_)
456: v(v_), si(si_), ev::io(this, &tcp_connection::tcpv4_ev) 456: v(v_), si(si_), ev::io(this, &tcp_connection::tcpv4_ev)
457{ 457{
458 last_activity = ev::ev_now (); 458 last_activity = ev_now ();
459 r_pkt = 0; 459 r_pkt = 0;
460 w_pkt = 0; 460 w_pkt = 0;
461 fd = fd_; 461 fd = fd_;
462#if ENABLE_HTTP_PROXY 462#if ENABLE_HTTP_PROXY
463 proxy_req = 0; 463 proxy_req = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines