// optimization - go ahead and try to send the response
WriteBytesForConnection(pConn);
// WriteBytesForConnection will close the connection on error
// And it might call ConsumeRemoteClose, which will also null it out
// so we can't assume the connection is still alive. And if it's not alive, pConn likely got deleted
// either refetch from the hash tables, or invent an out parameter on WriteBytesForConnection and ConsumeRemoteClose to better propagate the close state of the connection
// so we can't assume the connection is still alive. And if it's not alive, pConn likely got deleted
// either refetch from the hash tables, or invent an out parameter on WriteBytesForConnection and ConsumeRemoteClose to better propagate the close state of the connection
pConn=NULL;
break;
}
// loop back and try to send the remaining bytes
}
CRefCountedBufferspOutputBuffer;
size_ttxCount;// number of bytes transmitted thus far
// paranoia - just to be consistent with Vovida, send the attributes back in the same order it does
// I suspect there are clients out there that might be hardcoded to the ordering
// MAPPED-ADDRESS
// SOURCE-ADDRESS (RESPONSE-ORIGIN)
// CHANGED-ADDRESS (OTHER-ADDRESS)
// XOR-MAPPED-ADDRESS
builder.AddMappedAddress(_pMsgIn->addrRemote);
if(fLegacyFormat==false)
{
builder.AddXorMappedAddress(_pMsgIn->addrRemote);
}
if(fSendOriginAddress)
{
builder.AddResponseOriginAddress(addrOrigin,fLegacyFormat);// pass true to send back SOURCE_ADDRESS, otherwise, pass false to send back RESPONSE-ORIGIN