1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-17 08:01:36 +00:00
freebsd-ports/databases/godis/files/patch-conn.go
Michael Scheidell 80b3fb6c85 - Fixed authenticaton to database != 0
PR:		ports/164295
Submitted by:	maintainer
Approved by:	gabor (maintainer, implicit)
2012-01-19 01:53:50 +00:00

24 lines
719 B
Go

--- conn.go.orig 2011-09-04 22:00:03.000000000 +0200
+++ conn.go 2012-01-18 21:31:25.000000000 +0100
@@ -342,8 +342,8 @@
}
func (cc *conn) configConn(db int, password string) os.Error {
- if db != 0 {
- buf := [][]byte{[]byte("SELECT"), []byte(strconv.Itoa(db))}
+ if password != "" {
+ buf := [][]byte{[]byte("AUTH"), []byte(password)}
_, err := cc.rwc.Write(buildCmd(buf))
if err != nil {
@@ -356,8 +356,8 @@
}
}
- if password != "" {
- buf := [][]byte{[]byte("AUTH"), []byte(password)}
+ if db != 0 {
+ buf := [][]byte{[]byte("SELECT"), []byte(strconv.Itoa(db))}
_, err := cc.rwc.Write(buildCmd(buf))
if err != nil {