Merge pull request #329 from maxsupermanhd/blockcheck-pace

blockcheck2: request pacing
This commit is contained in:
bol-van authored and GitHub committed 2026-10-20 17:05:53 +03:00
commit 486626d28f
3 files changed
+10 -3

No files matched your search

+8 -2
View File
@@ -34,6 +34,7 @@ DVTWS2=${DVTWS2:-${ZAPRET_BASE}/nfq2/dvtws2}
WINWS2=${WINWS2:-${ZAPRET_BASE}/nfq2/winws2}
MDIG=${MDIG:-${ZAPRET_BASE}/mdig/mdig}
DESYNC_MARK=0x10000000
PACE=${PACE:-0}
CURL_MAX_TIME=${CURL_MAX_TIME:-2}
CURL_MAX_TIME_QUIC=${CURL_MAX_TIME_QUIC:-$CURL_MAX_TIME}
CURL_MAX_TIME_DOH=${CURL_MAX_TIME_DOH:-2}
@@ -698,8 +699,13 @@ curl_with_subst_ip()
local connect_to="--connect-to $1::$ip${2:+:$2}" arg
shift ; shift ; shift;
[ "$CURL_VERBOSE" = 1 ] && arg="-v"
[ "$CURL_CMD" = 1 ] && echo $CURL ${arg:+$arg }$connect_to "$@"
ALL_PROXY="$ALL_PROXY" "$CURL" ${arg:+$arg }$connect_to "$@"
[ "$CURL_CMD" = 1 ] && echo $CURL -w "%{time_total}" ${arg:+$arg }$connect_to "$@"
local tooks
tooks=$(ALL_PROXY="$ALL_PROXY" "$CURL" -w "%{time_total}" ${arg:+$arg }$connect_to "$@")
local ret=$?
local tookms=$(awk "BEGIN {print int($tooks * 1000)}")
[ "$PACE" -gt "$tookms" ] && msleep $(awk "BEGIN {print int($PACE - $tooks * 1000)}")
return "$ret"
}
curl_with_dig()
{
+1
View File
@@ -4978,6 +4978,7 @@ At the end of the test, all successful strategies are displayed for each domain
| CURL_HTTPS_GET=1 | use the GET method instead of HEAD for HTTPS |
| CURL_PAD | pad every curl request with a junk headers of this many bytes. Full length taken into account along with header name, data field and EOL. Useful for testing a "16 KB"-style whitelist block against a target with no large page of its own to download, since that block triggers on total bytes transferred rather than on how much of it was a real response. Independent of CURL_HTTPS_GET; use whichever fits the target |
| PAD_MAX_HEADER | maximum length in bytes of the data field of one header for CURL_PAD padding. the length can be exceeded by no more than 14 characters for the last header, if the last header together with the name and EOL could be less than 14 characters |
| PACE | minimum attempt time in milliseconds, prevents request spam if many consecutive strategies succeed |
| DOMAINS | space-separated list of domains or domains with URIs to test |
| TEST | name of the test |
| IPVS=4\|6\|46 | IP protocol versions to test |
+1 -1
View File
@@ -5166,6 +5166,7 @@ blockcheck2 будет выдавать параметры стратегий б
| CURL_HTTPS_GET=1 | использовать метод GET вместо HEAD для https |
| CURL_PAD | добавлять к каждому запросу curl мусорные заголовки длиной не более PAD_MAX_HEADER байт (4000 по умолчанию) на указанное число байт. Учитывается полная длина вместе с названием хедера, полем данных и EOL. Полезно для проверки блока в стиле "16 кб" на ресурсе без своей большой страницы для скачивания, поскольку этот блок срабатывает по суммарному числу переданных байт, а не по тому, сколько из них было настоящим ответом. Независимо от CURL_HTTPS_GET, используйте то, что подходит для конкретной цели |
| PAD_MAX_HEADER | максимальная длина в байтах поля данных одного хедера для паддинга CURL_PAD. длина может быть превышена на не болеее, чем 14 символов, для последнего хедера, если последний хедер вместе с названием и EOL мог бы получиться менее 14 символов |
| PACE | минимальное время попытки в миллисекундах, предотвращает долбежку если много стратегий подряд успешны |
| DOMAINS | список тестируемых доменов или доменов с URI через пробел |
| TEST | имя теста |
| IPVS=4\|6\|46 | тестируемые версии ip протокола |
@@ -5905,4 +5906,3 @@ DLL при этом менять не нужно - только sys.
На win10 arm64 нет эмуляции x64, но есть эмуляция x86 32 бит.
Теоретически можно использовать вариант win32 и положить рядом драйвер WinDivert64.sys для arm64. Этот вариант не проверялся.