3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 18:52:41 +01:00

don't async buffer flushing

This commit is contained in:
Jeremy Latt 2014-03-29 11:56:23 -07:00
parent 78b787f3ae
commit 142bf3d3bb
2 changed files with 4 additions and 6 deletions

View File

@ -1,7 +1,7 @@
package irc package irc
const ( const (
SEM_VER = "ergonomadic-1.4.1" SEM_VER = "ergonomadic-1.4.2"
CRLF = "\r\n" CRLF = "\r\n"
MAX_REPLY_LEN = 512 - len(CRLF) MAX_REPLY_LEN = 512 - len(CRLF)

View File

@ -74,16 +74,14 @@ func (socket *Socket) Write(line string) (err error) {
return return
} }
go socket.flush() if err = socket.writer.Flush(); socket.isError(err, W) {
return
}
Log.debug.Printf("%s ← %s", socket, line) Log.debug.Printf("%s ← %s", socket, line)
return return
} }
func (socket *Socket) flush() {
socket.isError(socket.writer.Flush(), W)
}
func (socket *Socket) isError(err error, dir rune) bool { func (socket *Socket) isError(err error, dir rune) bool {
if err != nil { if err != nil {
if err != io.EOF { if err != io.EOF {