Skip to content

Commit

Permalink
docs: adjust some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
developStorm committed May 2, 2024
1 parent f63bbd9 commit f5fbe15
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/amqp091/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (scanner *Scanner) Scan(target zgrab2.ScanTarget) (zgrab2.ScanStatus, inter
}
defer amqpConn.Close()

// if amqpConn.Locales has sth, we must have at least done a handshake. The scan is considered partially successful.
// If there's an error and we haven't even received START frame from the server, consider it a failure
if err != nil && len(amqpConn.Locales) == 0 {
status := zgrab2.TryGetScanStatus(err)
if status == zgrab2.SCAN_UNKNOWN_ERROR {
Expand All @@ -187,8 +187,10 @@ func (scanner *Scanner) Scan(target zgrab2.ScanTarget) (zgrab2.ScanStatus, inter

return status, nil, err
}
// If amqpConn.Locales has sth, we are (almost) sure that we are talking to an AMQP 091 server,
// therefore the scan is considered successful from this point on.

// Basic server information that can be gathered without authentication
// Following is basic server information that can be gathered without authentication
result.VersionMajor = amqpConn.Major
result.VersionMinor = amqpConn.Minor
result.ServerProperties = amqpConn.Properties
Expand Down

0 comments on commit f5fbe15

Please sign in to comment.