mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
frpc: add proxy status 'wait start'
This commit is contained in:
parent
44e8108910
commit
9b990adf96
3
Makefile
3
Makefile
@ -53,6 +53,3 @@ clean:
|
|||||||
rm -f ./bin/frpc
|
rm -f ./bin/frpc
|
||||||
rm -f ./bin/frps
|
rm -f ./bin/frps
|
||||||
cd ./tests && ./clean_test.sh && cd -
|
cd ./tests && ./clean_test.sh && cd -
|
||||||
|
|
||||||
save:
|
|
||||||
godep save ./...
|
|
||||||
|
@ -12,10 +12,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ProxyStatusNew = "new"
|
ProxyStatusNew = "new"
|
||||||
ProxyStatusStartErr = "start error"
|
ProxyStatusStartErr = "start error"
|
||||||
ProxyStatusRunning = "running"
|
ProxyStatusWaitStart = "wait start"
|
||||||
ProxyStatusClosed = "closed"
|
ProxyStatusRunning = "running"
|
||||||
|
ProxyStatusClosed = "closed"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ProxyManager struct {
|
type ProxyManager struct {
|
||||||
@ -89,6 +90,12 @@ func (pw *ProxyWrapper) GetStatus() *ProxyStatus {
|
|||||||
return ps
|
return ps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (pw *ProxyWrapper) WaitStart() {
|
||||||
|
pw.mu.Lock()
|
||||||
|
defer pw.mu.Unlock()
|
||||||
|
pw.Status = ProxyStatusWaitStart
|
||||||
|
}
|
||||||
|
|
||||||
func (pw *ProxyWrapper) Start(remoteAddr string, serverRespErr string) error {
|
func (pw *ProxyWrapper) Start(remoteAddr string, serverRespErr string) error {
|
||||||
if pw.pxy != nil {
|
if pw.pxy != nil {
|
||||||
pw.pxy.Close()
|
pw.pxy.Close()
|
||||||
@ -226,6 +233,7 @@ func (pm *ProxyManager) CheckAndStartProxy(pxyStatus []string) {
|
|||||||
pm.Warn("[%s] proxy send NewProxy message error")
|
pm.Warn("[%s] proxy send NewProxy message error")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
pxy.WaitStart()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user