소스 검색

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

Matt Robenolt 13 년 전
부모
커밋
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 {