iter_utils.c (249140) | iter_utils.c (249141) |
---|---|
1/* 2 * iterator/iter_utils.c - iterative resolver module utility functions. 3 * 4 * Copyright (c) 2007, NLnet Labs. All rights reserved. 5 * 6 * This software is open source. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 404 unchanged lines hidden (view full) --- 413 if(!(m->qinfo.qname = regional_alloc_init(region, from->qinfo.qname, 414 from->qinfo.qname_len))) 415 return NULL; 416 if(!(m->rep = reply_info_copy(from->rep, NULL, region))) 417 return NULL; 418 return m; 419} 420 | 1/* 2 * iterator/iter_utils.c - iterative resolver module utility functions. 3 * 4 * Copyright (c) 2007, NLnet Labs. All rights reserved. 5 * 6 * This software is open source. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 404 unchanged lines hidden (view full) --- 413 if(!(m->qinfo.qname = regional_alloc_init(region, from->qinfo.qname, 414 from->qinfo.qname_len))) 415 return NULL; 416 if(!(m->rep = reply_info_copy(from->rep, NULL, region))) 417 return NULL; 418 return m; 419} 420 |
421int | 421void |
422iter_dns_store(struct module_env* env, struct query_info* msgqinf, 423 struct reply_info* msgrep, int is_referral, uint32_t leeway, int pside, 424 struct regional* region) 425{ | 422iter_dns_store(struct module_env* env, struct query_info* msgqinf, 423 struct reply_info* msgrep, int is_referral, uint32_t leeway, int pside, 424 struct regional* region) 425{ |
426 return dns_cache_store(env, msgqinf, msgrep, is_referral, leeway, 427 pside, region); | 426 if(!dns_cache_store(env, msgqinf, msgrep, is_referral, leeway, 427 pside, region)) 428 log_err("out of memory: cannot store data in cache"); |
428} 429 430int 431iter_ns_probability(struct ub_randstate* rnd, int n, int m) 432{ 433 int sel; 434 if(n == m) /* 100% chance */ 435 return 1; --- 599 unchanged lines hidden --- | 429} 430 431int 432iter_ns_probability(struct ub_randstate* rnd, int n, int m) 433{ 434 int sel; 435 if(n == m) /* 100% chance */ 436 return 1; --- 599 unchanged lines hidden --- |