|
@@ -5,6 +5,7 @@ import (
|
|
"encoding/hex"
|
|
"encoding/hex"
|
|
"flag"
|
|
"flag"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "math"
|
|
"os"
|
|
"os"
|
|
"runtime"
|
|
"runtime"
|
|
"strconv"
|
|
"strconv"
|
|
@@ -461,14 +462,14 @@ func configure() {
|
|
|
|
|
|
if conf.DownloadBufferSize < 0 {
|
|
if conf.DownloadBufferSize < 0 {
|
|
logFatal("Download buffer size should be greater than or equal to 0")
|
|
logFatal("Download buffer size should be greater than or equal to 0")
|
|
- } else if conf.DownloadBufferSize > int(^uint32(0)) {
|
|
|
|
- logFatal("Download buffer size can't be greater than %d", ^uint32(0))
|
|
|
|
|
|
+ } else if conf.DownloadBufferSize > math.MaxInt32 {
|
|
|
|
+ logFatal("Download buffer size can't be greater than %d", math.MaxInt32)
|
|
}
|
|
}
|
|
|
|
|
|
if conf.GZipBufferSize < 0 {
|
|
if conf.GZipBufferSize < 0 {
|
|
logFatal("GZip buffer size should be greater than or equal to 0")
|
|
logFatal("GZip buffer size should be greater than or equal to 0")
|
|
- } else if conf.GZipBufferSize > int(^uint32(0)) {
|
|
|
|
- logFatal("GZip buffer size can't be greater than %d", ^uint32(0))
|
|
|
|
|
|
+ } else if conf.GZipBufferSize > math.MaxInt32 {
|
|
|
|
+ logFatal("GZip buffer size can't be greater than %d", math.MaxInt32)
|
|
}
|
|
}
|
|
|
|
|
|
if conf.BufferPoolCalibrationThreshold < 64 {
|
|
if conf.BufferPoolCalibrationThreshold < 64 {
|