mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
don't async buffer flushing
This commit is contained in:
parent
78b787f3ae
commit
142bf3d3bb
@ -1,7 +1,7 @@
|
||||
package irc
|
||||
|
||||
const (
|
||||
SEM_VER = "ergonomadic-1.4.1"
|
||||
SEM_VER = "ergonomadic-1.4.2"
|
||||
CRLF = "\r\n"
|
||||
MAX_REPLY_LEN = 512 - len(CRLF)
|
||||
|
||||
|
@ -74,16 +74,14 @@ func (socket *Socket) Write(line string) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
go socket.flush()
|
||||
if err = socket.writer.Flush(); socket.isError(err, W) {
|
||||
return
|
||||
}
|
||||
|
||||
Log.debug.Printf("%s ← %s", socket, line)
|
||||
return
|
||||
}
|
||||
|
||||
func (socket *Socket) flush() {
|
||||
socket.isError(socket.writer.Flush(), W)
|
||||
}
|
||||
|
||||
func (socket *Socket) isError(err error, dir rune) bool {
|
||||
if err != nil {
|
||||
if err != io.EOF {
|
||||
|
Loading…
Reference in New Issue
Block a user