Merge branch 'admin' of git.daplie.com:Daplie/go-rvpn-server into admin
# Conflicts: # rvpn/genericlistener/conn_wedge.go
This commit is contained in:
commit
55e49fb966
12
main.go
12
main.go
|
@ -35,10 +35,6 @@ var (
|
||||||
serverName string
|
serverName string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//Main -- main entry point
|
//Main -- main entry point
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
@ -56,10 +52,10 @@ func main() {
|
||||||
wssHostName = viper.Get("rvpn.wssdomain").(string)
|
wssHostName = viper.Get("rvpn.wssdomain").(string)
|
||||||
adminHostName = viper.Get("rvpn.admindomain").(string)
|
adminHostName = viper.Get("rvpn.admindomain").(string)
|
||||||
argGenericBinding = viper.GetInt("rvpn.genericlistener")
|
argGenericBinding = viper.GetInt("rvpn.genericlistener")
|
||||||
deadtime := viper.Get("rvpn.deadtime")
|
deadtime := viper.Get("rvpn.deadtime").(map[string]interface{})
|
||||||
idle = deadtime.(map[string]interface{})["idle"].(int)
|
idle = deadtime["idle"].(int)
|
||||||
dwell = deadtime.(map[string]interface{})["dwell"].(int)
|
dwell = deadtime["dwell"].(int)
|
||||||
cancelcheck = deadtime.(map[string]interface{})["cancelcheck"].(int)
|
cancelcheck = deadtime["cancelcheck"].(int)
|
||||||
lbDefaultMethod = viper.Get("rvpn.loadbalancing.defaultmethod").(string)
|
lbDefaultMethod = viper.Get("rvpn.loadbalancing.defaultmethod").(string)
|
||||||
serverName = viper.Get("rvpn.serverName").(string)
|
serverName = viper.Get("rvpn.serverName").(string)
|
||||||
|
|
||||||
|
|
|
@ -55,13 +55,12 @@ func (w *WedgeConn) Buffered() int {
|
||||||
//PeekAll --
|
//PeekAll --
|
||||||
// - get all the chars available
|
// - get all the chars available
|
||||||
// - pass then back
|
// - pass then back
|
||||||
func (w *WedgeConn) PeekAll() (buf []byte, err error) {
|
func (w *WedgeConn) PeekAll() ([]byte, error) {
|
||||||
|
// We first peek with 1 so that if there is no buffered data the reader will
|
||||||
_, err = w.Peek(1)
|
// fill the buffer before we read how much data is buffered.
|
||||||
if err != nil {
|
if _, err := w.Peek(1); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
buf, err = w.Peek(w.Buffered())
|
return w.Peek(w.Buffered())
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue