diff options
author | Ivan Ristic <ivanr@webkreator.com> | 2015-08-03 07:58:13 +0200 |
---|---|---|
committer | Ivan Ristic <ivanr@webkreator.com> | 2015-08-03 07:58:13 +0200 |
commit | 1cbaed8c74814258e4fe04bb5b69bd40071c55d5 (patch) | |
tree | b93b38a71653a47d37a0e5408eb43ec7f19be40a | |
parent | cd39075f41e912c6e783232a0d9de794aa7bbf70 (diff) | |
download | ssllabs-scan-1cbaed8c74814258e4fe04bb5b69bd40071c55d5.zip ssllabs-scan-1cbaed8c74814258e4fe04bb5b69bd40071c55d5.tar.gz ssllabs-scan-1cbaed8c74814258e4fe04bb5b69bd40071c55d5.tar.bz2 |
Fix not printing results to stdout.
-rw-r--r-- | ssllabs-scan.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/ssllabs-scan.go b/ssllabs-scan.go index 76b9564..50aaeec 100644 --- a/ssllabs-scan.go +++ b/ssllabs-scan.go @@ -563,14 +563,14 @@ func NewAssessment(host string, eventChannel chan Event) { } type HostProvider struct { - hostnames []string - i int + hostnames []string + StartingLen int } func NewHostProvider(hs []string) *HostProvider { hostnames := make([]string, len(hs)) copy(hostnames, hs) - hostProvider := HostProvider{hostnames, 0} + hostProvider := HostProvider{hostnames, len(hs)} return &hostProvider } @@ -589,10 +589,6 @@ 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 @@ -726,7 +722,7 @@ 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: - if manager.hostProvider.len() > 0 { + if manager.hostProvider.StartingLen > 0 { <-time.NewTimer(time.Duration(globalNewAssessmentCoolOff) * time.Millisecond).C } @@ -956,7 +952,7 @@ func main() { var results []byte var err error - if hp.len() == 0 { + if hp.StartingLen == 0 { return } |