Skip to content
Snippets Groups Projects
Verified Commit 76fe8a1e authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fix lint issues

parent 0cf415d9
No related branches found
No related tags found
No related merge requests found
......@@ -9,13 +9,12 @@ import (
"net"
)
const PROTOCOL_MAGIC uint32 = 0x42b33f00
const ProtocolMagic uint32 = 0x42b33f00
const PROTOCOL_FEATURE_TLS uint8 = 0x01
const PROTOCOL_FEATURE_COMPRESSION uint8 = 0x02
const ProtocolFeatureTls uint8 = 0x01
const ProtocolFeatureCompression uint8 = 0x02
const PROTOCOL_LEGACY uint32 = 0x01
const PROTOCOL_DATASTREAM uint32 = 0x02
const ProtocolDatastream uint32 = 0x02
type connection struct {
hostname string
......@@ -110,8 +109,8 @@ func parseProtocolInfo(data []byte) protocolInfo {
rawVersion := data[3]
return protocolInfo{
rawFeatures&PROTOCOL_FEATURE_TLS != 0,
rawFeatures&PROTOCOL_FEATURE_COMPRESSION != 0,
rawFeatures&ProtocolFeatureTls != 0,
rawFeatures&ProtocolFeatureCompression != 0,
binary.BigEndian.Uint16(rawData),
rawVersion,
}
......@@ -123,9 +122,9 @@ func main() {
flag.Parse()
conn := makeConnection(*hostname, *port)
conn.write(PROTOCOL_MAGIC | uint32(PROTOCOL_FEATURE_TLS))
conn.write(ProtocolMagic | uint32(ProtocolFeatureTls))
supportedProtocols := []uint32{
PROTOCOL_DATASTREAM,
ProtocolDatastream,
}
for _, protocol := range supportedProtocols {
conn.write(protocol)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment