@@ -123,7 +123,7 @@ func (s *server) ListenAndServe(_ context.Context) error {
123
123
}
124
124
}()
125
125
126
- return http .Serve (s .ll , r )
126
+ return http .Serve (s .ml , r )
127
127
}
128
128
129
129
type memListen struct {
@@ -153,10 +153,10 @@ func (m *memListen) Addr() net.Addr {
153
153
return & net.IPAddr {}
154
154
}
155
155
156
- func (m * memListen ) Dial () net.Conn {
156
+ func (m * memListen ) Dial () ( net.Conn , error ) {
157
157
in , out := net .Pipe ()
158
158
m .listen <- in
159
- return out
159
+ return out , nil
160
160
}
161
161
162
162
type memDialer struct {
@@ -170,7 +170,7 @@ func (m memDialer) Dial(network string, address string) (net.Conn, error) {
170
170
return nil , errors .New ("tls not supported" )
171
171
}
172
172
173
- return m .ll .Dial ()
173
+ return m .ml .Dial ()
174
174
}
175
175
176
176
func (m memDialer ) DialContext (ctx context.Context , network string , address string ) (net.Conn , error ) {
@@ -183,7 +183,7 @@ func (m memDialer) DialContext(ctx context.Context, network string, address stri
183
183
return d .DialContext (ctx , network , address )
184
184
}
185
185
186
- return m .ll .Dial ()
186
+ return m .ml .Dial ()
187
187
}
188
188
189
189
func (s * server ) Dialer () netns.Dialer {
@@ -253,7 +253,13 @@ func (s *server) NoiseUpgradeHandler(w http.ResponseWriter, r *http.Request) {
253
253
w ,
254
254
r ,
255
255
s .noisePrivateKey ,
256
- ns .earlyNoise ,
256
+ // ns.earlyNoise,
257
+ // TODO: for some reason when using an unbuffered network connection
258
+ // (such as our in-memory connection to the tsserver), the client will
259
+ // just hang on https://github.com/coadler/tailscale/blob/main/internal/noiseconn/conn.go#L59
260
+ // and https://github.com/coadler/tailscale/blob/main/control/controlhttp/server.go#L107.
261
+ // Disabling the early write seems to fix it.
262
+ nil ,
257
263
)
258
264
if err != nil {
259
265
// http.Error(w, err.Error(), http.StatusInternalServerError)
0 commit comments