mirror of https://github.com/v2ray/v2ray-core
reduce delay on passive connections
parent
d828aa2fba
commit
4e30ac33d0
|
@ -147,7 +147,7 @@ func (m *Client) monitor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeFirstPayload(reader buf.Reader, writer *Writer) error {
|
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 {
|
if err == buf.ErrNotTimeoutReader || err == buf.ErrReadTimeout {
|
||||||
return writer.WriteMultiBuffer(buf.MultiBuffer{})
|
return writer.WriteMultiBuffer(buf.MultiBuffer{})
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ func (v *Handler) Process(ctx context.Context, link *core.Link, dialer proxy.Dia
|
||||||
}
|
}
|
||||||
|
|
||||||
bodyWriter := session.EncodeRequestBody(request, writer)
|
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)
|
return newError("failed to write first payload").Base(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue