diff options
author | Ted Unangst <tedu@tedunangst.com> | 2019-08-13 12:23:35 -0400 |
---|---|---|
committer | Ted Unangst <tedu@tedunangst.com> | 2019-08-13 12:23:35 -0400 |
commit | cd6ba9eefd8e41cf42299266d40df1d9e025628f (patch) | |
tree | 4de5d346eb11ac2e4d50523162cadeefcc9759a2 | |
parent | 6a8f5f4904ab9189ea76adc8e064232eda6bbde1 (diff) |
simply close code a bit
-rw-r--r-- | miniwebproxy.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/miniwebproxy.go b/miniwebproxy.go index b491686..b6ea959 100644 --- a/miniwebproxy.go +++ b/miniwebproxy.go @@ -38,14 +38,13 @@ import ( func copyuntildone(w net.Conn, r net.Conn, pipe chan net.Conn) { io.Copy(w, r) + w.Close() pipe <- r } func closewhendone(pipe chan net.Conn) { - w := <-pipe - r := <-pipe - w.Close() - r.Close() + <-pipe + <-pipe close(pipe) } |