Commit Graph

30366 Commits

Author SHA1 Message Date
Daniel Stenberg
41a53b159d
ftp: remove dead code
This condition can never be true here since it is handled already 28
lines above.

Pointed out by PVS.

Ref: #10929
Closes #10957
2023-04-13 18:13:40 +02:00
Daniel Stenberg
aabfa60371
cf-h1-proxy: skip an extra NULL assign
and use Curl_safefree() once to save another NULL assign. Found by PVS.

Ref. #10929
Closes #10953
2023-04-13 17:23:50 +02:00
Philip H
314dc407d6
GHA: suppress git clone output
Follow-up: 8203aa6ed4

Closes #10949
2023-04-13 17:22:13 +02:00
Stefan Eissing
f67d6a6888
cf-socket: remove dead code discovered by PVS
Closes #10960
2023-04-13 17:20:29 +02:00
Daniel Stenberg
8b8d7acc6e
http: skip a double NULL assign
and also use a local variable to shorten the long names and increase
readability in the function. Pointed out by PVS.

Ref: #10929
Closes #10950
2023-04-13 17:16:43 +02:00
Daniel Stenberg
51b615a3eb
mime: skip NULL assigns after Curl_safefree()
Pointed out by PVS.

Ref: #10929
Closes #10947
2023-04-13 17:15:08 +02:00
Daniel Stenberg
aa3ee0a13a
rtsp: skip NULL assigns after Curl_safefree()
... since this is a macro that assigns NULL itself. Pointed out by PVS.

Ref: #10929
Closes #10946
2023-04-13 17:14:03 +02:00
Daniel Stenberg
d50045509c
smb: remove double assign
The same value is assigned the same value already a few lines above.
Pointed out by PVS.

Ref: #10929
Closes #10945
2023-04-13 17:12:55 +02:00
Daniel Stenberg
19c36f5ca3
transfer: skip extra assign
The 'result' variable already contains CURLE_OK at this point, no use in
setting it again. Pointed out by PVS.

Ref: #10929
Closes #10944
2023-04-13 14:39:08 +02:00
Daniel Stenberg
3f1d89ed24
urlapi: skip a pointless assign
It stores a null byte after already having confirmed there is a null
byte there. Detected by PVS.

Ref: #10929
Closes #10943
2023-04-13 14:36:28 +02:00
Philip H
8203aa6ed4
GHA: suppress git clone output
Closes #10939
2023-04-13 08:56:48 +02:00
Stefan Eissing
5126cbda00
tests: make test_12_01 a bit more forgiving on connection counts 2023-04-13 08:46:53 +02:00
Stefan Eissing
24726a437e
cf-socket: add socket recv buffering for most tcp cases
- use bufq as recv buffer, also for Windows pre-receive handling
- catch small reads followed by larger ones in a single socket
  call. A common pattern on TLS connections.

Closes #10787
2023-04-13 08:46:38 +02:00
Daniel Stenberg
4cfa5bcc9a
urlapi: cleanups
- move host checks together
- simplify the scheme parser loop and the end of host name parser
- avoid itermediate buffer storing in multiple places
- reduce scope for several variables
- skip the Curl_dyn_tail() call for speed
- detect IPv6 earlier and skip extra checks for such hosts
- normalize directly in dynbuf instead of itermediate buffer
- split out the IPv6 parser into its own funciton
- call the IPv6 parser directly for ipv6 addresses
- remove (unused) special treatment of % in host names
- junkscan() once in the beginning instead of scattered
- make junkscan return error code
- remove unused query management from dedotdotify()
- make Curl_parse_login_details use memchr
- more use of memchr() instead of strchr() and less strlen() calls
- make junkscan check and return the URL length

An optimized build runs one of my benchmark URL parsing programs ~41%
faster using this branch. (compared against the shipped 7.88.1 library
in Debian)

Closes #10935
2023-04-13 08:41:40 +02:00
Josh McCullough
233b4e4589
http2: fix typo in infof() call
Closes #10940
2023-04-13 08:39:56 +02:00
Daniel Stenberg
ca05e1afba
noproxy: pointer to local array 'hostip' is stored outside scope
Ref: #10929
Closes #10933
2023-04-12 09:00:20 +02:00
Stefan Eissing
dd8130406e
connect: fix https connection setup to treat ssl_mode correctly
- for HTTPS protocol, a disabled ssl should never be acceptables.

Closes #10934
2023-04-12 08:51:14 +02:00
Douglas R. Reno
fb08dd9c90
CMakeLists.txt: fix typo for Haiku detection
Closes #10937
2023-04-12 08:50:18 +02:00
Dan Fandrich
8e75c4f978 pathhelp: use the cached $use_cygpath when available 2023-04-11 14:55:32 -07:00
Dan Fandrich
def8dc8071 runtests: eliminate unneeded variable 2023-04-11 14:55:32 -07:00
Dan Fandrich
a3605d6a56 runtests: make the # of server start attempts a constant 2023-04-11 14:55:32 -07:00
Dan Fandrich
44256902f3 runtests: on startup failure call displaylogs only in serverfortest
This reduces the number of calls spread throughout the code.

Ref: #10818
Closes #10919
2023-04-11 14:55:32 -07:00
Dan Fandrich
f82a38e0f3 runtests: return an error code with startservers()
The code indicates the kind of failure encountered in starting a server,
which can be used by the caller to tailor the user experience.

Ref: #10818
2023-04-11 14:55:32 -07:00
Dan Fandrich
19b062a492 runtests: abort early if runpingpongserver is given a bad server type 2023-04-11 14:55:32 -07:00
Dan Fandrich
f25627014e runtests: don't use the SMB server verification time as reference
%FTPTIME2 and %FTPTIME3 should be set by the FTP server only, for
consistency.
2023-04-11 14:55:32 -07:00
Dan Fandrich
d39db81192 tests: factor out the test server management code
This now lives in servers.pm with some configuration variables moved to
globalconfig.pm

Ref: #10818
2023-04-11 14:55:32 -07:00
Dan Fandrich
a2ce734e28 runtests: remove an inappropriate use of runclientoutput
This function is intended for running client code, not servers.
2023-04-11 14:55:32 -07:00
Dan Fandrich
fdb24b3916 runtests: only add $LIBDIR to the path for checktestcmd
Since checkcmd is for finding servers, there will never be anything in
this directory of interest to them.

Ref: #10818
2023-04-11 14:55:32 -07:00
Dan Fandrich
dee50c9c51 tests: log sshserver.pl messages to a file
The logmsg messages were thrown away before, so they are now available
for debugging.
2023-04-11 14:55:32 -07:00
Dan Fandrich
25aba1683a runtests: also show DISABLED tests with -l
Other reasons for skipping tests are ignored for -l, so being explicitly
disabled should be too.
2023-04-11 14:55:32 -07:00
Dan Fandrich
89ede3953b runtests: move the UNIX sockets into $PIDDIR
These were missed when the other server files were moved there.

Follow-up to 70d2fca2

Ref: #10818
2023-04-11 14:55:31 -07:00
Dan Fandrich
44677b6565 tests: tighten up perl exports
This reduces namespace pollution a little.

Ref: #10818
2023-04-11 14:55:31 -07:00
Dan Fandrich
efbaa612f7 tests: turn perl modules into full packages
This helps enforce more modularization and encapsulation. Enable and fix
warnings on a few packages.  Also, rename ftp.pm to processhelp.pm since
there's really nothing ftp-specific in it.

Ref: #10818
2023-04-11 14:55:31 -07:00
Daniel Stenberg
9eeb7d3ed5
multi: remove a few superfluous assigns
PVS found these "The 'rc' variable was assigned the same value." cases.

Ref: #10929
Closes #10932
2023-04-11 23:51:49 +02:00
Daniel Stenberg
90aea8e2a9
schannel: add clarifying comment
Explaining how the PVS warning in #10929 is wrong: Dereferencing of the
null pointer 'backend->cred' might take place.

