1
0
Fork 0
forked from External/ergo

remove unnecessary String()s; rename parse functions

This commit is contained in:
Jeremy Latt 2014-03-28 13:47:49 -07:00
parent 21a86c3216
commit b0bb0faadc
6 changed files with 93 additions and 185 deletions

View file

@ -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)
}