1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-07 04:59:07 -04:00

remove 8k buffer pool

This commit is contained in:
Darien Raymond
2017-04-15 21:19:21 +02:00
parent f506a39d32
commit b1dfff2fdd
11 changed files with 13 additions and 57 deletions

View File

@@ -53,7 +53,7 @@ type HeaderReader struct {
}
func (*HeaderReader) Read(reader io.Reader) (*buf.Buffer, error) {
buffer := buf.NewSmall()
buffer := buf.New()
totalBytes := 0
endingDetected := false
for totalBytes < maxHeaderLength {
@@ -169,7 +169,7 @@ func (c *HttpConn) Close() error {
}
func formResponseHeader(config *ResponseConfig) *HeaderWriter {
header := buf.NewSmall()
header := buf.New()
header.AppendSupplier(serial.WriteString(strings.Join([]string{config.GetFullVersion(), config.GetStatusValue().Code, config.GetStatusValue().Reason}, " ")))
header.AppendSupplier(writeCRLF)
@@ -194,7 +194,7 @@ type HttpAuthenticator struct {
}
func (a HttpAuthenticator) GetClientWriter() *HeaderWriter {
header := buf.NewSmall()
header := buf.New()
config := a.config.Request
header.AppendSupplier(serial.WriteString(strings.Join([]string{config.GetMethodValue(), config.PickUri(), config.GetFullVersion()}, " ")))
header.AppendSupplier(writeCRLF)