Merge 05fd3a025c into 2fdafd34ca
				
					
				
			This commit is contained in:
		
						commit
						fbea9c29cf
					
				
							
								
								
									
										16
									
								
								util/util.go
								
								
								
								
							
							
						
						
									
										16
									
								
								util/util.go
								
								
								
								
							|  | @ -62,6 +62,8 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G | |||
| 
 | ||||
| 	desiredHost := setting.EndpointAddress | ||||
| 	desiredPort := server.Interface.ListenPort | ||||
| 	is_ipv4 := strings.Contains(desiredHost, ".") | ||||
| 	if is_ipv4 { | ||||
| 		if strings.Contains(desiredHost, ":") { | ||||
| 			split := strings.Split(desiredHost, ":") | ||||
| 			desiredHost = split[0] | ||||
|  | @ -71,6 +73,20 @@ func BuildClientConfig(client model.Client, server model.Server, setting model.G | |||
| 				log.Error("Endpoint appears to be incorrectly formatted: ", err) | ||||
| 			} | ||||
| 		} | ||||
| 	} else { | ||||
| 		if strings.Contains(desiredHost, "]") { | ||||
| 			// IPv6 with port
 | ||||
| 			split := strings.Split(desiredHost, "]") | ||||
| 			desiredHost = split[0] + "]" | ||||
| 			if n, err := strconv.Atoi(split[1][1:]); err == nil { | ||||
| 				desiredPort = n | ||||
| 			} else { | ||||
| 				log.Error("Endpoint appears to be incorrectly formatted: ", err) | ||||
| 			} | ||||
| 		} else { | ||||
| 			desiredHost = "[" + desiredHost + "]" | ||||
| 		} | ||||
| 	} | ||||
| 	peerEndpoint := fmt.Sprintf("Endpoint = %s:%d\n", desiredHost, desiredPort) | ||||
| 
 | ||||
| 	peerPersistentKeepalive := "" | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue