mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -05:00 
			
		
		
		
	New function DialWithDialer to create FCGIClient with custom Dialer.
This commit is contained in:
		
							parent
							
								
									b089d14b67
								
							
						
					
					
						commit
						b1208d3fdf
					
				@ -169,12 +169,11 @@ type FCGIClient struct {
 | 
				
			|||||||
	reqID     uint16
 | 
						reqID     uint16
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Dial connects to the fcgi responder at the specified network address.
 | 
					// DialWithDialer connects to the fcgi responder at the specified network address, using custom net.Dialer.
 | 
				
			||||||
// See func net.Dial for a description of the network and address parameters.
 | 
					// See func net.Dial for a description of the network and address parameters.
 | 
				
			||||||
func Dial(network, address string) (fcgi *FCGIClient, err error) {
 | 
					func DialWithDialer(network, address string, dialer net.Dialer) (fcgi *FCGIClient, err error) {
 | 
				
			||||||
	var conn net.Conn
 | 
						var conn net.Conn
 | 
				
			||||||
 | 
						conn, err = dialer.Dial(network, address)
 | 
				
			||||||
	conn, err = net.Dial(network, address)
 | 
					 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -188,6 +187,12 @@ func Dial(network, address string) (fcgi *FCGIClient, err error) {
 | 
				
			|||||||
	return
 | 
						return
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Dial connects to the fcgi responder at the specified network address, using default net.Dialer.
 | 
				
			||||||
 | 
					// See func net.Dial for a description of the network and address parameters.
 | 
				
			||||||
 | 
					func Dial(network, address string) (fcgi *FCGIClient, err error) {
 | 
				
			||||||
 | 
						return DialWithDialer(network, address, net.Dialer{})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Close closes fcgi connnection
 | 
					// Close closes fcgi connnection
 | 
				
			||||||
func (c *FCGIClient) Close() {
 | 
					func (c *FCGIClient) Close() {
 | 
				
			||||||
	c.rwc.Close()
 | 
						c.rwc.Close()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user