Skip to content

Commit

Permalink
nsqd: remove leftover go1.0 compatible files
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Jul 18, 2015
1 parent 7e1ff48 commit f387012
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 77 deletions.
2 changes: 0 additions & 2 deletions nsqd/buffer_pool_go13.go → nsqd/buffer_pool.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build go1.3

package nsqd

import (
Expand Down
13 changes: 0 additions & 13 deletions nsqd/buffer_pool_go10.go

This file was deleted.

7 changes: 0 additions & 7 deletions nsqd/client_tls_go10.go

This file was deleted.

23 changes: 0 additions & 23 deletions nsqd/client_tls_go13.go

This file was deleted.

61 changes: 29 additions & 32 deletions nsqd/client_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,54 +267,51 @@ type prettyConnectionState struct {
tls.ConnectionState
}

// taken from http://golang.org/src/pkg/crypto/tls/cipher_suites.go
// to be compatible with older versions
const (
local_TLS_RSA_WITH_RC4_128_SHA uint16 = 0x0005
local_TLS_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x000a
local_TLS_RSA_WITH_AES_128_CBC_SHA uint16 = 0x002f
local_TLS_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0035
local_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA uint16 = 0xc007
local_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xc009
local_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xc00a
local_TLS_ECDHE_RSA_WITH_RC4_128_SHA uint16 = 0xc011
local_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xc012
local_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0xc013
local_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0xc014
local_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02f
local_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02b
)

func (p *prettyConnectionState) GetCipherSuite() string {
switch p.CipherSuite {
case local_TLS_RSA_WITH_RC4_128_SHA:
case tls.TLS_RSA_WITH_RC4_128_SHA:
return "TLS_RSA_WITH_RC4_128_SHA"
case local_TLS_RSA_WITH_3DES_EDE_CBC_SHA:
case tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA:
return "TLS_RSA_WITH_3DES_EDE_CBC_SHA"
case local_TLS_RSA_WITH_AES_128_CBC_SHA:
case tls.TLS_RSA_WITH_AES_128_CBC_SHA:
return "TLS_RSA_WITH_AES_128_CBC_SHA"
case local_TLS_RSA_WITH_AES_256_CBC_SHA:
case tls.TLS_RSA_WITH_AES_256_CBC_SHA:
return "TLS_RSA_WITH_AES_256_CBC_SHA"
case local_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA:
case tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA:
return "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA"
case local_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:
case tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:
return "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA"
case local_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:
case tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:
return "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA"
case local_TLS_ECDHE_RSA_WITH_RC4_128_SHA:
case tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA:
return "TLS_ECDHE_RSA_WITH_RC4_128_SHA"
case local_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:
case tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:
return "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA"
case local_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:
case tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:
return "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"
case local_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
case tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
return "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"
case local_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:
case tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:
return "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
case local_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:
case tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:
return "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
}
return fmt.Sprintf("unkown %d", p.CipherSuite)
return fmt.Sprintf("Unknown %d", p.CipherSuite)
}

func (p *prettyConnectionState) GetVersion() string {
switch p.Version {
case tls.VersionSSL30:
return "SSL30"
case tls.VersionTLS10:
return "TLS1.0"
case tls.VersionTLS11:
return "TLS1.1"
case tls.VersionTLS12:
return "TLS1.2"
default:
return fmt.Sprintf("Unknown %d", p.Version)
}
}

func (c *clientV2) IsReadyForMessages() bool {
Expand Down

0 comments on commit f387012

Please sign in to comment.