mirror of
https://github.com/curl/curl.git
synced 2026-08-25 20:43:32 +03:00
tidy-up: miscellaneous
- drop more uses of the word "just". (not enforced here) - drop some uses of the "will" word. - "then" -> "than". - tests/http/testenv/curl.py: fix copy-paste typo in error message. - pytest: replace `shutdownh` with `shutdown` in test names. Spotted by GitHub Code Quality. - comment typos. - whitespace and newlines fixes. Closes #21830
This commit is contained in:
parent
032b15c434
commit
d229055549
116 changed files with 184 additions and 185 deletions
|
|
@ -35,7 +35,7 @@ all-am: test-ca.cacert
|
|||
|
||||
# Rebuild the certificates
|
||||
|
||||
# Generate all certs in a single shot, but declare just a single target file
|
||||
# Generate all certs in a single shot, but declare only a single target file
|
||||
# to support GNU Make <4.3 without the "grouped explicit targets" feature.
|
||||
test-ca.cacert: $(CERTCONFIG_CA) $(CERTCONFIGS) genserv.pl
|
||||
@PERL@ $(srcdir)/genserv.pl test $(CERTCONFIGS)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
###########################################################################
|
||||
#
|
||||
# This file can be used to specify test cases that should not run when all
|
||||
# test cases are run by runtests.pl. Just add the plain test case numbers, one
|
||||
# test cases are run by runtests.pl. Add the plain test case numbers, one
|
||||
# per line.
|
||||
# Lines starting with '#' letters are treated as comments.
|
||||
#
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
1184
|
||||
1209
|
||||
1211
|
||||
# fnmatch differences are just too common to make testing them sensible
|
||||
# fnmatch differences are too common to make testing them sensible
|
||||
1307
|
||||
1316
|
||||
1512
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ HTTP Basic auth
|
|||
<reply>
|
||||
# The test server provides no way to respond differently to a subsequent
|
||||
# Basic authenticated request (we really want to respond with 200 for
|
||||
# the second), so just respond with 401 for both and let curl deal with it.
|
||||
# the second), so respond with 401 for both and let curl deal with it.
|
||||
<data crlf="headers">
|
||||
HTTP/1.1 401 Authorization Required
|
||||
Server: testcurl
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ HTTP/0.9
|
|||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
No headers at all, just data swsclose
|
||||
No headers at all, only data swsclose
|
||||
|
||||
Let's get
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ FAILURE
|
|||
# Server-side
|
||||
<reply>
|
||||
<servercmd>
|
||||
REPLY PWD 257 "just one
|
||||
REPLY PWD 257 "Only one
|
||||
</servercmd>
|
||||
</reply>
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ Accept: */*
|
|||
<stripfile>
|
||||
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
|
||||
# CURLOPT_INTERLEAVEDATA requires RTSP protocol
|
||||
# configurations - just ignore them
|
||||
# configurations - ignore them
|
||||
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
||||
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
|
||||
$_ = '' if /CURLOPT_HTTP_VERSION/
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ X-Men: cyclops, iceman
|
|||
</protocol>
|
||||
<stripfile>
|
||||
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
|
||||
# configurations - just ignore them
|
||||
# configurations - ignore them
|
||||
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
||||
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
|
||||
$_ = '' if /CURLOPT_HTTP_VERSION/
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ foo=bar%AMPbaz=quux
|
|||
</protocol>
|
||||
<stripfile>
|
||||
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
|
||||
# configurations - just ignore them
|
||||
# configurations - ignore them
|
||||
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
||||
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
|
||||
$_ = '' if /CURLOPT_HTTP_VERSION/
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ Accept: */*
|
|||
</protocol>
|
||||
<stripfile>
|
||||
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
|
||||
# configurations - just ignore them
|
||||
# configurations - ignore them
|
||||
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
||||
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
|
||||
$_ = '' if /CURLOPT_HTTP_VERSION/
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ dummy data
|
|||
</protocol>
|
||||
<stripfile>
|
||||
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
|
||||
# configurations - just ignore them
|
||||
# configurations - ignore them
|
||||
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
||||
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
|
||||
$_ = '' if /CURLOPT_HTTP_VERSION/
|
||||
|
|
|
|||
|
|
@ -65,11 +65,11 @@ QUIT
|
|||
<stripfile>
|
||||
# CURLOPT_USERAGENT and CURLOPT_MAXREDIRS requires HTTP protocol
|
||||
# CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol
|
||||
# support, IOW depends on configuration - just ignore these.
|
||||
# support, IOW depends on configuration - ignore these.
|
||||
$_ = '' if /CURLOPT_USERAGENT/
|
||||
$_ = '' if /CURLOPT_MAXREDIRS/
|
||||
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
|
||||
# configurations - just ignore them
|
||||
# configurations - ignore them
|
||||
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
||||
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
|
||||
$_ = '' if /CURLOPT_HTTP_VERSION/
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ body
|
|||
.
|
||||
</upload>
|
||||
<stripfile>
|
||||
# These options vary with configurations - just ignore them
|
||||
# These options vary with configurations - ignore them
|
||||
# CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol
|
||||
$_ = '' if /CURLOPT_MAXREDIRS/
|
||||
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ LIST %TESTNUMBER
|
|||
QUIT
|
||||
</protocol>
|
||||
<stripfile>
|
||||
# These options vary with configurations - just ignore them
|
||||
# These options vary with configurations - ignore them
|
||||
# CURLOPT_USERAGENT and CURLOPT_MAXREDIRS requires HTTP protocol
|
||||
# CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol
|
||||
$_ = '' if /CURLOPT_USERAGENT/
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ A004 FETCH 1 BODY[]
|
|||
A005 LOGOUT
|
||||
</protocol>
|
||||
<stripfile>
|
||||
# These options vary with configurations - just ignore them
|
||||
# These options vary with configurations - ignore them
|
||||
# CURLOPT_INTERLEAVEDATA requires RTSP (HTTP) protocol
|
||||
$_ = '' if /CURLOPT_MAXREDIRS/
|
||||
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ Content-Type: application/x-www-form-urlencoded
|
|||
</protocol>
|
||||
<stripfile>
|
||||
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
|
||||
# configurations - just ignore them
|
||||
# configurations - ignore them
|
||||
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
||||
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
|
||||
$_ = '' if /CURLOPT_HTTP_VERSION/
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ Proxy-Connection: Keep-Alive
|
|||
<stripfile>
|
||||
# CURLOPT_SSL_VERIFYPEER, SSH_KNOWNHOSTS and HTTP_VERSION vary with
|
||||
# CURLOPT_INTERLEAVEDATA requires RTSP protocol
|
||||
# configurations - just ignore them
|
||||
# configurations - ignore them
|
||||
$_ = '' if /CURLOPT_SSL_VERIFYPEER/
|
||||
$_ = '' if /CURLOPT_SSH_KNOWNHOSTS/
|
||||
$_ = '' if /CURLOPT_HTTP_VERSION/
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Server: Apache/1.3.27 (Darwin) PHP/4.1.2
|
|||
Content-Type: text/html; charset=iso-8859-1
|
||||
Connection: close
|
||||
|
||||
GET received and served just fine. Thank you very much
|
||||
GET received and served fine. Thank you very much
|
||||
</data>
|
||||
</reply>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Explanation for the duplicate 400 requests:
|
|||
|
||||
libcurl does not detect that a given Digest password is wrong already on the
|
||||
first 401 response (as the data400 gives). libcurl will instead consider the
|
||||
new response just as a duplicate and it sends another and detects the auth
|
||||
new response as a duplicate and it sends another and detects the auth
|
||||
problem on the second 401 response!
|
||||
|
||||
-->
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ Explanation for the duplicate 400 requests:
|
|||
|
||||
libcurl does not detect that a given Digest password is wrong already on the
|
||||
first 401 response (as the data400 gives). libcurl will instead consider the
|
||||
new response just as a duplicate and it sends another and detects the auth
|
||||
new response as a duplicate and it sends another and detects the auth
|
||||
problem on the second 401 response!
|
||||
|
||||
-->
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ HTTP PUT from a file but enforce chunked transfer-encoding
|
|||
-T %LOGDIR/file%TESTNUMBER -H "Transfer-Encoding: chunked" http://%HOSTIP:%HTTPPORT/%TESTNUMBER
|
||||
</command>
|
||||
<file name="%LOGDIR/file%TESTNUMBER">
|
||||
just some tiny teeny contents
|
||||
some tiny teeny test contents
|
||||
</file>
|
||||
</client>
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ Accept: */*%CR
|
|||
Transfer-Encoding: chunked%CR
|
||||
%CR
|
||||
1e%CR
|
||||
just some tiny teeny contents
|
||||
some tiny teeny test contents
|
||||
%CR
|
||||
0%CR
|
||||
%CR
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ Connection: Upgrade
|
|||
</protocol>
|
||||
|
||||
# This test used to check that "connection closed" was output, but
|
||||
# that is flaky since the outgoing PING just before might fail already
|
||||
# that is flaky since the outgoing PING before might fail already
|
||||
# and then the test exists before the output gets to be written
|
||||
</verify>
|
||||
</testcase>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ HTTP GET
|
|||
# Server-side
|
||||
<reply>
|
||||
<data>
|
||||
No headers at all, just data swsclose
|
||||
No headers at all, data swsclose
|
||||
|
||||
Let's get
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ chunky-trailer: header data
|
|||
http
|
||||
</server>
|
||||
<name>
|
||||
A non existing file with --etag-compare is just a blank
|
||||
A non existing file with --etag-compare is a blank
|
||||
</name>
|
||||
<command>
|
||||
http://%HOSTIP:%HTTPPORT/%TESTNUMBER --etag-compare %LOGDIR/etag%TESTNUMBER
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ lib%TESTNUMBER
|
|||
SFTP with multi interface, remove handle early
|
||||
</name>
|
||||
|
||||
# The command here uses 'localhost' just to make sure that curl_multi_perform
|
||||
# The command here uses 'localhost' to make sure that curl_multi_perform
|
||||
# does not reach too far in the first invoke. When using c-ares at least, the
|
||||
# name resolve causes it to return rather quickly and thus we could trigger
|
||||
# the problem we are looking to verify.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ http
|
|||
proxy
|
||||
</features>
|
||||
<name>
|
||||
HTTP CONNECT with proxy returning just HTML and closing
|
||||
HTTP CONNECT with proxy returning HTML and closing
|
||||
</name>
|
||||
<command>
|
||||
http://test.example --proxy http://%HOSTIP:%HTTPPORT --proxytunnel -sS
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ smtp
|
|||
SMTP VRFY with custom request
|
||||
</name>
|
||||
|
||||
# the custom request just does it lowercase to remain the same command
|
||||
# the custom request does it lowercase to remain the same command
|
||||
<command>
|
||||
smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient --request "vrfy"
|
||||
</command>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
# TODO: Translate this into something that approximates a valid curl test:-)
|
||||
# Should be useful though even before such translation and a pile less work
|
||||
# to do this than that. The pile of work required would include making an
|
||||
# ECH-enabled server and a DoH server. For now, this is just run manually.
|
||||
# ECH-enabled server and a DoH server. For now, this is run manually.
|
||||
#
|
||||
|
||||
# set -x
|
||||
|
|
@ -1083,7 +1083,7 @@ else
|
|||
echo "NOT all good, log in $logfile"
|
||||
fi
|
||||
|
||||
# send a mail to root (will be forwarded) but just once every 24 hours
|
||||
# send a mail to root (will be forwarded) but only once every 24 hours
|
||||
# 'cause we only really need "new" news
|
||||
itsnews="yes"
|
||||
age_of_news=0
|
||||
|
|
|
|||
|
|
@ -562,8 +562,8 @@ sub protocolsetup {
|
|||
'LIST' => '150 here comes a directory',
|
||||
'NLST' => '150 here comes a directory',
|
||||
'CWD' => '250 CWD command successful.',
|
||||
'SYST' => '215 UNIX Type: L8', # just fake something
|
||||
'QUIT' => '221 bye bye baby', # just reply something
|
||||
'SYST' => '215 UNIX Type: L8', # fake something
|
||||
'QUIT' => '221 bye bye baby', # reply something
|
||||
'MKD' => '257 Created your requested directory',
|
||||
'REST' => '350 Yeah yeah we set it there for you',
|
||||
'DELE' => '200 OK OK OK whatever you say',
|
||||
|
|
@ -1143,7 +1143,7 @@ my $cmdid;
|
|||
my $selected;
|
||||
|
||||
# Any IMAP parameter can come in escaped and in double quotes.
|
||||
# This function is dumb (so far) and just removes the quotes if present.
|
||||
# This function is dumb (so far) and removes the quotes if present.
|
||||
sub fix_imap_params {
|
||||
foreach (@_) {
|
||||
$_ = $1 if /^"(.*)"$/;
|
||||
|
|
@ -3289,7 +3289,7 @@ while(1) {
|
|||
|
||||
my $delay = $delayreply{$FTPCMD};
|
||||
if($delay) {
|
||||
# just go sleep this many seconds!
|
||||
# go sleep this many seconds!
|
||||
logmsg("Sleep for $delay seconds\n");
|
||||
my $twentieths = $delay * 20;
|
||||
while($twentieths--) {
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ sub partexists {
|
|||
}
|
||||
|
||||
# The code currently never calls this more than once per part per file, so
|
||||
# caching a result that is never used again just slows things down.
|
||||
# caching a result that is never used again only slows things down.
|
||||
# memoize('partexists', NORMALIZER => 'normalize_part'); # cache each result
|
||||
|
||||
sub loadtest {
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ our $CURLINFO=dirsepadd("../src/" . ($ENV{'CURL_DIRSUFFIX'} || '')) .
|
|||
|
||||
our $VCURL=$CURL; # what curl binary to use to verify the servers with
|
||||
# VCURL is handy to set to the system one when the one you
|
||||
# just built hangs or crashes and thus prevent verification
|
||||
# built hangs or crashes and thus prevent verification
|
||||
# the path to the script that analyzes the memory debug output file
|
||||
our $memanalyze="$perl " . shell_quote("$srcdir/memanalyze.pl");
|
||||
our $valgrind; # path to valgrind, or empty if disabled
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ use serverhelp qw(
|
|||
);
|
||||
|
||||
my $verbose = 0; # set to 1 for debugging
|
||||
my $port = 8990; # just a default
|
||||
my $port = 8990; # a default
|
||||
my $unix_socket; # location to place a listening Unix socket
|
||||
my $ipvnum = 4; # default IP version of http server
|
||||
my $idnum = 1; # default http server instance number
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class TestDownload:
|
|||
])
|
||||
r.check_response(http_status=200, count=count)
|
||||
# should have used at most 2 connections only (test servers allow 100 req/conn)
|
||||
# it may be just 1 on slow systems where request are answered faster than
|
||||
# it may be 1 on slow systems where request are answered faster than
|
||||
# curl can exhaust the capacity or if curl runs with address-sanitizer speed
|
||||
assert r.total_connects <= 2, "h2 should use fewer connections here"
|
||||
|
||||
|
|
@ -417,7 +417,7 @@ class TestDownload:
|
|||
assert r.exit_code == 0, f'{client.dump_logs()}'
|
||||
|
||||
# Special client that tests TLS session reuse in parallel transfers
|
||||
# TODO: just uses a single connection for h2/h3. Not sure how to prevent that
|
||||
# TODO: uses a single connection for h2/h3. Not sure how to prevent that
|
||||
@pytest.mark.parametrize("proto", Env.http_protos())
|
||||
def test_02_26_session_shared_reuse(self, env: Env, proto, httpd, nghttpx):
|
||||
url = f'https://{env.authority_for(env.domain1, proto)}/data-100k'
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class TestErrors:
|
|||
assert r.stats[0]['http_version'] == '1.1', r.dump_logs()
|
||||
|
||||
# On the URL used here, Apache is doing an "unclean" TLS shutdown,
|
||||
# meaning it sends no shutdown notice and just closes TCP.
|
||||
# meaning it sends no shutdown notice and closes TCP.
|
||||
# The HTTP response delivers a body without Content-Length. We expect:
|
||||
# - http/1.0 to fail since it relies on a clean connection close to
|
||||
# detect the end of the body
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class TestAuth:
|
|||
if proto == 'h3' and not env.curl_uses_lib('ngtcp2'):
|
||||
# See <https://github.com/cloudflare/quiche/issues/1573>
|
||||
pytest.skip("quiche has problems with large requests")
|
||||
# just large enough that nghttp2 will submit
|
||||
# large enough that nghttp2 will submit
|
||||
password = 'x' * (47 * 1024)
|
||||
fdata = os.path.join(env.gen_dir, 'data-10m')
|
||||
curl = CurlClient(env=env)
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class TestVsFTPD:
|
|||
@pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
|
||||
def test_30_06_shutdownh_download(self, env: Env, vsftpd: VsFTPD):
|
||||
def test_30_06_shutdown_download(self, env: Env, vsftpd: VsFTPD):
|
||||
docname = 'data-1k'
|
||||
curl = CurlClient(env=env)
|
||||
count = 1
|
||||
|
|
@ -166,7 +166,7 @@ class TestVsFTPD:
|
|||
@pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
|
||||
def test_30_07_shutdownh_upload(self, env: Env, vsftpd: VsFTPD):
|
||||
def test_30_07_shutdown_upload(self, env: Env, vsftpd: VsFTPD):
|
||||
docname = 'upload-1k'
|
||||
curl = CurlClient(env=env)
|
||||
srcfile = os.path.join(env.gen_dir, docname)
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ class TestVsFTPD:
|
|||
@pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
|
||||
def test_31_06_shutdownh_download(self, env: Env, vsftpds: VsFTPD):
|
||||
def test_31_06_shutdown_download(self, env: Env, vsftpds: VsFTPD):
|
||||
docname = 'data-1k'
|
||||
curl = CurlClient(env=env)
|
||||
count = 1
|
||||
|
|
@ -170,7 +170,7 @@ class TestVsFTPD:
|
|||
@pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
|
||||
def test_31_07_shutdownh_upload(self, env: Env, vsftpds: VsFTPD):
|
||||
def test_31_07_shutdown_upload(self, env: Env, vsftpds: VsFTPD):
|
||||
docname = 'upload-1k'
|
||||
curl = CurlClient(env=env)
|
||||
srcfile = os.path.join(env.gen_dir, docname)
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ class TestFtpsVsFTPD:
|
|||
@pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
|
||||
def test_32_06_shutdownh_download(self, env: Env, vsftpds: VsFTPD):
|
||||
def test_32_06_shutdown_download(self, env: Env, vsftpds: VsFTPD):
|
||||
docname = 'data-1k'
|
||||
curl = CurlClient(env=env)
|
||||
count = 1
|
||||
|
|
@ -183,7 +183,7 @@ class TestFtpsVsFTPD:
|
|||
@pytest.mark.skipif(condition=not Env.tcpdump(), reason="tcpdump not available")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_debug(), reason="needs curl debug")
|
||||
@pytest.mark.skipif(condition=not Env.curl_is_verbose(), reason="needs curl verbose strings")
|
||||
def test_32_07_shutdownh_upload(self, env: Env, vsftpds: VsFTPD):
|
||||
def test_32_07_shutdown_upload(self, env: Env, vsftpds: VsFTPD):
|
||||
docname = 'upload-1k'
|
||||
curl = CurlClient(env=env)
|
||||
srcfile = os.path.join(env.gen_dir, docname)
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class TestH3Proxy:
|
|||
)
|
||||
|
||||
# An HTTP/3 target auto-triggers CONNECT-UDP even without --proxytunnel,
|
||||
# just as HTTPS targets auto-trigger CONNECT. nghttpx does not support
|
||||
# as HTTPS targets auto-trigger CONNECT. nghttpx does not support
|
||||
# CONNECT-UDP so this fails, which confirms auto-CONNECT-UDP is active.
|
||||
assert r.exit_code != 0, (
|
||||
"expected failure: h3 target auto-triggers CONNECT-UDP "
|
||||
|
|
|
|||
|
|
@ -1239,7 +1239,7 @@ class CurlClient:
|
|||
|
||||
def _perf_collapse(self, perf: PerfProfile, file_err):
|
||||
if not os.path.exists(perf.file):
|
||||
raise Exception(f'dtrace output file does not exist: {perf.file}')
|
||||
raise Exception(f'perf output file does not exist: {perf.file}')
|
||||
fg_collapse = os.path.join(self._fg_dir, 'stackcollapse-perf.pl')
|
||||
if not os.path.exists(fg_collapse):
|
||||
raise Exception(f'FlameGraph script not found: {fg_collapse}')
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ static int curltest_tweak_handler(request_rec *r)
|
|||
}
|
||||
}
|
||||
else if(!strcmp("id", arg)) {
|
||||
/* just an id for repeated requests with curl's URL globbing */
|
||||
/* an id for repeated requests with curl's URL globbing */
|
||||
request_id = val;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -551,7 +551,7 @@ static int curltest_put_handler(request_rec *r)
|
|||
*s = '\0';
|
||||
val = s + 1;
|
||||
if(!strcmp("id", arg)) {
|
||||
/* just an id for repeated requests with curl's URL globbing */
|
||||
/* an id for repeated requests with curl's URL globbing */
|
||||
request_id = val;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -748,7 +748,7 @@ static int curltest_sslinfo_handler(request_rec *r)
|
|||
*s = '\0';
|
||||
val = s + 1;
|
||||
if(!strcmp("id", arg)) {
|
||||
/* just an id for repeated requests with curl's URL globbing */
|
||||
/* an id for repeated requests with curl's URL globbing */
|
||||
request_id = val;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -862,7 +862,7 @@ static int curltest_limit_handler(request_rec *r)
|
|||
*s = '\0';
|
||||
val = s + 1;
|
||||
if(!strcmp("id", arg)) {
|
||||
/* just an id for repeated requests with curl's URL globbing */
|
||||
/* an id for repeated requests with curl's URL globbing */
|
||||
request_id = val;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ CURLcode ws_recv_pong(CURL *curl, const char *expected_payload)
|
|||
return CURLE_RECV_ERROR;
|
||||
}
|
||||
|
||||
/* just close the connection */
|
||||
/* close the connection */
|
||||
void ws_close(CURL *curl)
|
||||
{
|
||||
size_t sent;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ extern int unitfail; /* for unittests */
|
|||
#include "curlx/wait.h" /* for curlx_wait_ms() */
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
/* since so many tests use select(), we can just as well include it here */
|
||||
/* since so many tests use select(), we can as well include it here */
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ extern char *hexdump(const unsigned char *buf, size_t len);
|
|||
#ifndef CURL_DISABLE_WEBSOCKETS
|
||||
CURLcode ws_send_ping(CURL *curl, const char *send_payload);
|
||||
CURLcode ws_recv_pong(CURL *curl, const char *expected_payload);
|
||||
void ws_close(CURL *curl); /* just close the connection */
|
||||
void ws_close(CURL *curl); /* close the connection */
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ static CURLcode test_lib1518(const char *URL)
|
|||
}
|
||||
else {
|
||||
test_setopt(curl, CURLOPT_URL, URL);
|
||||
/* just to make it explicit and visible in this test: */
|
||||
/* to make it explicit and visible in this test: */
|
||||
test_setopt(curl, CURLOPT_FOLLOWLOCATION, 0L);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ static CURLcode test_lib1537(const char *URL)
|
|||
curl_mprintf("escape -1 length: %s\n", ptr);
|
||||
|
||||
/* weird input length */
|
||||
outlen = 2017; /* just a value */
|
||||
outlen = 2017; /* an arbitrary value */
|
||||
ptr = curl_easy_unescape(NULL, "moahahaha", -1, &outlen);
|
||||
curl_mprintf("unescape -1 length: %s %d\n", ptr, outlen);
|
||||
|
||||
|
|
|
|||
|
|
@ -61,20 +61,20 @@ static CURLcode test_lib1592(const char *URL)
|
|||
/* Since we could set the DNS server, presume we are working with a
|
||||
resolver that can be cancelled (i.e. c-ares). Thus,
|
||||
curl_multi_remove_handle() should not block even when the resolver
|
||||
request is outstanding. So, set a request timeout _longer_ than the
|
||||
request is outstanding. Thus, set a request timeout _longer_ than the
|
||||
test hang timeout so we will fail if the handle removal call incorrectly
|
||||
blocks. */
|
||||
timeout = TEST_HANG_TIMEOUT * 2;
|
||||
else {
|
||||
/* If we cannot set the DNS server, presume that we are configured to use
|
||||
a resolver that cannot be cancelled (i.e. the threaded resolver or the
|
||||
non-threaded blocking resolver). So, we just test that the
|
||||
non-threaded blocking resolver). Thus, we test that the
|
||||
curl_multi_remove_handle() call does finish well within our test
|
||||
timeout.
|
||||
|
||||
But, it is unlikely that the resolver request will take any time at
|
||||
all because we have not been able to configure the resolver to use an
|
||||
non-responsive DNS server. At least we exercise the flow.
|
||||
non-responsive DNS server. At least we exercise the flow.
|
||||
*/
|
||||
curl_mfprintf(stderr,
|
||||
"CURLOPT_DNS_SERVERS not supported; "
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static CURLcode test_lib1908(const char *URL)
|
|||
curl_easy_reset(curl);
|
||||
|
||||
/* using the same filename for the alt-svc cache, this clobbers the
|
||||
content just written from the 'curldupe' handle */
|
||||
content written from the 'curldupe' handle */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
curl_global_cleanup();
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ static CURLcode test_lib1911(const char *URL)
|
|||
return TEST_ERR_EASY_INIT;
|
||||
}
|
||||
|
||||
/* make it a null-terminated C string with just As */
|
||||
/* make it a null-terminated C string with only As */
|
||||
memset(testbuf, 'A', MAX_INPUT_LENGTH + 1);
|
||||
testbuf[MAX_INPUT_LENGTH + 1] = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static CURLcode test_lib1939(const char *URL)
|
|||
mresult = curl_multi_add_handle(multi, curl);
|
||||
|
||||
if(!mresult)
|
||||
/* Run the multi handle once, just enough to start establishing an
|
||||
/* Run the multi handle once, enough to start establishing an
|
||||
HTTPS connection. */
|
||||
mresult = curl_multi_perform(multi, &running_handles);
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ static CURLcode test_lib1977(const char *URL)
|
|||
global_init(CURL_GLOBAL_ALL);
|
||||
easy_init(curl);
|
||||
|
||||
/* first transfer: set just the URL in the first CURLU handle */
|
||||
/* first transfer: set the URL in the first CURLU handle */
|
||||
curl_url_set(curlu, CURLUPART_URL, URL, CURLU_DEFAULT_SCHEME);
|
||||
easy_setopt(curl, CURLOPT_CURLU, curlu);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ static CURLcode test_lib3027(const char *URL)
|
|||
result = curl_easy_getinfo(curl, CURLINFO_FILETIME, &filetime);
|
||||
/* MTDM fails with 550, so filetime should be -1 */
|
||||
if((result == CURLE_OK) && (filetime != -1)) {
|
||||
/* we just need to return something which is not CURLE_OK */
|
||||
/* we need to return something which is not CURLE_OK */
|
||||
result = CURLE_UNSUPPORTED_PROTOCOL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ static CURLcode test_lib501(const char *URL)
|
|||
|
||||
test_setopt(curl, CURLOPT_HEADER, 1L);
|
||||
|
||||
/* just verify that setting this to -1 is fine */
|
||||
/* verify that setting this to -1 is fine */
|
||||
test_setopt(curl, CURLOPT_MAXREDIRS, -1L);
|
||||
|
||||
result = curl_easy_perform(curl);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include "first.h"
|
||||
|
||||
/*
|
||||
* This example shows an FTP upload, with a rename of the file just after
|
||||
* This example shows an FTP upload, with a rename of the file right after
|
||||
* a successful upload.
|
||||
*
|
||||
* Example based on source code provided by Erick Nuwendam. Thanks!
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ static int t518_test_rlimit(int keep_open)
|
|||
curl_mfprintf(stderr, "raising soft limit up to OPEN_MAX\n");
|
||||
rl.rlim_cur = OPEN_MAX;
|
||||
if(setrlimit(RLIMIT_NOFILE, &rl) != 0) {
|
||||
/* on failure do not abort just issue a warning */
|
||||
/* on failure do not abort, only issue a warning */
|
||||
t518_store_errmsg("setrlimit() failed", errno);
|
||||
curl_mfprintf(stderr, "%s\n", t518_msgbuff);
|
||||
t518_msgbuff[0] = '\0';
|
||||
|
|
@ -147,7 +147,7 @@ static int t518_test_rlimit(int keep_open)
|
|||
curl_mfprintf(stderr, "raising soft limit up to hard limit\n");
|
||||
rl.rlim_cur = rl.rlim_max;
|
||||
if(setrlimit(RLIMIT_NOFILE, &rl) != 0) {
|
||||
/* on failure do not abort just issue a warning */
|
||||
/* on failure do not abort, only issue a warning */
|
||||
t518_store_errmsg("setrlimit() failed", errno);
|
||||
curl_mfprintf(stderr, "%s\n", t518_msgbuff);
|
||||
t518_msgbuff[0] = '\0';
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ static int t537_test_rlimit(int keep_open)
|
|||
curl_mfprintf(stderr, "raising soft limit up to OPEN_MAX\n");
|
||||
rl.rlim_cur = OPEN_MAX;
|
||||
if(setrlimit(RLIMIT_NOFILE, &rl) != 0) {
|
||||
/* on failure do not abort just issue a warning */
|
||||
/* on failure do not abort, only issue a warning */
|
||||
t537_store_errmsg("setrlimit() failed", errno);
|
||||
curl_mfprintf(stderr, "%s\n", t537_msgbuff);
|
||||
t537_msgbuff[0] = '\0';
|
||||
|
|
@ -148,7 +148,7 @@ static int t537_test_rlimit(int keep_open)
|
|||
curl_mfprintf(stderr, "raising soft limit up to hard limit\n");
|
||||
rl.rlim_cur = rl.rlim_max;
|
||||
if(setrlimit(RLIMIT_NOFILE, &rl) != 0) {
|
||||
/* on failure do not abort just issue a warning */
|
||||
/* on failure do not abort, only issue a warning */
|
||||
t537_store_errmsg("setrlimit() failed", errno);
|
||||
curl_mfprintf(stderr, "%s\n", t537_msgbuff);
|
||||
t537_msgbuff[0] = '\0';
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ elsif($ARGV[0] eq "postprocess") {
|
|||
my $line = sprintf("%s%s???????%5d U U %15d %s %s\n", $1,$2,$5,$6,$7,$8);
|
||||
push @canondir, $line;
|
||||
} else {
|
||||
# Unexpected format; just pass it through and let the test fail
|
||||
# Unexpected format; pass it through and let the test fail
|
||||
push @canondir, $_;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ class Negotiator:
|
|||
log.debug("Starting negotiation (IAC)")
|
||||
self.state = self.START_NEG
|
||||
else:
|
||||
# Just append the incoming byte to the buffer
|
||||
# Append the incoming byte to the buffer
|
||||
buffer.append(byte_int)
|
||||
|
||||
def start_neg(self, byte_int):
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ use serverhelp qw(
|
|||
);
|
||||
|
||||
my $verbose = 0; # set to 1 for debugging
|
||||
my $port = 8990; # just a default
|
||||
my $port = 8990; # a default
|
||||
my $ipvnum = 4; # default IP version of rtsp server
|
||||
my $idnum = 1; # default rtsp server instance number
|
||||
my $proto = 'rtsp'; # protocol the rtsp server speaks
|
||||
|
|
|
|||
|
|
@ -1724,8 +1724,7 @@ sub singletest_check {
|
|||
my @sout = sort @out;
|
||||
|
||||
if($hostname) {
|
||||
# when a hostname is set, we filter out requests to just this
|
||||
# pattern
|
||||
# when a hostname is set, we filter out requests to this pattern
|
||||
@sout = grep {/$hostname/} @sout;
|
||||
}
|
||||
|
||||
|
|
@ -2675,7 +2674,7 @@ if($valgrind) {
|
|||
# since valgrind 2.1.x, '--tool' option is mandatory
|
||||
# use it, if it is supported by the version installed on the system
|
||||
# (this happened in 2003, so we could probably do not need to care about
|
||||
# that old version any longer and just delete this check)
|
||||
# that old version any longer and delete this check)
|
||||
runclient("valgrind --help 2>&1 | grep -- --tool >$dev_null 2>&1");
|
||||
if(($? >> 8)) {
|
||||
$valgrind_tool="";
|
||||
|
|
@ -2690,7 +2689,7 @@ if($valgrind) {
|
|||
|
||||
# valgrind 3 renamed the --logfile option to --log-file!!!
|
||||
# (this happened in 2005, so we could probably do not need to care about
|
||||
# that old version any longer and just delete this check)
|
||||
# that old version any longer and delete this check)
|
||||
my $ver=join(' ', runclientoutput("valgrind --version"));
|
||||
# cut off all but digits and dots
|
||||
$ver =~ s/[^0-9.]//g;
|
||||
|
|
@ -3212,7 +3211,7 @@ while(1) {
|
|||
$endwaitcnt += $runnerwait;
|
||||
if($endwaitcnt >= 10) {
|
||||
# Once all tests have been scheduled on a runner at the end of a test
|
||||
# run, we just wait for their results to come in. If we are still
|
||||
# run, we wait for their results to come in. If we are still
|
||||
# waiting after a couple of minutes ($endwaitcnt multiplied by
|
||||
# $runnerwait, plus $jobs because that number will not time out), display
|
||||
# the same test runner status as we give with a SIGUSR1. This will
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#***************************************************************************
|
||||
|
||||
# This is the HTTPS, FTPS, POP3S, IMAPS, SMTPS, server used for curl test
|
||||
# harness. Actually just a layer that runs stunnel properly using the
|
||||
# harness. Actually a layer that runs stunnel properly using the
|
||||
# non-secure test harness servers.
|
||||
|
||||
use strict;
|
||||
|
|
@ -50,7 +50,7 @@ my $stunnel = "stunnel";
|
|||
|
||||
my $verbose=0; # set to 1 for debugging
|
||||
|
||||
my $accept_port = 8991; # just our default, weird enough
|
||||
my $accept_port = 8991; # our default, weird enough
|
||||
my $target_port = 8999; # default test http-server port
|
||||
|
||||
my $stuncert;
|
||||
|
|
@ -370,7 +370,7 @@ if($tstunnel_windows) {
|
|||
# new process to the parent waiting perl.exe and sh.exe processes.
|
||||
|
||||
# exec() should never return back here to this process. We protect
|
||||
# ourselves by calling die() just in case something goes really bad.
|
||||
# ourselves by calling die() in case something goes really bad.
|
||||
die "error: exec() has returned";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ static int decodedata(char **buf, /* dest buffer */
|
|||
/*
|
||||
* currently there is no way to tell apart an OOM condition in
|
||||
* curlx_base64_decode() from zero length decoded data. For now,
|
||||
* let's just assume it is an OOM condition, currently we have
|
||||
* let's assume it is an OOM condition, currently we have
|
||||
* no input for this function that decodes to zero length data.
|
||||
*/
|
||||
free(buf64);
|
||||
|
|
@ -231,7 +231,7 @@ static int decodedata(char **buf, /* dest buffer */
|
|||
* and the size of the data is stored at the addresses that caller specifies.
|
||||
*
|
||||
* If the returned data is a string the returned size will be the length of
|
||||
* the string excluding null-termination. Otherwise it will just be the size
|
||||
* the string excluding null-termination. Otherwise it will be the size
|
||||
* of the returned binary data.
|
||||
*
|
||||
* Calling function is responsible to free returned buffer.
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ struct rtspd_httprequest {
|
|||
#define CMD_AUTH_REQUIRED "auth_required"
|
||||
|
||||
/* 'idle' means that it will accept the request fine but never respond
|
||||
any data. Just keep the connection alive. */
|
||||
any data. Keep the connection alive. */
|
||||
#define CMD_IDLE "idle"
|
||||
|
||||
/* 'stream' means to send a never-ending stream of data */
|
||||
|
|
@ -890,7 +890,7 @@ static int rtspd_send_doc(curl_socket_t sock, struct rtspd_httprequest *req)
|
|||
|
||||
responsesize = count;
|
||||
do {
|
||||
/* Ok, we send no more than 200 bytes at a time, just to make sure that
|
||||
/* Ok, we send no more than 200 bytes at a time, to make sure that
|
||||
larger chunks are split up so that the client will need to do multiple
|
||||
recv() calls to get it and thus we exercise that code better */
|
||||
size_t num = count;
|
||||
|
|
|
|||
|
|
@ -68,14 +68,13 @@
|
|||
* 'exit_signal_handler' for both signals.
|
||||
*
|
||||
* The 'exit_signal_handler' upon the first SIGINT or SIGTERM received signal
|
||||
* will just set to one the global var 'got_exit_signal' storing in global var
|
||||
* sets to one the global var 'got_exit_signal' storing in global var
|
||||
* 'exit_signal' the signal that triggered this change.
|
||||
*
|
||||
* Nothing fancy that could introduce problems is used, the program at certain
|
||||
* points in its normal flow checks if var 'got_exit_signal' is set and in
|
||||
* case this is true it just makes its way out of loops and functions in
|
||||
* structured and well behaved manner to achieve proper program cleanup and
|
||||
* termination.
|
||||
* case this is true it makes its way out of loops and functions in structured
|
||||
* and well behaved manner to achieve proper program cleanup and termination.
|
||||
*
|
||||
* Even with the above mechanism implemented it is worthwhile to note that
|
||||
* other signals might still be received, or that there might be systems on
|
||||
|
|
@ -172,7 +171,7 @@ static ssize_t write_wincon(int fd, const void *buf, size_t count)
|
|||
#endif
|
||||
|
||||
/* On Windows, we sometimes get this for a broken pipe, seemingly
|
||||
* when the client just closed stdin? */
|
||||
* when the client closed stdin? */
|
||||
#define CURL_WIN32_EPIPE 109
|
||||
|
||||
/*
|
||||
|
|
@ -897,7 +896,7 @@ static bool disc_handshake(void)
|
|||
return FALSE;
|
||||
}
|
||||
else if(!memcmp("QUIT", buffer, 4)) {
|
||||
/* just die */
|
||||
/* die */
|
||||
logmsg("quits");
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -945,7 +944,7 @@ static bool juggle(curl_socket_t *sockfdp,
|
|||
}
|
||||
|
||||
#ifdef HAVE_GETPPID
|
||||
/* As a last resort, quit if sockfilt process becomes orphan. Just in case
|
||||
/* As a last resort, quit if sockfilt process becomes orphan. In case
|
||||
parent ftpserver process has died without killing its sockfilt children */
|
||||
if(getppid() <= 1) {
|
||||
logmsg("process becomes orphan, exiting");
|
||||
|
|
@ -1055,7 +1054,7 @@ static bool juggle(curl_socket_t *sockfdp,
|
|||
buffer[0], buffer[1], buffer[2], buffer[3]);
|
||||
|
||||
if(!memcmp("PING", buffer, 4)) {
|
||||
/* send reply on stdout, just proving we are alive */
|
||||
/* send reply on stdout, proving we are alive */
|
||||
if(!write_stdout("PONG\n", 5))
|
||||
return FALSE;
|
||||
}
|
||||
|
|
@ -1073,7 +1072,7 @@ static bool juggle(curl_socket_t *sockfdp,
|
|||
return FALSE;
|
||||
}
|
||||
else if(!memcmp("QUIT", buffer, 4)) {
|
||||
/* just die */
|
||||
/* die */
|
||||
logmsg("quits");
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ static const char *cmdfile = "log/server.cmd";
|
|||
#define CMD_AUTH_REQUIRED "auth_required"
|
||||
|
||||
/* 'idle' means that it will accept the request fine but never respond
|
||||
any data. Just keep the connection alive. */
|
||||
any data. Keep the connection alive. */
|
||||
#define CMD_IDLE "idle"
|
||||
|
||||
/* 'stream' means to send a never-ending stream of data */
|
||||
|
|
@ -304,7 +304,7 @@ static int sws_parse_servercmd(struct sws_httprequest *req)
|
|||
else {
|
||||
logmsg("Unknown <servercmd> instruction found: %s", cmd);
|
||||
}
|
||||
/* try to deal with CRLF or just LF */
|
||||
/* try to deal with CRLF or LF */
|
||||
check = strchr(cmd, '\r');
|
||||
if(!check)
|
||||
check = strchr(cmd, '\n');
|
||||
|
|
@ -966,7 +966,7 @@ static int sws_send_doc(curl_socket_t sock, struct sws_httprequest *req)
|
|||
|
||||
responsesize = count;
|
||||
do {
|
||||
/* Ok, we send no more than N bytes at a time, just to make sure that
|
||||
/* Ok, we send no more than N bytes at a time, to make sure that
|
||||
larger chunks are split up so that the client will need to do multiple
|
||||
recv() calls to get it and thus we exercise that code better */
|
||||
size_t num = count;
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ static ssize_t write_behind(struct testcase *test, int convert)
|
|||
|
||||
b = &bfs[nextone];
|
||||
if(b->counter < -1) /* anything to flush? */
|
||||
return 0; /* just nop if nothing to do */
|
||||
return 0; /* nop if nothing to do */
|
||||
|
||||
if(!test->ofile) {
|
||||
char outfile[256];
|
||||
|
|
@ -453,11 +453,11 @@ static ssize_t write_behind(struct testcase *test, int convert)
|
|||
while(ct--) { /* loop over the buffer */
|
||||
c = (unsigned char)*p++; /* pick up a character */
|
||||
if(prevchar == '\r') { /* if prev char was cr */
|
||||
if(c == '\n') /* if have cr,lf then just */
|
||||
if(c == '\n') /* if have cr,lf then */
|
||||
curl_lseek(test->ofile, -1, SEEK_CUR); /* smash lf on top of the cr */
|
||||
else if(c == '\0') /* if have cr,nul then */
|
||||
goto skipit; /* just skip over the putc */
|
||||
/* else just fall through and allow it */
|
||||
goto skipit; /* skip over the putc */
|
||||
/* else fall through and allow it */
|
||||
}
|
||||
/* formerly
|
||||
putc(c, file); */
|
||||
|
|
@ -570,7 +570,7 @@ static int tftpd_parse_servercmd(struct testcase *req)
|
|||
else {
|
||||
logmsg("Unknown <servercmd> instruction found: %s", cmd);
|
||||
}
|
||||
/* try to deal with CRLF or just LF */
|
||||
/* try to deal with CRLF or LF */
|
||||
check = strchr(cmd, '\r');
|
||||
if(!check)
|
||||
check = strchr(cmd, '\n');
|
||||
|
|
@ -858,7 +858,7 @@ send_ack:
|
|||
rap->th_block = htons(recvblock);
|
||||
(void)swrite(peer, &ackbuf.storage[0], 4);
|
||||
#if defined(HAVE_ALARM) && defined(SIGALRM)
|
||||
mysignal(SIGALRM, justtimeout); /* just abort read on timeout */
|
||||
mysignal(SIGALRM, justtimeout); /* abort read on timeout */
|
||||
alarm(rexmtval);
|
||||
#endif
|
||||
/* normally times out and quits */
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ use testutil qw(
|
|||
our $logfile; # server log filename, for logmsg
|
||||
|
||||
#***************************************************************************
|
||||
# Just for convenience, test harness uses 'https' and 'httptls' literals as
|
||||
# For convenience, test harness uses 'https' and 'httptls' literals as
|
||||
# values for 'proto' variable in order to differentiate different servers.
|
||||
# 'https' literal is used for stunnel based https test servers, and 'httptls'
|
||||
# is used for non-stunnel https test servers.
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ sub init_serverpidfile_hash {
|
|||
}
|
||||
|
||||
#######################################################################
|
||||
# Check if a given child process has just died. Reaps it if so.
|
||||
# Check if a given child process has died. Reaps it if so.
|
||||
#
|
||||
sub checkdied {
|
||||
my $pid = $_[0];
|
||||
|
|
@ -354,7 +354,7 @@ sub startnew {
|
|||
exec("exec $cmd") || die "Cannot exec() $cmd: $!";
|
||||
|
||||
# exec() should never return back here to this process. We protect
|
||||
# ourselves by calling die() just in case something goes really bad.
|
||||
# ourselves by calling die() in case something goes really bad.
|
||||
die "error: exec() has returned";
|
||||
}
|
||||
|
||||
|
|
@ -382,17 +382,17 @@ sub startnew {
|
|||
$pid2 = pidfromfile($pidfile, 0);
|
||||
if(($pid2 > 0) && pidexists($pid2)) {
|
||||
# if $pid2 is valid, then make sure this pid is alive, as
|
||||
# otherwise it is just likely to be the _previous_ pidfile or
|
||||
# otherwise it is likely to be the _previous_ pidfile or
|
||||
# similar!
|
||||
last;
|
||||
}
|
||||
if(checkdied($child)) {
|
||||
logmsg "startnew: child process has died, server might start up\n"
|
||||
if($verbose);
|
||||
# We cannot just abort waiting for the server with a
|
||||
# We cannot abort waiting for the server with a
|
||||
# return (-1,-1);
|
||||
# because the server might have forked and could still start
|
||||
# up normally. Instead, just reduce the amount of time we remain
|
||||
# up normally. Instead, reduce the amount of time we remain
|
||||
# waiting.
|
||||
$count >>= 2;
|
||||
}
|
||||
|
|
@ -1012,7 +1012,7 @@ sub verifytelnet {
|
|||
# particular can take a long time to start if it needs to generate
|
||||
# keys on a slow or loaded host.
|
||||
#
|
||||
# Just for convenience, test harness uses 'https' and 'httptls' literals
|
||||
# For convenience, test harness uses 'https' and 'httptls' literals
|
||||
# as values for 'proto' variable in order to differentiate different
|
||||
# servers. 'https' literal is used for stunnel based https test servers,
|
||||
# and 'httptls' is used for non-stunnel https test servers.
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class ShutdownHandler(threading.Thread):
|
|||
signal.signal(signal.SIGTERM, self._sighandler)
|
||||
|
||||
def __exit__(self, *_):
|
||||
# Call for shutdown just in case it was not done already
|
||||
# Call for shutdown in case it was not done already
|
||||
self.shutdown_event.set()
|
||||
# Wait for thread, and therefore also the server, to finish
|
||||
self.join()
|
||||
|
|
|
|||
|
|
@ -1190,7 +1190,7 @@ if($sshdid =~ /OpenSSH-Windows/) {
|
|||
# new process to the parent waiting perl.exe and sh.exe processes.
|
||||
|
||||
# exec() should never return back here to this process. We protect
|
||||
# ourselves by calling die() just in case something goes really bad.
|
||||
# ourselves by calling die() in case something goes really bad.
|
||||
die "error: exec() has returned";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ close $s;
|
|||
|
||||
my $ignored=0;
|
||||
for my $e (sort @syms) {
|
||||
# OBSOLETE - names that are just placeholders for a position where we
|
||||
# OBSOLETE - names that are placeholders for a position where we
|
||||
# previously had a name, that is now removed. The OBSOLETE names should
|
||||
# never be used for anything.
|
||||
#
|
||||
|
|
@ -176,7 +176,7 @@ for my $e (sort @syms) {
|
|||
#
|
||||
# CURL_TEMP_ - are defined and *undefined* again within the file
|
||||
#
|
||||
# *_LAST and *_LASTENTRY are just suffix for the placeholders used for the
|
||||
# *_LAST and *_LASTENTRY are suffix for the placeholders used for the
|
||||
# last entry in many enum series.
|
||||
#
|
||||
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ sub scanmanpage {
|
|||
while(<$m>) {
|
||||
chomp;
|
||||
if($_ =~ /^.so /) {
|
||||
# this man page is just a referral
|
||||
# this man page is a referral
|
||||
close($m);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ use serverhelp qw(
|
|||
);
|
||||
|
||||
my $verbose = 0; # set to 1 for debugging
|
||||
my $port = 8997; # just a default
|
||||
my $port = 8997; # a default
|
||||
my $ipvnum = 4; # default IP version of tftp server
|
||||
my $idnum = 1; # default tftp server instance number
|
||||
my $proto = 'tftp'; # protocol the tftp server speaks
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ static void t1303_stop(struct Curl_easy *easy)
|
|||
curl_global_cleanup();
|
||||
}
|
||||
|
||||
/* BASE is just a define to make us fool around with decently large number so
|
||||
/* BASE is a define to make us fool around with decently large number so
|
||||
that we are not zero-based */
|
||||
#define BASE 1000000
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ static CURLcode t1609_setup(void)
|
|||
we set address using CURLOPT_RESOLVE,
|
||||
it usually marks as permanent (by setting timestamp to zero). However,
|
||||
if address already exists
|
||||
in the cache, then it does not mark it, but just leaves it as it is.
|
||||
in the cache, then it does not mark it, but leaves it as it is.
|
||||
So we fixing this by timestamp to zero if address already exists too.
|
||||
|
||||
Test:
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ static CURLcode test_unit1615(const char *arg)
|
|||
};
|
||||
|
||||
unsigned char output_buf[CURL_SHA512_256_DIGEST_LENGTH];
|
||||
const unsigned char *computed_hash; /* Just to mute compiler warning */
|
||||
const unsigned char *computed_hash; /* to mute compiler warning */
|
||||
|
||||
/* Mute compiler warnings in 'verify_memory' macros below */
|
||||
computed_hash = output_buf;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static CURLcode test_unit1625(const char *arg)
|
|||
{ "Encoding: a, chunked, ninja", "Encoding:", "chunked", TRUE },
|
||||
/* empty incoming header */
|
||||
{ "Encoding:", "Encoding:", "chunked", FALSE },
|
||||
/* just spaces in header */
|
||||
/* spaces in header */
|
||||
{ "Encoding: ", "Encoding:", "chunked", FALSE },
|
||||
/* last among several with no spaces */
|
||||
{ "Encoding: ab,cd,ef,gh,ig,kl", "Encoding:", "kl", TRUE },
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ static CURLcode test_unit1652(const char *arg)
|
|||
* Any input that long or longer will truncated, ending in '...\n'.
|
||||
*/
|
||||
|
||||
/* A string just long enough to not be truncated */
|
||||
/* A string long enough to not be truncated */
|
||||
memset(input, '\0', sizeof(input));
|
||||
memset(input, 'A', 2045);
|
||||
Curl_infof(easy, "%s", input);
|
||||
|
|
@ -130,7 +130,7 @@ static CURLcode test_unit1652(const char *arg)
|
|||
fail_unless(output[sizeof(output) - 1] == '\0',
|
||||
"No truncation of infof input");
|
||||
|
||||
/* Just over the limit without newline for truncation via '...' */
|
||||
/* Over the limit without newline for truncation via '...' */
|
||||
memset(input + 2045, 'A', 4);
|
||||
Curl_infof(easy, "%s", input);
|
||||
curl_mfprintf(stderr, "output len %zu: %s", strlen(output), output);
|
||||
|
|
@ -138,7 +138,7 @@ static CURLcode test_unit1652(const char *arg)
|
|||
fail_unless(output[sizeof(output) - 1] == '\0',
|
||||
"Truncation of infof input 1");
|
||||
|
||||
/* Just over the limit with newline for truncation via '...' */
|
||||
/* Over the limit with newline for truncation via '...' */
|
||||
memset(input + 2045, 'A', 4);
|
||||
memset(input + 2045 + 4, '\n', 1);
|
||||
Curl_infof(easy, "%s", input);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ static CURLcode test_unit1655(const char *arg)
|
|||
static const char toolong[] =
|
||||
/* ..|....1.........2.........3.........4.........5.........6... */
|
||||
/* 3456789012345678901234567890123456789012345678901234567890123 */
|
||||
"here.is.a.hostname.which.is.just.barely.too.long." /* 49: 49 */
|
||||
"here.is.a.hostname.which.is.only.barely.too.long." /* 49: 49 */
|
||||
"to.be.encoded.as.a.QNAME.of.the.maximum.allowed.length."
|
||||
/* 55: 104 */
|
||||
"which.is.256.including.a.final.zero-length.label." /* 49: 153 */
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ static CURLcode test_unit1660(const char *arg)
|
|||
struct testit {
|
||||
const char *host;
|
||||
const char *chost; /* if non-NULL, use to lookup with */
|
||||
const char *hdr; /* if NULL, just do the lookup */
|
||||
const char *hdr; /* if NULL, do the lookup */
|
||||
const CURLcode result; /* parse result */
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ static CURLcode test_unit1666(const char *arg)
|
|||
"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"
|
||||
"\x01\x01\x01\x01\x01\x01\x01\x01"),
|
||||
"", CURLE_TOO_LARGE },
|
||||
/* one byte shorter than the previous is just below the limit: */
|
||||
/* one byte shorter than the previous is below the limit: */
|
||||
{ OID("\x2b\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"
|
||||
"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"
|
||||
"\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01"
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ static CURLcode cf_test_adjust_pollset(struct Curl_cfilter *cf,
|
|||
struct easy_pollset *ps)
|
||||
{
|
||||
struct cf_test_ctx *ctx = cf->ctx;
|
||||
/* just for testing, give one socket with events back */
|
||||
/* for testing, give one socket with events back */
|
||||
return Curl_pollset_set(data, ps, ctx->idx, TRUE, TRUE);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue