diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -256,54 +256,54 @@ host_in_relayed_domain_p(char *client) | |||
256 | free(hbuf); | 256 | free(hbuf); |
257 | return rc; | 257 | return rc; |
258 | } | 258 | } |
259 | 259 | ||
260 | 260 | ||
261 | static void | 261 | static void |
262 | set_milter_timeout(void *value) | 262 | set_milter_timeout(union mf_option_value *val) |
263 | { | 263 | { |
264 | time_t to = *(time_t*) value; | 264 | if (smfi_settimeout(val->ov_time) == MI_FAILURE) { |
265 | free(value); | 265 | mu_error(_("invalid milter timeout: %lu"), |
266 | if (smfi_settimeout(to) == MI_FAILURE) { | 266 | (unsigned long)val->ov_time); |
267 | mu_error(_("invalid milter timeout: %lu"), (unsigned long) to); | ||
268 | exit(EX_USAGE); | 267 | exit(EX_USAGE); |
269 | } | 268 | } |
270 | } | 269 | } |
271 | 270 | ||
272 | static int | 271 | static int |
273 | load_relay_file(void *item, void *data) | 272 | load_relay_file(void *item, void *data) |
274 | { | 273 | { |
275 | read_domain_file(item); | 274 | read_domain_file(item); |
276 | return 0; | 275 | return 0; |
277 | } | 276 | } |
278 | 277 | ||
279 | static void | 278 | static void |
280 | set_relay(void *value) | 279 | set_relay(union mf_option_value *val) |
281 | { | 280 | { |
282 | mu_list_foreach(value, load_relay_file, NULL); | 281 | mu_list_foreach(val->ov_list, load_relay_file, NULL); |
282 | mu_list_destroy(&val->ov_list); | ||
283 | } | 283 | } |
284 | 284 | ||
285 | void | 285 | void |
286 | set_stack_trace(void *value) | 286 | set_stack_trace(union mf_option_value *val) |
287 | { | 287 | { |
288 | stack_trace_option = (int) value; | 288 | stack_trace_option = val->ov_bool; |
289 | } | 289 | } |
290 | 290 | ||
291 | static int | 291 | static int |
292 | option_relay(char *opt, void **pval, char *newval) | 292 | option_relay(char const *opt, union mf_option_value *val, char const *newval) |
293 | { | 293 | { |
294 | if (!*pval) | 294 | if (!val->ov_list) |
295 | mu_list_create((mu_list_t*)pval); | 295 | mu_list_create(&val->ov_list); |
296 | mu_list_append(*pval, strdup(newval)); | 296 | mu_list_append(val->ov_list, strdup(newval)); |
297 | return 0; | 297 | return 0; |
298 | } | 298 | } |
299 | 299 | ||
300 | struct mf_option_cache option_cache[] = { | 300 | struct mf_option_cache option_cache[] = { |
301 | { "stack-trace", NULL, mf_option_boolean, set_stack_trace }, | 301 | { "stack-trace", mf_option_boolean, set_stack_trace }, |
302 | { "milter-timeout", NULL, mf_option_time, set_milter_timeout }, | 302 | { "milter-timeout", mf_option_timeout, set_milter_timeout }, |
303 | { "relay", NULL, option_relay, set_relay }, | 303 | { "relay", option_relay, set_relay }, |
304 | { NULL } | 304 | { NULL } |
305 | }; | 305 | }; |
306 | 306 | ||
307 | 307 | ||
308 | /* Command line parsing */ | 308 | /* Command line parsing */ |
309 | 309 | ||