1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-06 09:15:37 -05:00

fix udp handling in dokodemo and mux

This commit is contained in:
Darien Raymond
2017-05-02 23:36:37 +02:00
parent d5ef224ac0
commit d5f931ae8b
3 changed files with 28 additions and 11 deletions

View File

@@ -84,9 +84,14 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
})
responseDone := signal.ExecuteAsync(func() error {
v2writer := buf.NewWriter(conn)
var writer buf.Writer
if network == net.Network_TCP {
writer = buf.NewWriter(conn)
} else {
writer = buf.NewSequentialWriter(conn)
}
if err := buf.Copy(inboundRay.InboundOutput(), v2writer, buf.UpdateActivity(timer)); err != nil {
if err := buf.Copy(inboundRay.InboundOutput(), writer, buf.UpdateActivity(timer)); err != nil {
return newError("failed to transport response").Base(err)
}
return nil