From 1249a9f1a817b364d4b163fb986e7e88647cdb7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E5=AE=87=E8=88=AA?= Date: Wed, 19 Jul 2017 21:56:21 +0800 Subject: [PATCH] hold wrong maxCount --- ShadowsocksX-NG/Subscribe.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ShadowsocksX-NG/Subscribe.swift b/ShadowsocksX-NG/Subscribe.swift index 53f31eb..7320f69 100644 --- a/ShadowsocksX-NG/Subscribe.swift +++ b/ShadowsocksX-NG/Subscribe.swift @@ -135,7 +135,9 @@ class Subscribe: NSObject{ let decodeRes = decode64(resString)! let ssrregexp = "ssr://([A-Za-z0-9_-]+)" let urls = splitor(url: decodeRes, regexp: ssrregexp) - let maxN = self.maxCount == -1 ? urls.count: self.maxCount + // hold if user fill a maxCount larger then server return + // Should push a notification about it and correct the user filled maxCOunt? + let maxN = (self.maxCount > urls.count) ? urls.count : (self.maxCount == -1) ? urls.count: self.maxCount // TODO change the loop into random pick for index in 0..