Closes #10931
2023-04-11 23:50:49 +02:00
Daniel Stenberg
b1b326ec50
cookie: clarify that init with data set to NULL reads no file
... and make Curl_cookie_add() require 'data' being set proper with an
assert.

The function has not worked with a NULL data for quite some time so this
just corrects the code and comment.

This is a different take than the proposed fixed in #10927

Reported-by: Kvarec Lezki
Ref: #10929
Closes #10930
2023-04-11 23:49:50 +02:00
Kvarec Lezki
a1763648a5
vtls: remove int typecast for sizeof()
V220 Suspicious sequence of types castings: memsize -> 32-bit integer ->
memsize. The value being cast: 'sizeof
(buf->data)'. curl\lib\vtls\vtls.c 2025

https://pvs-studio.com/en/docs/warnings/v220/

Closes #10928
2023-04-11 23:48:06 +02:00
Stefan Eissing
c59b5b3c87
http2: fix copynpaste error reported by coverity
- move all code handling HTTP/2 frames for a particular
  stream into a separate function to keep from confusing
  the call `data` with the stream `data`.

Closes #10924
2023-04-11 23:46:53 +02:00
Dan Fandrich
dc18b40b40 tests: log a too-long Unix socket path in sws and socksd
Ref: #10919
2023-04-11 10:10:16 -07:00
Daniel Stenberg
a8fbdb461c
gen.pl: error on duplicated See-Also fields
Updated http2.d accordingly.

Closes #10925
2023-04-11 12:31:30 +02:00
Daniel Stenberg
452b8e39ef
http2: avoid possible null pointer dereference
Reported-by: Dan Fandrich
Fixes #10920
Closes #10923
2023-04-11 12:29:03 +02:00
Daniel Stenberg
309a517ffd
lib1560: verify that more bad host names are rejected
when setting the hostname component of a URL

Closes #10922
2023-04-11 11:33:07 +02:00
Daniel Stenberg
587dac67fb
curl_url_set.3: mention that users can set content rather freely
... which then might render bad URLs if you extract a URL later.

Closes #10921
2023-04-11 11:30:51 +02:00
Dan Fandrich
aafb79de2a CI: retry failed downloads of aws-lc
Don't fail the build in case of a temporary server problem.
2023-04-10 12:19:11 -07:00
Dan Fandrich
52d4a41b2f test1169: fix so it works properly everywhere
- Use an absolute path for the -L option since the module isn't in the
  perl path
- Create the needed test file in a <file> section; <precheck> isn't
  intended for this
- Fix the test number in the file name, which was wrong

Follow-up to f754990a

Ref: #10818
Fixes #10889
Closes #10917
2023-04-10 11:50:51 -07:00
Dan Fandrich
6ed0629901 tests: stop using strndup(), which isn't portable
It's not available on Solaris 10, for example. Since this is just test
code that doesn't need to use an optimized system version, replace it
with the implementation copied from tool_cb_hdr.c.
2023-04-10 10:51:07 -07:00
Dan Fandrich
a72a548774 runtests: fix an incorrect comment about the ld_preload feature
Follow-up to 1f631864

Ref: #10818
2023-04-10 10:51:07 -07:00
Daniel Stenberg
826e8011d5
urlapi: prevent setting invalid schemes with *url_set()
A typical mistake would be to try to set "https://" - including the
separator - this is now rejected as that would then lead to
url_get(... URL...) would get an invalid URL extracted.

Extended test 1560 to verify.

Closes #10911
2023-04-09 23:23:54 +02:00
Biswapriyo Nath
5023d7c944
http2: remove unused Curl_http2_strerror function declaration
Curl_http2_strerror was renamed to http2_strerror in
05b100aee2 and then http2_strerror was removed in
5808a0d0f5

This also fixes the following compiler error

lib/http2.h:41:33: error: unknown type name 'uint32_t'
lib/http2.h:1:1: note: 'uint32_t' is defined in header '<stdint.h>'

Closes #10912
2023-04-09 23:21:42 +02:00
Daniel Stenberg
dfabe8bca2
RELEASE-NOTES: synced 2023-04-08 23:57:30 +02:00