| 318 | | for(pos=rrs.begin();pos<rrs.end();++pos) { |
| 319 | | // this needs to deal with the 'prio' mismatch! |
| 320 | | if(pos->qtype.getCode()==QType::MX || pos->qtype.getCode() == QType::SRV) { |
| 321 | | pos->content = lexical_cast<string>(pos->priority) + " " + pos->content; |
| 322 | | } |
| 323 | | pw.startRecord(pos->qname, pos->qtype.getCode(), pos->ttl, 1, (DNSPacketWriter::Place)pos->d_place); |
| 324 | | shared_ptr<DNSRecordContent> drc(DNSRecordContent::mastermake(pos->qtype.getCode(), 1, pos->content)); |
| 325 | | drc->toPacket(pw); |
| 326 | | } |
| 327 | | try { |
| 328 | | pw.commit(); |
| 329 | | } |
| 330 | | catch(exception& e) { |
| 331 | | cerr<<"Exception: "<<e.what()<<endl; |
| 332 | | throw; |
| | 319 | if(!rrs.empty()) { |
| | 320 | for(pos=rrs.begin();pos<rrs.end();++pos) { |
| | 321 | // this needs to deal with the 'prio' mismatch! |
| | 322 | if(pos->qtype.getCode()==QType::MX || pos->qtype.getCode() == QType::SRV) { |
| | 323 | pos->content = lexical_cast<string>(pos->priority) + " " + pos->content; |
| | 324 | } |
| | 325 | pw.startRecord(pos->qname, pos->qtype.getCode(), pos->ttl, 1, (DNSPacketWriter::Place)pos->d_place); |
| | 326 | shared_ptr<DNSRecordContent> drc(DNSRecordContent::mastermake(pos->qtype.getCode(), 1, pos->content)); |
| | 327 | drc->toPacket(pw); |
| | 328 | } |
| | 329 | try { |
| | 330 | pw.commit(); |
| | 331 | } |
| | 332 | catch(exception& e) { |
| | 333 | cerr<<"Exception: "<<e.what()<<endl; |
| | 334 | throw; |
| | 335 | } |