mirror of https://github.com/v2ray/v2ray-core
fix udp broken
parent
3feec68a87
commit
7cfa5aed18
|
@ -164,6 +164,10 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
|
||||||
|
|
||||||
writer = &buf.SequentialWriter{Writer: tConn}
|
writer = &buf.SequentialWriter{Writer: tConn}
|
||||||
tReader := buf.NewPacketReader(tConn)
|
tReader := buf.NewPacketReader(tConn)
|
||||||
|
notify, ok := conn.(buf.ActivityNotifiable)
|
||||||
|
if !ok {
|
||||||
|
panic("conn should implement ActivityNotifiable")
|
||||||
|
}
|
||||||
requestCount++
|
requestCount++
|
||||||
tproxyRequest = func() error {
|
tproxyRequest = func() error {
|
||||||
defer func() {
|
defer func() {
|
||||||
|
@ -171,7 +175,7 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in
|
||||||
timer.SetTimeout(plcy.Timeouts.DownlinkOnly)
|
timer.SetTimeout(plcy.Timeouts.DownlinkOnly)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if err := buf.Copy(tReader, link.Writer, buf.UpdateActivity(timer)); err != nil {
|
if err := buf.Copy(tReader, link.Writer, buf.UpdateActivity(timer), buf.NotifyActivity(notify)); err != nil {
|
||||||
return newError("failed to transport request (TPROXY conn)").Base(err)
|
return newError("failed to transport request (TPROXY conn)").Base(err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue