don't do a short write
This commit is contained in:
parent
a66d31f447
commit
28a30bdd3d
@ -22,9 +22,13 @@ func (l *LineWriter) Write(data []byte) (n int, err error) {
|
|||||||
err = ErrOversizedMessage
|
err = ErrOversizedMessage
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
wr := len(data)
|
||||||
data = bytes.Replace(data, []byte{13, 10}, []byte{10}, -1)
|
data = bytes.Replace(data, []byte{13, 10}, []byte{10}, -1)
|
||||||
n, err = l.w.Write(data)
|
n, err = l.w.Write(data)
|
||||||
l.Left -= int64(n)
|
l.Left -= int64(n)
|
||||||
|
if err != nil {
|
||||||
|
return n, err
|
||||||
|
}
|
||||||
|
n = wr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user