1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
Commit Graph

4463 Commits

Author SHA1 Message Date
Daniel Stenberg
7e359bccd2
tests: move pingpong server to dynamic listening port
FTP, IMAP, POP3, SMTP and their IPv6 versions are now all on dynamic
ports

Test 842-845 are unfortunately a bit hard to move over to this concept
right now and require "default port" still...
2020-04-18 23:57:22 +02:00
Daniel Stenberg
f99b007cd8
test1056: work with dynamic HTTP ipv6 port 2020-04-18 22:48:24 +02:00
Daniel Stenberg
721f24d6fc
test1448: work with dynamic HTTP server port 2020-04-18 22:48:24 +02:00
Daniel Stenberg
d009bc2e56
tests: introduce preprocessed test cases
The runtests script now always performs variable replacement on the
entire test source file before the test gets executed, and saves the
updated version in a temporary file (log/test[num]) so that all test
case readers/servers can use that version (if present) and thus enjoy
the powers of test case variable substitution.

This is necessary to allow complete port number freedom.

Test 309 is updated to work with a non-fixed port number thanks to this.
2020-04-18 22:46:04 +02:00
Daniel Stenberg
5e2f4a33fe
tests: make 2006-2010 handle different port number lengths 2020-04-18 22:45:40 +02:00
Daniel Stenberg
80d6515415
tests: run the sws server on "any port"
Makes the test servers for HTTP and Gopher pop up on a currently unused
port and runtests adapts to that!

Closes #5247
2020-04-18 22:45:28 +02:00
Marc Hoersken
e917492048
sockfilt: tidy variable naming and data structure in select_ws
This commit does not introduce any logical changes to the code.

Reviewed-by: Jay Satiro and Marcel Raad
Closes #5238
2020-04-18 20:46:54 +02:00
Daniel Stenberg
de2126b182
mqttd: s/errno/SOCKERRNO
To behave proper on Windows
Reported-by: Gisle Vanem
Bug: 5e855bbd18 (r38507132)
Closes #5241
2020-04-16 16:41:21 +02:00
Daniel Stenberg
4cd239fbf6
copyright: bump the copyright year range 2020-04-15 09:24:49 +02:00
Marc Hoersken
a6f7b2f2a4
test2043: use revoked.badssl.com instead of revoked.grc.com
The certificate of revoked.grc.com has expired on 2020-04-13.

Reviewed-by: Jay Satiro

Closes #5233
2020-04-14 17:51:31 +02:00
Marc Hoersken
8a2038a3ad
sockfilt: fix broken pipe on Windows to be ready in select_ws
Closes #5228
2020-04-14 17:50:38 +02:00
Daniel Stenberg
41f5b66a02
tests: add four MQTT tests 1190 - 1193 2020-04-14 13:04:10 +02:00
Daniel Stenberg
5e855bbd18
tests: add the mqtt test server mqttd 2020-04-14 13:04:10 +02:00
Daniel Stenberg
675f5fb66f
tests: support hex encoded data and mqtt server
The mqtt server is started using a "random" port.
2020-04-14 13:04:10 +02:00
Daniel Stenberg
ac343fed7a
test1908: avoid using fixed port number in test data
Closes #5225
2020-04-13 01:05:01 +02:00
Marc Hoersken
ac1e206278
tests/server: add hidden window to gracefully handle WM_CLOSE
Forward Window events as signals to existing signal event handler.
2020-04-12 18:38:12 +02:00
Marc Hoersken
30c8ef7d63
tests/server: add CTRL event handler for Win32 consoles
Forward CTRL events as signals to existing signal event handler.
2020-04-12 15:55:22 +02:00
Marc Hoersken
9869f6dc5a
tests/server: move all signal handling routines to util.[ch]
Avoid code duplication to prepare for portability enhancements.
2020-04-12 15:55:21 +02:00
Marc Hoersken
dd0365d560
tests/server/util.c: use curl_off_t instead of long for pid
Avoid potential overflow of huge PIDs on Windows.

Related to #5188
Assisted-by: Marcel Raad
2020-04-11 23:46:30 +02:00
Marc Hoersken
c1951cdb38
tests: use Cygwin/msys PIDs for stunnel and sshd on Windows
Since the Windows versions of both programs would write Windows
PIDs to their pidfiles which we cannot handle, we need to use
our known perl.exe Cygwin/msys PID together with exec() in order
to tie the spawned processes to the existance of our perl.exe

The perl.exe that is executing secureserver.pl and sshserver.pl
has a Cygwin/msys PID, because it is started inside Cygwin/msys.

Related to #5188
2020-04-11 23:46:15 +02:00
Marc Hoersken
2a93021750
tests: add Windows compatible pidwait like pidkill and pidterm
Related to #5188
2020-04-11 23:46:00 +02:00
Marc Hoersken
3f60a9e995
tests: fix conflict between Cygwin/msys and Windows PIDs
Add 65536 to Windows PIDs to allow Windows specific treatment
by having disjunct ranges for Cygwin/msys and Windows PIDs.

See also:
- https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵
  h=b5e1003722cb14235c4f166be72c09acdffc62ea
- https://cygwin.com/git/?p=newlib-cygwin.git;a=commit; ↵
  h=448cf5aa4b429d5a9cebf92a0da4ab4b5b6d23fe

Replaces #5178
Closes #5188
2020-04-11 23:44:52 +02:00
Jay Satiro
17c18fbc30 test1148: tolerate progress updates better (again)
- Ignore intermediate progress updates.

- Support locales that use a character other than period as decimal
  separator (eg 100,0%).

test1148 checks that the progress finishes at 100% and has the right
bar width. Prior to this change the test assumed that the only progress
reported for such a quick transfer was 100%, however in rare instances
(like in the CI where transfer time can slow considerably) there may be
intermediate updates. For example, below is stderrlog1148 from a failed
CI run with explicit \r and \n added (it is one line; broken up so that
it's easier to understand).

\r
\r##################################                                        48.3%
\r######################################################################## 100.0%
\n

Closes https://github.com/curl/curl/pull/5194
2020-04-11 02:51:50 -04:00
Marc Hoersken
8c92f7e82f
sshserver.pl: use cached Win32 environment check variable 2020-04-10 21:03:24 +02:00
Daniel Stenberg
cb232b13de
server/resolve: remove AI_CANONNAME to make macos tell the truth
With this bit set, my mac successfully resolves "ip6-localhost" when in
fact there is no such host known to my machine! That in turn made test
241 wrongly execute and fail.

Closes #5202
2020-04-09 09:45:58 +02:00
Daniel Stenberg
07778542b3
runtests: fix warning about using an undefined variable
Follow-up from 4d939ef6ce
2020-04-09 09:45:52 +02:00
Daniel Stenberg
4d939ef6ce
runtests: provide nicer errormsg when protocol "dump" file is empty 2020-04-08 14:15:47 +02:00
Daniel Stenberg
741cb81d09
tests: verify split initial HTTP requests with CURL_SMALLREQSEND
test1294: "split request" being when the entire request isn't sent in
the first go, and the remainder is sent in the PERFORM state. A GET
request is otherwise not sending anything during PERFORM.

test1295: same kind of split but with POST

Closes #5197
2020-04-08 08:14:32 +02:00
Daniel Stenberg
860eaebae6
tests/README: update the port numbers list
Since the pipelining server is long gone.
Reported-by: James Fuller
2020-04-07 13:15:14 +02:00
Daniel Stenberg
fef4334091
cleanup: correct copyright year range on a few files 2020-04-06 23:21:52 +02:00
Marc Hoersken
f50bc76c99
lib670: use the same Win32 API check as all other lib tests 2020-04-05 18:25:03 +02:00
Marc Hoersken
4ba6ba2d94
appveyor: show failed tests in log even if test is ignored
And print API response with newline only if there is one
2020-04-05 17:33:07 +02:00
Daniel Stenberg
6bc1040d55
test1566: verify --etag-compare that gets a 304 back
Verifies the fix in #5183

Closes #5186
2020-04-05 11:15:20 +02:00
Kwon-Young Choi
a448a4ce26
curl: allow both --etag-compare and --etag-save with same file name
This change inverse the order of processing for the --etag-compare and
--etag-save option to process first --etag-compare. This in turn allows
to use the same file name to compare and save an etag.

The original behavior of not failing if the etag file does not exists is
conserved.

Fixes #5179
Closes #5180
2020-04-05 01:07:52 +02:00
Marc Hoersken
57476a91e4
sockfilt: remove redundancy in timeout handling
And update other logmsg output in select_ws on Windows.
2020-04-03 12:37:39 +02:00
Marc Hoersken
3d1f35eb13
sockfilt: fix handling of ready closed sockets on Windows
Replace the incomplete workaround regarding FD_CLOSE
only signalling once by instead doing a pre-check with
standard select and storing the result for later use.

select keeps triggering on closed sockets on Windows while
WSAEventSelect fires only once with data still available.
By doing the pre-check we do not run in a deadlock
due to waiting forever for another FD_CLOSE event.
2020-04-03 12:37:39 +02:00
Marc Hoersken
9657ecb15b
sockfilt: fix race-condition of waiting threads and event handling
Fix race-condition of waiting threads finishing while events are
already being processed which lead to invalid or skipped events.

Use mutex to check for one event at a time or do post-processing.
In addition to mutex-based locking use specific event as signal.

Closes #5156
2020-04-03 12:37:39 +02:00
Marc Hoersken
b023008e7b
runtests.pl: log host OS as detected by Perl environment 2020-04-02 18:33:22 +02:00
Marc Hoersken
7208a989b7
ftpserver.pl: log before and after data connection is closed 2020-04-02 18:31:02 +02:00
Harry Sintonen
7a71965e97
build: fixed build for systems with select() in unistd.h
Closes #5169
2020-03-31 10:59:06 +02:00
Daniel Stenberg
0e607542dc
cleanup: insert newline after if() conditions
Our code style mandates we put the conditional block on a separate
line. These mistakes are now detected by the updated checksrc.
2020-03-30 16:05:30 +02:00
Daniel Stenberg
a3a5e2eaa3
dist: add tests/version-scan.pl to tarball
... used in test 1177.

Follow-up to a97d826f6d
2020-03-29 23:30:51 +02:00
Daniel Stenberg
a97d826f6d
test1177: verify that all the CURL_VERSION_ bits are documented 2020-03-29 23:29:26 +02:00
Michael Kaufmann
884de1a763 writeout_json: Fix data type issues
Load long values correctly (e.g. for http_code).

Use curl_off_t (not long) for:
- size_download (CURLINFO_SIZE_DOWNLOAD_T)
- size_upload (CURLINFO_SIZE_UPLOAD_T)

The unit for these values is bytes/second, not microseconds:
- speed_download (CURLINFO_SPEED_DOWNLOAD_T)
- speed_upload (CURLINFO_SPEED_UPLOAD_T)

Fixes #5131
Closes #5152
2020-03-27 23:32:25 +01:00
Marc Hoersken
6d45588ba3
sockfilt: add logmsg output to select_ws_wait_thread on Windows
Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Closes #5086
2020-03-26 16:27:50 +01:00
Daniel Stenberg
9a8b3b3e13
copyright: fix out-of-date copyright ranges and missing headers
Reported by the new script 'scripts/copyright.pl'. The script has a
regex whitelist for the files that don't need copyright headers.

Removed three (mostly usesless) README files from docs/

Closes #5141
2020-03-24 15:05:59 +01:00
Daniel Stenberg
c448c4840e
getinfo: provide CURLINFO_HEADER_SIZE and CURLINFO_REQUEST_SIZE override
To let debug-builds return fake values, like in test 970.

Ref: #5131
Closes #5136
2020-03-22 23:32:57 +01:00
Daniel Stenberg
9a7e62e7c3
test970: improve the test
- send more data to make problems more obvious
- don't start the data with minus, it makes diffs harder to read
- skip the headers in the stdout comparison
- save to a file name to also verify 'filename_effective'

Ref: #5131
2020-03-22 23:32:39 +01:00
Daniel Stenberg
ab18027d6c
tests: add test 430, 431 and 432 to verify the --config fix
Verify the fixes in 4e0b4fee4
2020-03-20 11:14:56 +01:00
Marc Hoersken
3d77d089a4
test2100: fix static port instead of dynamic value being used 2020-03-20 00:28:31 +01:00
Marc Hoersken
9c2aaf3d33
test970: fix static ip:port instead of dynamic values being used 2020-03-20 00:24:36 +01:00
Marc Hoersken
3c9066fce5
tests: make Python-based servers compatible with Python 2 and 3
Update smbserver.py and negtelnetserver.py to be compatible with
Python 3 while staying backwards-compatible to support Python 2.

Fix string encoding and handling of echoed and transferred data.

Tested with both Python 2.7.17 and Python 3.7.7

Reported-by: Daniel Stenberg
Assisted-by: Kamil Dudka
Reviewed-by: Marcel Raad

Fixes #5104
Closes #5110
2020-03-19 03:26:19 +01:00
Johannes Schindelin
5450428491 schannel: add "best effort" revocation check option
- Implement new option CURLSSLOPT_REVOKE_BEST_EFFORT and
  --ssl-revoke-best-effort to allow a "best effort" revocation check.

A best effort revocation check ignores errors that the revocation check
was unable to take place. The reasoning is described in detail below and
discussed further in the PR.

---

When running e.g. with Fiddler, the schannel backend fails with an
unhelpful error message:

	Unknown error (0x80092012) - The revocation function was unable
	to check revocation for the certificate.

Sadly, many enterprise users who are stuck behind MITM proxies suffer
the very same problem.

This has been discussed in plenty of issues:
https://github.com/curl/curl/issues/3727,
https://github.com/curl/curl/issues/264, for example.

In the latter, a Microsoft Edge developer even made the case that the
common behavior is to ignore issues when a certificate has no recorded
distribution point for revocation lists, or when the server is offline.
This is also known as "best effort" strategy and addresses the Fiddler
issue.

Unfortunately, this strategy was not chosen as the default for schannel
(and is therefore a backend-specific behavior: OpenSSL seems to happily
ignore the offline servers and missing distribution points).

To maintain backward-compatibility, we therefore add a new flag
(`CURLSSLOPT_REVOKE_BEST_EFFORT`) and a new option
(`--ssl-revoke-best-effort`) to select the new behavior.

Due to the many related issues Git for Windows and GitHub Desktop, the
plan is to make this behavior the default in these software packages.

The test 2070 was added to verify this behavior, adapted from 310.

Based-on-work-by: georgeok <giorgos.n.oikonomou@gmail.com>
Co-authored-by: Markus Olsson <j.markus.olsson@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Closes https://github.com/curl/curl/pull/4981
2020-03-18 03:23:39 -04:00
Daniel Stenberg
7631f2b752
test 970: verify --write-out '%{json}'
Makes curl_easy_getinfo() of "variable" numerical content instead return
the number set in the env variable `CURL_TIME`.

Makes curl_version() of "variable" textual content. This guarantees a
stable version string which can be tested against. Environment variable
`CURL_VERSION` defines the content.

Assisted-by: Mathias Gumz
2020-03-17 15:04:24 +01:00
Daniel Stenberg
8a2b36df5b
DISABLED: disable test 323
The test uses SRP to "a server not supporting it" but modern stunnel
versions will silently accept it and remain happy. The test is therefore
faulty.

I haven't figured out how to make stunnel explicitly reject SRP-using
connects.

Reported-by: Marc Hörsken
Fixes #5105
Closes #5113
2020-03-17 09:55:35 +01:00
Marc Hoersken
dda8babd07
tests: fix verification of stdout in test 1452 due to newline
Fixes test1452:41:1: error: missing </stdout> tag before </verify>
2020-03-15 23:17:01 +01:00
Marc Hoersken
92f129cd9f
tests/README: add note about manually installing python-impacket
Follow up to 4be2560
2020-03-15 12:34:17 +01:00
Marc Hoersken
4be2560e01
tests: remove python_dependencies for smbserver from our tree
Users of the SMB tests will have to install impacket manually.

Reasoning: our in-tree version of impacket was quite outdated
and only compatible with Python 2 which is already end-of-life.
Upgrading to Python 3 and a compatible impacket version would
require to import additional Python-only and CPython-extension
dependencies. This would have hindered portability enormously.

Closes #5094
2020-03-15 10:01:38 +01:00
Daniel Stenberg
fe8ba51209
server/getpart: make the "XML-parser" stricter
When extracting a <section> <part> and there's no </part> before
</section>, this now outputs an error and returns a wrong string to
make users spot the mistake.

Ref: #5070
Closes #5071
2020-03-13 11:03:42 +01:00
Marc Hoersken
a7e24c7362
impacket: some more Python 3 code compatibility updates
This makes smbserver load on Python 3, but still not work completely.
2020-03-13 02:49:07 +01:00
Marc Hoersken
ba0e6fbd30
smbserver: pin Python version to 2 since we are not yet 3 compatible
Even though the existing code can be fixed to run on Python 3, the
tests will fail due to the Unicode transition the protocol is invalid.

Follow up to ee63837
Closes #5085
2020-03-13 02:48:48 +01:00
Viktor Szakats
af07875c0d
cleanup: fix some text/comment typos
Closes #5087
2020-03-12 14:28:17 +01:00
Marc Hoersken
d5c01d779f
smbserver: fix Python version specific ConfigParser import
Follow up to ee63837 and 8c7c4a6
Fixes #5077
2020-03-12 09:15:36 +01:00
Dan Fandrich
c0fe3b3260 tests/data: Fix some XML formatting issues in test cases
This allows these test files to pass xmllint.
2020-03-11 10:33:03 +01:00
Marc Hoersken
fb6134427a
test1129: fix invalid case of closing XML-tag and Content-Length
Fixes #5070
Closes #5072
2020-03-10 22:38:56 +01:00
Marc Hoersken
f11b2cb62b
tests/data: fix static ip instead of dynamic value being used
Follow up to 94ced8e
2020-03-10 13:31:19 +01:00
Marc Hoersken
94ced8e368
tests/data: fix static ip:port instead of dynamic values being used
Closes #5065
2020-03-10 03:56:50 +01:00
Marc Hoersken
26c5ba0e65
tests/server: fix missing use of exe_ext helper function
Follow up to 9819984 and 3dce984
Reviewed-By: Daniel Stenberg
Closes #5064
2020-03-10 03:56:17 +01:00
Marc Hoersken
4d43d06143
runtests: log minimal and maximal used port numbers 2020-03-10 03:55:37 +01:00
Jim Fuller
e96fe70cab
sftp: fix segfault regression introduced by #4747
This fix adds a defensive check for the case where the char *name in
struct libssh2_knownhost is NULL

Fixes #5041
Closes #5062
2020-03-09 15:01:40 +01:00
Patrick Monnerat
77336671dc
silly web server: silent a compilation warning
Recent gcc warns when byte count of strncpy() equals the destination
buffer size. Since the destination buffer is previously cleared and
the source string is always shorter, reducing the byte count by one
silents the warning without affecting the result.

Closes #5059
2020-03-08 17:30:55 +01:00
Patrick Monnerat
a75f12768d
test 1560: avoid valgrind false positives
When using maximum code optimization level (-O3), valgrind wrongly
detects uses of uninitialized values in strcmp().

Preset buffers with all zeroes to avoid that.
2020-03-08 17:30:55 +01:00
Daniel Stenberg
0a04dc4d5d
lib1564: reduce number of mid-wait wakeup calls
This test does A LOT of *wakeup() calls and then calls curl_multi_poll()
twice. The first *poll() is then expected to return early and the second
not - as the first is supposed to drain the socketpair pipe.

It turns out however that when given "excessive" amounts of writes to
the pipe, some operating systems (the Solaris based are known) will
return EAGAIN before the pipe is drained, which in our test case causes
the second *poll() call to also abort early.

This change attempts to avoid the OS-specific behaviors in the test by
reducing the amount of wakeup calls from 1234567 to 10.

Reported-by: Andy Fiddaman
Fixes #5037
Closes #5058
2020-03-07 23:27:58 +01:00
Patrick Monnerat
e5b366c0b5
mime: fix the binary encoder to handle large data properly
New test 666 checks this is effective.
As upload buffer size is significant in this kind of tests, shorten it
in similar test 652.

Fixes #4860
Closes #4833
Reported-by: RuurdBeerstra on github
2020-03-07 23:26:15 +01:00
Patrick Monnerat
1e4cb333ef
mime: do not perform more than one read in a row
Input buffer filling may delay the data sending if data reads are slow.
To overcome this problem, file and callback data reads do not accumulate
in buffer anymore. All other data (memory data and mime framing) are
considered as fast and still concatenated in buffer.
As this may highly impact performance in terms of data overhead, an early
end of part data check is added to spare a read call.
When encoding a part's data, an encoder may require more bytes than made
available by a single read. In this case, the above rule does not apply
and reads are performed until the encoder is able to deliver some data.

Tests 643, 644, 645, 650 and 654 have been adapted to the output data
changes, with test data size reduced to avoid the boredom of long lists of
1-byte chunks in verification data.
New test 667 checks mimepost using single-byte read callback with encoder.
New test 668 checks the end of part data early detection.

Fixes #4826
Reported-by: MrdUkk on github
2020-03-07 23:26:00 +01:00
Patrick Monnerat
96972ec1c0
mime: latch last read callback status.
In case a read callback returns a status (pause, abort, eof,
error) instead of a byte count, drain the bytes read so far but
remember this status for further processing.
Takes care of not losing data when pausing, and properly resume a
paused mime structure when requested.
New tests 670-673 check unpausing cases, with easy or multi
interface and mime or form api.

Fixes #4813
Reported-by: MrdUkk on github
2020-03-07 23:26:00 +01:00
Marc Hoersken
3dce9849be
runtests: fix missing use of exe_ext helper function 2020-03-07 20:16:10 +01:00
Marc Hoersken
a6fed41f6f
tests: use native Sleep function as fallback on Windows
Reviewed-By: Daniel Stenberg
Closes #5054
2020-03-07 11:02:43 +01:00
Marc Hoersken
99c688ba21
perl: align order and completeness of Windows OS checks 2020-03-07 11:02:43 +01:00
Jay Satiro
09aa807240 libssh: Fix matching user-specified MD5 hex key
Prior to this change a match would never be successful because it
was mistakenly coded to compare binary data from libssh to a
user-specified hex string (ie CURLOPT_SSH_HOST_PUBLIC_KEY_MD5).

Reported-by: fds242@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/4971
Closes https://github.com/curl/curl/pull/4974
2020-03-07 03:06:11 -05:00
Steve Holme
3c3db98b6f
unit1612: fixed the inclusion and compilation of the HMAC unit test
Follow up to 3f74e5e6 to fix:

- A typo in Makefile.inc where unit1611 was used instead
- Some compilation issues in unit1612.c

Closes #5024
2020-03-06 13:08:03 +00:00
Daniel Stenberg
52d302ed64
polarssl: remove more references and mentions
Assisted-by: Jay Satiro
Follow-up to 6357a19ff2
Closes #5036
2020-03-05 07:57:45 +01:00
Marc Hoersken
30f7360025 tests: wrap ignored test failures in braces 2020-03-04 22:36:47 +01:00
Marc Hoersken
3c1b9145c7
tests: align some Windows sleep defines with each other 2020-03-04 16:11:03 +01:00
Marc Hoersken
9aaca09044
tests: try to make sleeping portable by avoiding select
select does not support just waiting on Windows:
https://perldoc.perl.org/perlport.html#select

Reviewed-By: Daniel Stenberg
Closes #5035
2020-03-04 15:31:42 +01:00
Daniel Stenberg
1eecb0e022
runtests.1: rephrase how to specify what tests to run
Also mention the new tilde-prefixed way to ignore test results.

Reviewed-By: Marc Hoersken
Closes #5033
2020-03-04 15:08:08 +01:00
Marc Hoersken
e7c144f1d1
ci/tests: fix escaping of testnames and disable proxy for CI APIs
Follow up to ada581f and c0d8b96
Closes #5031
2020-03-03 22:13:57 +01:00
Marc Hoersken
119ea453f9
ci/tests: Make it possible to still run but ignore failing tests
This enables the development of a solution for the failing tests by
running them on CI while ignoring their result for the overall status.

Closes #4994
2020-03-03 17:32:38 +01:00
Marc Hoersken
3feb60d289
ci/tests: Move CI test result creation above environment setup
This avoids using our test servers as proxy to the AppVeyor API.

Closes #5022
2020-03-03 16:00:04 +01:00
Marc Hoersken
c0d8b96f24
ci/tests: Send test results to AppVeyor for status overview
Closes #5021
2020-03-03 15:59:59 +01:00
Daniel Stenberg
c537b00577
dist: include tests/azure.pm in the tarball
Bug: ada581f2cc (commitcomment-37601589)
Reported-by: Marcel Raad
2020-03-03 08:42:38 +01:00
Daniel Stenberg
5494afac8f
tests: disable 962, 963 and 964 on Windows
These tests are also doing UTF-8 SMTP.

Follow-up to df207d2dd9
2020-03-02 14:44:46 +01:00
Steve Holme
df207d2dd9
tests: disable SMTP UTF-8 tests on Windows
Fixes #4988
Closes #4992
2020-03-02 08:29:11 +01:00
Daniel Stenberg
8cd4e6d81f
Revert "mime: latch last read callback status."
This reverts commit 87869e38d7.

Fixes #5014
Closes #5015
Reopens #4833
2020-03-02 08:07:49 +01:00
Daniel Stenberg
d7242f4757
Revert "mime: do not perform more than one read in a row"
This reverts commit ed0f357f7d.
2020-03-02 07:42:54 +01:00
Daniel Stenberg
e002f6c0cb
Revert "mime: fix the binary encoder to handle large data properly"
This reverts commit b2caaa0681.
2020-03-02 07:42:48 +01:00
Patrick Monnerat
b2caaa0681
mime: fix the binary encoder to handle large data properly
New test 666 checks this is effective.
As upload buffer size is significant in this kind of tests, shorten it
in similar test 652.

Fixes #4860
Reported-by: RuurdBeerstra on github
2020-03-02 00:00:59 +01:00
Patrick Monnerat
ed0f357f7d
mime: do not perform more than one read in a row
Input buffer filling may delay the data sending if data reads are slow.
To overcome this problem, file and callback data reads do not accumulate
in buffer anymore. All other data (memory data and mime framing) are
considered as fast and still concatenated in buffer.
As this may highly impact performance in terms of data overhead, an early
end of part data check is added to spare a read call.
When encoding a part's data, an encoder may require more bytes than made
available by a single read. In this case, the above rule does not apply
and reads are performed until the encoder is able to deliver some data.

Tests 643, 644, 645, 650 and 654 have been adapted to the output data
changes, with test data size reduced to avoid the boredom of long lists of
1-byte chunks in verification data.
New test 664 checks mimepost using single-byte read callback with encoder.
New test 665 checks the end of part data early detection.

Fixes #4826
Reported-by: MrdUkk on github
2020-03-02 00:00:58 +01:00
Patrick Monnerat
87869e38d7
mime: latch last read callback status.
In case a read callback returns a status (pause, abort, eof,
error) instead of a byte count, drain the bytes read so far but
remember this status for further processing.
Takes care of not losing data when pausing, and properly resume a
paused mime structure when requested.
New tests 670-673 check unpausing cases, with easy or multi
interface and mime or form api.

Fixes #4813
Reported-by: MrdUkk on github
Closes #4833
2020-03-02 00:00:50 +01:00
Steve Holme
cf1466bd47
unit1651: Fixed conversion compilation warning
371:17: warning: conversion to 'unsigned char' from 'int' may alter its
        value [-Wconversion]

Closes #5008
2020-03-01 15:10:28 +00:00