mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-01 22:38:56 -07:00
remove unnecessary String()s; rename parse functions
This commit is contained in:
+2
-6
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user