Commit Graph

5324 Commits

Author SHA1 Message Date
Marcel Raad
29a19369ec
tests: add cookies features
These tests don't work with `--disable-cookies`.

Closes https://github.com/curl/curl/pull/10713
2023-03-09 14:33:05 +01:00
Marcel Raad
387dbe53c4
test420: add cookies keyword
It fails with `--disable-cookies`.

Closes https://github.com/curl/curl/pull/10713
2023-03-09 14:33:03 +01:00
Daniel Stenberg
3bef98f615
test1671: fix after fix 2023-03-09 00:13:41 +01:00
Daniel Stenberg
27a7600871
test421: -w %{header_json} test with multiple same header names
To reproduce the issue in #10704
2023-03-09 00:13:41 +01:00
Daniel Stenberg
0a0c9b6dfa
urlapi: '%' is illegal in host names
Update test 1560 to verify

Ref: #10708
Closes #10711
2023-03-08 15:33:43 +01:00
Stefan Eissing
7c5637b8b4
url: fix logic in connection reuse to deny reuse on "unclean" connections
- add parameter to `conn_is_alive()` cfilter method that returns
  if there is input data waiting on the connection
- refrain from re-using connnection from the cache that have
  input pending
- adapt http/2 and http/3 alive checks to digest pending input
  to check the connection state
- remove check_cxn method from openssl as that was just doing
  what the socket filter now does.
- add tests for connection reuse with special server configs

Closes #10690
2023-03-07 12:50:31 +01:00
Stefan Eissing
48cd032623
http2: fix handling of RST and GOAWAY to recognize partial transfers
- a reset transfer (HTTP/2 RST) did not always lead to the proper
  error message on receiving its response, leading to wrong reports
  of a successful transfer
- test_05_02 was able to trigger this condition with increased transfer
  count. The simulated response errors did not carry a 'Content-Length'
  so only proper RST handling could detect the abort
- When doing such transfers in parallel, a connection could enter the
  state where
  a) it had been closed (GOAWAY received)
  b) the RST had not been "seen" for the transfer yet
  or c) the GOAWAY announced an error and the last successful
  stream id was not checked against ongoing transfers

Closes #10693
2023-03-06 23:58:24 +01:00
Stefan Eissing
b0564c1d54
tests: use dynamic ports numbers in pytest suite
- necessary ports are bound at start of test suite and then
  given to server fixtures for use.
- this make parallel use of pytest (in separate directories),
  practically safe for use as OS tend to not reuse such port numbers
  for a while

Closes #10692
2023-03-06 23:44:45 +01:00
Stefan Eissing
257416023d
connect: fix time_connect and time_appconnect timer statistics
- time_connect was not updated when the overall connection failed,
  e.g. when SSL verification was unsuccessful, refs #10670
- rework gather those values to interrogate involved filters,
  also from all eyeballing attempts, to report the maximum of
  those values.
- added 3 test cases in test_06 to check reported values on
  successful, partially failed and totally failed connections.

Reported-by: Master Inspire
Fixes #10670
Closes #10671
2023-03-06 20:16:43 +01:00
Daniel Stenberg
93eefa6ba1
test1905: update output cookie order
After the #10685 update
2023-03-06 15:52:00 +01:00
Daniel Stenberg
076764c5d7
test420: verify expiring cookies
Cookies that are loaded fine from a jar but then are expired in headers.
2023-03-06 15:52:00 +01:00
Jay Satiro
c12e8bfa89 tests: fix gnutls-serv check
- If gnutls-serv doesn't exist then don't try to execute it.

Follow-up to 2fdc1d81.

Closes https://github.com/curl/curl/pull/10688
2023-03-06 03:52:46 -05:00
Daniel Stenberg
54605666ed
lib1560: fix enumerated type mixed with another type
Follow-up to c84c0f9aa3

Closes #10684
2023-03-06 08:14:42 +01:00
Daniel Stenberg
c84c0f9aa3
lib1560: test parsing URLs with ridiculously large fields
In the order of 120K.

Closes #10665
2023-03-03 23:23:53 +01:00
Brad Spencer
ad4997e5b2
urlapi: parse IPv6 literals without ENABLE_IPV6
This makes the URL parser API stable and working the same way
independently of libcurl supporting IPv6 transfers or not.

Closes #10660
2023-03-03 10:05:08 +01:00
Balakrishnan Balasubramanian
351ea4ff53
test1470: test socks proxy using unix sockets and connect to https
Similar to test1468 except using https instead of http

Closes #10662
2023-03-03 09:18:21 +01:00
Daniel Stenberg
e4dfe6fc2f
test1960: verify CURL_SOCKOPT_ALREADY_CONNECTED
When returned from the CURLOPT_SOCKOPTFUNCTION, like when we have a
custom socket connected in the app, passed in to libcurl.

Verifies the fix in #10648

Closes #10651
2023-03-03 08:36:25 +01:00
Stefan Eissing
e497a96a0e
tests: rename tests/tests-httpd to tests/http
- httpd is only one server we test with
 - the suite coveres the HTTP protocol in general where
   the default test cases need a more beefy environment

Closes #10654
2023-03-02 14:05:19 +01:00
Stefan Eissing
d9ccc75b00 http2: fix upload busy loop
- Set KEEP_SEND_PAUSE when exhausting remote HTTP/2 window size of a
  stream.

- Clear KEEP_SEND_PAUSE when receiving HTTP/2 window updates on a paused
  stream.

- Also fix http2 send compiler warnings reported in #10449.

Prior to this change, starting in 71b7e016 which precedes 7.88.0,
libcurl may eat CPU during HTTP/2 upload.

Reported-by: Jay Satiro

Fixes https://github.com/curl/curl/issues/10449
Fixes https://github.com/curl/curl/issues/10618
Closes https://github.com/curl/curl/pull/10627
2023-03-01 04:13:49 -05:00
Stefan Eissing
cbe9d82c22
http2: fix for http2-prior-knowledge when reusing connections
- refs #10634 where errors in the HTTP/2 framing layer are observed.
- the bug was that on connection reuse, the code attempted to switch
  in yet another layer of HTTP/2 handling instead of detecting that
  this was already in place.
- added pytest testcase reproducing the issue.

Reported-by: rwmjones on github
Fixes #10634
Closes #10643
2023-02-28 23:04:00 +01:00
Stefan Eissing
a4d015e69f
http: fix unix domain socket use in https connects
- when h2/h3 eyeballing was involved, unix domain socket
  configurations were not honoured
- configuring --unix-socket will disable HTTP/3 as candidate for eyeballing
- combinatino of --unix-socket and --http3-only will fail during initialisation
- adding pytest test_11 to reproduce

Reported-by: Jelle van der Waa
Fixes #10633
Closes #10641
2023-02-28 22:59:19 +01:00
Patrick Monnerat
90756d33d8
tests: test secure mail protocols with explicit SSL requests
New tests 987, 988 and 989, disabled for rustls (hanging).

Closes #10077
2023-02-25 11:49:31 +01:00
Patrick Monnerat
5855c478cb
tests: support for imaps/pop3s/smtps protocols
Closes #10077
2023-02-25 11:49:31 +01:00
Patrick Monnerat
8bfa4d66de
runtests: use a hash table for server port numbers
Closes #10077
2023-02-25 11:49:31 +01:00
Daniel Stenberg
835682661c
misc: remove support for curl_off_t < 8 bytes
Closes #10597
2023-02-24 17:05:33 +01:00
Daniel Stenberg
5da5684cec
test978: mark file as text mode
Follow-up to 4ea5702980

To fix test failures on Windows

Closes #10594
2023-02-23 16:32:43 +01:00
Daniel Stenberg
4ea5702980
test978: verify that --stderr works for -w's stderr as well 2023-02-23 10:05:13 +01:00
Stefan Eissing
463158bfe5
test2600: detect when ALARM_TIMEOUT is in use and adjust
- use higher timeout values > 1s
- skip duration checks

Assisted-by: Marcel Raad
Closes #10513
2023-02-22 16:42:36 +01:00
Daniel Stenberg
0338eb85d3
test686: verify return code for no URL after --next 2023-02-22 08:44:54 +01:00
Daniel Stenberg
2e3da51550
test1278: verify that an extra --no-remote-name cause no warning 2023-02-22 08:43:19 +01:00
Daniel Stenberg
bb11969838
lib1560: add a test using %25 in the userinfo in a URL
Closes #10578
2023-02-21 16:10:13 +01:00
Stefan Eissing
821f6e2a89
CURLOPT_PIPEWAIT: allow waited reuse also for subsequent connections
As tested in test_02_07, when firing off 200 urls with --parallel, 199
wait for the first connection to be established. if that is multiuse,
urls are added up to its capacity.

The first url over capacity opens another connection. But subsequent
urls found the same situation and open a connection too. They should
have waited for the second connection to actually connect and make its
capacity known.

This change fixes that by

- setting `connkeep()` early in the HTTP setup handler. as otherwise
  a new connection is marked as closeit by default and not considered
  for multiuse at all
- checking the "connected" status for a candidate always and continuing
  to PIPEWAIT if no alternative is found.

pytest:
- removed "skip" from test_02_07
- added test_02_07b to check that http/1.1 continues to work as before

Closes #10456
2023-02-21 11:12:48 +01:00
Daniel Stenberg
d79c3af259
test419: verify --dump-header to file that cannot be created
Closes #10571
2023-02-21 10:35:17 +01:00
Daniel Stenberg
f074602072
lib517: verify time stamps without leading zeroes plus some more 2023-02-20 23:48:25 +01:00
Matt Jolly
cbf5717615
tests: HTTP server fixups
- httpserver.pl -> http-server.pl for consistency
- add http3-server.pl to EXTRA_DIST; alphabetise for maintainability
- nghttpx proxy invocation scripts should not use getcwd

Closes #10568
2023-02-20 12:59:27 +01:00
Jacob Hoffman-Andrews
30411d7278
GHA: update rustls dependency to 0.9.2
This allows re-enabling test 312 for the rustls backend.

Closes #10553
2023-02-18 09:53:58 +01:00
Daniel Stenberg
b30b0c3840
lib1560: add IPv6 canonicalization tests
Closes #10552
2023-02-17 23:22:05 +01:00
Daniel Stenberg
8b27799f8c
urlapi: do the port number extraction without using sscanf()
- sscanf() is rather complex and slow, strchr() much simpler

- the port number function does not need to fully verify the IPv6 address
  anyway as it is done later in the hostname_check() function and doing
  it twice is unnecessary.

Closes #10541
2023-02-17 16:21:26 +01:00
Stefan Eissing
216e4b1fb6
tests-httpd: add proxy tests
for direct and tunneling checks on http: and https:

Closes #10519
2023-02-17 11:40:57 +01:00
Stefan Eissing
4437e3e344
test: add test for HTTP/2 corruption as reported in #10525
- adding test_02_20 for reproducing the situation
- using recently released mod_h2 Apache module
- skipping test if an older version is installed
- adding installation of current mod_h2 to github pytest workflow

This reproduces the error reliable (for me) on the lib/http2.c version
of curl 7.88.0. And passes with the recent curl master.

Closes #10534
2023-02-17 09:17:04 +01:00
Stefan Eissing
cc52bc45f6
connnect: fix timeout handling to use full duration
- connect timeout was used at half the configured value, if the
  destination had 1 ip version 4 and other version 6 addresses
  (or the other way around)
- extended test2600 to reproduce these cases

Reported-by: Michael Kaufmann
Fixes #10514
Closes #10517
2023-02-16 11:24:29 +01:00
Stefan Eissing
79d0b3c0c0
tests: make the telnet server shut down a socket gracefully
- test 1452 failed occasionally with ECONNRESET errnos in curl when the
  server closed the connection in an unclean state.

Closes #10509
2023-02-16 10:05:54 +01:00
Daniel Stenberg
2fdc1d816e
tests: make sure gnuserv-tls has SRP support before using it
Reported-by: fundawang on github
Fixes #10522
Closes #10524
2023-02-15 23:42:42 +01:00
Daniel Stenberg
f1d09231ad
runtests: fix "uninitialized value $port"
by using a more appropriate variable

Reported-by: fundawang on github
Fixes #10518
Closes #10520
2023-02-15 16:09:05 +01:00
Stefan Eissing
ce0cad713d
openssl: test and fix for forward proxy handling (non-tunneling).
- adding pytest test_10 cases for proxy httpd setup tests
- fixing openssl bug in https: proxy hostname verification that
  used the hostname of the request and not the proxy name.

Closes #10498
2023-02-13 20:54:57 +01:00
Stefan Eissing
c74bad29fd
tests: add tests for HTTP/2 and HTTP/3 to verify the header API
Test 2403 and 2503 check "header_json" output and therefore use of
header-api

Closes #10495
2023-02-13 17:14:21 +01:00
Patrick Monnerat
119fb18719
content_encoding: do not reset stage counter for each header
Test 418 verifies

Closes #10492
2023-02-13 17:06:19 +01:00
Daniel Stenberg
36fca647a4
libtest: build lib2305 with multibyte as well
Fixes a build regression.

Follow-up to 5a9a04d556
Reported-by: Viktor Szakats
Ref: https://github.com/curl/curl/pull/10475#issuecomment-1426831800

Closes #10477
2023-02-12 11:20:34 +01:00
Stefan Eissing
ca95d391ea
pytest: add a test case for PUSH related things.
- checking that "103 Early Hints" are visible in curl's header dump file

Closes #10452
2023-02-10 10:30:22 +01:00
Stefan Eissing
c96f982166
vquic: stabilization and improvements
vquic stabilization
- udp send code shared between ngtcp2 and quiche
- quiche handling of data and events improved

ngtcp2 and pytest improvements
- fixes handling of "drain" situations, discovered in scorecard
  tests with the Caddy server.
- improvements in handling transfers that have already  data or
  are already closed to make an early return on recv

pytest
- adding caddy tests when available

scorecard improvemnts.
- using correct caddy port
- allowing tests for only httpd or caddy

Closes #10451
2023-02-10 10:26:40 +01:00