Browse Source

force packet reader in freedom on UDP

pull/1465/head
Darien Raymond 6 years ago
parent
commit
ec95dca3e5
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
  1. 8
      proxy/freedom/freedom.go

8
proxy/freedom/freedom.go

@ -160,7 +160,13 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
responseDone := func() error {
defer timer.SetTimeout(plcy.Timeouts.UplinkOnly)
if err := buf.Copy(buf.NewReader(conn), output, buf.UpdateActivity(timer)); err != nil {
var reader buf.Reader
if destination.Network == net.Network_TCP {
reader = buf.NewReader(conn)
} else {
reader = &buf.PacketReader{Reader: conn}
}
if err := buf.Copy(reader, output, buf.UpdateActivity(timer)); err != nil {
return newError("failed to process response").Base(err)
}

Loading…
Cancel
Save