From: Sergey Matveev Date: Sun, 18 May 2014 11:26:50 +0000 (+0400) Subject: Unnecessary message broadcasting goroutines X-Git-Tag: 1.0~23 X-Git-Url: http://www.git.cypherpunks.ru/?p=goircd.git;a=commitdiff_plain;h=216a9dc05efb227bf793e18ec10fcc978f782d21 Unnecessary message broadcasting goroutines --- diff --git a/room.go b/room.go index f92d0e6..87b35f6 100644 --- a/room.go +++ b/room.go @@ -87,7 +87,7 @@ func (room *Room) Processor(events chan ClientEvent) { room.members[client] = true log.Println(client, "joined", room.name) room.SendTopic(client) - go room.Broadcast(fmt.Sprintf(":%s JOIN %s", client, room.name)) + room.Broadcast(fmt.Sprintf(":%s JOIN %s", client, room.name)) room.log_sink <- LogEvent{room.name, client.nickname, "joined", true} nicknames := []string{} for member := range room.members { @@ -163,7 +163,7 @@ func (room *Room) Processor(events chan ClientEvent) { room.StateSave() case EVENT_MSG: sep := strings.Index(event.text, " ") - go room.Broadcast(fmt.Sprintf(":%s %s %s :%s", client, event.text[:sep], room.name, event.text[sep+1:]), client) + room.Broadcast(fmt.Sprintf(":%s %s %s :%s", client, event.text[:sep], room.name, event.text[sep+1:]), client) room.log_sink <- LogEvent{room.name, client.nickname, event.text[sep+1:], false} } }