Commit Graph

26709 Commits

Author SHA1 Message Date
Daniel Stenberg df58343440
scripts/singleuse: add curl_easy_option* 2021-01-26 09:30:30 +01:00
Jay Satiro 782143ee81 test410: fix for windows
- Pass the very long request header via file instead of command line.

Prior to this change the 49k very long request header string was passed
via command line and on Windows that is too long so it was truncated and
the test would fail (specifically msys CI).

Closes https://github.com/curl/curl/pull/6516
2021-01-25 23:28:02 -05:00
Daniel Stenberg 2dcc940959
libssh2: move data from connection object to transfer object
Readdir data, filenames and attributes are strictly related to the
transfer and not the connection. This also reduces the total size of the
fixed connectdata struct.

Closes #6519
2021-01-25 17:07:57 +01:00
Daniel Stenberg abfb0b57bc
RELEASE-NOTES: synced 2021-01-25 14:40:17 +01:00
Patrick Monnerat ecb13416e3
lib: remove conn->data uses
Closes #6499
2021-01-24 18:15:03 +01:00
Daniel Stenberg 14e075d1a7
hyper: remove the conn->data references
Closes #6508
2021-01-22 16:07:17 +01:00
Daniel Stenberg b371d267f8
travis: build ngtcp2 --with-gnutls
... since they disable it by default since a few days back.

Closes #6506
Fixes #6493
2021-01-22 16:00:27 +01:00
Daniel Stenberg 8335c6417e
hostip: remove conn->data from resolver functions
This also moves the 'async' struct from the connectdata struct into the
Curl_easy struct, which seems like a better home for it.

Closes #6497
2021-01-22 08:25:09 +01:00
Jay Satiro d3a3bdb5ef strerror: skip errnum >= 0 assertion on windows
On Windows an error number may be greater than INT_MAX and negative once
cast to int.

The assertion is checked only in debug builds.

Closes https://github.com/curl/curl/pull/6504
2021-01-22 01:47:04 -05:00
Daniel Stenberg b97a60f5f4
doh: make Curl_doh_is_resolved survive a NULL pointer
... if Curl_doh() returned a NULL, this function gets called anyway as
in a asynch procedure. Then the doh struct pointer is NULL and signifies
an OOM situation.

Follow-up to 6246a1d8c6
2021-01-21 23:31:19 +01:00
Daniel Stenberg 5a19cb5a3c
wolfssh: remove conn->data references
... and repair recent build breakage

Closes #6507
2021-01-21 16:43:51 +01:00
Daniel Stenberg e8710633ed
http: empty reply connection are not left intact
... so mark the connection as closed in this condition to prevent that
verbose message to wrongly appear.

Reported-by: Matt Holt
Bug: https://twitter.com/mholt6/status/1352130240265375744
Closes #6503
2021-01-21 16:39:35 +01:00
Daniel Stenberg c977a6d0dc
chunk/encoding: remove conn->data references
... by anchoring more functions on Curl_easy instead of connectdata

Closes #6498
2021-01-21 13:19:58 +01:00
Erik Olsson 0a5827571f lib: save a bit of space with some structure packing
- Reorder some internal struct members so that less padding is used.

This is an attempt at saving a bit of space by packing some structs
(using pahole to find the holes) where it might make sense to do
so without losing readability.

I.e., I tried to avoid separating fields that seem grouped
together (like the cwd... fields in struct ftp_conn for instance).
Also abstained from touching fields behind conditional macros as
that quickly can get complicated.

Closes https://github.com/curl/curl/pull/6483
2021-01-20 22:52:34 -05:00
Daniel Stenberg 46f4736356
INSTALL.md: fix typo
Found-by: Marcel Raad
2021-01-20 22:45:12 +01:00
Fabian Keil 0015e06151
http: get CURLOPT_REQUEST_TARGET working with a HTTP proxy
Added test 1613 to verify.

