ing
This commit is contained in:
parent
6f6d62f409
commit
4e18a6f932
|
@ -136,14 +136,16 @@ LOOP:
|
|||
d.SendMessage(req, types.DiscoveryMessageTypeStart, omu.Now(), nil)
|
||||
s := session.RetainDiscoverySession()
|
||||
d.discover(req, s)
|
||||
select {
|
||||
case <-time.After(time.Millisecond * 500):
|
||||
}
|
||||
d.SendMessage(req, types.DiscoveryMessageTypeStop, time.Since(startTime).String(), nil)
|
||||
|
||||
session.ReleaseDiscoverySession(s)
|
||||
|
||||
req.(*ofDiscoveryRequest).release()
|
||||
|
||||
select {
|
||||
case <-time.After(time.Second * 1):
|
||||
case <-time.After(time.Second * 2):
|
||||
}
|
||||
|
||||
log.Print("Discovery Session complete")
|
||||
|
|
|
@ -55,11 +55,8 @@ func scanV4(discoverySession session.DiscoverySession) error {
|
|||
delay.Store(true)
|
||||
if h := handlePacketICMP4(zone, targetHosts, hosts, packet); nil != h {
|
||||
if h != nil {
|
||||
// log.Print("Host ", h)
|
||||
discoverySession.AddHost(h)
|
||||
}
|
||||
|
||||
// resultChan <- h
|
||||
}
|
||||
case <-ticker.C:
|
||||
if false == delay.Load().(bool) {
|
||||
|
|
|
@ -43,13 +43,11 @@ func scanV4(discoverySession session.DiscoverySession, targetHost *omd.Host) err
|
|||
select {
|
||||
case packet, ok := <-tcpChan:
|
||||
if !ok {
|
||||
// olog.Logger().Debug("Discovery: tcp channel is closed")
|
||||
return
|
||||
}
|
||||
delay.Store(true)
|
||||
if p := handlePacketTCP4(discoverySession, targetHost, ports, packet); nil != p {
|
||||
discoverySession.AddPort(p)
|
||||
log.Print(p)
|
||||
}
|
||||
case <-ticker.C:
|
||||
if false == delay.Load().(bool) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user