Skip to content

Commit 21240ed

Browse files
committed
some improvements
1 parent 6481870 commit 21240ed

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

client/service.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,13 @@ func (svr *Service) ReloadConf(pxyCfgs map[string]config.ProxyConf, visitorCfgs
357357
svr.cfgMu.Unlock()
358358

359359
svr.ctlMu.RLock()
360-
defer svr.ctlMu.RUnlock()
361-
return svr.ctl.ReloadConf(pxyCfgs, visitorCfgs)
360+
ctl := svr.ctl
361+
svr.ctlMu.RUnlock()
362+
363+
if ctl != nil {
364+
return svr.ctl.ReloadConf(pxyCfgs, visitorCfgs)
365+
}
366+
return nil
362367
}
363368

364369
func (svr *Service) Close() {

cmd/frpc/sub/root.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ var rootCmd = &cobra.Command{
115115
return nil
116116
}
117117
wg.Add(1)
118+
time.Sleep(time.Millisecond)
118119
go func() {
119120
defer wg.Done()
120121
err := runClient(path)

pkg/util/vhost/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func NewHTTPReverseProxy(option HTTPReverseProxyOptions, vhostRouter *Routers) *
8989
BufferPool: newWrapPool(),
9090
ErrorLog: log.New(newWrapLogger(), "", 0),
9191
ErrorHandler: func(rw http.ResponseWriter, req *http.Request, err error) {
92-
frpLog.Warn("do http proxy request error: %v", err)
92+
frpLog.Warn("do http proxy request [host: %s] error: %v", req.Host, err)
9393
rw.WriteHeader(http.StatusNotFound)
9494
rw.Write(getNotFoundPageContent())
9595
},

0 commit comments

Comments
 (0)