mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
some improvements
This commit is contained in:
parent
6481870d03
commit
21240ed962
@ -357,9 +357,14 @@ func (svr *Service) ReloadConf(pxyCfgs map[string]config.ProxyConf, visitorCfgs
|
|||||||
svr.cfgMu.Unlock()
|
svr.cfgMu.Unlock()
|
||||||
|
|
||||||
svr.ctlMu.RLock()
|
svr.ctlMu.RLock()
|
||||||
defer svr.ctlMu.RUnlock()
|
ctl := svr.ctl
|
||||||
|
svr.ctlMu.RUnlock()
|
||||||
|
|
||||||
|
if ctl != nil {
|
||||||
return svr.ctl.ReloadConf(pxyCfgs, visitorCfgs)
|
return svr.ctl.ReloadConf(pxyCfgs, visitorCfgs)
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (svr *Service) Close() {
|
func (svr *Service) Close() {
|
||||||
svr.GracefulClose(time.Duration(0))
|
svr.GracefulClose(time.Duration(0))
|
||||||
|
@ -115,6 +115,7 @@ var rootCmd = &cobra.Command{
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
time.Sleep(time.Millisecond)
|
||||||
go func() {
|
go func() {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
err := runClient(path)
|
err := runClient(path)
|
||||||
|
@ -89,7 +89,7 @@ func NewHTTPReverseProxy(option HTTPReverseProxyOptions, vhostRouter *Routers) *
|
|||||||
BufferPool: newWrapPool(),
|
BufferPool: newWrapPool(),
|
||||||
ErrorLog: log.New(newWrapLogger(), "", 0),
|
ErrorLog: log.New(newWrapLogger(), "", 0),
|
||||||
ErrorHandler: func(rw http.ResponseWriter, req *http.Request, err error) {
|
ErrorHandler: func(rw http.ResponseWriter, req *http.Request, err error) {
|
||||||
frpLog.Warn("do http proxy request error: %v", err)
|
frpLog.Warn("do http proxy request [host: %s] error: %v", req.Host, err)
|
||||||
rw.WriteHeader(http.StatusNotFound)
|
rw.WriteHeader(http.StatusNotFound)
|
||||||
rw.Write(getNotFoundPageContent())
|
rw.Write(getNotFoundPageContent())
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user