Commit Graph

513 Commits

Author SHA1 Message Date
Dan Fandrich f19baf27eb tests: make test file names more unique
Include the test number in the names of files written out by tests to
reduce the chance of accidental duplication and to make it more clear
which test is associated with which file.
2017-05-09 21:52:05 +02:00
Marcel Raad e076fdaf5b
tftpd: fix signed/unsigned mismatch warnings
alarm's argument is unsigned.
2017-05-08 20:11:03 +02:00
Daniel Stenberg 22fdb0954c tests/server: run checksrc by default in debug-builds 2017-05-05 15:51:25 +02:00
Dan Fandrich 79bb0afddb sockfilt.c: shortened too long line 2017-05-04 22:37:34 +02:00
Marcel Raad 4032c5da84
tests/server: make string literals const
assign string literals to const char * instead of char * in order to
avoid a lot of these warnings:
cast from 'const char *' to 'char *' drops const qualifier
[-Wcast-qual]
2017-05-04 20:26:06 +02:00
Marcel Raad f2d5d05893
testpart: remove _MPRINTF_REPLACE
Support for _MPRINTF_REPLACE in mprintf.h was removed in
55452ebdff, replaced with curl_printf.h.
2017-05-02 21:09:41 +02:00
Marcel Raad 0912a5c760
getpart: use correct variable type
This fixes the following clang warning:
getpart.c:201:17: warning: cast from function call of type 'CURLcode'
to non-matching type 'int' [-Wbad-function-cast]
2017-05-01 13:17:57 +02:00
Daniel Gustafsson aaa7e05c78 code: fix typos and style in comments
A few random typos, and minor whitespace cleanups, found in comments
while reading code.

Closes #1423
2017-04-17 23:17:50 +02:00
Marcel Raad fad74ba4cc
tests/server/util: prefer <poll.h> over <sys/poll.h>
Follow-up to aa573c3c55

Ref: https://github.com/curl/curl/pull/1406
2017-04-12 08:45:54 +02:00
Marcel Raad 55f4ababde
tests/server/util: remove in6addr_any for recent MinGW
In ancient MinGW versions, in6addr_any was declared as extern, but not
defined. Because of that, 22a0c57746 added
definitions for in6addr_any when compiling with MinGW. The bug was fixed in
w32api version 3.6 from 2006, so this workaround is not needed anymore for
recent versions.

This fixes the following MinGW-w64 warnings because the MinGW-w64 version of
IN6ADDR_ANY_INIT has the two additional braces inside the macro:
util.c:59:14: warning: braces around scalar initializer
util.c:59:40: warning: excess elements in scalar initializer

Ref: e4803e0da2/tree/w32api/ChangeLog
Closes https://github.com/curl/curl/pull/1379
2017-04-03 11:18:08 +02:00
Daniel Stenberg 81cb255cb3 sws: use SOCKERRNO, not errno
Reported-by: Gisle Vanem
2017-01-19 23:04:53 +01:00
Daniel Stenberg 62e67c7772 sws: retry send() on EWOULDBLOCK
Fixes spurious test 1060 and 1061 failures on OpenBSD, Solaris and more.

Bug: https://curl.haxx.se/mail/lib-2017-01/0009.html
Reported-by: Christian Weisgerber
2017-01-09 23:43:15 +01:00
Jay Satiro c2402b6e02 tests: checksrc compliance 2016-12-19 02:31:59 -05:00
Daniel Stenberg 1c3e8bbfed checksrc: warn for assignments within if() expressions
... they're already frowned upon in our source code style guide, this
now enforces the rule harder.
2016-12-14 01:29:44 +01:00
Daniel Stenberg b228d2952b checksrc: stricter no-space-before-paren enforcement
In order to make the code style more uniform everywhere
2016-12-13 23:39:11 +01:00
Daniel Stenberg 8657c268e1 checksrc: white space edits to comply to stricter checksrc 2016-11-24 23:58:22 +01:00
Daniel Stenberg dbadaebfc4 checksrc: code style: use 'char *name' style 2016-11-24 23:58:22 +01:00
Dan Fandrich 56bb7b1a3c tests: fixed variable might be clobbered warning
This stops the compiler from potentially making invalid assumptions
about the immutability of sdp and sap across the longjmp boundary.
2016-11-12 12:37:24 +01:00
Daniel Stenberg 27302abb94 s/cURL/curl
We're mostly saying just "curl" in lower case these days so here's a big
cleanup to adapt to this reality. A few instances are left as the
project could still formally be considered called cURL.
2016-11-07 10:36:23 +01:00
Daniel Stenberg 07b95ea268 tests/util: get a private strncasecompare clone
... since the curlx_* code no longer provides one and we don't link
libcurl to these test servers.
2016-10-31 23:49:54 +01:00
Daniel Stenberg 502acba2af strcasecompare: is the new name for strequal()
... to make it less likely that we forget that the function actually
does case insentive compares. Also replaced several invokes of the
function with a plain strcmp when case sensitivity is not an issue (like
comparing with "-").
2016-10-31 08:46:35 +01:00
Daniel Stenberg 434f8d0389 internals: rename the SessionHandle struct to Curl_easy 2016-06-22 10:28:41 +02:00
Daniel Stenberg a07727005a make/checksrc: use $srcdir, not $top_srcdir 2016-04-19 08:56:06 +02:00
Daniel Stenberg ab493af731 checksrc/makefile.am: use $top_srcdir to find source files
... to properly support out of source tree builds.
2016-04-18 14:58:11 +02:00
Daniel Stenberg 3d94a113e9 tests: fix make checksrc in servers/ 2016-04-03 22:42:49 +02:00
Daniel Stenberg a332c4f769 tests/server: comply with our code style 2016-04-03 22:38:36 +02:00
Viktor Szakats d49881cb19 URLs: change more http to https 2016-02-04 18:46:54 -05:00
Daniel Stenberg 4af40b3646 URLs: change all http:// URLs to https:// 2016-02-03 00:19:02 +01:00
Marc Hoersken 7bf5f6e054 sockfilt.c: fix calculation of sleep timeout on Windows
Not converting to double caused small timeouts to be skipped.
2015-12-23 15:04:02 +01:00
Marc Hoersken 18c95d4bc0 tftpd server: add Windows support by writing files in binary mode 2015-12-23 13:04:00 +01:00
Marc Hoersken c3eeb526ae sockfilt.c: added some debug output to select_ws 2015-12-16 15:33:36 +01:00
Marc Hoersken 234abd9013 sockfilt.c: keep lines shorter than 80 chars 2015-12-16 15:33:13 +01:00
Marc Hoersken f4646b9069 sockfilt.c: do not wait on unreliable file or pipe handle
The previous implementation caused issues on modern MSYS2 runtimes.
2015-12-16 15:32:31 +01:00
Daniel Stenberg 60c86297bf tftp tests: verify sent options too
The tftpd test server now logs all received options and thus all TFTP
test cases need to match them exactly.

Extended test 283 to use and verify --tftp-blksize.
2015-11-06 10:55:30 +01:00
Jay Satiro 9518139c73 gitignore: Sort for readability
find . -name .gitignore -print0 | xargs -i -0 sort -o '{}' '{}'
2015-08-18 01:03:05 -04:00
Roger Leigh e3e06e1aee tests: Distribute CMakeLists.txt files in subdirectories 2015-06-25 07:48:50 -07:00
Daniel Stenberg 1945f99d59 sws: init http2 state properly
It would otherwise cause problems when running tests after 1801 etc.
2015-04-27 08:38:52 +02:00
Markus Elfring 29c655c0a6 Bug #149: Deletion of unnecessary checks before calls of the function "free"
The function "free" is documented in the way that no action shall occur for
a passed null pointer. It is therefore not needed that a function caller
repeats a corresponding check.
http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first

This issue was fixed by using the software Coccinelle 1.0.0-rc24.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2015-03-16 12:13:56 +01:00
Daniel Stenberg becff7da56 sws: timeout idle CONNECT connections 2015-02-25 09:54:30 +01:00
Daniel Stenberg 0c050662b7 sws: stop logging about TPC_NODELAY nonsense 2015-02-24 11:51:22 +01:00
Steve Holme 4088721726 sockfilt.c: Fixed compilation warnings
sockfilt.c:288: warning: conversion to 'DWORD' from 'size_t' may alter
                its value
sockfilt.c:291: warning: conversion to 'DWORD' from 'size_t' may alter
                its value
sockfilt.c:323: warning: conversion to 'DWORD' from 'size_t' may alter
                its value
sockfilt.c:326: warning: conversion to 'DWORD' from 'size_t' may alter
                its value
2014-12-28 22:34:26 +00:00
Steve Holme 151ae59436 code/docs: Use correct case for IPv4 and IPv6
For consistency, as we seem to have a bit of a mixed bag, changed all
instances of ipv4 and ipv6 in comments and documentations to use the
correct case.
2014-12-27 11:31:55 +00:00
Steve Holme 1abe65d928 code/docs: Use Unix rather than UNIX to avoid use of the trademark
Use Unix when generically writing about Unix based systems as UNIX is
the trademark and should only be used in a particular product's name.
2014-12-26 21:42:44 +00:00
Marc Hoersken 7f99e12e98 sockfilt.c: Reduce the number of individual memory allocations
Merge multiple internal arrays into one, even if some variables
will not not be used. They are all created with the number of
file descriptors as their size.

Also fix possible thread handle leak in CloseHandle-loop.
2014-12-26 10:41:40 +01:00
Marc Hoersken 62a018762e sockfilt.c: Replace 100ms sleep with thread throttle
Improves performance of test cases 574 and 575 by 50%.

A value of zero causes the thread to relinquish the remainder
of its time slice to any other thread of equal priority that is
ready to run. If there are no other threads of equal priority
ready to run, the function returns immediately, and the thread
continues execution.

http://msdn.microsoft.com/library/windows/desktop/ms686307.aspx
2014-12-26 10:15:33 +01:00
Marc Hoersken 6f1f5a7506 sockfilt.c: use non-Ex functions that are available before WinXP
It was initially reported by Guenter that GetFileSizeEx
requires (_WIN32_WINNT >= 0x0500) to be true.
2014-12-21 14:32:40 +01:00
Dan Fandrich f768be0a25 sws.c: Fixed 'rc' may be used uninitialized warning 2014-12-10 00:06:10 +01:00
Steve Holme f5e9c636e8 sws.c: Fixed compilation warning
sws.c:2191 warning: 'rc' may be used uninitialized in this function
2014-12-06 22:18:42 +00:00
Peter Wu 970c22f970 libcurl: add UNIX domain sockets support
The ability to do HTTP requests over a UNIX domain socket has been
requested before, in Apr 2008 [0][1] and Sep 2010 [2]. While a
discussion happened, no patch seems to get through. I decided to give it
a go since I need to test a nginx HTTP server which listens on a UNIX
domain socket.

One patch [3] seems to make it possible to use the
CURLOPT_OPENSOCKETFUNCTION function to gain a UNIX domain socket.
Another person wrote a Go program which can do HTTP over a UNIX socket
for Docker[4] which uses a special URL scheme (though the name contains
cURL, it has no relation to the cURL library).

This patch considers support for UNIX domain sockets at the same level
as HTTP proxies / IPv6, it acts as an intermediate socket provider and
not as a separate protocol. Since this feature affects network
operations, a new feature flag was added ("unix-sockets") with a
corresponding CURL_VERSION_UNIX_SOCKETS macro.

A new CURLOPT_UNIX_SOCKET_PATH option is added and documented. This
option enables UNIX domain sockets support for all requests on the
handle (replacing IP sockets and skipping proxies).

A new configure option (--enable-unix-sockets) and CMake option
(ENABLE_UNIX_SOCKETS) can disable this optional feature. Note that I
deliberately did not mark this feature as advanced, this is a
feature/component that should easily be available.

 [0]: http://curl.haxx.se/mail/lib-2008-04/0279.html
 [1]: http://daniel.haxx.se/blog/2008/04/14/http-over-unix-domain-sockets/
 [2]: http://sourceforge.net/p/curl/feature-requests/53/
 [3]: http://curl.haxx.se/mail/lib-2008-04/0361.html
 [4]: https://github.com/Soulou/curl-unix-socket

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:19 +01:00
Peter Wu 99fb36797a sws: try to remove socket and retry bind
If sws is killed it might leave a stale socket file on the filesystem
which would cause an EADDRINUSE error. After this patch, it is checked
whether the socket is really stale and if so, the socket file gets
removed and another bind is executed.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-12-04 02:52:18 +01:00