use stream instead of raw chan

This commit is contained in:
v2ray committed 2016-04-18 18:44:10 +02:00
1 parent 42b8dbe871
commit 7407c8d561
25 files changed
+217 -188

No files matched your search

+6 -2
View File
@@ -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
}