HttpWriter暴露两个方法/默认Buffer为4K

This commit is contained in:
刘祥超
2022-03-24 21:42:03 +08:00
parent 99227bb4f2
commit f6a983e683
2 changed files with 24 additions and 0 deletions

View File

@@ -1584,6 +1584,9 @@ func (this *HTTPRequest) addError(err error) {
// 计算合适的buffer size
func (this *HTTPRequest) bytePool(contentLength int64) *utils.BytePool {
if contentLength < 0 {
return utils.BytePool4k
}
if contentLength < 8192 { // 8K
return utils.BytePool1k
}