Record current time for connect probes, not an old time

This commit is contained in:
dmiller 2024-10-28 23:11:52 +00:00
parent cf718f2071
commit 191aadf142

View file

@ -438,11 +438,11 @@ UltraProbe *sendConnectScanProbe(UltraScanInfo *USI, HostScanStats *hss,
#if HAVE_IPV6
else sin6->sin6_port = htons(probe->pspec()->pd.tcp.dport);
#endif
probe->sent = USI->now;
/* We don't record a byte count for connect probes. */
hss->probeSent(0);
rc = connect(CP->sd, (struct sockaddr *)&sock, socklen);
gettimeofday(&USI->now, NULL);
probe->sent = USI->now;
if (rc == -1)
connect_errno = socket_errno();
/* This counts as probe being sent, so update structures */
@ -464,6 +464,7 @@ UltraProbe *sendConnectScanProbe(UltraScanInfo *USI, HostScanStats *hss,
handleConnectResult(USI, hss, probeI, connect_errno, true);
probe = NULL;
}
// Not sure if we need to call this again:
gettimeofday(&USI->now, NULL);
return probe;
}