Daniel Stenberg [Sat, 12 Sep 2020 16:27:08 +0000 (18:27 +0200)]
ftp: a 550 response to SIZE returns CURLE_REMOTE_FILE_NOT_FOUND
This is primarily interesting for cases where CURLOPT_NOBODY is set as
previously curl would not return an error for this case.
MDTM getting 550 now also returns this error (it returned
CURLE_FTP_COULDNT_RETR_FILE before) in order to unify return codes for
missing files across protocols and specific FTP commands.
libcurl already returns error on a 550 as a MDTM response (when
CURLOPT_FILETIME is set). If CURLOPT_NOBODY is not set, an error would
happen subsequently anyway since the RETR command would fail.
Add test 1913 and 1914 to verify. Updated several tests accordingly due
to the updated SIZE behavior.
Reported-by: Tomas Berger
Fixes #5953
Closes #5957
imap: set cselect_bits to CURL_CSELECT_IN initially
... when continuing a transfer from a FETCH response.
When the size of the file was small enough that the entirety of the
transfer happens in a single go and schannel buffers holds the entire
data. However, it wasn't completely read in Curl_pp_readresp since a
line break was found before that could happen. So, by the time we are in
imap_state_fetch_resp - there's data in buffers that needs to be read
via Curl_read but nothing to read from the socket. After we setup a
transfer (Curl_setup_transfer), curl just waits on the socket state to
change - which doesn't happen since no new data ever comes.
Previously there were several locations that called
nghttp2_session_mem_recv and handled responses slightly differently.
Those have been converted to call the existing
h2_process_pending_input() function.
Moved the end-of-session check to h2_process_pending_input() since the
only place the end-of-session state can change is after nghttp2
processes additional input frames.
This will likely fix the fuzzing error. While I don't have a root cause
the out-of-bounds read seems like a use after free, so moving the
nghttp2_session_check_request_allowed() call to a location with a
guaranteed nghttp2 session seems reasonable.
Also updated a few nghttp2 callsites to include error messages and added
a few additional error checks.
Daniel Stenberg [Mon, 7 Sep 2020 14:20:16 +0000 (16:20 +0200)]
openssl: consider ALERT_CERTIFICATE_EXPIRED a failed verification
If the error reason from the lib is
SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED, libcurl will return
CURLE_PEER_FAILED_VERIFICATION and not CURLE_SSL_CONNECT_ERROR.
This unifies the libcurl return code and makes libressl run test 313
(CRL testing) fine.
Marc Hoersken [Sun, 6 Sep 2020 19:27:41 +0000 (21:27 +0200)]
CI/azure: add test number to title for display in analytics
To ease identification of tests the test number is added to
the test case title in order to have it on the Azure DevOps
Analytics pages and reports which currently do not show it.
Bump test case revision to make Azure DevOps update titles.
Daniel Stenberg [Sat, 5 Sep 2020 19:21:26 +0000 (21:21 +0200)]
altsvc: clone setting in curl_easy_duphandle
The cache content is not duplicated, like other caches, but the setting
and specified file name are.
Test 1908 is extended to verify this somewhat. Since the duplicated
handle gets the same file name, the test unfortunately overwrites the
same file twice (with different contents) which makes it hard to check
automatically.
Daniel Stenberg [Sat, 5 Sep 2020 18:30:26 +0000 (20:30 +0200)]
test1541: remove since it is a known bug
A shared connection cache is not thread-safe is a known issue. Stop
testing this until we believe this issue is addressed. Reduces
occasional test failures we don't care about.
The test code in lib1541.c is left in git to allow us to restore it when
we get to fix this.
Daniel Stenberg [Sat, 5 Sep 2020 15:44:24 +0000 (17:44 +0200)]
curl: retry delays in parallel mode no longer sleeps blocking
The previous sleep for retries would block all other concurrent
transfers. Starting now, the retry will instead be properly marked to
not get restarted until after the delay time but other transfers can
still continue in the mean time.
Samuel Marks [Thu, 21 May 2020 10:21:50 +0000 (20:21 +1000)]
CMake: remove explicit `CMAKE_ANSI_CFLAGS`
This variable was removed from cmake in commit
https://gitlab.kitware.com/cmake/cmake/commit/5a834b0bb0bc288. A later
CMake commit removes the variable from the tests, claiming that it was
removed in CMake 2.6
Marc Hoersken [Mon, 31 Aug 2020 08:49:20 +0000 (10:49 +0200)]
select: align poll emulation to return all relevant events
The poll emulation via select already consumes POLLRDNORM,
POLLWRNORM and POLLRDBAND as input events. Therefore it
should also return them as output events if signaled.
Also fix indentation in input event handling block.
Assisted-by: Jay Satiro Reviewed-by: Daniel Stenberg
Replaces #5852
Closes #5883
Marcel Raad [Sat, 22 Aug 2020 08:16:13 +0000 (10:16 +0200)]
AppVeyor: switch 64-bit Schannel Debug CMake builds to Unicode
The Schannel builds are the most useful to verify as they make the most
use of the Windows API. Classic MinGW doesn't support Unicode at all,
only MinGW-w64 and MSVC do.
Marc Hoersken [Fri, 28 Aug 2020 20:30:39 +0000 (22:30 +0200)]
sockfilt: handle FD_CLOSE winsock event on write socket
Learn from the way Cygwin handles and maps the WinSock events
to simulate correct and complete poll and select behaviour
according to Richard W. Stevens Network Programming book.
Marc Hoersken [Wed, 26 Aug 2020 20:13:21 +0000 (22:13 +0200)]
multi: handle connection state winsock events
Learn from the way Cygwin handles and maps the WinSock events
to simulate correct and complete poll and select behaviour
according to Richard W. Stevens Network Programming book.
Reviewed-by: Jay Satiro Reviewed-by: Marcel Raad
Follow up to #5634
Closes #5867
Daniel Stenberg [Mon, 24 Aug 2020 09:07:59 +0000 (11:07 +0200)]
Curl_pgrsTime - return new time to avoid timeout integer overflow
Setting a timeout to INT_MAX could cause an immediate error to get
returned as timeout because of an overflow when different values of
'now' were used.
This is primarily fixed by having Curl_pgrsTime() return the "now" when
TIMER_STARTSINGLE is set so that the parent function will continue using
that time.