forked from External/ergo
stop leaking client goroutines; closes #34
This commit is contained in:
parent
c2e3bbe494
commit
d696f2313e
2 changed files with 17 additions and 12 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue