mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-25 07:20:44 +00:00
use stream instead of raw chan
This commit is contained in:
1 parent
42b8dbe871
commit
7407c8d561
25 files changed
+217
-188
No files matched your search
@@ -199,13 +199,17 @@ func (this *Point) FilterPacketAndDispatch(packet v2net.Packet, link ray.Outboun
|
||||
chunk := packet.Chunk()
|
||||
moreChunks := packet.MoreChunks()
|
||||
changed := false
|
||||
var err error
|
||||
for chunk == nil && moreChunks {
|
||||
changed = true
|
||||
chunk, moreChunks = <-link.OutboundInput()
|
||||
chunk, err = link.OutboundInput().Read()
|
||||
if err != nil {
|
||||
moreChunks = false
|
||||
}
|
||||
}
|
||||
if chunk == nil && !moreChunks {
|
||||
log.Info("Point: No payload to dispatch, stopping dispatching now.")
|
||||
close(link.OutboundOutput())
|
||||
link.OutboundOutput().Close()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user