Explorar o código

correct magic number

Darien Raymond %!s(int64=7) %!d(string=hai) anos
pai
achega
5af3580bcf
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      common/crypto/auth.go

+ 1 - 1
common/crypto/auth.go

@@ -124,7 +124,7 @@ func (r *AuthenticationReader) readSize() (int32, error) {
 var errSoft = newError("waiting for more data")
 
 func (r *AuthenticationReader) readInternal(soft bool) (*buf.Buffer, error) {
-	if soft && r.reader.BufferedBytes() < 2 {
+	if soft && r.reader.BufferedBytes() < int32(r.sizeParser.SizeBytes()) {
 		return nil, errSoft
 	}