mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
more memory-efficient implementation of line reading
This commit is contained in:
parent
12bcba01cd
commit
c78253fd93
6 changed files with 96 additions and 45 deletions
|
|
@ -69,10 +69,6 @@ func (socket *Socket) Read() (string, error) {
|
|||
|
||||
if err == io.EOF {
|
||||
socket.Close()
|
||||
// process last message properly (such as ERROR/QUIT/etc), just fail next reads/writes
|
||||
if line != "" {
|
||||
err = nil
|
||||
}
|
||||
}
|
||||
|
||||
return line, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue