Преглед изворни кода

Don't try to compress when the body is too short

Matt Robenolt пре 12 година
родитељ
комит
1418d31338
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      gocql.go

+ 1 - 1
gocql.go

@@ -232,7 +232,7 @@ func (cn *connection) _send(opcode byte, body []byte, compression bool) error {
 		return driver.ErrBadConn
 	}
 	var flags byte = 0x00
-	if compression {
+	if compression && len(body) > 1 {
 		var err error
 		body, err = snappy.Encode(nil, body)
 		if err != nil {