|
@@ -88,11 +88,10 @@ func newTransportConn(c net.Conn, tr *ProxyAuthTransport) *transportConn {
|
|
|
for {
|
|
for {
|
|
|
req, err := http.ReadRequest(bufio.NewReader(pr))
|
|
req, err := http.ReadRequest(bufio.NewReader(pr))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
- tc.Close()
|
|
|
|
|
- tc.errChannel <- fmt.Errorf("intercept request loop http.ReadRequest error: %s", err)
|
|
|
|
|
|
|
+ tc.Conn.Close()
|
|
|
pr.Close()
|
|
pr.Close()
|
|
|
pw.Close()
|
|
pw.Close()
|
|
|
- tc.Close()
|
|
|
|
|
|
|
+ tc.errChannel <- fmt.Errorf("intercept request loop http.ReadRequest error: %s", err)
|
|
|
break requestInterceptLoop
|
|
break requestInterceptLoop
|
|
|
}
|
|
}
|
|
|
//read and copy entire body
|
|
//read and copy entire body
|
|
@@ -157,10 +156,7 @@ func (tc *transportConn) Read(p []byte) (int, error) {
|
|
|
return 0, err
|
|
return 0, err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //TODO: eliminate possible race condition
|
|
|
|
|
//Replay authenticated request
|
|
//Replay authenticated request
|
|
|
- //block until a new cycle of the request intercept loop started
|
|
|
|
|
- //<-tc.writeBlocker
|
|
|
|
|
tc.lastRequest.WriteProxy(tc)
|
|
tc.lastRequest.WriteProxy(tc)
|
|
|
return tc.Read(p)
|
|
return tc.Read(p)
|
|
|
}
|
|
}
|