Browse Source

conn: dont auto set protocol to 2

Don't set the protocol version to 2 by default in conn, this allows us
to test setting unsupported protocol versions
Chris Bannister 9 năm trước cách đây
mục cha
commit
6ed31b206e
1 tập tin đã thay đổi với 0 bổ sung6 xóa
  1. 0 6
      conn.go

+ 0 - 6
conn.go

@@ -175,12 +175,6 @@ func Connect(host *HostInfo, addr string, cfg *ConnConfig,
 		return nil, err
 	}
 
-	// going to default to proto 2
-	if cfg.ProtoVersion < protoVersion1 || cfg.ProtoVersion > protoVersion4 {
-		log.Printf("unsupported protocol version: %d using 2\n", cfg.ProtoVersion)
-		cfg.ProtoVersion = 2
-	}
-
 	headerSize := 8
 	if cfg.ProtoVersion > protoVersion2 {
 		headerSize = 9