Commit 147d2664 authored by Jonathon Duerig's avatar Jonathon Duerig

Added debugging info to PacketSensor and added 0-delta consolidation of size to CircularTraffic

parent c3ad38dc
......@@ -31,16 +31,22 @@ Time CircularTraffic::addWrite(TrafficWriteCommand const & newWrite,
Time const & deadline)
{
Time now = getCurrentTime();
writes.push_back(newWrite);
writes.back().localTime = now;
// XXX: end() is not necessarily a constant value. Though this
// should work, if there is erratic behaviour, here is a good place
// to check.
if (current == writes.end())
if (! writes.empty() && newWrite.delta == 0)
{
current = writes.begin();
writes.back().size += newWrite.size;
}
else
{
writes.push_back(newWrite);
writes.back().localTime = now;
// XXX: end() is not necessarily a constant value. Though this
// should work, if there is erratic behaviour, here is a good place
// to check.
if (current == writes.end())
{
current = writes.begin();
}
}
if (deadline == Time())
{
// If there is no current deadline, return the next one.
......
......@@ -630,6 +630,7 @@ void PacketSensor::localAck(PacketInfo * packet)
{
ackValid = false;
}
logWrite(SENSOR, "REGION: %d", currentRegionState);
}
bool PacketSensor::SentPacket::inSequenceBlock(unsigned int sequence)
......
......@@ -29,9 +29,9 @@ public:
// idleness has been detected.
enum RegionState
{
INVALID_REGION,
BEGIN_VALID_REGION,
VALID_REGION
INVALID_REGION = 0,
BEGIN_VALID_REGION = 1,
VALID_REGION = 2
};
public:
PacketSensor(StateSensor const * newState);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment