Yang Tse
6e461e45c3
fix compiler warning
2010-02-18 12:31:24 +00:00
Yang Tse
f442dd6496
fix Content-Length validation
2010-02-16 11:17:00 +00:00
Yang Tse
d5b2d8e081
fix compiler warning: conversion from "long" to "size_t" may lose sign
2010-02-15 17:40:35 +00:00
Yang Tse
68d83a8142
Overhauled test suite getpart() function. Fixing potential out of bounds
...
stack and memory overwrites triggered with huge test case definitions.
2010-02-14 13:14:17 +00:00
Yang Tse
f47b84b57f
Validate server port argument
2010-02-04 17:17:19 +00:00
Yang Tse
232d17ec64
avoid possibility of using obsoleted stuff
2010-02-02 12:39:10 +00:00
Yang Tse
a114b7b1c0
sws and tftpd command line option naming adjustments
2010-01-08 01:48:54 +00:00
Yang Tse
7bede9180d
log a message when continuing once sleep time is over
2009-12-22 13:45:01 +00:00
Yang Tse
002ed5f298
Test harness process control enhancements
2009-12-16 19:55:35 +00:00
Yang Tse
364d76aca7
Fix compiler warnings
2009-12-14 13:27:50 +00:00
Yang Tse
6e9a484ea6
signal handling to cleanup on SIGINT and SIGTERM, followup
2009-12-13 03:45:32 +00:00
Yang Tse
0653fa107f
signal handling to cleanup on SIGINT and SIGTERM, followup
2009-12-09 18:41:43 +00:00
Yang Tse
f07f17f2a4
Log sws IPv version, port and pid when exiting due to SIGINT or SIGTERM.
2009-11-27 12:01:25 +00:00
Yang Tse
cbd527843b
Only attempt to clear the server-logs lock when previously set by this same server.
2009-11-26 10:15:08 +00:00
Yang Tse
fba233bb34
signal handling to cleanup on SIGINT and SIGTERM
2009-11-26 04:38:29 +00:00
Yang Tse
094afbeb56
Enhance some debug messages for initialization failures.
...
Fix compiler warning: conditional expression is constant.
2009-11-23 16:11:50 +00:00
Yang Tse
be5c815f63
remove line obsoleted with previous commit
2009-09-17 14:02:50 +00:00
Yang Tse
31e106ced2
Attempt to silence bogus compiler warning: "Potential null pointer dereference"
2009-09-17 11:45:27 +00:00
Gunter Knauf
f1320d6733
add cast to silent compiler warning with 64bit systems.
2009-08-29 15:44:31 +00:00
Yang Tse
c2ce2aa4de
fix compiler warning
2009-06-12 09:01:41 +00:00
Yang Tse
3ca0b9bb47
fix compiler warning
2009-06-11 17:46:33 +00:00
Yang Tse
af41fb79b5
Include <arpa/inet.h> if HAVE_ARPA_INET_H is defined
2009-04-27 23:59:41 +00:00
Dan Fandrich
640974fb28
If a HTTP request is Basic and num is already >=1000, the HTTP test server
...
adds 1 to num to get the data section to return. This allows testing
authentication negotiations using the Basic authentication method.
2008-11-25 23:23:47 +00:00
Dan Fandrich
88513d2d1a
Fixed some compiler warnings with gcc
2008-10-01 17:34:24 +00:00
Yang Tse
57ee847ce7
Avoid the use of the '? :' operator inside the call to our
...
test-server logging function. It doesn't work on some systems.
2008-09-26 11:21:22 +00:00
Yang Tse
985bd18904
attempt to avoid HTTP server startup misdetection on some systems
2008-09-26 01:08:24 +00:00
Yang Tse
b6f29bef06
fix compiler warning: defined but not used
2008-09-21 02:35:20 +00:00
Yang Tse
fe5f448015
fix compiler warning: external definition with no prior declaration
2008-09-20 12:33:02 +00:00
Yang Tse
a6c915aab9
fix compiler warning: external declaration in primary source file
2008-09-18 16:21:09 +00:00
Yang Tse
8733e087d7
fix print formatting string directives
2008-09-04 05:29:10 +00:00
Daniel Stenberg
c67a99ff27
- When libcurl was doing a HTTP POST and the server would respond with
...
"Connection: close" and actually close the connection after the
response-body, libcurl could still have outstanding data to send and it
would not properly notice this and stop sending. This caused weirdness and
sad faces. http://curl.haxx.se/bug/view.cgi?id=2080222
Note that there are still reasons to consider libcurl's behavior when
getting a >= 400 response code while sending data, as Craig Perras' note
"http upload: how to stop on error" specifies:
http://curl.haxx.se/mail/archive-2008-08/0138.html
2008-08-29 10:47:59 +00:00
Dan Fandrich
1f26ea4a85
Added test case 1051 to test Location: following with PUT, as reported
...
by Ben Sutcliffe. The test when run manually shows a problem in curl,
but the test harness web server doesn't run the test correctly so it's
disabled for now.
2008-07-30 07:24:59 +00:00
Yang Tse
96edebf4d9
improve synchronization between test harness runtests.pl script
...
and test harness servers to minimize risk of false test failures.
http://curl.haxx.se/mail/lib-2008-04/0392.html
2008-04-23 23:55:34 +00:00
Yang Tse
ad1dd08693
fix minor memory leak triggered upon test failure
2008-04-22 13:07:27 +00:00
Yang Tse
95fd093c4a
Remove fflush() + fsync() previously introduced accelerated writing of
...
server input and response request files of the test harness sws server.
Reintroduce, for test # 1001, the <postcheck> small delay. The delay is
needed even with the accelerated writing of server input and response
request files in test harness sws server.
http://curl.haxx.se/mail/lib-2008-04/0385.html
2008-04-22 12:40:05 +00:00
Yang Tse
a87c468c5c
accelerate the writing of server input and response request files
...
to disk, trying to defeat file and disk write-behind algorithms
2008-04-20 19:15:08 +00:00
Yang Tse
ed63d9d4de
header inclusion cleanup
2008-02-28 00:55:06 +00:00
Yang Tse
0d09f342c4
refactor some code out to write_pidfile() in util.c
2008-02-26 15:06:44 +00:00
Yang Tse
fecb67b246
Use a long int data type to handle getpid() result
2008-02-06 16:54:01 +00:00
Yang Tse
2c0956200f
Fix buffer size specification.
...
Improve handling of boundary conditions for huge requests.
2008-02-05 18:37:53 +00:00
Yang Tse
acd9d72466
Minor variable type cleanups.
...
Disable "swsbounce" mode when the received request
isn't for the same test and part number.
2008-02-05 14:43:16 +00:00
Yang Tse
cd63a461d7
proper initialization of httprequest, no longer zeroing out twice
...
the whole 150000+ bytes struct, and also removing an equally big
additional buffer for pipelining treatment.
2008-02-05 02:21:38 +00:00
Yang Tse
69e540dfa6
improve request initialization for test harness HTTP server
2008-01-25 05:08:53 +00:00
Yang Tse
2198869eb1
Dmitry Kurochkin's test harness HTTP server pipelining fix fot test 530
2008-01-25 05:07:04 +00:00
Yang Tse
1d49c04545
Detect, log and avoid storing a request with a negative size.
2007-10-26 00:36:36 +00:00
Patrick Monnerat
0678a51d3b
Allow test server to handle binary POSTs.
...
Tests 35, 544 545 added: binary data POSTs.
2007-10-25 19:40:05 +00:00
Yang Tse
54bcde0a14
also log error message string
2007-10-09 23:24:28 +00:00
Yang Tse
06be8bc389
On error, close "log/server.response"
2007-10-04 02:09:33 +00:00
Yang Tse
0ac5fd354b
If TCP_NODELAY is not defined we can't disable the Nagle algorithm
2007-10-03 23:38:07 +00:00
Daniel Stenberg
8d1239c091
Disable the Nagle algorithm and send back responses in small chunks in an
...
attempt to force smaller bits to get read by clients.
2007-10-02 10:13:37 +00:00
Yang Tse
f2cd2882a0
Oops missing var
2007-02-19 03:59:41 +00:00
Yang Tse
31e598d2f3
add debug messages for initialization failures
2007-02-19 02:03:58 +00:00
Yang Tse
4894ce16fc
use macros ERRNO, SET_ERRNO(), SOCKERRNO and SET_SOCKERRNO() for errno handling
2007-02-16 16:01:19 +00:00
Yang Tse
5a267c4312
compiler warning fix
2007-02-14 13:46:08 +00:00
Yang Tse
7033a1c072
enhance HTTP server request input writing,
...
retrying upon EINTR errors.
2007-02-14 00:28:01 +00:00
Daniel Stenberg
da58d03ff7
Venkat Akella found out that libcurl did not like HTTP responses that simply
...
responded with a single status line and no headers nor body. Starting now, a
HTTP response on a persistent connection (i.e not set to be closed after the
response has been taken care of) must have Content-Length or chunked
encoding set, or libcurl will simply assume that there is no body.
To my horror I learned that we had no less than 57(!) test cases that did bad
HTTP responses like this, and even the test http server (sws) responded badly
when queried by the test system if it is the test system. So although the
actual fix for the problem was tiny, going through all the newly failing test
cases got really painful and boring.
2006-11-25 13:32:04 +00:00
Daniel Stenberg
e264f699d4
Tor Arntsen spotted this mistake
2006-11-13 13:48:55 +00:00
Yang Tse
13e60c55a1
Avoid trying to compare more than strlen bytes.
2006-10-23 19:16:19 +00:00
Yang Tse
4ec9316155
Replace is*() macros with our own IS*() ones.
2006-10-23 19:14:54 +00:00
Yang Tse
e150150d9f
Remove redundant __CYGWIN__ symbol check
2006-10-11 16:01:16 +00:00
Yang Tse
5a6c89661a
Cygwin preprocessor adjustments
2006-09-12 01:17:16 +00:00
Daniel Stenberg
e3c15fc4b9
test 530 is the first ever HTTP pipelining test for libcurl
2006-09-08 11:56:56 +00:00
Yang Tse
ee3514ccdc
Replace exit() with return() in main()
2006-08-14 17:00:08 +00:00
Yang Tse
46c5e562bf
Abort if unable to write pid file.
2006-07-19 15:26:28 +00:00
Yang Tse
42f5a90d09
-Use curl_socket_t instead of int.
...
-Log errno in message if setsockopt() fails.
-Close listener socket on major errors.
2006-07-17 22:44:40 +00:00
Yang Tse
95aecc5dbb
Fix compiler warning: comparison between signed and unsigned
2006-07-12 09:03:48 +00:00
Yang Tse
8272874704
Place parenthesis surrounding macro parameters so that the use of sread and swrite is more intuitive.
2006-07-12 06:52:40 +00:00
Yang Tse
88a1a10e6f
Pay attention when typecasting an operation
2006-07-12 06:09:53 +00:00
Yang Tse
624e657210
sread now returns ssize_t
2006-07-12 05:54:06 +00:00
Yang Tse
58176d1484
Use platform's native types for recv() and send() arguments.
2006-07-12 05:19:00 +00:00
Daniel Stenberg
00312e95fe
removed variable declarations shadowing previously declared variables
2006-05-10 09:53:52 +00:00
Daniel Stenberg
e5babd086d
if configure found a fork(), sws supports --fork which is *NOT* used by the
...
ordinary test suite. Also removed the perror() calls and instead made the
logging output the errno code to ease error tracking using logs.
2006-04-10 13:11:52 +00:00
Gisle Vanem
f592ea6c30
Fix typo.
2006-02-25 18:57:20 +00:00
Daniel Stenberg
10beb36b1c
Ulf Hrnhammar fixed a format string (printf style) problem in the Negotiate
...
code. It should however not be the cause of any troubles. He also fixed a
few similar problems in the HTTP test server code.
2006-02-18 22:27:01 +00:00
Daniel Stenberg
bda1e9aeab
Made the copyright year match the latest modification's year.
2006-01-09 13:17:14 +00:00
Daniel Stenberg
687cf0235e
modified to hush compiler warnings
2006-01-03 12:18:22 +00:00
Daniel Stenberg
74a299fd08
1. sws now supports two new "commands" and 2. if built with
...
CURL_SWS_FORK_ENABLED defined it forks for each new connection and thus can
support any amount of connection clients (used for hiper tests and not for the
standard plain curl test suite)
2006-01-02 12:19:12 +00:00
Daniel Stenberg
9542dfdcdc
moved test2file() to util.c
2005-09-15 20:22:43 +00:00
Daniel Stenberg
b9c8de598b
Thanks to Scott Davis' detailed reports, I found this premature detection
...
of the end of a chunked-encoded POST request.
2005-09-07 10:51:37 +00:00
Daniel Stenberg
e22ac39da4
detabify
2005-08-18 08:47:56 +00:00
Daniel Stenberg
b749910e6c
include ctype.h for isdigit()
2005-05-19 09:55:53 +00:00
Daniel Stenberg
4a091bbd8a
Bug report #1204435 identified a problem with malformed URLs like
...
"http://somehost?data " as it added a slash too much in the request ("GET
/?data/"...). Added test case 260 to verify.
2005-05-18 20:01:01 +00:00
Daniel Stenberg
84fd4686e2
Moved more generic functions to util.[ch]
...
Added resolve.c to simply resolve a given host name
2005-05-17 10:22:22 +00:00
Daniel Stenberg
366b62af2d
always use the libcurl-provided *printf() functions
2005-05-01 12:56:09 +00:00
Daniel Stenberg
23da55a9f1
Moved common code to util.[ch] instead of having it duplicated in sws.c
...
and sockfilt.c. For good-to-have functions for the servers written in C.
2005-04-30 23:30:55 +00:00
Daniel Stenberg
3bcfe678ab
display listening port in log
2005-04-27 12:27:23 +00:00
Daniel Stenberg
ab4086bc24
Updated the copyright year since changes have been this year.
2005-03-31 07:02:02 +00:00
Daniel Stenberg
31443724c6
modified some log outputs, added comment about auth required as used in
...
test 154
2005-03-28 22:15:17 +00:00
Daniel Stenberg
dc28a9c0c1
make sure the ipv6 http server gets its pid stored in a separate file
2004-12-14 21:52:16 +00:00
Gisle Vanem
d02b2c4308
Fixed missing braces warning.
2004-12-13 11:31:01 +00:00
Gisle Vanem
22a0c57746
Missing 'in6addr_any' in MingW's lib. ld bug?
2004-12-12 20:14:25 +00:00
Daniel Stenberg
9b3b7ad22e
HTTP IPv6 support added to the test suite
2004-12-11 21:41:00 +00:00
Daniel Stenberg
18f14ae23d
close the connection when a bad test number was requested
2004-12-09 09:58:25 +00:00
Daniel Stenberg
d6c155ff47
added comment about port number in CONNECT string being used as test number
2004-12-02 17:11:09 +00:00
Daniel Stenberg
0eb8414750
Enable test cases to provide sections base64-encoded to be able to test
...
with binary data.
2004-11-29 12:10:09 +00:00
Daniel Stenberg
a6d4d3eeac
use curlx_strnequal() from the private lib sources instead of strncasecmp()
...
for maximum portability
2004-10-07 22:57:24 +00:00
Daniel Stenberg
2a701a1aac
modified some logging output
2004-06-22 06:44:14 +00:00
Daniel Stenberg
67341c4cbe
when the client disconnects prematurely, dump the request as received thus
...
far
2004-06-21 14:00:11 +00:00
Daniel Stenberg
0a83fa90bb
skip the pid from the logging
2004-06-15 10:28:56 +00:00
Daniel Stenberg
da6eea9b38
delete trailing whitespace
2004-05-28 09:52:15 +00:00
Daniel Stenberg
0aa7d11cc9
%ld for long
2004-05-06 13:21:32 +00:00
Daniel Stenberg
933f7cecae
int/long fix
2004-05-06 12:44:08 +00:00
Daniel Stenberg
15f9a93c25
include the full size of the sent response in the log
2004-04-30 05:51:37 +00:00
Daniel Stenberg
e373f1fd73
log the WAIT command
2004-04-21 06:56:54 +00:00
Daniel Stenberg
25e98179be
Gisle Vanem: patches to make sws.c compile under MingW/MSVC is
...
attached. And some cosmetic fixes.
2004-04-17 11:38:41 +00:00
Daniel Stenberg
bc11929395
remade the logging function to better deal with removed logfiles during
...
the execution of the tests
2004-04-16 07:01:47 +00:00
Daniel Stenberg
2ff9f55001
Added "swsbounce" magic: if this keyword is present in a <data> section it
...
sets the "swsbounce" magic mode. If there follows a request for the SAME
test number and the SAME part number, this mode will make the server bump
the part number internally and thus return a different <dataNUM> section
than it otherwise would.
Test case 153 uses this in case you need an example. It is pretty involved
and hard-to-use, but then the situation is pretty special over all. Enjoy.
2004-03-31 11:50:44 +00:00
Daniel Stenberg
0fd88d7c8f
minor variable type cleanups
2004-03-23 08:50:28 +00:00
Daniel Stenberg
8cbfe5d24a
Andrs Garca-fix to make it build with mingw
2004-03-09 08:38:25 +00:00
Daniel Stenberg
2cd6403011
Major rewrite of the test HTTP server to allow more fancy features to make
...
better tests with the issue12-patch applied.
This change also includes Andrs Garca's win32-fixes.
Made the logging look better/more readable in sws.log
2004-03-05 08:32:11 +00:00
Daniel Stenberg
236337ce86
fix protos to prevent warnings
2004-02-20 07:19:18 +00:00
Daniel Stenberg
372b141d5b
make the path const
2004-02-13 07:05:15 +00:00
Daniel Stenberg
49ab1d914c
provide a source path to the servers to make them find the tests when run
...
outside the source dir, not needing any symlinks
2004-02-12 14:40:08 +00:00
Daniel Stenberg
f385b1976e
when we receive a request overflow, we still dump the incoming request to
...
the dump file to make it easier to understand and debug the situation
2004-01-30 09:27:27 +00:00
Daniel Stenberg
053f6c85ef
updated year in the copyright string
2004-01-07 09:19:33 +00:00
Daniel Stenberg
2f9f843e8a
new way to trick sws to return special data on CONNECT
2003-11-24 16:12:41 +00:00
Daniel Stenberg
41535eaea9
only use siginterrupt() if it really exists on the platform
2003-10-30 07:32:04 +00:00
Daniel Stenberg
c29740f0d8
portability fix by using setup.h from the lib directory
2003-10-09 08:12:43 +00:00
Daniel Stenberg
20943292ff
make the NTLM part numbers get increased instead of plainly assigned, as
...
this then makes redirection tests work (as the new test 89)
2003-09-15 21:42:46 +00:00
Daniel Stenberg
5ef6520d4e
fixed the CONNECT thing again
2003-07-19 23:54:15 +00:00
Daniel Stenberg
2c1925161e
If the data contents contains the word 'swsclose', then this server will
...
disconnect the client after the response have been sent. This also happens
if the respons is zero byte long.
In all other cases (unless an error happens), it will now maintain the
connection to allow proper persistant connection testing. This was required
for the NTLM testing to work so I finally had to fix this. Of course most of
the existing HTTP tests will be adjusted to work with this new rule of test
file syntax for HTTP tests.
Also fixed the log function to deal with varargs for better logging.
2003-07-19 23:44:22 +00:00
Daniel Stenberg
7968e3c2de
David Byron's patch that allows a client to make the server quit with a
...
magic url.
2003-07-01 15:21:42 +00:00
Daniel Stenberg
fb6a51b8fd
basic NTLM support
2003-06-11 13:44:31 +00:00
Daniel Stenberg
0102726aeb
Digest support added
2003-05-22 22:36:39 +00:00
Daniel Stenberg
df7bbcfd21
Added log output for when the writing of the input HTTP request is successful
...
or unsuccessful. Used to track down the recent cygwin test suite problems.
2003-04-03 13:43:15 +00:00
Daniel Stenberg
9b43ade1c0
typecase getpid() to int to prevent compiler warning
2003-03-16 10:46:52 +00:00
Daniel Stenberg
0251563c98
report pid back in the WE ROOLZ message
2003-03-15 16:39:15 +00:00
Daniel Stenberg
72673a351b
removed the "banner" when the server is starting
2003-03-15 16:05:47 +00:00
Daniel Stenberg
dcc2f16416
Rick Jones' minor thing to build better on HPUX 11
2003-03-15 14:47:09 +00:00
Daniel Stenberg
065b87e949
7.10.4-pre2 commit
2003-02-24 18:14:48 +00:00
Daniel Stenberg
f26a338a54
copyright year update in the source header
2003-01-16 21:08:12 +00:00
Daniel Stenberg
da5ae565ab
added support for CONNECT, both good and bad
2002-12-13 16:20:07 +00:00
Daniel Stenberg
ec7bccf671
more logging, now logs the full response too, basic support for dealing
...
with chunked transfer-encoding uploads added
2002-12-10 12:59:16 +00:00
Daniel Stenberg
12cfb4f7ee
this fix seems to make the '305 306' test case combination to run ok finally!
2002-11-22 13:48:24 +00:00
Daniel Stenberg
ba4e69bebc
updated source code boilerplate/header
2002-09-03 11:52:59 +00:00
Daniel Stenberg
3d0969d1d1
Added source header and made it clear that this code was originally donated
...
to us by Juergen Wilke.
2002-05-21 08:22:00 +00:00
Daniel Stenberg
0c00eb93a0
removed compiler warnings
2002-05-17 08:15:33 +00:00
Daniel Stenberg
044755b30f
handles much larger POSTs, replaced snprintf() with sprintf() since this
...
needs to be more portable and in the test server we can skip the extra
safety
2002-04-26 07:48:05 +00:00
Daniel Stenberg
ad3cef0fc8
Ralph Mitchell's minor #include patch to prevent some warnings
2002-03-06 09:40:06 +00:00
Daniel Stenberg
d9f307623c
use the former logfile name again since the ftp server also uses that...
2002-02-25 12:14:24 +00:00
Daniel Stenberg
71bb2d0b8b
reply/postcmd support for "wait"
2002-02-25 11:11:03 +00:00
Daniel Stenberg
2e9a798f09
create the pidfile and store the pid on invoke
2002-02-25 10:27:29 +00:00
Daniel Stenberg
d86f9611b3
support HUGE requests too
2002-02-25 09:42:58 +00:00
Daniel Stenberg
417c8fb602
16 tests OK
2002-02-22 15:40:17 +00:00
Daniel Stenberg
41dd5121f0
adjusted to work on test case 11 better
2002-02-22 13:54:06 +00:00
Daniel Stenberg
7d043f46d5
hide debug output from screen, use log/ for logfiles
2002-02-22 10:40:05 +00:00
Daniel Stenberg
485edb777f
a minor step forwards
2002-02-19 01:04:46 +00:00
Daniel Stenberg
a782c96e81
no .. in path
2002-02-19 00:26:25 +00:00
Daniel Stenberg
83f35463f5
added note about persistancy in the server
2002-02-07 12:52:04 +00:00
Daniel Stenberg
818cdb879e
POSTs seems to work somewhat now
2002-02-07 12:42:59 +00:00