Don't use udiffTimeStamp() with struct timeval
It will fail to build for non-Linux platforms where TimeStamp is NOT timeval
This commit is contained in:
parent
976fc72de8
commit
d375736a39
@ -159,16 +159,12 @@ bool PcapTxThread::appendToPacketList(long sec, long nsec,
|
|||||||
// If not enough space, update usecDelay and alloc a new seq
|
// If not enough space, update usecDelay and alloc a new seq
|
||||||
if (!currentPacketSequence_->hasFreeSpace(2*sizeof(pcap_pkthdr)+length))
|
if (!currentPacketSequence_->hasFreeSpace(2*sizeof(pcap_pkthdr)+length))
|
||||||
{
|
{
|
||||||
#if 0 // FIXME: temporary MacOS build fix
|
|
||||||
currentPacketSequence_->usecDelay_ = udiffTimeStamp(
|
|
||||||
¤tPacketSequence_->lastPacket_->ts, &pktHdr.ts);
|
|
||||||
#else
|
|
||||||
struct timeval diff;
|
struct timeval diff;
|
||||||
timersub(&pktHdr.ts, ¤tPacketSequence_->lastPacket_->ts, &diff);
|
timersub(&pktHdr.ts, ¤tPacketSequence_->lastPacket_->ts, &diff);
|
||||||
currentPacketSequence_->usecDelay_ = diff.tv_usec;
|
currentPacketSequence_->usecDelay_ = diff.tv_usec;
|
||||||
if (diff.tv_sec)
|
if (diff.tv_sec)
|
||||||
currentPacketSequence_->usecDelay_ += diff.tv_sec*1e6;
|
currentPacketSequence_->usecDelay_ += diff.tv_sec*1e6;
|
||||||
#endif
|
|
||||||
//! \todo (LOW): calculate sendqueue size
|
//! \todo (LOW): calculate sendqueue size
|
||||||
currentPacketSequence_ = new PacketSequence(trackStreamStats_);
|
currentPacketSequence_ = new PacketSequence(trackStreamStats_);
|
||||||
packetSequenceList_.append(currentPacketSequence_);
|
packetSequenceList_.append(currentPacketSequence_);
|
||||||
|
Loading…
Reference in New Issue
Block a user