1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

reduce delay on passive connections

This commit is contained in:
Darien Raymond 2018-08-21 23:09:45 +02:00
parent d828aa2fba
commit 4e30ac33d0
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 2 additions and 2 deletions

View File

@ -147,7 +147,7 @@ func (m *Client) monitor() {
}
func writeFirstPayload(reader buf.Reader, writer *Writer) error {
err := buf.CopyOnceTimeout(reader, writer, time.Millisecond*200)
err := buf.CopyOnceTimeout(reader, writer, time.Millisecond*100)
if err == buf.ErrNotTimeoutReader || err == buf.ErrReadTimeout {
return writer.WriteMultiBuffer(buf.MultiBuffer{})
}

View File

@ -120,7 +120,7 @@ func (v *Handler) Process(ctx context.Context, link *core.Link, dialer proxy.Dia
}
bodyWriter := session.EncodeRequestBody(request, writer)
if err := buf.CopyOnceTimeout(input, bodyWriter, time.Millisecond*500); err != nil && err != buf.ErrNotTimeoutReader && err != buf.ErrReadTimeout {
if err := buf.CopyOnceTimeout(input, bodyWriter, time.Millisecond*100); err != nil && err != buf.ErrNotTimeoutReader && err != buf.ErrReadTimeout {
return newError("failed to write first payload").Base(err)
}