mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
TCPStreamFollower now doesn't clear its state each time follow_streams is called.
This commit is contained in:
@@ -300,11 +300,6 @@ private:
|
||||
EndFunctor end_fun;
|
||||
};
|
||||
|
||||
void clear_state() {
|
||||
sessions.clear();
|
||||
last_identifier = 0;
|
||||
}
|
||||
|
||||
template<typename DataFunctor, typename EndFunctor>
|
||||
bool callback(PDU &pdu, const DataFunctor &fun, const EndFunctor &end_fun);
|
||||
static void dummy_function(TCPStream&) { }
|
||||
@@ -317,7 +312,6 @@ template<typename DataFunctor, typename EndFunctor>
|
||||
void TCPStreamFollower::follow_streams(BaseSniffer &sniffer, DataFunctor data_fun, EndFunctor end_fun) {
|
||||
typedef proxy_caller<DataFunctor, EndFunctor> 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<typename ForwardIterator, typename DataFunctor, typename EndFunctor>
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user