Browse Source

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

Matt Robenolt 12 years ago
parent
commit
1418d31338
1 changed files with 1 additions and 1 deletions
  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 {