diff --git a/include/tcp_stream.h b/include/tcp_stream.h index 1e5c1c9..e0d2fbc 100644 --- a/include/tcp_stream.h +++ b/include/tcp_stream.h @@ -300,11 +300,6 @@ private: EndFunctor end_fun; }; - void clear_state() { - sessions.clear(); - last_identifier = 0; - } - template bool callback(PDU &pdu, const DataFunctor &fun, const EndFunctor &end_fun); static void dummy_function(TCPStream&) { } @@ -317,7 +312,6 @@ template void TCPStreamFollower::follow_streams(BaseSniffer &sniffer, DataFunctor data_fun, EndFunctor end_fun) { typedef proxy_caller proxy_type; proxy_type proxy = { this, data_fun, end_fun }; - clear_state(); sniffer.sniff_loop(make_sniffer_handler(&proxy, &proxy_type::callback)); } @@ -325,7 +319,6 @@ template void TCPStreamFollower::follow_streams(ForwardIterator start, ForwardIterator end, DataFunctor data_fun, EndFunctor end_fun) { - clear_state(); while(start != end) { if(!callback(Utils::dereference_until_pdu(start), data_fun, end_fun)) return; diff --git a/src/sniffer.cpp b/src/sniffer.cpp index d813407..7895293 100644 --- a/src/sniffer.cpp +++ b/src/sniffer.cpp @@ -199,7 +199,7 @@ Sniffer::Sniffer(const std::string &device, promisc_type promisc, void Sniffer::init_sniffer(const std::string &device, unsigned max_packet_size, bool promisc, const std::string &filter) { - char error[PCAP_ERRBUF_SIZE]; + char error[PCAP_ERRBUF_SIZE]; bpf_u_int32 ip, if_mask; if (pcap_lookupnet(device.c_str(), &ip, &if_mask, error) == -1) { ip = 0;