1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-25 17:05:23 +00:00

prevent using net.Conn.WriteTo()

This commit is contained in:
Darien Raymond 2017-11-24 23:24:12 +01:00
parent 2fdccb2424
commit 74327ea8ae
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -86,8 +86,12 @@ func parseBasicAuth(auth string) (username, password string, ok bool) {
return cs[:s], cs[s+1:], true
}
type readerOnly struct {
io.Reader
}
func (s *Server) Process(ctx context.Context, network net.Network, conn internet.Connection, dispatcher dispatcher.Interface) error {
reader := bufio.NewReaderSize(conn, buf.Size)
reader := bufio.NewReaderSize(readerOnly{conn}, buf.Size)
Start:
conn.SetReadDeadline(time.Now().Add(time.Second * 16))