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

Comparing gvpe/src/connection.C (file contents):
Revision 1.36 by pcg, Sun May 30 17:36:00 2004 UTC vs.
Revision 1.39 by pcg, Tue Oct 12 12:06:06 2004 UTC

744 && connectmode != conf_node::C_DISABLED 744 && connectmode != conf_node::C_DISABLED
745 && NOW > w.at) 745 && NOW > w.at)
746 { 746 {
747 double retry_int = double (retry_cnt & 3 ? (retry_cnt & 3) : 1 << (retry_cnt >> 2)) * 0.6; 747 double retry_int = double (retry_cnt & 3 ? (retry_cnt & 3) : 1 << (retry_cnt >> 2)) * 0.6;
748 748
749 if (retry_int < 3600 * 8) 749 if (retry_int < conf->max_retry)
750 retry_cnt++; 750 retry_cnt++;
751 else
752 retry_int = conf->max_retry;
751 753
752 w.start (NOW + retry_int); 754 w.start (NOW + retry_int);
753 755
754 reset_si (); 756 reset_si ();
755 757
783 } 785 }
784 786
785 delete ictx; ictx = 0; 787 delete ictx; ictx = 0;
786 delete octx; octx = 0; 788 delete octx; octx = 0;
787 789
788 si.host= 0; 790 si.host = 0;
789 791
790 last_activity = 0; 792 last_activity = 0;
791 retry_cnt = 0; 793 retry_cnt = 0;
792 794
793 rekey.stop (); 795 rekey.stop ();
1096 break; 1098 break;
1097 1099
1098 case vpn_packet::PT_CONNECT_INFO: 1100 case vpn_packet::PT_CONNECT_INFO:
1099 if (ictx && octx && rsi == si && pkt->hmac_chk (ictx)) 1101 if (ictx && octx && rsi == si && pkt->hmac_chk (ictx))
1100 { 1102 {
1101 connect_info_packet *p = (connect_info_packet *) pkt; 1103 connect_info_packet *p = (connect_info_packet *)pkt;
1102 1104
1103 assert (p->id > 0 && p->id <= vpn->conns.size ()); // hmac-auth does not mean we accept anything 1105 if (p->id > 0 && p->id <= vpn->conns.size ()) // hmac-auth does not mean we accept anything
1104 1106 {
1105 connection *c = vpn->conns[p->id - 1]; 1107 connection *c = vpn->conns[p->id - 1];
1106 1108
1107 c->conf->protocols = p->protocols; 1109 c->conf->protocols = p->protocols;
1108 protocol = best_protocol (c->conf->protocols & THISNODE->protocols & p->si.supported_protocols (c->conf)); 1110 protocol = best_protocol (c->conf->protocols & THISNODE->protocols & p->si.supported_protocols (c->conf));
1109 p->si.upgrade_protocol (protocol, c->conf); 1111 p->si.upgrade_protocol (protocol, c->conf);
1110 1112
1111 slog (L_TRACE, "<<%d PT_CONNECT_INFO(%d,%s) (%d)", 1113 slog (L_TRACE, "<<%d PT_CONNECT_INFO(%d,%s) (%d)",
1112 conf->id, p->id, (const char *)p->si, !c->ictx && !c->octx); 1114 conf->id, p->id, (const char *)p->si, !c->ictx && !c->octx);
1113 1115
1114 const sockinfo &dsi = forward_si (p->si); 1116 const sockinfo &dsi = forward_si (p->si);
1115 1117
1116 if (dsi.valid ()) 1118 if (dsi.valid ())
1117 c->send_auth_request (dsi, true); 1119 c->send_auth_request (dsi, true);
1120 }
1118 } 1121 }
1119 1122
1120 break; 1123 break;
1121 1124
1122 default: 1125 default:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines