2
0
mirror of https://github.com/curl/curl.git synced 2025-03-01 15:15:34 +08:00
Commit Graph

30320 Commits

Author SHA1 Message Date
Stefan Eissing
4bc597d27c cf-socket: Disable socket receive buffer by default
- Disable socket receive buffer unless USE_RECV_BEFORE_SEND_WORKAROUND
  is in place.

While we would like to use the receive buffer, we have stalls in
parallel transfers where not all buffered data is consumed and no socket
events happen.

Note USE_RECV_BEFORE_SEND_WORKAROUND is a Windows sockets workaround
that has been disabled by default since b4b6e4f1, due to other bugs.

Closes https://github.com/curl/curl/pull/10961
2023-04-14 03:15:05 -04:00
Stefan Eissing
43d7ccd03d
cf-h2-proxy: fix processing ingress to stop too early
- progress ingress stopped too early, causing data
  from the underlying filters to not be processed and
  report that no tunnel data was available
- this lead to "hangers" where no socket activity was
  seen but data rested in buffers

Closes 
2023-04-13 23:54:43 +02:00
Stefan Eissing
be800a6cab
http3: check stream_ctx more thoroughly in all backends
- callbacks and filter methods might be invoked at unexpected
  times, e.g. when the transfer's stream_ctx has not been initialized
  yet or, more likely, has already been taken down.
- check for existance of stream_ctx in such places and return
  an error or silently succeed the call.

Closes 
2023-04-13 23:53:36 +02:00
Daniel Stenberg
7e68133d04
ftp: fix 'portsock' variable was assigned the same value
Pointed out by PVS

Ref: 
Closes 
2023-04-13 18:14:30 +02:00
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: 
Closes 
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. 
Closes 
2023-04-13 17:23:50 +02:00
Philip H
314dc407d6
GHA: suppress git clone output
Follow-up: 8203aa6ed4

Closes 
2023-04-13 17:22:13 +02:00
Stefan Eissing
f67d6a6888
cf-socket: remove dead code discovered by PVS
Closes 
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: 
Closes 
2023-04-13 17:16:43 +02:00
Daniel Stenberg
51b615a3eb
mime: skip NULL assigns after Curl_safefree()
Pointed out by PVS.

Ref: 
Closes 
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: 
Closes 
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: 
Closes 
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: 
Closes 
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: 
Closes 
2023-04-13 14:36:28 +02:00
Philip H
8203aa6ed4
GHA: suppress git clone output
Closes 
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 
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 
2023-04-13 08:41:40 +02:00
Josh McCullough
233b4e4589
http2: fix typo in infof() call
Closes 
2023-04-13 08:39:56 +02:00
Daniel Stenberg
ca05e1afba
noproxy: pointer to local array 'hostip' is stored outside scope
Ref: 
Closes 
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 
2023-04-12 08:51:14 +02:00
Douglas R. Reno
fb08dd9c90
CMakeLists.txt: fix typo for Haiku detection
Closes 
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: 
Closes 
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: 
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: 
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: 
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: 
2023-04-11 14:55:31 -07:00
Dan Fandrich
44677b6565 tests: tighten up perl exports
This reduces namespace pollution a little.

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

Closes 
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 

Reported-by: Kvarec Lezki
Ref: 
Closes 
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 
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 
2023-04-11 23:46:53 +02:00
Dan Fandrich
dc18b40b40 tests: log a too-long Unix socket path in sws and socksd
Ref: 
2023-04-11 10:10:16 -07:00
Daniel Stenberg
a8fbdb461c
gen.pl: error on duplicated See-Also fields
Updated http2.d accordingly.

Closes 
2023-04-11 12:31:30 +02:00
Daniel Stenberg
452b8e39ef
http2: avoid possible null pointer dereference
Reported-by: Dan Fandrich
Fixes 
Closes 
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 
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 
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: 
Fixes 
Closes 
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