mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-04 20:37:40 +03:00
Fix HandshakeConn write back
This commit is contained in:
parent
ad6dd0aa7b
commit
18a3739974
2 changed files with 17 additions and 15 deletions
|
@ -67,7 +67,8 @@ func (r *BufferedReader) ReadBuffer(buffer *buf.Buffer) error {
|
|||
return err
|
||||
}
|
||||
|
||||
func (r *BufferedReader) WriteTo(w io.Writer) (n int64, err error) {
|
||||
//TODO: add CopyBuffer
|
||||
/*func (r *BufferedReader) WriteTo(w io.Writer) (n int64, err error) {
|
||||
if r.buffer == nil {
|
||||
return Copy(w, r.upstream)
|
||||
}
|
||||
|
@ -76,7 +77,7 @@ func (r *BufferedReader) WriteTo(w io.Writer) (n int64, err error) {
|
|||
}
|
||||
defer r.buffer.Release()
|
||||
return CopyExtendedBuffer(NewExtendedWriter(w), NewExtendedReader(r.upstream), r.buffer)
|
||||
}
|
||||
}*/
|
||||
|
||||
func (r *BufferedReader) ReadCached() *buf.Buffer {
|
||||
buffer := r.buffer
|
||||
|
@ -150,12 +151,12 @@ func (w *BufferedWriter) Fallthrough() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (w *BufferedWriter) ReadFrom(r io.Reader) (n int64, err error) {
|
||||
/*func (w *BufferedWriter) ReadFrom(r io.Reader) (n int64, err error) {
|
||||
if w.buffer == nil {
|
||||
return Copy(w.upstream, r)
|
||||
}
|
||||
return CopyExtendedBuffer(NewExtendedWriter(w), NewExtendedReader(r), w.buffer)
|
||||
}
|
||||
}*/
|
||||
|
||||
func (w *BufferedWriter) WriterReplaceable() bool {
|
||||
return w.buffer == nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue