Use humanize constants for KiB, MiB and GiB units. (#3322)

This commit is contained in:
Bala FA
2016-11-22 18:18:22 -08:00
committed by Harshavardhana
parent c1ebcbcda2
commit 825000bc34
23 changed files with 170 additions and 135 deletions

View File

@@ -28,6 +28,7 @@ import (
"net/http"
"time"
humanize "github.com/dustin/go-humanize"
"github.com/minio/sha256-simd"
)
@@ -151,7 +152,7 @@ func calculateSeedSignature(r *http.Request) (signature string, date time.Time,
return newSignature, date, ErrNone
}
const maxLineLength = 4096 // assumed <= bufio.defaultBufSize 4KiB.
const maxLineLength = 4 * humanize.KiByte // assumed <= bufio.defaultBufSize 4KiB
// lineTooLong is generated as chunk header is bigger than 4KiB.
var errLineTooLong = errors.New("header line too long")