]> Cypherpunks.ru repositories - goircd.git/blobdiff - daemon.go
Fix unnecessary unlocking causing panics
[goircd.git] / daemon.go
index d46ee07fe0944ea74e63694bd6787cbb253aeb6e..8e22caf96a10a0af87de7243ec422d7f6d58d6df 100644 (file)
--- a/daemon.go
+++ b/daemon.go
@@ -167,7 +167,8 @@ func ClientRegister(client *Client, cmd string, cols []string) {
                        client.ReplyNotEnoughParameters("PASS")
                        return
                }
-               client.password = &cols[1]
+               password := strings.TrimPrefix(cols[1], ":")
+               client.password = &password
        case "NICK":
                if len(cols) == 1 || len(cols[1]) < 1 {
                        client.ReplyParts("431", "No nickname given")
@@ -444,9 +445,7 @@ func Processor(events chan ClientEvent, finished chan struct{}) {
                                        if r, found := rooms[room]; found {
                                                roomSinks[r] <- ClientEvent{client, EventDel, ""}
                                        } else {
-                                               roomsM.RUnlock()
                                                client.ReplyNoChannel(room)
-                                               continue
                                        }
                                }
                                roomsM.RUnlock()