Skip to content
Permalink
Browse files

Bugfix: correctly reject lines that are not parsed by sorcix/irc

  • Loading branch information...
stapelberg committed Jan 2, 2016
1 parent 979b014 commit 531dbc140a38e84afd0fa282244c0317bbd35772
Showing with 13 additions and 2 deletions.
  1. +13 −2 ircserver/ircserver.go
@@ -416,14 +416,25 @@ func (i *IRCServer) maybeDeleteChannel(c *channel) {
func (i *IRCServer) ProcessMessage(id types.RobustId, session types.RobustId, message *irc.Message) *Replyctx {
i.sessionsMu.Lock()
defer i.sessionsMu.Unlock()

// alias for convenience
s := i.sessions[session]
reply := &Replyctx{msgid: id.Id, session: s}

if message == nil {
i.sendUser(s, reply, &irc.Message{
Prefix: i.ServerPrefix,
Command: irc.ERR_UNKNOWNCOMMAND,
Params: []string{s.Nick},
Trailing: "Unknown command",
})
return reply
}

command := strings.ToUpper(message.Command)

messagesProcessed.WithLabelValues(command).Inc()

reply := &Replyctx{msgid: id.Id, session: s}

if !s.loggedIn() && !s.Server &&
command != irc.NICK &&
command != irc.USER &&

0 comments on commit 531dbc1

Please sign in to comment.
You can’t perform that action at this time.