@ -721,6 +721,11 @@ var getRemoteInstanceTransportOnce sync.Once
// Returns a minio-go Client configured to access remote host described by destDNSRecord
// Returns a minio-go Client configured to access remote host described by destDNSRecord
// Applicable only in a federated deployment
// Applicable only in a federated deployment
var getRemoteInstanceClient = func ( r * http . Request , host string ) ( * miniogo . Core , error ) {
var getRemoteInstanceClient = func ( r * http . Request , host string ) ( * miniogo . Core , error ) {
getRemoteInstanceTransportOnce . Do ( func ( ) {
getRemoteInstanceTransport = NewGatewayHTTPTransport ( )
getRemoteInstanceTransportLongTO = newGatewayHTTPTransport ( time . Hour )
} )
cred := getReqAccessCred ( r , globalServerRegion )
cred := getReqAccessCred ( r , globalServerRegion )
// In a federated deployment, all the instances share config files
// In a federated deployment, all the instances share config files
// and hence expected to have same credentials.
// and hence expected to have same credentials.
@ -732,10 +737,6 @@ var getRemoteInstanceClient = func(r *http.Request, host string) (*miniogo.Core,
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
getRemoteInstanceTransportOnce . Do ( func ( ) {
getRemoteInstanceTransport = NewGatewayHTTPTransport ( )
getRemoteInstanceTransportLongTO = newGatewayHTTPTransport ( time . Hour )
} )
return core , nil
return core , nil
}
}
@ -743,6 +744,11 @@ var getRemoteInstanceClient = func(r *http.Request, host string) (*miniogo.Core,
// Applicable only in a federated deployment.
// Applicable only in a federated deployment.
// The transport does not contain any timeout except for dialing.
// The transport does not contain any timeout except for dialing.
func getRemoteInstanceClientLongTimeout ( r * http . Request , host string ) ( * miniogo . Core , error ) {
func getRemoteInstanceClientLongTimeout ( r * http . Request , host string ) ( * miniogo . Core , error ) {
getRemoteInstanceTransportOnce . Do ( func ( ) {
getRemoteInstanceTransport = NewGatewayHTTPTransport ( )
getRemoteInstanceTransportLongTO = newGatewayHTTPTransport ( time . Hour )
} )
cred := getReqAccessCred ( r , globalServerRegion )
cred := getReqAccessCred ( r , globalServerRegion )
// In a federated deployment, all the instances share config files
// In a federated deployment, all the instances share config files
// and hence expected to have same credentials.
// and hence expected to have same credentials.
@ -754,10 +760,6 @@ func getRemoteInstanceClientLongTimeout(r *http.Request, host string) (*miniogo.
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
getRemoteInstanceTransportOnce . Do ( func ( ) {
getRemoteInstanceTransport = NewGatewayHTTPTransport ( )
getRemoteInstanceTransportLongTO = newGatewayHTTPTransport ( time . Hour )
} )
return core , nil
return core , nil
}
}