Opened 17 years ago

Closed 17 years ago

#157 closed defect (fixed)

Not enough memory to parse DNS packets in resolver (thanks Frank Wiersma)

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-0.7.0-rc1
Component: pjlib-util Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description

This is copy of ticket #156 for trunk.

Change History (1)

comment:1 Changed 17 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r1031:

  • Optimization in DNS packet data structure to conserve memory
  • Enlarge the size of temporary pool to parse message from 1500 to 4000 (this value is now also controlled by PJ_DNS_RESOLVER_TMP_BUF_SIZE configuration macro.
  • Added flags in pj_dns_packet_dup() to allow exclusions of particular sections in DNS packet (for example, the query, NS, and additional info sections don't need to be kept in a cache in resolver).

Testing:

  • A DNS response with 7 answers, 7 NS records, and 7 additional info records now only need ~1600 bytes of temporary memory to parse it (compared to >1800 previously)
  • Only ~480 bytes of memory is needed to store DNS packet with 7 answer records (previously PJ_ENOMEM will be returned with 512 memory buffer).
Note: See TracTickets for help on using tickets.