feat: add timeout and chunking to proxy label fetching
This commit is contained in:
@@ -1840,11 +1840,19 @@ get_proxy_label() {
|
||||
local section="$1"
|
||||
local proxy_string
|
||||
local label=""
|
||||
local chunk_size=50
|
||||
local start=0
|
||||
|
||||
config_get proxy_string "$section" "proxy_string"
|
||||
if [ -n "$proxy_string" ]; then
|
||||
label=$(echo "$proxy_string" | sed -n 's/.*#\(.*\)$/\1/p')
|
||||
echo "$label"
|
||||
if [ -n "$label" ]; then
|
||||
# Split label into chunks and output one at a time
|
||||
while [ $start -lt ${#label} ]; do
|
||||
echo "${label:$start:$chunk_size}"
|
||||
start=$((start + chunk_size))
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user