Changeset 2575

Show
Ignore:
Timestamp:
04/23/12 20:04:24 (13 months ago)
Author:
ahu
Message:

combine two calls to write() when doing outgoing AXFR, possibly making Microsoft DNS happy.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/tcpreceiver.cc

    r2571 r2575  
    176176void TCPNameserver::sendPacket(shared_ptr<DNSPacket> p, int outsock) 
    177177{ 
    178   const string buffer = p->getString(); 
    179   uint16_t len=htons(buffer.length()); 
    180   writenWithTimeout(outsock, &len, 2); 
     178  uint16_t len=htons(p->getString().length()); 
     179  string buffer((const char*)&len, 2); 
     180  buffer.append(p->getString()); 
    181181  writenWithTimeout(outsock, buffer.c_str(), buffer.length()); 
    182182}