mirror of https://github.com/v2ray/v2ray-core
commit
68fe9d8007
|
@ -72,6 +72,7 @@ func (v *DefaultDispatcher) DispatchToOutbound(session *proxy.SessionInfo) ray.I
|
||||||
return direct
|
return direct
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FilterPacketAndDispatch waits for a payload from source and starts dispatching.
|
||||||
// Private: Visible for testing.
|
// Private: Visible for testing.
|
||||||
func (v *DefaultDispatcher) FilterPacketAndDispatch(destination v2net.Destination, link ray.OutboundRay, dispatcher proxy.OutboundHandler) {
|
func (v *DefaultDispatcher) FilterPacketAndDispatch(destination v2net.Destination, link ray.OutboundRay, dispatcher proxy.OutboundHandler) {
|
||||||
payload, err := link.OutboundInput().Read()
|
payload, err := link.OutboundInput().Read()
|
||||||
|
|
|
@ -99,10 +99,12 @@ func (v *Client) Dispatch(destination v2net.Destination, payload *buf.Buffer, ra
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !payload.IsEmpty() {
|
||||||
if err := bodyWriter.Write(payload); err != nil {
|
if err := bodyWriter.Write(payload); err != nil {
|
||||||
log.Info("Shadowsocks|Client: Failed to write payload: ", err)
|
log.Info("Shadowsocks|Client: Failed to write payload: ", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var responseMutex sync.Mutex
|
var responseMutex sync.Mutex
|
||||||
responseMutex.Lock()
|
responseMutex.Lock()
|
||||||
|
|
Loading…
Reference in New Issue