File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -132,13 +132,11 @@ type memListen struct {
132
132
133
133
// Accept waits for and returns the next connection to the listener.
134
134
func (m * memListen ) Accept () (net.Conn , error ) {
135
- select {
136
- case c := <- m .listen :
137
- if c == nil {
138
- return nil , errors .New ("closed" )
139
- }
140
- return c , nil
135
+ c , ok := <- m .listen
136
+ if ! ok {
137
+ return nil , errors .New ("closed" )
141
138
}
139
+ return c , nil
142
140
}
143
141
144
142
// Close closes the listener.
@@ -258,7 +256,10 @@ func (s *server) NoiseUpgradeHandler(w http.ResponseWriter, r *http.Request) {
258
256
// (such as our in-memory connection to the tsserver), the client will
259
257
// just hang on https://github.com/coadler/tailscale/blob/main/internal/noiseconn/conn.go#L59
260
258
// and https://github.com/coadler/tailscale/blob/main/control/controlhttp/server.go#L107.
261
- // Disabling the early write seems to fix it.
259
+ // Disabling the early write seems to fix it. Using a buffered network
260
+ // connection (such as *fasthttputil.InmemoryListener), works somewhat
261
+ // but still causes random race conditions that causes the connection to
262
+ // stall.
262
263
nil ,
263
264
)
264
265
if err != nil {
You can’t perform that action at this time.
0 commit comments