From c867cc0854fa0cba6d30fd82dad6b6f09a10c1fd Mon Sep 17 00:00:00 2001 From: "Chris (ChrisJr404)" <11917633+ChrisJr404@users.noreply.github.com> Date: Sat, 2 May 2026 10:27:08 -0400 Subject: [PATCH] Accept --sleep in addition to --sleep= Issue #357: --sleep is the only common rate-limiting flag in sslscan and the manual arg parser only matched the strncmp("--sleep=", ...) form. The space-separated form --sleep silently fell through to the next else-if (and was eventually treated as an unrecognized argument or as a hostname), so users who tried --sleep 100 saw it appear to have no effect. Add a parallel branch that handles --sleep : it advances argLoop to consume the value, atoi-parses it, and sets options->sleep using the same >=0 guard as the existing branch. If the user passes --sleep with no following argument, print a friendly error pointing at both working forms and exit. End-to-end timing against example.com confirms both forms now sleep identically: --no-sleep: 0.26s --sleep=200: 2.49s (existing) --sleep 200: 2.51s (was broken; now fixed) Closes #357 --- sslscan.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sslscan.c b/sslscan.c index abe3d69..13b1b57 100644 --- a/sslscan.c +++ b/sslscan.c @@ -3997,7 +3997,8 @@ int main(int argc, char *argv[]) else if (strncmp("--connect-timeout=", argv[argLoop], 18) == 0) options->connect_timeout = atoi(argv[argLoop] + 18); - // Sleep between requests (ms) + // Sleep between requests (ms). Accept both `--sleep=` and + // `--sleep ` (issue #357 — the latter form silently did nothing). else if (strncmp("--sleep=", argv[argLoop], 8) == 0) { msec = atoi(argv[argLoop] + 8); @@ -4005,6 +4006,19 @@ int main(int argc, char *argv[]) options->sleep = msec; } } + else if (strcmp("--sleep", argv[argLoop]) == 0) + { + if (argLoop + 1 >= argc) + { + printf("%s--sleep%s requires a value in milliseconds (e.g. --sleep 100 or --sleep=100)\n", COL_RED, RESET); + exit(1); + } + argLoop++; + msec = atoi(argv[argLoop]); + if (msec >= 0) { + options->sleep = msec; + } + } // RDP Preamble... else if (strcmp("--rdp", argv[argLoop]) == 0)