mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
Apply Debian's patch to upstream
This commit is contained in:
parent
bf80143789
commit
90af5f19ba
@ -249,7 +249,7 @@ func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, option IPO
|
|||||||
b, _ := dns.PackMessage(r.msg)
|
b, _ := dns.PackMessage(r.msg)
|
||||||
resp, err := s.dohHTTPSContext(dnsCtx, b.Bytes())
|
resp, err := s.dohHTTPSContext(dnsCtx, b.Bytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newError("failed to retrive response").Base(err).AtError().WriteToLog()
|
newError("failed to retrieve response").Base(err).AtError().WriteToLog()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
rec, err := parseResponse(resp)
|
rec, err := parseResponse(resp)
|
||||||
|
@ -108,7 +108,7 @@ func (s *ClassicNameServer) HandleResponse(ctx context.Context, packet *udp_prot
|
|||||||
|
|
||||||
ipRec, err := parseResponse(packet.Payload.Bytes())
|
ipRec, err := parseResponse(packet.Payload.Bytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
newError(s.name, " fail to parse responsed DNS udp").AtError().WriteToLog()
|
newError(s.name, " fail to parse responded DNS udp").AtError().WriteToLog()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
0
app/proxyman/command/command.go
Executable file → Normal file
0
app/proxyman/command/command.go
Executable file → Normal file
0
common/crypto/chunk.go
Executable file → Normal file
0
common/crypto/chunk.go
Executable file → Normal file
0
common/protocol/account.go
Executable file → Normal file
0
common/protocol/account.go
Executable file → Normal file
0
common/protocol/context.go
Executable file → Normal file
0
common/protocol/context.go
Executable file → Normal file
0
common/protocol/id.go
Executable file → Normal file
0
common/protocol/id.go
Executable file → Normal file
0
common/signal/done/done.go
Executable file → Normal file
0
common/signal/done/done.go
Executable file → Normal file
0
common/signal/notifier.go
Executable file → Normal file
0
common/signal/notifier.go
Executable file → Normal file
0
common/uuid/uuid.go
Executable file → Normal file
0
common/uuid/uuid.go
Executable file → Normal file
0
proxy/http/server.go
Executable file → Normal file
0
proxy/http/server.go
Executable file → Normal file
0
proxy/proxy.go
Executable file → Normal file
0
proxy/proxy.go
Executable file → Normal file
0
proxy/vmess/account.pb.go
Executable file → Normal file
0
proxy/vmess/account.pb.go
Executable file → Normal file
0
proxy/vmess/account.proto
Executable file → Normal file
0
proxy/vmess/account.proto
Executable file → Normal file
0
transport/internet/kcp/segment.go
Executable file → Normal file
0
transport/internet/kcp/segment.go
Executable file → Normal file
@ -15,10 +15,10 @@ var (
|
|||||||
type controller func(network, address string, fd uintptr) error
|
type controller func(network, address string, fd uintptr) error
|
||||||
|
|
||||||
type DefaultListener struct {
|
type DefaultListener struct {
|
||||||
contollers []controller
|
controllers []controller
|
||||||
}
|
}
|
||||||
|
|
||||||
func getControlFunc(ctx context.Context, sockopt *SocketConfig, contollers []controller) func(network, address string, c syscall.RawConn) error {
|
func getControlFunc(ctx context.Context, sockopt *SocketConfig, controllers []controller) func(network, address string, c syscall.RawConn) error {
|
||||||
return func(network, address string, c syscall.RawConn) error {
|
return func(network, address string, c syscall.RawConn) error {
|
||||||
return c.Control(func(fd uintptr) {
|
return c.Control(func(fd uintptr) {
|
||||||
if sockopt != nil {
|
if sockopt != nil {
|
||||||
@ -27,7 +27,7 @@ func getControlFunc(ctx context.Context, sockopt *SocketConfig, contollers []con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, controller := range contollers {
|
for _, controller := range controllers {
|
||||||
if err := controller(network, address, fd); err != nil {
|
if err := controller(network, address, fd); err != nil {
|
||||||
newError("failed to apply external controller").Base(err).WriteToLog(session.ExportIDToError(ctx))
|
newError("failed to apply external controller").Base(err).WriteToLog(session.ExportIDToError(ctx))
|
||||||
}
|
}
|
||||||
@ -39,8 +39,8 @@ func getControlFunc(ctx context.Context, sockopt *SocketConfig, contollers []con
|
|||||||
func (dl *DefaultListener) Listen(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.Listener, error) {
|
func (dl *DefaultListener) Listen(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.Listener, error) {
|
||||||
var lc net.ListenConfig
|
var lc net.ListenConfig
|
||||||
|
|
||||||
if sockopt != nil || len(dl.contollers) > 0 {
|
if sockopt != nil || len(dl.controllers) > 0 {
|
||||||
lc.Control = getControlFunc(ctx, sockopt, dl.contollers)
|
lc.Control = getControlFunc(ctx, sockopt, dl.controllers)
|
||||||
}
|
}
|
||||||
|
|
||||||
return lc.Listen(ctx, addr.Network(), addr.String())
|
return lc.Listen(ctx, addr.Network(), addr.String())
|
||||||
@ -49,8 +49,8 @@ func (dl *DefaultListener) Listen(ctx context.Context, addr net.Addr, sockopt *S
|
|||||||
func (dl *DefaultListener) ListenPacket(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.PacketConn, error) {
|
func (dl *DefaultListener) ListenPacket(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.PacketConn, error) {
|
||||||
var lc net.ListenConfig
|
var lc net.ListenConfig
|
||||||
|
|
||||||
if sockopt != nil || len(dl.contollers) > 0 {
|
if sockopt != nil || len(dl.controllers) > 0 {
|
||||||
lc.Control = getControlFunc(ctx, sockopt, dl.contollers)
|
lc.Control = getControlFunc(ctx, sockopt, dl.controllers)
|
||||||
}
|
}
|
||||||
|
|
||||||
return lc.ListenPacket(ctx, addr.Network(), addr.String())
|
return lc.ListenPacket(ctx, addr.Network(), addr.String())
|
||||||
@ -65,6 +65,6 @@ func RegisterListenerController(controller func(network, address string, fd uint
|
|||||||
return newError("nil listener controller")
|
return newError("nil listener controller")
|
||||||
}
|
}
|
||||||
|
|
||||||
effectiveListener.contollers = append(effectiveListener.contollers, controller)
|
effectiveListener.controllers = append(effectiveListener.controllers, controller)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
0
transport/internet/websocket/ws.go
Executable file → Normal file
0
transport/internet/websocket/ws.go
Executable file → Normal file
Loading…
Reference in New Issue
Block a user