From 142bf3d3bb9098fc6a57b418af2fe7ed5a73a777 Mon Sep 17 00:00:00 2001 From: Jeremy Latt Date: Sat, 29 Mar 2014 11:56:23 -0700 Subject: [PATCH] don't async buffer flushing --- irc/constants.go | 2 +- irc/socket.go | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/irc/constants.go b/irc/constants.go index 9125666a..cb604680 100644 --- a/irc/constants.go +++ b/irc/constants.go @@ -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) diff --git a/irc/socket.go b/irc/socket.go index bee701e9..06a2be5a 100644 --- a/irc/socket.go +++ b/irc/socket.go @@ -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 {