Ignore:
Timestamp:
Mar 2, 2007 2:35:57 PM (17 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/trunk/pjlib-util/include/pjlib-util/dns.h

    r974 r1031  
    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_str_t  ip_addr;/**< IP host address string.                */ 
     262            pj_in_addr  ip_addr; 
    262263        } a; 
    263264 
     
    280281    pj_dns_parsed_rr    *arr;   /**< Array of additional RR answer.         */ 
    281282} pj_dns_parsed_packet; 
     283 
     284 
     285/** 
     286 * Option flags to be specified when calling #pj_dns_packet_dup() function. 
     287 * These flags can be combined with bitwise OR operation. 
     288 */ 
     289enum pj_dns_dup_options 
     290{ 
     291    PJ_DNS_NO_QD    = 1, /**< Do not duplicate the query section.           */ 
     292    PJ_DNS_NO_ANS   = 2, /**< Do not duplicate the answer section.          */ 
     293    PJ_DNS_NO_NS    = 4, /**< Do not duplicate the NS section.              */ 
     294    PJ_DNS_NO_AR    = 8  /**< Do not duplicate the additional rec section   */ 
     295}; 
    282296 
    283297 
     
    332346 * @param pool          The pool to allocate memory for the duplicated packet. 
    333347 * @param p             The DNS packet to be cloned. 
     348 * @param options       Option flags, from pj_dns_dup_options. 
    334349 * @param p_dst         Pointer to store the cloned DNS packet. 
    335350 */ 
    336351PJ_DECL(void) pj_dns_packet_dup(pj_pool_t *pool, 
    337352                                const pj_dns_parsed_packet*p, 
     353                                unsigned options, 
    338354                                pj_dns_parsed_packet **p_dst); 
    339355 
Note: See TracChangeset for help on using the changeset viewer.