|  | @@ -15,7 +15,6 @@ import (
 | 
											
												
													
														|  |  	"v2ray.com/core/common/buf"
 |  |  	"v2ray.com/core/common/buf"
 | 
											
												
													
														|  |  	"v2ray.com/core/common/errors"
 |  |  	"v2ray.com/core/common/errors"
 | 
											
												
													
														|  |  	"v2ray.com/core/common/net"
 |  |  	"v2ray.com/core/common/net"
 | 
											
												
													
														|  | -	"v2ray.com/core/common/signal"
 |  | 
 | 
											
												
													
														|  |  	"v2ray.com/core/proxy"
 |  |  	"v2ray.com/core/proxy"
 | 
											
												
													
														|  |  	"v2ray.com/core/transport/ray"
 |  |  	"v2ray.com/core/transport/ray"
 | 
											
												
													
														|  |  )
 |  |  )
 | 
											
										
											
												
													
														|  | @@ -147,7 +146,7 @@ func fetchInput(ctx context.Context, s *Session, output buf.Writer) {
 | 
											
												
													
														|  |  		log.Trace(newError("failed to write first payload").Base(err))
 |  |  		log.Trace(newError("failed to write first payload").Base(err))
 | 
											
												
													
														|  |  		return
 |  |  		return
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  | -	if err := buf.Copy(signal.BackgroundTimer(), s.input, writer); err != nil {
 |  | 
 | 
											
												
													
														|  | 
 |  | +	if err := buf.Copy(s.input, writer); err != nil {
 | 
											
												
													
														|  |  		log.Trace(newError("failed to fetch all input").Base(err))
 |  |  		log.Trace(newError("failed to fetch all input").Base(err))
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
										
											
												
													
														|  | @@ -175,7 +174,7 @@ func (m *Client) Dispatch(ctx context.Context, outboundRay ray.OutboundRay) bool
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  func drain(reader *Reader) error {
 |  |  func drain(reader *Reader) error {
 | 
											
												
													
														|  | -	buf.Copy(signal.BackgroundTimer(), reader, buf.Discard)
 |  | 
 | 
											
												
													
														|  | 
 |  | +	buf.Copy(reader, buf.Discard)
 | 
											
												
													
														|  |  	return nil
 |  |  	return nil
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -199,7 +198,7 @@ func (m *Client) handleStatusKeep(meta *FrameMetadata, reader *Reader) error {
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	if s, found := m.sessionManager.Get(meta.SessionID); found {
 |  |  	if s, found := m.sessionManager.Get(meta.SessionID); found {
 | 
											
												
													
														|  | -		return buf.Copy(signal.BackgroundTimer(), reader, s.output, buf.IgnoreWriterError())
 |  | 
 | 
											
												
													
														|  | 
 |  | +		return buf.Copy(reader, s.output, buf.IgnoreWriterError())
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	return drain(reader)
 |  |  	return drain(reader)
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
										
											
												
													
														|  | @@ -291,7 +290,7 @@ type ServerWorker struct {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  func handle(ctx context.Context, s *Session, output buf.Writer) {
 |  |  func handle(ctx context.Context, s *Session, output buf.Writer) {
 | 
											
												
													
														|  |  	writer := NewResponseWriter(s.ID, output)
 |  |  	writer := NewResponseWriter(s.ID, output)
 | 
											
												
													
														|  | -	if err := buf.Copy(signal.BackgroundTimer(), s.input, writer); err != nil {
 |  | 
 | 
											
												
													
														|  | 
 |  | +	if err := buf.Copy(s.input, writer); err != nil {
 | 
											
												
													
														|  |  		log.Trace(newError("session ", s.ID, " ends: ").Base(err))
 |  |  		log.Trace(newError("session ", s.ID, " ends: ").Base(err))
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	writer.Close()
 |  |  	writer.Close()
 | 
											
										
											
												
													
														|  | @@ -323,7 +322,7 @@ func (w *ServerWorker) handleStatusNew(ctx context.Context, meta *FrameMetadata,
 | 
											
												
													
														|  |  	w.sessionManager.Add(s)
 |  |  	w.sessionManager.Add(s)
 | 
											
												
													
														|  |  	go handle(ctx, s, w.outboundRay.OutboundOutput())
 |  |  	go handle(ctx, s, w.outboundRay.OutboundOutput())
 | 
											
												
													
														|  |  	if meta.Option.Has(OptionData) {
 |  |  	if meta.Option.Has(OptionData) {
 | 
											
												
													
														|  | -		return buf.Copy(signal.BackgroundTimer(), reader, s.output, buf.IgnoreWriterError())
 |  | 
 | 
											
												
													
														|  | 
 |  | +		return buf.Copy(reader, s.output, buf.IgnoreWriterError())
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	return nil
 |  |  	return nil
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
										
											
												
													
														|  | @@ -333,7 +332,7 @@ func (w *ServerWorker) handleStatusKeep(meta *FrameMetadata, reader *Reader) err
 | 
											
												
													
														|  |  		return nil
 |  |  		return nil
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	if s, found := w.sessionManager.Get(meta.SessionID); found {
 |  |  	if s, found := w.sessionManager.Get(meta.SessionID); found {
 | 
											
												
													
														|  | -		return buf.Copy(signal.BackgroundTimer(), reader, s.output, buf.IgnoreWriterError())
 |  | 
 | 
											
												
													
														|  | 
 |  | +		return buf.Copy(reader, s.output, buf.IgnoreWriterError())
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	return drain(reader)
 |  |  	return drain(reader)
 | 
											
												
													
														|  |  }
 |  |  }
 |