forked from External/ergo
cleanup
This commit is contained in:
parent
2dc69c7e3d
commit
3b12dec207
2 changed files with 11 additions and 17 deletions
|
|
@ -38,6 +38,10 @@ func (socket *Socket) Close() {
|
|||
}
|
||||
|
||||
func (socket *Socket) readLines(commands chan<- Command) {
|
||||
commands <- &ProxyCommand{
|
||||
hostname: AddrLookupHostname(socket.conn.RemoteAddr()),
|
||||
}
|
||||
|
||||
scanner := bufio.NewScanner(socket.conn)
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
|
|
@ -58,6 +62,10 @@ func (socket *Socket) readLines(commands chan<- Command) {
|
|||
Log.debug.Printf("%s error: %s", socket, err)
|
||||
}
|
||||
|
||||
commands <- &QuitCommand{
|
||||
message: "connection closed",
|
||||
}
|
||||
|
||||
close(commands)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue