mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-06-14 23:16:06 +00:00
Show information about individual active queues
This commit is contained in:
@ -527,7 +527,17 @@ func (a *admin) getData_getSwitchQueues() admin_nodeInfo {
|
||||
var peerInfos admin_nodeInfo
|
||||
switchTable := a.core.switchTable
|
||||
getSwitchQueues := func() {
|
||||
queues := make([]map[string]interface{}, 0)
|
||||
for k, v := range switchTable.queues.bufs {
|
||||
queue := map[string]interface{}{
|
||||
"queue_id": k,
|
||||
"queue_size": v.size,
|
||||
"queue_packets": len(v.packets),
|
||||
}
|
||||
queues = append(queues, queue)
|
||||
}
|
||||
peerInfos = admin_nodeInfo{
|
||||
{"queues", queues},
|
||||
{"queues_count", len(switchTable.queues.bufs)},
|
||||
{"queues_size", switchTable.queues.size},
|
||||
{"max_queues_count", switchTable.queues.maxbufs},
|
||||
|
@ -699,12 +699,12 @@ func (t *switchTable) doWorker() {
|
||||
if t.queues.size > t.queues.maxsize {
|
||||
t.queues.maxsize = t.queues.size
|
||||
}
|
||||
t.queues.bufs[streamID] = buf
|
||||
if !bufExists {
|
||||
if len(t.queues.bufs) > t.queues.maxbufs {
|
||||
t.queues.maxbufs = len(t.queues.bufs)
|
||||
}
|
||||
}
|
||||
t.queues.bufs[streamID] = buf
|
||||
t.queues.cleanup(t)
|
||||
}
|
||||
case port := <-t.idleIn:
|
||||
|
@ -162,8 +162,8 @@ func (iface *tcpInterface) call(saddr string, socksaddr *string, sintf string) {
|
||||
if sintf != "" {
|
||||
ief, err := net.InterfaceByName(sintf)
|
||||
if err == nil {
|
||||
if ief.Flags & net.FlagUp == 0 {
|
||||
return
|
||||
if ief.Flags&net.FlagUp == 0 {
|
||||
return
|
||||
}
|
||||
addrs, err := ief.Addrs()
|
||||
if err == nil {
|
||||
|
Reference in New Issue
Block a user