Connection compressor fix from #338. This changes starting times of

quite a few connections in the test-suite, but that all seems
legitimate.
This commit is contained in:
Robin Sommer 2011-01-19 11:28:27 -08:00
parent bbbe32e443
commit a7df00eca7
2 changed files with 0 additions and 35 deletions

View file

@ -391,26 +391,6 @@ Connection* ConnCompressor::NextFromOrig(PendingConn* pending, double t,
{ {
if ( (tp->th_flags & TH_ACK) && ! pending->ACK ) if ( (tp->th_flags & TH_ACK) && ! pending->ACK )
Weird(pending, t, "repeated_SYN_with_ack"); Weird(pending, t, "repeated_SYN_with_ack");
else
{
// We adjust the start-time. Unfortunately
// this means that we have to create a new
// PendingConn as all of them need to be
// monotonically increasing in time. This
// leads to some inconsistencies with TCP.cc,
// as by doing this we basically restart our
// attempt_timer.
pending = MoveState(t, pending);
// Removing is necessary because the key
// will be destroyed at some point.
conns.Remove(&pending->key, sizeof(pending->key),
pending->hash, true);
conns.Dictionary::Insert(&pending->key,
sizeof(pending->key), pending->hash,
MakeMapPtr(pending), 0);
}
} }
else else
@ -715,17 +695,6 @@ uint8 ConnCompressor::MakeFlags(const PendingConn* c) const
return tcp_flags; return tcp_flags;
} }
ConnCompressor::PendingConn* ConnCompressor::MoveState(double time,
PendingConn* c)
{
PendingConn* nc = MakeNewState(time);
memcpy(nc, c, sizeof(PendingConn));
c->invalid = 1;
nc->time = time;
++sizes.pending_in_mem;
return nc;
}
ConnCompressor::PendingConn* ConnCompressor::MakeNewState(double t) ConnCompressor::PendingConn* ConnCompressor::MakeNewState(double t)
{ {
// See if there is enough space in the current block. // See if there is enough space in the current block.

View file

@ -138,10 +138,6 @@ private:
// Fakes a TCP packet based on the available information. // Fakes a TCP packet based on the available information.
const IP_Hdr* PendingConnToPacket(const PendingConn* c); const IP_Hdr* PendingConnToPacket(const PendingConn* c);
// For changing the timestamp of PendingConn - allocates a new one,
// sets the given time, and copies all other data from old.
PendingConn* MoveState(double time, PendingConn* old);
// Construct a TCP-flags byte. // Construct a TCP-flags byte.
uint8 MakeFlags(const PendingConn* c) const; uint8 MakeFlags(const PendingConn* c) const;