Skip to content

Commit 4db0fc8

Browse files
committed
fix: run0 after access stopped.
1 parent cae1c82 commit 4db0fc8

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

pkg/access/access.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ func (p *MixAccess) Start() {
6868

6969
func (p *MixAccess) Stop() {
7070
defer libol.Catch("MixAccess.Stop")
71+
p.Run0()
7172
if p.http != nil {
7273
p.http.Shutdown()
7374
}

pkg/config/switch.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package config
22

33
import (
44
"flag"
5+
"fmt"
56
"path/filepath"
67

78
"github.com/luscis/openlan/pkg/libol"
@@ -44,7 +45,11 @@ func (q *Queue) Correct() {
4445
if q.VirWrt == 0 {
4546
q.VirWrt = QdVWr
4647
}
47-
libol.Info("Queue.Correct %v", *q)
48+
libol.Info("Queue.Correct %s", q)
49+
}
50+
51+
func (q *Queue) String() string {
52+
return fmt.Sprintf("sock wr:%d,rd:%d tap wr:%d,rd:%d vir sd:%d,wr:%d", q.SockWr, q.SockRd, q.TapWr, q.SockRd, q.VirSnd, q.VirWrt)
4853
}
4954

5055
type Limit struct {
@@ -87,7 +92,11 @@ func (p *Limit) Correct() {
8792
if p.VxLAN == 0 {
8893
p.VxLAN = 128
8994
}
90-
libol.Info("Limit.Correct %v", *p)
95+
libol.Info("Limit.Correct %s", p)
96+
}
97+
98+
func (p *Limit) String() string {
99+
return fmt.Sprintf("access:%d user:%d link:%d", p.Access, p.User, p.Link)
91100
}
92101

93102
type Switch struct {

pkg/libol/version.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@ var (
77
)
88

99
func ShowVersion() {
10-
Info("Version is %s", Version)
11-
Info("Built on %s", Date)
12-
Info("Commit id %s", Commit)
10+
Info("version: %s build at: %s commit id: %s", Version, Date, Commit)
1311
}

0 commit comments

Comments
 (0)