mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
remove unnecessary String()s; rename parse functions
This commit is contained in:
parent
21a86c3216
commit
b0bb0faadc
6 changed files with 93 additions and 185 deletions
|
|
@ -38,9 +38,7 @@ func (socket *Socket) Close() {
|
|||
}
|
||||
|
||||
func (socket *Socket) readLines(commands chan<- Command) {
|
||||
commands <- &ProxyCommand{
|
||||
hostname: AddrLookupHostname(socket.conn.RemoteAddr()),
|
||||
}
|
||||
commands <- NewProxyCommand(AddrLookupHostname(socket.conn.RemoteAddr()))
|
||||
|
||||
scanner := bufio.NewScanner(socket.conn)
|
||||
for scanner.Scan() {
|
||||
|
|
@ -62,9 +60,7 @@ func (socket *Socket) readLines(commands chan<- Command) {
|
|||
Log.debug.Printf("%s error: %s", socket, err)
|
||||
}
|
||||
|
||||
commands <- &QuitCommand{
|
||||
message: "connection closed",
|
||||
}
|
||||
commands <- NewQuitCommand("connection closed")
|
||||
|
||||
close(commands)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue