tidy-up: add space around operators, where missing

Closes #21793
This commit is contained in:
Viktor Szakats 2026-05-28 09:23:27 +02:00
parent de9bb509d1
commit 9591ff123d
No known key found for this signature in database
34 changed files with 128 additions and 128 deletions

View file

@ -218,7 +218,7 @@ sub runconfig {
}
# run curl command lines using -K
my $end = time() + $seconds/2;
my $end = time() + $seconds / 2;
my $c = 0;
print "Running command lines\n";
do {
@ -228,7 +228,7 @@ do {
print "$c command lines\n";
# run curl command lines
$end = time() + $seconds/2;
$end = time() + $seconds / 2;
$c = 0;
print "Running config lines\n";
do {

View file

@ -68,7 +68,7 @@ sub extract {
print O "/* !checksrc! disable BANNEDFUNC all */\n"; # for fopen()
print O "/* !checksrc! disable COPYRIGHT all */\n";
print O "/* !checksrc! disable UNUSEDIGNORE all */\n";
printf O "#line %d \"$f\"\n", $iline+1;
printf O "#line %d \"$f\"\n", $iline + 1;
}
}
elsif($syn == 2) {

View file

@ -252,7 +252,7 @@ typedef int (*curl_xferinfo_callback)(void *clientp,
#ifndef CURL_MAX_READ_SIZE
/* The maximum receive buffer size configurable via CURLOPT_BUFFERSIZE. */
#define CURL_MAX_READ_SIZE (10*1024*1024)
#define CURL_MAX_READ_SIZE (10 * 1024 * 1024)
#endif
#ifndef CURL_MAX_WRITE_SIZE
@ -269,7 +269,7 @@ typedef int (*curl_xferinfo_callback)(void *clientp,
/* The only reason to have a max limit for this is to avoid the risk of a bad
server feeding libcurl with a never-ending header that causes reallocs
infinitely */
#define CURL_MAX_HTTP_HEADER (100*1024)
#define CURL_MAX_HTTP_HEADER (100 * 1024)
#endif
/* This is a magic return code for the write callback that, when returned,

View file

@ -754,7 +754,7 @@ sub scanfile {
my $cond = $4;
if($cond =~ / = /) {
checkwarn("ASSIGNWITHINCONDITION",
$line, $pos+1, $file, $l,
$line, $pos + 1, $file, $l,
"assignment within conditional expression");
}
my $temp = $cond;

View file

@ -82,7 +82,7 @@ awk '
{
if(length($0)) {
num++;
n = sprintf("%s%s%s,", n, length(n)?" ":"", $0);
n = sprintf("%s%s%s,", n, length(n) ? " " : "", $0);
#print n;
if(length(n) > 77) {
printf(" %s\n", p);
@ -93,7 +93,7 @@ awk '
}
END {
pp=substr(p,1,length(p)-1);
pp = substr(p, 1, length(p) - 1);
printf(" %s\n", pp);
printf(" (%d contributors)\n", num);
}

View file

@ -89,8 +89,8 @@ my $colwidth=79; # max number of columns
sub prefixline {
my ($num) = @_;
print "\t" x ($num/8);
print ' ' x ($num%8);
print "\t" x ($num / 8);
print ' ' x ($num % 8);
}
sub justline {
@ -868,7 +868,7 @@ sub single {
if($count == ($num -1)) {
$sep = " and ";
}
$mstr .= sprintf "%s$l", $mstr?$sep:"";
$mstr .= sprintf "%s$l", $mstr ? $sep : "";
$count++;
}
push @foot, overrides($standalone,
@ -1202,7 +1202,7 @@ sub listglobals {
close(F);
}
for my $e (0 .. $#globalopts) {
$globals .= sprintf "%s--%s", $e?($globalopts[$e+1] ? ", " : " and "):"",
$globals .= sprintf "%s--%s", $e ? ($globalopts[$e + 1] ? ", " : " and ") : "",
$globalopts[$e],;
}
}

View file

@ -134,7 +134,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type,
struct timeval tv;
char timebuf[20];
/* largest signed 64-bit is: 9,223,372,036,854,775,807
* max length in decimal: 1 + (6*3) = 19
* max length in decimal: 1 + (6 * 3) = 19
* formatted via TRC_IDS_FORMAT_IDS_2 this becomes 2 + 19 + 1 + 19 + 2 = 43
* negative xfer-id are not printed, negative conn-ids use TRC_IDS_FORMAT_1
*/

View file

@ -21,7 +21,7 @@ Largefile
<name>
Invalid large X- range on a file://
</name>
# This range value is 2**32+7, which will be truncated to the valid value 7
# This range value is 2**32 + 7, which will be truncated to the valid value 7
# if the large file support is not working correctly
<command>
-r 4294967303- file://localhost%FILE_PWD/%LOGDIR/test%TESTNUMBER.txt

View file

@ -65,7 +65,7 @@ def CombinationRepetitionUtil(chosen, arr, badarr, index,
chosen[index] = arr[start]
# Current is excluded, replace it
# with next (Note that i+1 is passed,
# with next (Note that i + 1 is passed,
# but index is not changed)
CombinationRepetitionUtil(chosen, arr, badarr, index + 1,
r, start, end)

View file

@ -1090,7 +1090,7 @@ age_of_news=0
if [ -f "$LTOP"/bad_runs ]; then
age_of_news=$(fileage "$LTOP"/bad_runs)
# only consider news "new" if we have not mailed today
if ((age_of_news < 24*3600)); then
if ((age_of_news < 24 * 3600)); then
itsnews="no"
fi
fi

View file

@ -2567,7 +2567,7 @@ sub PASV_ftp {
$p="1,2,3,4";
}
sendcontrol sprintf("227 Entering Passive Mode ($p,%d,%d)\r\n",
int($pasvport/256), int($pasvport%256));
int($pasvport / 256), int($pasvport % 256));
}
else {
# EPSV reply

View file

@ -55,14 +55,14 @@ class ScoreCardError(Exception):
class Card:
@classmethod
def fmt_ms(cls, tval):
return f'{int(tval*1000)} ms' if tval >= 0 else '--'
return f'{int(tval * 1000)} ms' if tval >= 0 else '--'
@classmethod
def fmt_size(cls, val):
if val >= (1024*1024*1024):
return f'{val / (1024*1024*1024):0.000f}GB'
if val >= (1024 * 1024 * 1024):
return f'{val / (1024 * 1024 * 1024):0.000f}GB'
if val >= (1024 * 1024):
return f'{val / (1024*1024):0.000f}MB'
return f'{val / (1024 * 1024):0.000f}MB'
if val >= 1024:
return f'{val / 1024:0.000f}KB'
return f'{val:0.000f}B'
@ -71,8 +71,8 @@ class Card:
def fmt_mbs(cls, val):
if val is None or val < 0:
return '--'
if val >= (1024*1024):
return f'{val/(1024*1024):.3g} MB/s'
if val >= (1024 * 1024):
return f'{val / (1024 * 1024):.3g} MB/s'
if val >= 1024:
return f'{val / 1024:.3g} KB/s'
return f'{val:.3g} B/s'
@ -81,10 +81,10 @@ class Card:
def fmt_speed(cls, val):
if val is None or val < 0:
return '--'
if val >= (10*1024*1024):
return f'{(val/(1024*1024)):.3f} MB/s'
if val >= (10*1024):
return f'{val/1024:.3f} KB/s'
if val >= (10 * 1024 * 1024):
return f'{(val / (1024 * 1024)):.3f} MB/s'
if val >= (10 * 1024):
return f'{val / 1024:.3f} KB/s'
return f'{val:.3f} B/s'
@classmethod
@ -92,10 +92,10 @@ class Card:
if val is None or val < 0:
return '--'
pct = ((val / limit) * 100) - 100
if val >= (10*1024*1024):
return f'{(val/(1024*1024)):.3f} MB/s, {pct:+.1f}%'
if val >= (10*1024):
return f'{val/1024:.3f} KB/s, {pct:+.1f}%'
if val >= (10 * 1024 * 1024):
return f'{(val / (1024 * 1024)):.3f} MB/s, {pct:+.1f}%'
if val >= (10 * 1024):
return f'{val / 1024:.3f} KB/s, {pct:+.1f}%'
return f'{val:.3f} B/s, {pct:+.1f}%'
@classmethod
@ -260,9 +260,9 @@ class ScoreRunner:
raise Exception(f'unrecognised limit-rate: {self._limit_rate}')
self._limit_rate_num = float(m.group(1))
if m.group(3) == 'g':
self._limit_rate_num *= 1024*1024*1024
self._limit_rate_num *= 1024 * 1024 * 1024
elif m.group(3) == 'm':
self._limit_rate_num *= 1024*1024
self._limit_rate_num *= 1024 * 1024
elif m.group(3) == 'k':
self._limit_rate_num *= 1024
elif m.group(3) == 'b':
@ -335,7 +335,7 @@ class ScoreRunner:
self._make_docs_file(docs_dir=server_docs,
fname=fname, fsize=fsize)
self._make_docs_file(docs_dir=server_docs,
fname='reqs10.data', fsize=10*1024)
fname='reqs10.data', fsize=10 * 1024)
def _check_downloads(self, r: ExecResult, count: int):
error = ''
@ -636,7 +636,7 @@ class ScoreRunner:
def requests(self, count: int, meta: Dict[str, Any]) -> Dict[str, Any]:
url = f'https://{self.env.domain1}:{self.server_port}/reqs10.data'
fsize = 10*1024
fsize = 10 * 1024
cols = ['size', 'total']
rows = []
mparallel = meta['request_parallels']

View file

@ -43,12 +43,12 @@ class TestDownload:
def _class_scope(self, env, httpd):
indir = httpd.docs_dir
env.make_data_file(indir=indir, fname="data-0k", fsize=0)
env.make_data_file(indir=indir, fname="data-10k", fsize=10*1024)
env.make_data_file(indir=indir, fname="data-100k", fsize=100*1024)
env.make_data_file(indir=indir, fname="data-1m", fsize=1024*1024)
env.make_data_file(indir=indir, fname="data-10m", fsize=10*1024*1024)
env.make_data_file(indir=indir, fname="data-50m", fsize=50*1024*1024)
env.make_data_gzipbomb(indir=indir, fname="bomb-100m.txt", fsize=100*1024*1024)
env.make_data_file(indir=indir, fname="data-10k", fsize=10 * 1024)
env.make_data_file(indir=indir, fname="data-100k", fsize=100 * 1024)
env.make_data_file(indir=indir, fname="data-1m", fsize=1024 * 1024)
env.make_data_file(indir=indir, fname="data-10m", fsize=10 * 1024 * 1024)
env.make_data_file(indir=indir, fname="data-50m", fsize=50 * 1024 * 1024)
env.make_data_gzipbomb(indir=indir, fname="bomb-100m.txt", fsize=100 * 1024 * 1024)
# download 1 file
@pytest.mark.parametrize("proto", Env.http_protos())
@ -275,7 +275,7 @@ class TestDownload:
self.check_downloads(curl, srcfile, count)
# download serial via lib client, pause/resume at different offsets
@pytest.mark.parametrize("pause_offset", [0, 10*1024, 100*1023, 640000])
@pytest.mark.parametrize("pause_offset", [0, 10 * 1024, 100 * 1023, 640000])
@pytest.mark.parametrize("proto", Env.http_protos())
def test_02_21_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset):
count = 2
@ -293,7 +293,7 @@ class TestDownload:
self.check_downloads(client, srcfile, count)
# download via lib client, several at a time, pause/resume
@pytest.mark.parametrize("pause_offset", [100*1023])
@pytest.mark.parametrize("pause_offset", [100 * 1023])
@pytest.mark.parametrize("proto", Env.http_protos())
def test_02_22_lib_parallel_resume(self, env: Env, httpd, nghttpx, proto, pause_offset):
count = 2
@ -481,7 +481,7 @@ class TestDownload:
assert False, f'download {dfile} differs:\n{diff}'
# download via lib client, 1 at a time, pause/resume at different offsets
@pytest.mark.parametrize("pause_offset", [0, 10*1024, 100*1023, 640000])
@pytest.mark.parametrize("pause_offset", [0, 10 * 1024, 100 * 1023, 640000])
@pytest.mark.parametrize("proto", Env.http_protos())
def test_02_29_h2_lib_serial(self, env: Env, httpd, nghttpx, proto, pause_offset):
count = 2
@ -688,7 +688,7 @@ class TestDownload:
# download with looong urls
@pytest.mark.parametrize("proto", Env.http_protos())
@pytest.mark.parametrize("url_junk", [1024, 16*1024, 32*1024, 64*1024, 80*1024, 96*1024])
@pytest.mark.parametrize("url_junk", [1024, 16 * 1024, 32 * 1024, 64 * 1024, 80 * 1024, 96 * 1024])
def test_02_36_looong_urls(self, env: Env, httpd, nghttpx, proto, url_junk):
if proto == 'h3' and env.curl_uses_lib('quiche'):
pytest.skip("quiche fails from 16k onwards")
@ -699,11 +699,11 @@ class TestDownload:
if url_junk <= 1024:
r.check_exit_code(0)
r.check_response(http_status=200)
elif url_junk <= 16*1024:
elif url_junk <= 16 * 1024:
r.check_exit_code(0)
# server replies with 414, Request URL too long
r.check_response(http_status=414)
elif url_junk <= 32*1024:
elif url_junk <= 32 * 1024:
r.check_exit_code(0)
# server replies with 414, Request URL too long
r.check_response(http_status=414)
@ -716,7 +716,7 @@ class TestDownload:
# h2 is unable to send such large headers (frame limits)
r.check_exit_code(55)
elif proto == 'h3':
if url_junk <= 64*1024:
if url_junk <= 64 * 1024:
r.check_exit_code(0)
# nghttpx reports 431 Request Header Field too Large
r.check_response(http_status=431)

View file

@ -42,12 +42,12 @@ class TestUpload:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, httpd, nghttpx):
env.make_data_file(indir=env.gen_dir, fname="data-10k", fsize=10*1024)
env.make_data_file(indir=env.gen_dir, fname="data-63k", fsize=63*1024)
env.make_data_file(indir=env.gen_dir, fname="data-64k", fsize=64*1024)
env.make_data_file(indir=env.gen_dir, fname="data-100k", fsize=100*1024)
env.make_data_file(indir=env.gen_dir, fname="data-1m+", fsize=(1024*1024)+1)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024)
env.make_data_file(indir=env.gen_dir, fname="data-10k", fsize=10 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-63k", fsize=63 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-64k", fsize=64 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-100k", fsize=100 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-1m+", fsize=(1024 * 1024) + 1)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10 * 1024 * 1024)
# upload small data, check that this is what was echoed
@pytest.mark.parametrize("proto", Env.http_protos())
@ -147,7 +147,7 @@ class TestUpload:
@pytest.mark.parametrize("proto", Env.http_protos())
def test_07_15_hx_put(self, env: Env, httpd, nghttpx, proto):
count = 2
upload_size = 128*1024
upload_size = 128 * 1024
url = f'https://localhost:{env.https_port}/curltest/put'
client = LocalClient(name='cli_hx_upload', env=env)
if not client.exists():
@ -161,7 +161,7 @@ class TestUpload:
@pytest.mark.parametrize("proto", Env.http_protos())
def test_07_16_hx_put_reuse(self, env: Env, httpd, nghttpx, proto):
count = 2
upload_size = 128*1024
upload_size = 128 * 1024
url = f'https://localhost:{env.https_port}/curltest/put'
client = LocalClient(name='cli_hx_upload', env=env)
if not client.exists():
@ -175,7 +175,7 @@ class TestUpload:
@pytest.mark.parametrize("proto", Env.http_protos())
def test_07_17_hx_post_reuse(self, env: Env, httpd, nghttpx, proto):
count = 2
upload_size = 128*1024
upload_size = 128 * 1024
url = f'https://localhost:{env.https_port}/curltest/echo'
client = LocalClient(name='cli_hx_upload', env=env)
if not client.exists():
@ -519,7 +519,7 @@ class TestUpload:
@pytest.mark.parametrize("httpcode", [301, 302, 307, 308])
def test_07_44_put_redir(self, env: Env, httpd, nghttpx, proto, httpcode):
count = 1
upload_size = 128*1024
upload_size = 128 * 1024
url = f'https://localhost:{env.https_port}/curltest/put-redir-{httpcode}'
client = LocalClient(name='cli_hx_upload', env=env)
if not client.exists():
@ -639,10 +639,10 @@ class TestUpload:
@pytest.mark.skipif(condition=not Env.have_nghttpx(), reason="no nghttpx")
@pytest.mark.parametrize("proto,upload_size", [
pytest.param('http/1.1', 100, id='h1-small-body'),
pytest.param('http/1.1', 10*1024, id='h1-medium-body'),
pytest.param('http/1.1', 32*1024, id='h1-limited-body'),
pytest.param('h2', 10*1024, id='h2-medium-body'),
pytest.param('h2', 32*1024, id='h2-limited-body'),
pytest.param('http/1.1', 10 * 1024, id='h1-medium-body'),
pytest.param('http/1.1', 32 * 1024, id='h1-limited-body'),
pytest.param('h2', 10 * 1024, id='h2-medium-body'),
pytest.param('h2', 32 * 1024, id='h2-limited-body'),
pytest.param('h3', 1024, id='h3-small-body'),
pytest.param('h3', 1024 * 1024, id='h3-limited-body'),
])

View file

@ -59,12 +59,12 @@ class TestCaddy:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, caddy):
self._make_docs_file(docs_dir=caddy.docs_dir, fname='data10k.data', fsize=10*1024)
self._make_docs_file(docs_dir=caddy.docs_dir, fname='data1.data', fsize=1024*1024)
self._make_docs_file(docs_dir=caddy.docs_dir, fname='data5.data', fsize=5*1024*1024)
self._make_docs_file(docs_dir=caddy.docs_dir, fname='data10.data', fsize=10*1024*1024)
self._make_docs_file(docs_dir=caddy.docs_dir, fname='data100.data', fsize=100*1024*1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024)
self._make_docs_file(docs_dir=caddy.docs_dir, fname='data10k.data', fsize=10 * 1024)
self._make_docs_file(docs_dir=caddy.docs_dir, fname='data1.data', fsize=1024 * 1024)
self._make_docs_file(docs_dir=caddy.docs_dir, fname='data5.data', fsize=5 * 1024 * 1024)
self._make_docs_file(docs_dir=caddy.docs_dir, fname='data10.data', fsize=10 * 1024 * 1024)
self._make_docs_file(docs_dir=caddy.docs_dir, fname='data100.data', fsize=100 * 1024 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10 * 1024 * 1024)
# download 1 file
@pytest.mark.parametrize("proto", Env.http_protos())

View file

@ -40,9 +40,9 @@ class TestPush:
push_dir = os.path.join(httpd.docs_dir, 'push')
if not os.path.exists(push_dir):
os.makedirs(push_dir)
env.make_data_file(indir=push_dir, fname="data1", fsize=1*1024)
env.make_data_file(indir=push_dir, fname="data2", fsize=1*1024)
env.make_data_file(indir=push_dir, fname="data3", fsize=1*1024)
env.make_data_file(indir=push_dir, fname="data1", fsize=1 * 1024)
env.make_data_file(indir=push_dir, fname="data2", fsize=1 * 1024)
env.make_data_file(indir=push_dir, fname="data3", fsize=1 * 1024)
def httpd_configure(self, env, httpd):
httpd.set_extra_config(env.domain1, [

View file

@ -45,11 +45,11 @@ class TestProxy:
os.makedirs(push_dir)
if env.have_nghttpx():
nghttpx_fwd.start_if_needed()
env.make_data_file(indir=env.gen_dir, fname="data-100k", fsize=100*1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024)
env.make_data_file(indir=env.gen_dir, fname="data-100k", fsize=100 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10 * 1024 * 1024)
indir = httpd.docs_dir
env.make_data_file(indir=indir, fname="data-100k", fsize=100*1024)
env.make_data_file(indir=indir, fname="data-1m", fsize=1024*1024)
env.make_data_file(indir=indir, fname="data-100k", fsize=100 * 1024)
env.make_data_file(indir=indir, fname="data-1m", fsize=1024 * 1024)
def get_tunnel_proto_used(self, r: ExecResult):
for line in r.trace_lines:

View file

@ -37,7 +37,7 @@ class TestAuth:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, httpd, nghttpx):
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10 * 1024 * 1024)
# download 1 file, not authenticated
@pytest.mark.parametrize("proto", Env.http_protos())

View file

@ -38,10 +38,10 @@ class TestInfo:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, httpd):
indir = httpd.docs_dir
env.make_data_file(indir=indir, fname="data-10k", fsize=10*1024)
env.make_data_file(indir=indir, fname="data-100k", fsize=100*1024)
env.make_data_file(indir=indir, fname="data-1m", fsize=1024*1024)
env.make_data_file(indir=env.gen_dir, fname="data-100k", fsize=100*1024)
env.make_data_file(indir=indir, fname="data-10k", fsize=10 * 1024)
env.make_data_file(indir=indir, fname="data-100k", fsize=100 * 1024)
env.make_data_file(indir=indir, fname="data-1m", fsize=1024 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-100k", fsize=100 * 1024)
# download plain file
@pytest.mark.parametrize("proto", Env.http_protos())

View file

@ -64,7 +64,7 @@ class TestSSLUse:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, httpd, nghttpx):
env.make_data_file(indir=httpd.docs_dir, fname="data-10k", fsize=10*1024)
env.make_data_file(indir=httpd.docs_dir, fname="data-10k", fsize=10 * 1024)
def test_17_01_sslinfo_plain(self, env: Env, httpd):
proto = 'http/1.1'

View file

@ -37,9 +37,9 @@ class TestMethods:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, httpd, nghttpx):
indir = httpd.docs_dir
env.make_data_file(indir=indir, fname="data-10k", fsize=10*1024)
env.make_data_file(indir=indir, fname="data-100k", fsize=100*1024)
env.make_data_file(indir=indir, fname="data-1m", fsize=1024*1024)
env.make_data_file(indir=indir, fname="data-10k", fsize=10 * 1024)
env.make_data_file(indir=indir, fname="data-100k", fsize=100 * 1024)
env.make_data_file(indir=indir, fname="data-1m", fsize=1024 * 1024)
# download 1 file
@pytest.mark.parametrize("proto", Env.http_protos())

View file

@ -39,9 +39,9 @@ class TestShutdown:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, httpd):
indir = httpd.docs_dir
env.make_data_file(indir=indir, fname="data-10k", fsize=10*1024)
env.make_data_file(indir=indir, fname="data-100k", fsize=100*1024)
env.make_data_file(indir=indir, fname="data-1m", fsize=1024*1024)
env.make_data_file(indir=indir, fname="data-10k", fsize=10 * 1024)
env.make_data_file(indir=indir, fname="data-100k", fsize=100 * 1024)
env.make_data_file(indir=indir, fname="data-1m", fsize=1024 * 1024)
# check with `tcpdump` that we see curl TCP RST packets
@pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available")

View file

@ -64,13 +64,13 @@ class TestVsFTPD:
os.makedirs(vsftpd.docs_dir)
self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-0k', fsize=0)
self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-1k', fsize=1024)
self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-10k', fsize=10*1024)
self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-1m', fsize=1024*1024)
self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-10m', fsize=10*1024*1024)
self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-10k', fsize=10 * 1024)
self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-1m', fsize=1024 * 1024)
self._make_docs_file(docs_dir=vsftpd.docs_dir, fname='data-10m', fsize=10 * 1024 * 1024)
env.make_data_file(indir=env.gen_dir, fname="upload-0k", fsize=0)
env.make_data_file(indir=env.gen_dir, fname="upload-1k", fsize=1024)
env.make_data_file(indir=env.gen_dir, fname="upload-100k", fsize=100*1024)
env.make_data_file(indir=env.gen_dir, fname="upload-1m", fsize=1024*1024)
env.make_data_file(indir=env.gen_dir, fname="upload-100k", fsize=100 * 1024)
env.make_data_file(indir=env.gen_dir, fname="upload-1m", fsize=1024 * 1024)
def test_30_01_list_dir(self, env: Env, vsftpd: VsFTPD):
curl = CurlClient(env=env)

View file

@ -70,12 +70,12 @@ class TestVsFTPD:
if not os.path.exists(vsftpds.docs_dir):
os.makedirs(vsftpds.docs_dir)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-1k', fsize=1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-10k', fsize=10*1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-1m', fsize=1024*1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-10m', fsize=10*1024*1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-10k', fsize=10 * 1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-1m', fsize=1024 * 1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-10m', fsize=10 * 1024 * 1024)
env.make_data_file(indir=env.gen_dir, fname="upload-1k", fsize=1024)
env.make_data_file(indir=env.gen_dir, fname="upload-100k", fsize=100*1024)
env.make_data_file(indir=env.gen_dir, fname="upload-1m", fsize=1024*1024)
env.make_data_file(indir=env.gen_dir, fname="upload-100k", fsize=100 * 1024)
env.make_data_file(indir=env.gen_dir, fname="upload-1m", fsize=1024 * 1024)
def test_31_01_list_dir(self, env: Env, vsftpds: VsFTPD):
curl = CurlClient(env=env)
@ -191,7 +191,7 @@ class TestVsFTPD:
line_length = 21
srcfile = os.path.join(env.gen_dir, docname)
dstfile = os.path.join(vsftpds.docs_dir, docname)
env.make_data_file(indir=env.gen_dir, fname=docname, fsize=100*1024,
env.make_data_file(indir=env.gen_dir, fname=docname, fsize=100 * 1024,
line_length=line_length)
srcsize = os.path.getsize(srcfile)
self._rmf(dstfile)

View file

@ -70,12 +70,12 @@ class TestFtpsVsFTPD:
if not os.path.exists(vsftpds.docs_dir):
os.makedirs(vsftpds.docs_dir)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-1k', fsize=1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-10k', fsize=10*1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-1m', fsize=1024*1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-10m', fsize=10*1024*1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-10k', fsize=10 * 1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-1m', fsize=1024 * 1024)
self._make_docs_file(docs_dir=vsftpds.docs_dir, fname='data-10m', fsize=10 * 1024 * 1024)
env.make_data_file(indir=env.gen_dir, fname="upload-1k", fsize=1024)
env.make_data_file(indir=env.gen_dir, fname="upload-100k", fsize=100*1024)
env.make_data_file(indir=env.gen_dir, fname="upload-1m", fsize=1024*1024)
env.make_data_file(indir=env.gen_dir, fname="upload-100k", fsize=100 * 1024)
env.make_data_file(indir=env.gen_dir, fname="upload-1m", fsize=1024 * 1024)
def test_32_01_list_dir(self, env: Env, vsftpds: VsFTPD):
curl = CurlClient(env=env)
@ -204,7 +204,7 @@ class TestFtpsVsFTPD:
line_length = 21
srcfile = os.path.join(env.gen_dir, docname)
dstfile = os.path.join(vsftpds.docs_dir, docname)
env.make_data_file(indir=env.gen_dir, fname=docname, fsize=100*1024,
env.make_data_file(indir=env.gen_dir, fname=docname, fsize=100 * 1024,
line_length=line_length)
srcsize = os.path.getsize(srcfile)
self._rmf(dstfile)

View file

@ -49,8 +49,8 @@ class TestSocks:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, httpd):
indir = httpd.docs_dir
env.make_data_file(indir=indir, fname="data-10m", fsize=10*1024*1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024)
env.make_data_file(indir=indir, fname="data-10m", fsize=10 * 1024 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10 * 1024 * 1024)
@pytest.mark.parametrize("sproto", ['socks4', 'socks5'])
def test_40_01_socks_http(self, env: Env, sproto, danted: Dante, httpd):

View file

@ -41,10 +41,10 @@ class TestScp:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, sshd):
env.make_data_file(indir=sshd.home_dir, fname="data-10k", fsize=10*1024)
env.make_data_file(indir=sshd.home_dir, fname="data-10m", fsize=10*1024*1024)
env.make_data_file(indir=env.gen_dir, fname="data-10k", fsize=10*1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024)
env.make_data_file(indir=sshd.home_dir, fname="data-10k", fsize=10 * 1024)
env.make_data_file(indir=sshd.home_dir, fname="data-10m", fsize=10 * 1024 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-10k", fsize=10 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10 * 1024 * 1024)
def test_50_01_insecure(self, env: Env, sshd: Sshd):
curl = CurlClient(env=env)

View file

@ -41,10 +41,10 @@ class TestSftp:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env, sshd):
env.make_data_file(indir=sshd.home_dir, fname="data-10k", fsize=10*1024)
env.make_data_file(indir=sshd.home_dir, fname="data-10m", fsize=10*1024*1024)
env.make_data_file(indir=env.gen_dir, fname="data-10k", fsize=10*1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10*1024*1024)
env.make_data_file(indir=sshd.home_dir, fname="data-10k", fsize=10 * 1024)
env.make_data_file(indir=sshd.home_dir, fname="data-10m", fsize=10 * 1024 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-10k", fsize=10 * 1024)
env.make_data_file(indir=env.gen_dir, fname="data-10m", fsize=10 * 1024 * 1024)
def test_51_01_insecure(self, env: Env, sshd: Sshd):
curl = CurlClient(env=env)

View file

@ -84,7 +84,7 @@ class NegotiatingTelnetHandler(socketserver.BaseRequestHandler):
neg.send_wont("NAWS")
# Get the data passed through the negotiator
data = neg.recv(4*1024)
data = neg.recv(4 * 1024)
log.debug("Incoming data: %r", data)
if VERIFIED_REQ.encode('utf-8') in data:
@ -106,7 +106,7 @@ class NegotiatingTelnetHandler(socketserver.BaseRequestHandler):
# put some effort into making a clean socket shutdown
# that does not give the client ECONNRESET
self.request.settimeout(0.1)
self.request.recv(4*1024)
self.request.recv(4 * 1024)
self.request.shutdown(socket.SHUT_RDWR)
except IOError:

View file

@ -342,8 +342,8 @@ sub killpid {
@requested = sort({$a <=> $b} @requested);
}
for(my $i = scalar(@requested) - 2; $i >= 0; $i--) {
if($requested[$i] == $requested[$i+1]) {
splice @requested, $i+1, 1;
if($requested[$i] == $requested[$i + 1]) {
splice @requested, $i + 1, 1;
}
}

View file

@ -1928,11 +1928,11 @@ sub singletest_success {
my $esttotal = $sofar/$count * $total;
my $estleft = $esttotal - $sofar;
my $timeleft=sprintf("remaining: %02d:%02d",
$estleft/60,
$estleft%60);
$estleft / 60,
$estleft % 60);
my $took = $timevrfyend{$testnum} - $timeprepini{$testnum};
my $duration = sprintf("duration: %02d:%02d",
$sofar/60, $sofar%60);
$sofar / 60, $sofar % 60);
if(!$automakestyle) {
logmsg sprintf("OK (%-3d out of %-3d, %s, took %.3fs, %s)\n",
$count, $total, $timeleft, $took, $duration);
@ -2613,7 +2613,7 @@ EOHELP
}
}
elsif($ARGV[0] =~ /^to$/i) {
$fromnum = $number+1;
$fromnum = $number + 1;
}
elsif($ARGV[0] =~ /^!(\d+)/) {
$fromnum = -1;
@ -2645,7 +2645,7 @@ if(!$randseed) {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);
# seed of the month. December 2019 becomes 201912
$randseed = ($year+1900)*100 + $mon+1;
$randseed = ($year + 1900) * 100 + $mon + 1;
print "Using curl: $CURL\n";
open(my $curlvh, "-|", exerunner() . shell_quote($CURL) . " --version 2>$dev_null") ||
die "could not get curl version!";
@ -3342,7 +3342,7 @@ if($executed) {
logmsg "IGNORED: failed tests: $sorted\n";
}
logmsg sprintf("TESTDONE: $ok tests out of $total reported OK: %d%%\n",
$ok/$total*100);
$ok / $total * 100);
if($failed && ($ok != $total)) {
my $failedsorted = numsortwords($failed);

View file

@ -76,7 +76,7 @@ struct rtspd_httprequest {
- skip bytes. */
int rcmd; /* doing a special command, see defines above */
reqprot_t protocol; /* request protocol, HTTP or RTSP */
int prot_version; /* HTTP or RTSP version (major*10 + minor) */
int prot_version; /* HTTP or RTSP version (major * 10 + minor) */
bool pipelining; /* true if request is pipelined */
char *rtp_buffer;
size_t rtp_buffersize;

View file

@ -56,8 +56,8 @@ if(join("", @gen) ne join("", @file)) {
$file[$i] =~ s/[\r\n]//g;
if($gen[$i] ne $file[$i]) {
printf "File: %u:%s\nGen: %u:%s\n",
$i+1, showline($file[$i]),
$i+1, showline($gen[$i]);
$i + 1, showline($file[$i]),
$i + 1, showline($gen[$i]);
$e++;
if($e > 10) {
# only show 10 lines diff

View file

@ -164,7 +164,7 @@ sub subbase64 {
# boundary. Then provide two alternatives.
my $now = time();
my $d = ($1 * 24 * 3600) + $now + 30;
$d = int($d/60) * 60;
$d = int($d / 60) * 60;
my $d2 = $d + 60;
$$thing =~ s/%%DAYS%%/%alternatives[$d,$d2]/;
}