1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-14 01:29:17 -04:00

completely remove connection reuse feature

This commit is contained in:
Darien Raymond
2017-04-07 21:54:40 +02:00
parent cc8935ee02
commit ade8453c0a
40 changed files with 139 additions and 920 deletions

View File

@@ -60,8 +60,6 @@ func (s *Server) Network() net.NetworkList {
}
func (s *Server) Process(ctx context.Context, network net.Network, conn internet.Connection, dispatcher dispatcher.Interface) error {
conn.SetReusable(false)
switch network {
case net.Network_TCP:
return s.handleConnection(ctx, conn, dispatcher)
@@ -183,7 +181,8 @@ func (s *Server) handleConnection(ctx context.Context, conn internet.Connection,
responseDone := signal.ExecuteAsync(func() error {
defer ray.InboundInput().Close()
if err := buf.PipeUntilEOF(timer, bodyReader, ray.InboundInput()); err != nil {
mergeReader := buf.NewMergingReader(bodyReader)
if err := buf.PipeUntilEOF(timer, mergeReader, ray.InboundInput()); err != nil {
return errors.New("failed to transport all TCP request").Base(err).Path("Shadowsocks", "Server")
}
return nil