3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-23 03:02:48 +01:00

Fix clients no longer being able to send commands after a single command errors out

This commit is contained in:
Daniel Oaks 2016-04-15 19:08:52 +10:00
parent fb345a2dd4
commit ed95f09725
2 changed files with 5 additions and 3 deletions

View File

@ -31,3 +31,4 @@ Initial release of Oragono!
* NICK: Improve nickname handling, restrict nicknames that break the protocol. * NICK: Improve nickname handling, restrict nicknames that break the protocol.
* WHOIS: Include the required `<nick>` param on `RPL_ENDOFWHOIS`. * WHOIS: Include the required `<nick>` param on `RPL_ENDOFWHOIS`.
* WHOIS: Hide hidden channels in WHOIS responses. * WHOIS: Hide hidden channels in WHOIS responses.
* Fixed clients no longer being able to send commands after a single command errored out.

View File

@ -67,18 +67,19 @@ func (client *Client) run() {
client.socket.conn.RemoteAddr()))) client.socket.conn.RemoteAddr())))
for err == nil { for err == nil {
//TODO(dan): does this read sockets correctly and split lines properly? (think that ZNC bug that kept happening with mammon)
if line, err = client.socket.Read(); err != nil { if line, err = client.socket.Read(); err != nil {
command = NewQuitCommand("connection closed") command = NewQuitCommand("connection closed")
} else if command, err = ParseCommand(line); err != nil { } else if command, err = ParseCommand(line); err != nil {
switch err { switch err {
case ErrParseCommand: case ErrParseCommand:
//TODO(dan): why is this a notice? there's a proper numeric for this I swear
client.Reply(RplNotice(client.server, client, client.Reply(RplNotice(client.server, client,
NewText("failed to parse command"))) NewText("failed to parse command")))
case NotEnoughArgsError:
// TODO
} }
// so the read loop will continue
err = nil
continue continue
} else if checkPass, ok := command.(checkPasswordCommand); ok { } else if checkPass, ok := command.(checkPasswordCommand); ok {