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

Comparing gvpe/src/conf.C (file contents):
Revision 1.36 by pcg, Sun Mar 20 02:34:16 2005 UTC vs.
Revision 1.38 by pcg, Wed Mar 23 17:03:58 2005 UTC

121 default_node.protocols = 0; 121 default_node.protocols = 0;
122 default_node.max_retry = DEFAULT_MAX_RETRY; 122 default_node.max_retry = DEFAULT_MAX_RETRY;
123 123
124#if ENABLE_DNS 124#if ENABLE_DNS
125 default_node.dns_port = 0; // default is 0 == client 125 default_node.dns_port = 0; // default is 0 == client
126
126 dns_forw_host = strdup ("127.0.0.1"); 127 dns_forw_host = strdup ("127.0.0.1");
127 dns_forw_port = 53; 128 dns_forw_port = 53;
129 dns_timeout_factor = DEFAULT_DNS_TIMEOUT_FACTOR;
130 dns_send_interval = DEFAULT_DNS_SEND_INTERVAL;
131 dns_overlap_factor = DEFAULT_DNS_OVERLAP_FACTOR;
132 dns_max_outstanding = DEFAULT_DNS_MAX_OUTSTANDING;
128#endif 133#endif
129 134
130 conf.pidfilename = strdup (LOCALSTATEDIR "/run/gvpe.pid"); 135 conf.pidfilename = strdup (LOCALSTATEDIR "/run/gvpe.pid");
131} 136}
132 137
158 163
159 cleanup (); 164 cleanup ();
160 init (); 165 init ();
161} 166}
162 167
163#define parse_bool(target,name,trueval,falseval) \ 168#define parse_bool(target,name,trueval,falseval) do { \
164 if (!strcmp (val, "yes")) target = trueval; \ 169 if (!strcmp (val, "yes")) target = trueval; \
165 else if (!strcmp (val, "no")) target = falseval; \ 170 else if (!strcmp (val, "no")) target = falseval; \
166 else if (!strcmp (val, "true")) target = trueval; \ 171 else if (!strcmp (val, "true")) target = trueval; \
167 else if (!strcmp (val, "false")) target = falseval; \ 172 else if (!strcmp (val, "false")) target = falseval; \
168 else if (!strcmp (val, "on")) target = trueval; \ 173 else if (!strcmp (val, "on")) target = trueval; \
169 else if (!strcmp (val, "off")) target = falseval; \ 174 else if (!strcmp (val, "off")) target = falseval; \
170 else \ 175 else \
171 slog (L_WARN, \ 176 slog (L_WARN, \
172 _("illegal value for '%s', only 'yes|true|on' or 'no|false|off' allowed, at '%s' line %d"), \ 177 _("illegal value for '%s', only 'yes|true|on' or 'no|false|off' allowed, at '%s' line %d"), \
173 name, var, fname, lineno); 178 name, var, fname, lineno); \
179} while (0)
174 180
175void configuration::read_config (bool need_keys) 181void configuration::read_config (bool need_keys)
176{ 182{
177 char *fname; 183 char *fname;
178 FILE *f; 184 FILE *f;
330 { 336 {
331#if ENABLE_DNS 337#if ENABLE_DNS
332 dns_forw_port = atoi (val); 338 dns_forw_port = atoi (val);
333#endif 339#endif
334 } 340 }
341 else if (!strcmp (var, "dns-timeout-factor"))
342 {
343#if ENABLE_DNS
344 dns_timeout_factor = atof (val);
345#endif
346 }
347 else if (!strcmp (var, "dns-send-interval"))
348 {
349#if ENABLE_DNS
350 dns_send_interval = atoi (val);
351#endif
352 }
353 else if (!strcmp (var, "dns-overlap-factor"))
354 {
355#if ENABLE_DNS
356 dns_overlap_factor = atof (val);
357#endif
358 }
359 else if (!strcmp (var, "dns-max-outstanding"))
360 {
361#if ENABLE_DNS
362 dns_max_outstanding = atoi (val);
363#endif
364 }
335 else if (!strcmp (var, "http-proxy-host")) 365 else if (!strcmp (var, "http-proxy-host"))
336 { 366 {
337#if ENABLE_HTTP_PROXY 367#if ENABLE_HTTP_PROXY
338 free (proxy_host), proxy_host = strdup (val); 368 free (proxy_host), proxy_host = strdup (val);
339#endif 369#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines