1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-05 00:55:04 -05:00
Commit Graph

621 Commits

Author SHA1 Message Date
Daniel Stenberg
30fc1cc7db
tests/mqttd: extract the client id from the correct offset
Closes #6334
2020-12-17 10:15:31 +01:00
Daniel Stenberg
769a4687df
tests/server/disabled: add "wakeup"
To allow the test suite to know if wakeup support is disabled in the
build.
2020-12-11 17:42:17 +01:00
Marc Hoersken
227daceabe
tests/server/tftpd.c: close upload file in case of abort
Commit c353207 removed the closing right after do_tftp
which covered the case of abort. This handles that case.

Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Follow up to #6209
Closes #6234
2020-11-28 19:19:18 +01:00
Marc Hoersken
c353207057
tests/server/tftpd.c: close upload file right after transfer
Make sure uploaded file is no longer locked after the
transfer while waiting for the final ACK to be handled.

Assisted-by: Daniel Stenberg

Bug: #6058
Closes #6209
2020-11-20 12:50:57 +01:00
Daniel Stenberg
3c5c6e7477
mqttd: fclose test file when done
Reported-by: Marc Hörsken
Reviewed-by: Jay Satiro
Bug: #6058
Closes #6189
2020-11-09 17:25:22 +01:00
Daniel Stenberg
ac0a88fd25
copyright: fix year ranges
Follow-up from 4d2f800677
2020-11-05 08:22:10 +01:00
Daniel Stenberg
4d2f800677
curl.se: new home
Closes #6172
2020-11-04 23:59:47 +01:00
Marc Hoersken
112418070a
tests/server/util.c: fix support for Windows Unicode builds
Detected via #6066
Closes #6070
2020-10-14 06:58:04 +02:00
Marc Hoersken
3e4b32a3e1
win32: drop support for WinSock version 1, require version 2
IPv6, telnet and now also the multi API require WinSock
version 2 which is available starting with Windows 95.

Therefore we think it is time to drop support for version 1.

Reviewed-by: Marcel Raad
Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Reviewed-by: Viktor Szakats

Follow up to #5634
Closes #5854
2020-09-02 16:30:39 +02:00
Marc Hoersken
5fcad1c1c6
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.

Follow up to #5867
Closes #5879
2020-08-28 22:30:39 +02:00
Daniel Stenberg
2f72ad44fc
checksrc: ban gmtime/localtime
They're not thread-safe so they should not be used in libcurl code.

Explictly enabled when deemed necessary and in examples and tests

Reviewed-by: Nicolas Sterchele
Closes #5732
2020-07-28 23:51:17 +02:00
Marcel Raad
c90e48c005
util: silence conversion warnings
timeval::tv_usec might be a 32-bit integer and timespec::tv_nsec might
be a 64-bit integer. This is the case when building for recent macOS
versions, for example. Just treat tv_usec as an int, which should
hopefully always be sufficient on systems with
`HAVE_CLOCK_GETTIME_MONOTONIC`.

Closes https://github.com/curl/curl/pull/5695
2020-07-19 10:34:58 +02:00
Daniel Stenberg
2705830f2f
server/util: fix logmsg format using curl_off_t argument
... this caused segfaults on armv7.

Regression added in dd0365d560 (7.70.0)

Reviewed-by: Jay Satiro
Closes #5529
2020-06-06 13:25:56 +02:00
Daniel Stenberg
6531d089e5
server/sws: fix asan warning on use of uninitialized variable 2020-05-29 13:05:09 +02:00
Viktor Szakats
308c243db5
all: fix codespell errors
Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Closes https://github.com/curl/curl/pull/5452
2020-05-25 19:44:04 +00:00
Daniel Stenberg
bb79320af7
tests/server/util.h: add extern to silence compiler warning
Follow-up from a3b0699d5c
2020-05-20 15:37:09 +02:00
Daniel Stenberg
a3b0699d5c
sws: as last resort, get test number from server cmd file
If it can't be found in the request. Also support --cmdfile to set it to
a custom file name.

runtests.pl always writes this file with the test number in it since a
while back.
2020-05-15 08:28:56 +02:00
Marcel Raad
a55c835e6b
curl_multibyte: add to curlx
This will also be needed in the tool and tests.

Ref: https://github.com/curl/curl/pull/3758#issuecomment-482197512
Closes https://github.com/curl/curl/pull/3784
2020-05-14 18:13:27 +02:00
Peter Wu
c2ab2494ef
CMake: do not build test programs by default
The default target should only build libcurl and curl. Add a dedicated
'testdeps' target which will be used later when running tests. Note that
unittests are currently broken in CMake and already excluded.

Closes #5368
2020-05-12 08:50:07 +02:00
Marc Hoersken
000f721690
tests/server/tftpd.c: fix include and enhance debug logging
setjmp.h should only be included if HAVE_SETJMP_H is defined.

Add additional log statements to see wether reads and writes
are blocking or finishing before an alarm signal is received.

Assisted-by: Peter Wu
Part of #5364
2020-05-10 17:58:29 +02:00
Daniel Stenberg
ed35d6590e
dynbuf: introduce internal generic dynamic buffer functions
A common set of functions instead of many separate implementations for
creating buffers that can grow when appending data to them. Existing
functionality has been ported over.

In my early basic testing, the total number of allocations seem at
roughly the same amount as before, possibly a few less.

See docs/DYNBUF.md for a description of the API.

Closes #5300
2020-05-04 10:40:39 +02:00
Marc Hoersken
0e058776c0
sockfilt: make select_ws stop waiting on exit signal event
This makes sure that select_ws behaves similar to real select
which stops waiting on a signal handler being triggered.

This makes it possible to gracefully stop sockfilt.exe on
Windows with taskkill /IM sockfilt.exe (without /F force flag).

Reviewed-by: Jay Satiro
Part of #5260
2020-05-02 17:30:54 +02:00
Marc Hoersken
7dc8a981fa
tests/server/util.[ch]: add exit event to stop waiting on Windows
This commit adds a global exit event to the test servers that
Windows-specific wait routines can use to get triggered if the
program was signaled to be terminated, eg. select_ws in sockfilt.c

The exit event will be managed by the signal handling code and is
set to not reset automatically to support multiple wait routines.

Reviewed-by: Jay Satiro
Closes #5260
2020-05-02 17:29:52 +02:00
Marc Hoersken
551577f357
tests/server/util.c: fix thread handle not being closed
Reviewed-by: Jay Satiro
Part of #5260
2020-05-02 17:05:26 +02:00
Marc Hoersken
fe28fcf04c
tests/server/util.c: use raise instead of calling signal handler
Use raise to trigger signal handler instead of calling it
directly and causing potential unexpected control flow.

Reviewed-by: Jay Satiro
Part of #5260
2020-05-02 17:04:55 +02:00
Kamil Dudka
1066f5f0d4 tests: look for preprocessed tests in build directory
... which is not always the same directory as source directory

Closes #5310
2020-04-29 13:53:12 +02:00
Emil Engler
ba7b94b1e7
tests/git: ignore mqttd and port files
Closes #5290
2020-04-24 13:48:58 +02:00
Daniel Stenberg
bae87dc0d9
tests: run the RTSP test server on a dynamic port number
To avoid port collisions.

Closes #5272
2020-04-20 22:48:57 +02:00
Daniel Stenberg
fa7daafdbc
server/tftpd: fix compiler warning
Follow-up from 369ce38ac1
Reported-by: Marc Hörsken
2020-04-20 22:21:31 +02:00
Daniel Stenberg
bcd9813588
tests: run the SOCKS test server on a dynamic port number
Closes #5266
2020-04-20 10:00:30 +02:00
Daniel Stenberg
369ce38ac1
tests: run the TFTP test server on a dynamic port number
Picking a dynamic unused port is better than a fixed to avoid the
collision risk.

Closes #5265
2020-04-20 09:13:20 +02:00
Daniel Stenberg
5811beba39
mqtt: improve the state machine
To handle PUBLISH before SUBACK and more.

Updated the existing tests and added three new ones.

Reported-by: Christoph Krey
Bug: https://curl.haxx.se/mail/lib-2020-04/0021.html
Closes #5246
2020-04-20 08:09:33 +02:00
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
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
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
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
5e855bbd18
tests: add the mqtt test server mqttd 2020-04-14 13:04:10 +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
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
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
fef4334091
cleanup: correct copyright year range on a few files 2020-04-06 23:21: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