]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Improve 直播流回放连接限制
authorqydysky <qydysky@foxmail.com>
Sun, 21 May 2023 07:45:45 +0000 (15:45 +0800)
committerqydysky <qydysky@foxmail.com>
Sun, 21 May 2023 07:45:45 +0000 (15:45 +0800)
F/api.go
Reply/F.go
demo/config/config_K_v.json

index 8171966305de580f5dcc96563a81e8c16282ead9..c6b578463b0bdbb5eae1a2b50dbb6cf7338705f9 100644 (file)
--- a/F/api.go
+++ b/F/api.go
@@ -2345,7 +2345,6 @@ func (c *GetFunc) getOnlineGoldRank() (misskey []string) {
                },
                Proxy:   c.Proxy,
                Timeout: 3 * 1000,
-               Retry:   2,
        }); err != nil {
                apilog.L(`E: `, err)
                return
index 8cc2b979b97d3cae150f5ae846a9b62c4e2cb929..1d18d945829dbf2c44392984b1d258dad2172cd7 100644 (file)
@@ -1169,7 +1169,7 @@ func init() {
                                if vm, ok := limits[i].(map[string]any); ok {
                                        if cidr, ok := vm["cidr"].(string); !ok {
                                                continue
-                                       } else if max, ok := vm["max"].(float64); !ok || max == 0 {
+                                       } else if max, ok := vm["max"].(float64); !ok {
                                                continue
                                        } else {
                                                if _, cidrx, err := net.ParseCIDR(cidr); err != nil {
@@ -1266,7 +1266,7 @@ func init() {
                                        if !limitCon[i].cidr.Contains(ip) {
                                                continue
                                        }
-                                       if limitCon[i].available <= 0 {
+                                       if limitCon[i].available == 0 {
                                                isOverflow = true
                                                break
                                        }
@@ -1310,7 +1310,7 @@ func init() {
                                        if !limitCon[i].cidr.Contains(ip) {
                                                continue
                                        }
-                                       if limitCon[i].available > 0 {
+                                       if limitCon[i].available != 0 {
                                                add = append(add, i)
                                        }
                                }
index d2be3ae72fc69ede79124e7226b40e7598cd3590..9355cdb1be18e6eb9199472b63c6b3b6f8f12d76 100644 (file)
     "弹幕回放": true,
     "直播流回放速率-help": "速率为每秒速率 例最小值(1 MB)",
     "直播流回放速率": "2 MB",
-    "直播流回放连接限制-help": "限制回放连接数,0无限制",
+    "直播流回放连接限制-help": "限制回放连接数,<0无限制,=0禁止,>0最大数量",
     "直播流回放连接限制": [
         {
             "cidr":"0.0.0.0/0",
-            "max":0
+            "max":-1
         }
     ],
     "ass-help": "只有保存直播流时才考虑生成ass,ass编码默认GB18030(可选utf-8)",