summaryrefslogtreecommitdiffstats
path: root/ssllabs-scan.go
diff options
context:
space:
mode:
authorIvan Ristic <ivanr@webkreator.com>2015-07-30 16:44:00 +0200
committerIvan Ristic <ivanr@webkreator.com>2015-07-30 16:44:00 +0200
commit2ad6f0f87ebe008c58bf9957a078672cb37bd680 (patch)
tree76daea849ccaf14fe929a1674ad4da934af7435f /ssllabs-scan.go
parentdc38cfbb96cefb3d37c1de5421f093aafbc6f0bc (diff)
downloadssllabs-scan-2ad6f0f87ebe008c58bf9957a078672cb37bd680.zip
ssllabs-scan-2ad6f0f87ebe008c58bf9957a078672cb37bd680.tar.gz
ssllabs-scan-2ad6f0f87ebe008c58bf9957a078672cb37bd680.tar.bz2
Improve behaviour when run with without any hostnames. Closes #48.
Diffstat (limited to 'ssllabs-scan.go')
-rw-r--r--ssllabs-scan.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/ssllabs-scan.go b/ssllabs-scan.go
index 4078c1f..39fabfe 100644
--- a/ssllabs-scan.go
+++ b/ssllabs-scan.go
@@ -579,6 +579,10 @@ func (hp *HostProvider) retry(host string) {
hp.hostnames = append(hp.hostnames, host)
}
+func (hp *HostProvider) len() int {
+ return len(hp.hostnames)
+}
+
type Manager struct {
hostProvider *HostProvider
FrontendEventChannel chan Event
@@ -712,7 +716,10 @@ func (manager *Manager) run() {
// Once a second, start a new assessment, provided there are
// hostnames left and we're not over the concurrent assessment limit.
default:
- <-time.NewTimer(time.Duration(globalNewAssessmentCoolOff) * time.Millisecond).C
+ if manager.hostProvider.len() > 0 {
+ <-time.NewTimer(time.Duration(globalNewAssessmentCoolOff) * time.Millisecond).C
+ }
+
if moreAssessments {
if currentAssessments < maxAssessments {
host, hasNext := manager.hostProvider.next()
@@ -939,6 +946,10 @@ func main() {
var results []byte
var err error
+ if hp.len() == 0 {
+ return
+ }
+
if *conf_grade {
// Just the grade(s). We use flatten and RAW
/*