From 829d060fbb085f04b8a9c2a938345e9b3a87d66a Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Wed, 3 Aug 2011 18:28:30 -0400 Subject: [PATCH] Small cleanup --- network.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/network.cpp b/network.cpp index 78871a2..3667995 100644 --- a/network.cpp +++ b/network.cpp @@ -33,12 +33,14 @@ Flow::Packet::Packet( string coded_packet ) seq( decoding_cache.seq ), direction( decoding_cache.direction ), payload( decoding_cache.payload_string ) -{} +{ + decoding_cache = DecodingCache(); +} template string Flow::Packet::tostring( void ) { - uint64_t direction_seq = ((uint64_t( direction == TO_CLIENT ) & 0x1) << 63) | (seq & 0x7FFFFFFFFFFFFFFF); + uint64_t direction_seq = (uint64_t( direction == TO_CLIENT ) << 63) | (seq & 0x7FFFFFFFFFFFFFFF); uint64_t network_order_seq = htobe64( direction_seq ); const char *seq_str = (const char *)&network_order_seq; string seq_string( seq_str, 8 ); /* necessary in case there is a zero byte */