Readme host

This commit is contained in:
刘河
2019-03-19 23:00:54 +08:00
parent c0e2b6283c
commit a4d429bbc1
2 changed files with 904 additions and 3 deletions

View File

@@ -59,9 +59,9 @@ func (s *httpServer) processHttps(c net.Conn) {
}
var host *file.Host
file.GetCsvDb().Lock()
for _, host = range file.GetCsvDb().Hosts {
if bytes.Index(buf[:n], []byte(host.Host)) >= 0 {
break
for _, v := range file.GetCsvDb().Hosts {
if bytes.Index(buf[:n], []byte(v.Host)) >= 0 && (host == nil || len(host.Host) < len(v.Host)) {
host = v
}
}
file.GetCsvDb().Unlock()