Always apply tcp_connection_attempt.

Before this change it was only applied when a connection_attempt()
event handler was defined.
This commit is contained in:
Robin Sommer 2013-04-28 16:40:39 -07:00
parent 9d483b7e74
commit 1603da5af3
4 changed files with 11 additions and 23 deletions

View file

@ -1,4 +1,9 @@
2.1-487 | 2013-05-01 18:03:22 -0700
* Always apply tcp_connection_attempt timer, even if no
connection_attempt() event handler is defined. (Robin Sommer)
2.1-486 | 2013-05-01 15:28:45 -0700 2.1-486 | 2013-05-01 15:28:45 -0700
* New framework for computing summary statistics in * New framework for computing summary statistics in

View file

@ -1 +1 @@
2.1-486 2.1-487

View file

@ -566,7 +566,7 @@ void TCP_Analyzer::UpdateInactiveState(double t,
else else
endpoint->SetState(TCP_ENDPOINT_SYN_SENT); endpoint->SetState(TCP_ENDPOINT_SYN_SENT);
if ( connection_attempt ) if ( tcp_attempt_delay )
ADD_ANALYZER_TIMER(&TCP_Analyzer::AttemptTimer, ADD_ANALYZER_TIMER(&TCP_Analyzer::AttemptTimer,
t + tcp_attempt_delay, 1, t + tcp_attempt_delay, 1,
TIMER_TCP_ATTEMPT); TIMER_TCP_ATTEMPT);
@ -1497,24 +1497,7 @@ void TCP_Analyzer::ExpireTimer(double t)
if ( resp->state == TCP_ENDPOINT_INACTIVE ) if ( resp->state == TCP_ENDPOINT_INACTIVE )
{ {
if ( (orig->state == TCP_ENDPOINT_SYN_SENT || if ( orig->state == TCP_ENDPOINT_INACTIVE )
orig->state == TCP_ENDPOINT_SYN_ACK_SENT) )
{
if ( ! connection_attempt )
{
// Time out the connection attempt,
// since the AttemptTimer isn't going
// to do it for us, and we don't want
// to clog the data structures with
// old, failed attempts.
Event(connection_timeout);
is_active = 0;
sessions->Remove(Conn());
return;
}
}
else if ( orig->state == TCP_ENDPOINT_INACTIVE )
{ {
// Nothing ever happened on this connection. // Nothing ever happened on this connection.
// This can occur when we see a trashed // This can occur when we see a trashed

View file

@ -3,8 +3,8 @@
#empty_field (empty) #empty_field (empty)
#unset_field - #unset_field -
#path socks #path socks
#open 2012-06-20-17-23-38 #open 2013-05-02-01-02-50
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p version user status request.host request.name request_p bound.host bound.name bound_p #fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p version user status request.host request.name request_p bound.host bound.name bound_p
#types time string addr port addr port count string string addr string port addr string port #types time string addr port addr port count string string addr string port addr string port
1340213015.276495 UWkUyAuUGXf 10.0.0.55 53994 60.190.189.214 8124 5 - succeeded - www.osnews.com 80 192.168.0.31 - 2688 1340213015.276495 arKYeMETxOg 10.0.0.55 53994 60.190.189.214 8124 5 - succeeded - www.osnews.com 80 192.168.0.31 - 2688
#close 2012-06-20-17-28-10 #close 2013-05-02-01-02-50