From a7df00eca711a029e034315dd4a52547decaf7cc Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Wed, 19 Jan 2011 11:28:27 -0800 Subject: [PATCH] Connection compressor fix from #338. This changes starting times of quite a few connections in the test-suite, but that all seems legitimate. --- src/ConnCompressor.cc | 31 ------------------------------- src/ConnCompressor.h | 4 ---- 2 files changed, 35 deletions(-) diff --git a/src/ConnCompressor.cc b/src/ConnCompressor.cc index f38c0dcb89..36ecbd6c9a 100644 --- a/src/ConnCompressor.cc +++ b/src/ConnCompressor.cc @@ -391,26 +391,6 @@ Connection* ConnCompressor::NextFromOrig(PendingConn* pending, double t, { if ( (tp->th_flags & TH_ACK) && ! pending->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 @@ -715,17 +695,6 @@ uint8 ConnCompressor::MakeFlags(const PendingConn* c) const 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) { // See if there is enough space in the current block. diff --git a/src/ConnCompressor.h b/src/ConnCompressor.h index f0069024a2..a76a35134a 100644 --- a/src/ConnCompressor.h +++ b/src/ConnCompressor.h @@ -138,10 +138,6 @@ private: // Fakes a TCP packet based on the available information. 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. uint8 MakeFlags(const PendingConn* c) const;