Merge pull request #1118 from harshavardhana/hostconfig

Make sure that if we find the exact match reply quickly, do not go through globURL ref #1111
This commit is contained in:
Harshavardhana
2015-09-22 02:22:16 -07:00
2 changed files with 5 additions and 1 deletions
+2 -1
View File
@@ -152,7 +152,8 @@ func getMcConfig() (*configV5, *probe.Error) {
return v.(quick.Config).Data().(*configV5), nil
}
conf := newConfigV5()
conf := new(configV5)
conf.Version = globalMCConfigVersion
qconf, err := quick.New(conf)
if err != nil {
return nil, err.Trace()
+3
View File
@@ -45,6 +45,9 @@ func getHostConfig(URL string) (hostConfig, *probe.Error) {
}
return hostCfg, nil
}
if _, ok := config.Hosts[url.Host]; ok {
return config.Hosts[url.Host], nil
}
for globURL, hostCfg := range config.Hosts {
match, err := filepath.Match(globURL, url.Host)
if err != nil {