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

Comparing gvpe/src/sockinfo.C (file contents):
Revision 1.13 by pcg, Tue Mar 1 06:27:20 2005 UTC vs.
Revision 1.14 by pcg, Thu Mar 3 07:24:57 2005 UTC

59} 59}
60 60
61void 61void
62sockinfo::set (const conf_node *conf, u8 prot_) 62sockinfo::set (const conf_node *conf, u8 prot_)
63{ 63{
64 set (prot_ == PROT_DNSv4 ? ::conf.dns_forw_host 64 if (prot_ == PROT_DNSv4)
65 : conf->hostname, 65 set (conf->dns_hostname, conf->dns_hostname ? conf->dns_port : 0, prot_);
66 else
67 set (conf->hostname,
66 prot_ == PROT_UDPv4 ? conf->udp_port 68 prot_ == PROT_UDPv4 ? conf->udp_port
67 : prot_ == PROT_TCPv4 ? conf->tcp_port 69 : prot_ == PROT_TCPv4 ? conf->tcp_port
68 : prot_ == PROT_DNSv4 ? conf->dns_port 70 : prot_ == PROT_DNSv4 ? conf->dns_port
69 : 0, 71 : 0,
70 prot_); 72 prot_);
71} 73}
72 74
73const sockaddr * 75const sockaddr *
74sockinfo::sav4() const 76sockinfo::sav4() const
75{ 77{
166 prot = prot_; 168 prot = prot_;
167 port = htons (conf->tcp_port); 169 port = htons (conf->tcp_port);
168 return true; 170 return true;
169 } 171 }
170 172
173#if ENABLE_DNS
171 if (conf 174 if (conf
172 && prot_ & PROT_DNSv4 175 && prot_ & PROT_DNSv4
173 && conf->protocols & PROT_DNSv4 176 && conf->protocols & PROT_DNSv4
174 && conf->dns_port) 177 && conf->dns_port)
175 { 178 {
176 set (::conf.dns_forw_host, ::conf.dns_forw_port, prot_); 179 set (::conf.dns_forw_host, ::conf.dns_forw_port, prot_);
177 return true; 180 return true;
178 } 181 }
182#endif
179 } 183 }
180 184
181 return false; 185 return false;
182} 186}
183 187

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines