| 285 | | pw.startRecord(pos->qname, pos->qtype.getCode(), pos->ttl, pos->qclass, (DNSPacketWriter::Place)pos->d_place); |
| 286 | | shared_ptr<DNSRecordContent> drc(DNSRecordContent::mastermake(pos->qtype.getCode(), 1, pos->content)); |
| 287 | | drc->toPacket(pw); |
| 288 | | if(!d_tcp && pw.size() + 20 > getMaxReplyLen()) { // 20 = room for EDNS0 |
| 289 | | pw.rollback(); |
| 290 | | if(pos->d_place == DNSResourceRecord::ANSWER) { |
| 291 | | pw.getHeader()->tc=1; |
| 292 | | } |
| 293 | | goto noCommit; |
| 294 | | |
| 295 | | break; |
| 296 | | } |
| | 285 | pw.startRecord(pos->qname, pos->qtype.getCode(), pos->ttl, pos->qclass, (DNSPacketWriter::Place)pos->d_place); |
| | 286 | shared_ptr<DNSRecordContent> drc(DNSRecordContent::mastermake(pos->qtype.getCode(), 1, pos->content)); |
| | 287 | drc->toPacket(pw); |
| | 288 | if(!d_tcp && pw.size() + 20 > getMaxReplyLen()) { // 20 = room for EDNS0 |
| | 289 | pw.rollback(); |
| | 290 | if(pos->d_place == DNSResourceRecord::ANSWER) { |
| | 291 | pw.getHeader()->tc=1; |
| | 292 | } |
| | 293 | goto noCommit; |
| | 294 | |
| | 295 | break; |
| | 296 | } |