Browse Source

restrict multi-writer to syscall.conn only

pull/1524/head^2
Darien Raymond 6 years ago
parent
commit
f27a381fe8
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
  1. 7
      common/buf/io.go

7
common/buf/io.go

@ -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,
}

Loading…
Cancel
Save