Commit 868d368
committed
Fix proxy test hang: close both conns when either pipe direction exits
TestHTTPConnectDialer_Dial timed out after 10 minutes because
handleProxyConn waited for both piping goroutines to signal done, but
the target→client goroutine blocked on targetConn.Read indefinitely
when the client closed its side. Added a sync.Once-guarded closeBoth()
that closes both connections when either direction finishes, so the
other goroutine unblocks immediately.1 parent e5b9f9a commit 868d368
1 file changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
106 | 116 | | |
107 | 117 | | |
108 | 118 | | |
| |||
115 | 125 | | |
116 | 126 | | |
117 | 127 | | |
| 128 | + | |
118 | 129 | | |
119 | 130 | | |
120 | 131 | | |
| |||
128 | 139 | | |
129 | 140 | | |
130 | 141 | | |
| 142 | + | |
131 | 143 | | |
132 | 144 | | |
133 | 145 | | |
| |||
0 commit comments