stop leaking client goroutines; closes #34

This commit is contained in:
Jeremy Latt 2014-03-27 16:49:22 -07:00
parent c2e3bbe494
commit d696f2313e
2 changed files with 17 additions and 12 deletions

View file

@ -41,10 +41,6 @@ func (socket *Socket) Close() {
}
func (socket *Socket) readLines(commands chan<- Command) {
commands <- &ProxyCommand{
hostname: AddrLookupHostname(socket.conn.RemoteAddr()),
}
for {
line, err := socket.reader.ReadString('\n')
if socket.isError(err, R) {
@ -64,9 +60,7 @@ func (socket *Socket) readLines(commands chan<- Command) {
commands <- msg
}
commands <- &QuitCommand{
message: "connection closed",
}
close(commands)
}
func (socket *Socket) Write(line string) (err error) {