Closes #6490
2021-01-20 15:21:13 +01:00
Daniel Stenberg 86a95eb076
Merge branch 'bagder/curl_range-data-conn' 2021-01-20 14:59:24 +01:00
Daniel Stenberg ba4808d53c
ftp: remove conn->data leftover 2021-01-20 14:59:17 +01:00
Daniel Stenberg 56d1891db6
curl_range: remove conn->data
Closes #6496
2021-01-20 14:59:11 +01:00
Daniel Stenberg 89918c424c
INSTALL: now at 85 operating systems 2021-01-20 14:58:05 +01:00
Daniel Stenberg fb4c5d55b5
quiche: fix unused parameter ‘conn’
Follow-up to 2bdec0b3
2021-01-20 09:17:19 +01:00
Daniel Stenberg 4907431903
transfer: fix ‘conn’ undeclared mistake for iconv build
Follow-up to 219d9f8620
2021-01-20 09:13:14 +01:00
Daniel Stenberg 6246a1d8c6
doh: allocate state struct on demand
... instead of having it static within the Curl_easy struct. This takes
away 1176 bytes (18%) from the Curl_easy struct that aren't used very
often and instead makes the code allocate it when needed.

Closes #6492
2021-01-20 09:02:24 +01:00
Daniel Stenberg d0688dcbdf
socks: use the download buffer instead
The SOCKS code now uses the generic download buffer for temporary
storage during the connection procedure, instead of having its own
private 600 byte buffer that adds to the connectdata struct size. This
works fine because this point the buffer is allocated but is not use for
download yet since the connection hasn't completed.

This reduces the connection struct size by 22% on a 64bit arch!

The SOCKS buffer needs to be at least 600 bytes, and the download buffer
is guaranteed to never be smaller than 1000 bytes.

Closes #6491
2021-01-20 08:54:19 +01:00
Daniel Stenberg 942cf12c2f
urldata: make magic be the first struct field
By making the `magic` identifier the same size and at the same place
within the structs (easy, multi, share), libcurl will be able to more
reliably detect and safely error out if an application passes in the
wrong handle to APIs. Easier to detect and less likely to cause crashes
if done.

Such mixups can't be detected at compile-time due to them being
typedefed void pointers - unless `CURL_STRICTER` is defined.

Closes #6484
2021-01-20 08:51:01 +01:00
Daniel Stenberg 13bc1ea9bc
http_chunks: correct and clarify a comment on hexnumber length
... and also rename the define for max length.

Closes #6489
2021-01-19 23:43:10 +01:00
Daniel Stenberg e71542a9d9
curl_path: remove conn->data use
Closes #6487
2021-01-19 17:08:49 +01:00
Daniel Stenberg 219d9f8620
transfer: remove conn->data use
Closes #6486
2021-01-19 17:07:02 +01:00
Daniel Stenberg 2bdec0b363
quic: remove conn->data use
Closes #6485
2021-01-19 16:56:35 +01:00
Fabian Keil 6fcf22654e
Add test1181: Proxy request with --proxy-header "Connection: Keep-Alive" 2021-01-19 11:41:23 +01:00
Fabian Keil 3bccc182a2
Add test1180: Proxy request with -H "Proxy-Connection: Keep-Alive"
At the moment the test fails as curl sends two Proxy-Connection
headers.
2021-01-19 11:41:23 +01:00
Daniel Stenberg 3acf6fe539
c-hyper: avoid duplicated Proxy-Connection headers 2021-01-19 11:41:23 +01:00
Daniel Stenberg ea6ce0afad
http: make providing Proxy-Connection header not cause duplicated headers
Fixes test 1180

Bug: https://curl.se/mail/lib-2021-01/0095.html
Reported-by: Fabian Keil
Closes #6472
2021-01-19 11:40:15 +01:00
Daniel Stenberg f451206266
runtests: preprocess DISABLED to allow conditionals
... with this function provided, we can disable tests for specific
environments and setups directly within this file.

Closes #6477
2021-01-19 10:04:41 +01:00
Daniel Stenberg bbfad7e8a1
runtests: turn preprocessing into a separate function
... and remove all other variable substitutions as they're now done once
and for all in the preprocessor.
2021-01-19 10:04:41 +01:00
Daniel Stenberg 7542ec5b32
lib/Makefile.inc: convert to listing each file on its own line
... to make it diff friendlier and easier to read.

Closes #6448
2021-01-19 10:03:07 +01:00
Daniel Stenberg f86fcd0080
ftplistparser: remove use of conn->data
Closes #6482
2021-01-19 09:22:38 +01:00
Daniel Stenberg a304051620
lib: more conn->data cleanups
Closes #6479
2021-01-19 09:14:51 +01:00
Patrick Monnerat bbe3aa9f88
vtls: reduce conn->data use
Closes #6474
2021-01-19 09:14:40 +01:00
Daniel Stenberg 8399d89360
hyper: deliver data to application with Curl_client_write
... just as the native code path does. Avoids sending too large data
chunks in the callback and more.

Reported-by: Gisle Vanem
Fixes #6462
Closes #6473
2021-01-18 23:06:03 +01:00
Daniel Stenberg f98f219c35
gopher: remove accidental conn->data leftover 2021-01-18 22:57:56 +01:00
Daniel Stenberg a3efced012
libssh: avoid plain free() of libssh-memory
Since curl's own memory debugging system redefines free() calls to track
and fiddle with memory, it cannot be used on memory allocated by 3rd
party libraries.

Third party libraries SHOULD NOT require free() to release allocated
resources for this reason - and libs can use separate healp allocators
on some systems (like Windows) so free() doesn't necessarily work
anyway.

Filed as an issue with libssh: https://bugs.libssh.org/T268

Closes #6481
2021-01-18 22:50:56 +01:00
Daniel Stenberg 2bf77b3cba
send: assert that Curl_write_plain() has a ->conn when called
To help catch bad invokes.

Closes #6476
2021-01-18 16:12:20 +01:00
Daniel Stenberg 11b2dd86d3
test410: verify HTTPS GET with a 49K request header
skip test 410 for mesalink in the CI as it otherwise hangs "forever"
2021-01-18 16:10:34 +01:00
Daniel Stenberg 215db086e0
lib: pass in 'struct Curl_easy *' to most functions
... in most cases instead of 'struct connectdata *' but in some cases in
addition to.

- We mostly operate on transfers and not connections.

- We need the transfer handle to log, store data and more. Everything in
  libcurl is driven by a transfer (the CURL * in the public API).

- This work clarifies and separates the transfers from the connections
  better.

- We should avoid "conn->data". Since individual connections can be used
  by many transfers when multiplexing, making sure that conn->data
  points to the current and correct transfer at all times is difficult
  and has been notoriously error-prone over the years. The goal is to
  ultimately remove the conn->data pointer for this reason.

Closes #6425
2021-01-17 23:56:09 +01:00
Emil Engler 0d26ab9ed3
docs: fix typos in NEW-PROTOCOL.md
This fixes a misspelled "it" and a grammatically wrong "-ing" suffix.

Closes #6471
2021-01-17 12:56:03 +01:00
Daniel Stenberg c701498e6e
RELEASE-NOTES: synced 2021-01-16 22:49:25 +01:00
Razvan Cojocaru 13fe0b6ade cmake: expose CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
This does for cmake builds what --disable-openssl-auto-load-config
does for autoconf builds.

Closes https://github.com/curl/curl/pull/6435
2021-01-16 02:18:12 -05:00
Daniel Stenberg 30e7641d7d
test1918: verify curl_easy_option_by_name() and curl_easy_option_by_id()
... and as a practical side-effect, make sure that the
Curl_easyopts_check() function is asserted in debug builds, which we
want to detect mismatches between the options list in easyoptions.c and
the options in curl.h

Found-by: Gisle Vanem
Bug: 08e8455ddd (commitcomment-45991815)

Closes #6461
2021-01-15 17:03:29 +01:00
Gisle Vanem cbf0446973
easyoptions: add the missing AWS_SIGV4
Follow-up from AWS_SIGV4
2021-01-15 13:13:32 +01:00