mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-10-26 08:00:24 +00:00
restrict multi-writer to syscall.conn only
This commit is contained in:
@@ -79,6 +79,13 @@ func NewWriter(writer io.Writer) Writer {
|
||||
return mw
|
||||
}
|
||||
|
||||
if _, ok := writer.(syscall.Conn); !ok {
|
||||
// If the writer doesn't implement syscall.Conn, it is probably not a TCP connection.
|
||||
return &SequentialWriter{
|
||||
Writer: writer,
|
||||
}
|
||||
}
|
||||
|
||||
return &BufferToBytesWriter{
|
||||
Writer: writer,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user