Ignore:
Timestamp:
Mar 2, 2007 2:51:03 PM (18 years ago)
Author:
bennylp
Message:

Fixed ticket #156: Not enough memory to parse DNS packets in resolver (thanks Frank Wiersma)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/pjproject-0.5-stable/pjlib-util/include/pjlib-util/dns.h

    r974 r1033  
    2626 */ 
    2727#include <pjlib-util/types.h> 
    28  
     28#include <pj/sock.h> 
    2929 
    3030PJ_BEGIN_DECL 
     
    259259        /** A Resource Data (PJ_DNS_TYPE_A, 1) */ 
    260260        struct a { 
    261             pj_str_t    ip_addr;/**< IP host address string.                */ 
     261            pj_in_addr  ip_addr;/**< IP host address string.                */ 
    262262        } a; 
    263263 
     
    280280    pj_dns_parsed_rr    *arr;   /**< Array of additional RR answer.         */ 
    281281} pj_dns_parsed_packet; 
     282 
     283 
     284/** 
     285 * Option flags to be specified when calling #pj_dns_packet_dup() function. 
     286 * These flags can be combined with bitwise OR operation. 
     287 */ 
     288enum pj_dns_dup_options 
     289{ 
     290    PJ_DNS_NO_QD    = 1, /**< Do not duplicate the query section.           */ 
     291    PJ_DNS_NO_ANS   = 2, /**< Do not duplicate the answer section.          */ 
     292    PJ_DNS_NO_NS    = 4, /**< Do not duplicate the NS section.              */ 
     293    PJ_DNS_NO_AR    = 8  /**< Do not duplicate the additional rec section   */ 
     294}; 
    282295 
    283296 
     
    332345 * @param pool          The pool to allocate memory for the duplicated packet. 
    333346 * @param p             The DNS packet to be cloned. 
     347 * @param options       Option flags, from pj_dns_dup_options. 
    334348 * @param p_dst         Pointer to store the cloned DNS packet. 
    335349 */ 
    336350PJ_DECL(void) pj_dns_packet_dup(pj_pool_t *pool, 
    337351                                const pj_dns_parsed_packet*p, 
     352                                unsigned options, 
    338353                                pj_dns_parsed_packet **p_dst); 
    339354 
Note: See TracChangeset for help on using the changeset viewer.