]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: fix goroutine leak for DumpRequestOut
authorAgniva De Sarker <agnivade@yahoo.co.in>
Thu, 13 Jun 2019 04:59:39 +0000 (10:29 +0530)
committerAgniva De Sarker <agniva.quicksilver@gmail.com>
Wed, 28 Aug 2019 04:44:32 +0000 (04:44 +0000)
commite7a4ab427d0df0f1b18c5899552bed6e3bc75266
tree1022c58a50f258987f6039cb696bf1dfb14702ec
parent8fedb2d3383c29a00c8b43dc456a0ac03f836b45
net/http/httputil: fix goroutine leak for DumpRequestOut

When an invalid URL was passed to DumpRequestOut, it would directly return
without gracefully shutting down the reader goroutine.

So we create a channel and signal the reader goroutine to exit
if an error occurs during roundtrip.

Fixes #32571

Change-Id: I8c2970f1601e599f3d1ebfed298faf5f5716fc2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/182037
Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
src/net/http/httputil/dump.go
src/net/http/httputil/dump_test.go