mirror of
				https://github.com/tailscale/tailscale.git
				synced 2025-10-25 02:02:51 +00:00 
			
		
		
		
	wgengine/magicsock: remove TODO
The TODO above derphttp.NewClient suggests it does network I/O, but the derphttp client connects lazily and so creating one is very cheap. Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
		 David Crawshaw
					David Crawshaw
				
			
				
					committed by
					
						 David Crawshaw
						David Crawshaw
					
				
			
			
				
	
			
			
			 David Crawshaw
						David Crawshaw
					
				
			
						parent
						
							af58cfc476
						
					
				
				
					commit
					7ec54e0064
				
			| @@ -706,7 +706,8 @@ func (c *Conn) derpWriteChanOfAddr(addr *net.UDPAddr) chan<- derpWriteRequest { | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		// TODO(bradfitz): don't hold derpMu here. It's slow. Release first and use singleflight to dial+re-lock to add. | ||||
| 		// Note that derphttp.NewClient does not dial the server | ||||
| 		// so it is safe to do under the derpMu lock. | ||||
| 		dc, err := derphttp.NewClient(c.privateKey, "https://"+derpSrv.HostHTTPS+"/derp", c.logf) | ||||
| 		if err != nil { | ||||
| 			c.logf("derphttp.NewClient: port %d, host %q invalid? err: %v", addr.Port, derpSrv.HostHTTPS, err) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user