@@ -16,11 +16,15 @@ public class Config
1616 /// </summary>
1717 public static string DefaultUcHost = "uc.qbox.me" ;
1818 /// <summary>
19- /// 默认备用空间管理域名
19+ /// 默认查询区域域名
2020 /// </summary>
21- public static List < string > DefaultBackupUcHosts = new List < string >
21+ public static string DefaultQueryRegionHost = "kodo-config.qiniuapi.com" ;
22+ /// <summary>
23+ /// 默认备用查询区域域名
24+ /// </summary>
25+ public static List < string > DefaultBackupQueryRegionHosts = new List < string >
2226 {
23- "kodo-config.qiniuapi.com " ,
27+ "uc.qbox.me " ,
2428 "api.qiniu.com"
2529 } ;
2630
@@ -68,12 +72,15 @@ public class Config
6872
6973 private string _ucHost = DefaultUcHost ;
7074
71- private List < string > _backupUcHosts = DefaultBackupUcHosts ;
75+ private string _queryRegionHost = DefaultQueryRegionHost ;
76+
77+ private List < string > _backupQueryRegionHosts = DefaultBackupQueryRegionHosts ;
7278
7379 public void SetUcHost ( string val )
7480 {
7581 _ucHost = val ;
76- _backupUcHosts . Clear ( ) ;
82+ _queryRegionHost = val ;
83+ _backupQueryRegionHosts . Clear ( ) ;
7784 }
7885
7986 public string UcHost ( )
@@ -82,14 +89,26 @@ public string UcHost()
8289 return string . Format ( "{0}{1}" , scheme , _ucHost ) ;
8390 }
8491
85- public void SetBackupUcHost ( List < string > val )
92+ public void SetQueryRegionHost ( string val )
93+ {
94+ _queryRegionHost = val ;
95+ _backupQueryRegionHosts . Clear ( ) ;
96+ }
97+
98+ public string QueryRegionHost ( )
99+ {
100+ string scheme = UseHttps ? "https://" : "http://" ;
101+ return string . Format ( "{0}{1}" , scheme , _queryRegionHost ) ;
102+ }
103+
104+ public void SetBackupQueryRegionHosts ( List < string > val )
86105 {
87- _backupUcHosts = val ;
106+ _backupQueryRegionHosts = val ;
88107 }
89108
90- public List < string > BackupUcHost ( )
109+ public List < string > BackupQueryRegionHosts ( )
91110 {
92- return _backupUcHosts ;
111+ return _backupQueryRegionHosts ;
93112 }
94113
95114 /// <summary>
@@ -104,7 +123,7 @@ public string RsHost(string ak, string bucket)
104123 Zone z = this . Zone ;
105124 if ( z == null )
106125 {
107- z = ZoneHelper . QueryZone ( ak , bucket , UcHost ( ) , BackupUcHost ( ) ) ;
126+ z = ZoneHelper . QueryZone ( ak , bucket , QueryRegionHost ( ) , BackupQueryRegionHosts ( ) ) ;
108127 }
109128 return string . Format ( "{0}{1}" , scheme , z . RsHost ) ;
110129 }
@@ -121,7 +140,7 @@ public string RsfHost(string ak, string bucket)
121140 Zone z = this . Zone ;
122141 if ( z == null )
123142 {
124- z = ZoneHelper . QueryZone ( ak , bucket , UcHost ( ) , BackupUcHost ( ) ) ;
143+ z = ZoneHelper . QueryZone ( ak , bucket , QueryRegionHost ( ) , BackupQueryRegionHosts ( ) ) ;
125144 }
126145 return string . Format ( "{0}{1}" , scheme , z . RsfHost ) ;
127146 }
@@ -138,7 +157,7 @@ public string ApiHost(string ak, string bucket)
138157 Zone z = this . Zone ;
139158 if ( z == null )
140159 {
141- z = ZoneHelper . QueryZone ( ak , bucket , UcHost ( ) , BackupUcHost ( ) ) ;
160+ z = ZoneHelper . QueryZone ( ak , bucket , QueryRegionHost ( ) , BackupQueryRegionHosts ( ) ) ;
142161 }
143162 return string . Format ( "{0}{1}" , scheme , z . ApiHost ) ;
144163 }
@@ -155,7 +174,7 @@ public string IovipHost(string ak, string bucket)
155174 Zone z = this . Zone ;
156175 if ( z == null )
157176 {
158- z = ZoneHelper . QueryZone ( ak , bucket , UcHost ( ) , BackupUcHost ( ) ) ;
177+ z = ZoneHelper . QueryZone ( ak , bucket , QueryRegionHost ( ) , BackupQueryRegionHosts ( ) ) ;
159178 }
160179 return string . Format ( "{0}{1}" , scheme , z . IovipHost ) ;
161180 }
@@ -172,7 +191,7 @@ public string UpHost(string ak, string bucket)
172191 Zone z = this . Zone ;
173192 if ( z == null )
174193 {
175- z = ZoneHelper . QueryZone ( ak , bucket , UcHost ( ) , BackupUcHost ( ) ) ;
194+ z = ZoneHelper . QueryZone ( ak , bucket , QueryRegionHost ( ) , BackupQueryRegionHosts ( ) ) ;
176195 }
177196 string upHost = z . SrcUpHosts [ 0 ] ;
178197 if ( this . UseCdnDomains )
0 commit comments