}
if($any_test) {
- print "\nstatic const struct entry_s s_entries[] = {\n$tlist};\n";
+ print "\nconst struct entry_s s_entries[] = {\n$tlist {NULL, NULL}\n};\n";
print "\n#include \"first.c\"\n";
}
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "first.h"
int main(int argc, char **argv)
{
entry_name = argv[1];
entry_func = NULL;
- for(tmp = 0; tmp < CURL_ARRAYSIZE(s_entries); ++tmp) {
+ for(tmp = 0; s_entries[tmp].ptr; ++tmp) {
if(strcmp(entry_name, s_entries[tmp].name) == 0) {
entry_func = s_entries[tmp].ptr;
break;
entry_func_t ptr;
};
+extern const struct entry_s s_entries[];
+
#include <curl/curl.h>
#include "curlx.h"
***************************************************************************/
/* This is based on the PoC client of issue #11982
*/
+#include "first.h"
+
#include <assert.h>
static void usage_h2_pausing(const char *msg)
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "first.h"
static int my_trace(CURL *handle, curl_infotype type,
char *data, size_t size, void *userp)
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "first.h"
static size_t write_h2ue_cb(char *ptr, size_t size, size_t nmemb, void *opaque)
{
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "first.h"
static int verbose_d = 1;
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "first.h"
static int verbose_u = 1;
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "first.h"
static size_t write_tse_cb(char *ptr, size_t size, size_t nmemb, void *opaque)
{
***************************************************************************/
/* This is based on the PoC client of issue #11769
*/
+#include "first.h"
+
static size_t total_read = 0;
static size_t read_callback(char *ptr, size_t size, size_t nmemb,
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "first.h"
+
#ifndef CURL_DISABLE_WEBSOCKETS
static CURLcode check_recv(const struct curl_ws_frame *frame,
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "first.h"
+
#ifndef CURL_DISABLE_WEBSOCKETS
static CURLcode ping(CURL *curl, const char *send_payload)
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "first.h"
+
#ifdef HAVE_LOCALE_H
# include <locale.h> /* for setlocale() */
#endif
entry_name = argv[1];
entry_func = NULL;
- for(tmp = 0; tmp < CURL_ARRAYSIZE(s_entries); ++tmp) {
+ for(tmp = 0; s_entries[tmp].ptr; ++tmp) {
if(strcmp(entry_name, s_entries[tmp].name) == 0) {
entry_func = s_entries[tmp].ptr;
break;
entry_func_t ptr;
};
+extern const struct entry_s s_entries[];
+
#include "curlx.h"
#endif /* HEADER_LIBTEST_FIRST_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
/*
Check range/resume returned error codes and data presence.
char buffer[] = "test buffer";
rc = curl_formadd(&post, &last, CURLFORM_COPYNAME, "name",
- CURLFORM_COPYCONTENTS, "content", CURLFORM_END);
+ CURLFORM_COPYCONTENTS, "content", CURLFORM_END);
fail_unless(rc == 0, "curl_formadd returned error");
/* after the first curl_formadd when there's a single entry, both pointers
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include <fcntl.h>
* leak in the CURLOPT_RESOLVE handling with the multi interface.
*/
-#include "test.h"
+#include "first.h"
#include <limits.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "timediff.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* easy transfer finds and uses the populated stuff.
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* of 42 (CURLE_ABORTED_BY_CALLBACK).
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* size is unknown.
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* (test1515) nor a dead connection is detected (test1616).
*/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
#include "testutil.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
/* test case and code based on https://github.com/curl/curl/issues/2847 */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
/* test case and code based on https://github.com/curl/curl/issues/3927 */
* from server http header
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* from server http header
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* for server and proxy
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "timediff.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* because this implies that the data has been sent completely to the server.
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
#include "testutil.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* first connection and open a second.
*/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "testtrace.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
static CURLcode test_lib1545(char *URL)
{
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "testtrace.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* Verify that some API functions are locked from being called inside callback
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* that this test will assume to be present!
*/
-#include "test.h"
+#include "first.h"
#if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN) || defined(USE_APPLE_IDN)
#define USE_IDN
#endif
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* from server http header
*/
-#include "test.h"
+#include "first.h"
#include <stdio.h>
the default TEST_HANG_TIMEOUT to avoid issues when running on overloaded
CI machines. */
-#include "test.h"
+#include "first.h"
#include "testutil.h"
/* Test suppressing the If-Modified-Since header */
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
/* Testing Retry-After header parser */
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
/* Testing CURLOPT_PROTOCOLS_STR */
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* from server http header
*/
-#include "test.h"
+#include "first.h"
#include <stdio.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
struct t1662_WriteThis {
size_t sizeleft;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "timediff.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "timediff.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
#include "testutil.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
typedef struct
{
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifdef HAVE_INET_PTON
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* argv3 = second auth type
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include <limits.h>
#include <assert.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
typedef struct prcs {
int prereq_retcode;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifndef CURL_DISABLE_WEBSOCKETS
#if 0
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifndef CURL_DISABLE_WEBSOCKETS
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifndef CURL_DISABLE_WEBSOCKETS
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* successfully.
*/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
#include "testutil.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include <string.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include <fcntl.h>
* with HTTP.
*/
-#include "test.h"
+#include "first.h"
#include <fcntl.h>
* aborted correctly.
*/
-#include "test.h"
+#include "first.h"
#include <fcntl.h>
***************************************************************************/
/* used for test case 533, 534, 535 and 546 */
-#include "test.h"
+#include "first.h"
#include <fcntl.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* argv4 = host name to use for the custom Host: header
*/
-#include "test.h"
+#include "first.h"
#include <limits.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
***************************************************************************/
/* Based on Alex Fishman's bug report on September 30, 2007 */
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* argv3 = proxyuser:password
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* argv3 = non-zero means ASCII transfer
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* argv2 = proxy with embedded user+password
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* bug report #1871269, fixed on Jan 14 2008 before the 7.18.0 release.
*/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* argv3 = proxyuser:password
*/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* curl_m*printf formatting capabilities and handling of some data types.
*/
-#include "test.h"
+#include "first.h"
#include <limits.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include <fcntl.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testtrace.h"
#include "testutil.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include <fcntl.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include <fcntl.h>
* https://curl.se/mail/lib-2011-03/0066.html
*/
-#include "test.h"
+#include "first.h"
#include <sys/stat.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
/*
Based on a bug report recipe by Rene Bernhardt in
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
/* lib591 is used for test cases 591, 592, 593 and 594 */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include <limits.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "warnless.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include <time.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "memdebug.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "testutil.h"
#include "testtrace.h"
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
+
#include "curl_memory.h"
#ifndef CURL_STATICLIB
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
+#include "first.h"
#include "memdebug.h"
#include <limits.h>
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "test.h"
-#include "testutil.h"
#include "testtrace.h"
+#include "testutil.h"
+
#include "memdebug.h"
struct libtest_trace_cfg libtest_debug_config;
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "test.h"
struct libtest_trace_cfg {
int tracetime; /* 0 represents FALSE, anything else TRUE */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "curl_setup.h"
-#include <curl/curl.h>
#include "testutil.h"
+
#include "memdebug.h"
#ifdef _WIN32
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "curl_setup.h"
+#include "test.h"
struct timeval tutil_tvnow(void);
FIRSTFILES = first.c first.h
# Common files used by test programs
-UTILS = getpart.c getpart.h util.c
+UTILS = getpart.c util.c
CURLX_CFILES = \
../../lib/curlx/base64.c \
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
-#include "curl_setup.h"
-
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#ifndef UNDER_CE
-#include <signal.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#include <ctype.h>
-
-#include <curlx.h> /* from the private lib dir */
-#include "getpart.h"
+#include "first.h"
static int dnsd_wrotepidfile = 0;
static int dnsd_wroteportfile = 0;
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "first.h"
+
#include <stdio.h>
#include <string.h>
entry_name = argv[1];
entry_func = NULL;
- for(tmp = 0; tmp < CURL_ARRAYSIZE(s_entries); ++tmp) {
+ for(tmp = 0; s_entries[tmp].ptr; ++tmp) {
if(strcmp(entry_name, s_entries[tmp].name) == 0) {
entry_func = s_entries[tmp].ptr;
break;
* SPDX-License-Identifier: curl
*
***************************************************************************/
+#include "curl_setup.h"
+
typedef int (*entry_func_t)(int, char **);
struct entry_s {
entry_func_t ptr;
};
+extern const struct entry_s s_entries[];
+
+#ifndef UNDER_CE
+#include <signal.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN6_H
+#include <netinet/in6.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#include <curlx.h> /* from the private lib dir */
+
+/* adjust for old MSVC */
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
+# define snprintf _snprintf
+#endif
+
+#ifdef _WIN32
+# define CURL_STRNICMP(p1, p2, n) _strnicmp(p1, p2, n)
+#elif defined(HAVE_STRCASECMP)
+# ifdef HAVE_STRINGS_H
+# include <strings.h>
+# endif
+# define CURL_STRNICMP(p1, p2, n) strncasecmp(p1, p2, n)
+#elif defined(HAVE_STRCMPI)
+# define CURL_STRNICMP(p1, p2, n) strncmpi(p1, p2, n)
+#elif defined(HAVE_STRICMP)
+# define CURL_STRNICMP(p1, p2, n) strnicmp(p1, p2, n)
+#else
+# error "missing case insensitive comparison function"
+#endif
+
+enum {
+ DOCNUMBER_NOTHING = -7,
+ DOCNUMBER_QUIT = -6,
+ DOCNUMBER_BADCONNECT = -5,
+ DOCNUMBER_INTERNAL = -4,
+ DOCNUMBER_CONNECT = -3,
+ DOCNUMBER_WERULEZ = -2,
+ DOCNUMBER_404 = -1
+};
+
+#include <curl/curl.h> /* for curl_socket_t */
+
+#ifdef USE_UNIX_SOCKETS
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h> /* for sockaddr_un */
+#endif
+#endif /* USE_UNIX_SOCKETS */
+
+typedef union {
+ struct sockaddr sa;
+ struct sockaddr_in sa4;
+#ifdef USE_IPV6
+ struct sockaddr_in6 sa6;
+#endif
+#ifdef USE_UNIX_SOCKETS
+ struct sockaddr_un sau;
+#endif
+} srvr_sockaddr_union_t;
+
+/* getpart */
+#define GPE_NO_BUFFER_SPACE -2
+#define GPE_OUT_OF_MEMORY -1
+#define GPE_OK 0
+#define GPE_END_OF_FILE 1
+
+extern int getpart(char **outbuf, size_t *outlen,
+ const char *main, const char *sub, FILE *stream);
+
+/* utility functions */
+extern char *data_to_hex(char *data, size_t len);
+extern void logmsg(const char *msg, ...);
+extern void loghex(unsigned char *buffer, ssize_t len);
+extern unsigned char byteval(char *value);
+extern int win32_init(void);
+extern const char *sstrerror(int err);
+extern FILE *test2fopen(long testno, const char *logdir2);
+extern curl_off_t our_getpid(void);
+extern int write_pidfile(const char *filename);
+extern int write_portfile(const char *filename, int port);
+extern void set_advisor_read_lock(const char *filename);
+extern void clear_advisor_read_lock(const char *filename);
+static volatile int got_exit_signal = 0;
+static volatile int exit_signal = 0;
+#ifdef _WIN32
+static HANDLE exit_event = NULL;
+#endif
+extern void install_signal_handlers(bool keep_sigalrm);
+extern void restore_signal_handlers(bool keep_sigalrm);
+#ifdef USE_UNIX_SOCKETS
+extern int bind_unix_socket(curl_socket_t sock, const char *unix_socket,
+ struct sockaddr_un *sau);
+#endif
+extern unsigned short util_ultous(unsigned long ulnum);
+
+/* global variables */
+static const char *srcpath = "."; /* pointing to the test dir */
+static const char *pidname = NULL;
+static const char *portname = NULL; /* none by default */
+static const char *serverlogfile = NULL;
+static int serverlogslocked;
+static const char *configfile = NULL;
+static const char *logdir = "log";
+static char loglockfile[256];
+#ifdef USE_IPV6
+static bool use_ipv6 = FALSE;
+#endif
+static const char *ipv_inuse = "IPv4";
+static unsigned short server_port = 0;
+static const char *socket_type = "IPv4";
+static int socket_domain = AF_INET;
+
+#define SERVERLOGS_LOCKDIR "lock" /* within logdir */
+
#endif /* HEADER_SERVER_FIRST_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "curl_setup.h"
-
-#include "getpart.h"
-#include <curlx.h> /* from the private lib dir */
-#include "curl_memory.h"
+#include "first.h"
#define EAT_SPACE(p) while(*(p) && ISSPACE(*(p))) (p)++
#define system_strdup strdup
#endif
+#include "curl_memory.h"
+
#if defined(_MSC_VER) && defined(_DLL)
# pragma warning(push)
# pragma warning(disable:4232) /* MSVC extension, dllimport identity */
* GPE_OUT_OF_MEMORY
* GPE_OK
*/
-static int getpart(char **outbuf, size_t *outlen,
- const char *main, const char *sub, FILE *stream)
+int getpart(char **outbuf, size_t *outlen,
+ const char *main, const char *sub, FILE *stream)
{
# define MAX_TAG_LEN 200
char couter[MAX_TAG_LEN + 1]; /* current outermost section */
+++ /dev/null
-#ifndef HEADER_CURL_SERVER_GETPART_H
-#define HEADER_CURL_SERVER_GETPART_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at https://curl.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * SPDX-License-Identifier: curl
- *
- ***************************************************************************/
-#include "curl_setup.h"
-
-#include "strdup.h"
-
-#define GPE_NO_BUFFER_SPACE -2
-#define GPE_OUT_OF_MEMORY -1
-#define GPE_OK 0
-#define GPE_END_OF_FILE 1
-
-static int getpart(char **outbuf, size_t *outlen,
- const char *main, const char *sub, FILE *stream);
-
-#endif /* HEADER_CURL_SERVER_GETPART_H */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "curl_setup.h"
+#include "first.h"
+
#include <stdlib.h>
#include <string.h>
/* based on sockfilt.c */
-#ifndef UNDER_CE
-#include <signal.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_NETINET_IN6_H
-#include <netinet/in6.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#include <curlx.h> /* from the private lib dir */
-#include "getpart.h"
-
#define MQTT_MSG_CONNECT 0x10
#define MQTT_MSG_CONNACK 0x20
#define MQTT_MSG_PUBLISH 0x30
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "curl_setup.h"
+#include "first.h"
/* Purpose
*
*
*/
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef _XOPEN_SOURCE_EXTENDED
-/* This define is "almost" required to build on HP-UX 11 */
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
static int test_resolve(int argc, char *argv[])
{
int arg = 1;
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "curl_setup.h"
+#include "first.h"
/*
* curl's test suite Real Time Streaming Protocol (RTSP) server.
* This source file was started based on curl's HTTP test suite server.
*/
-#ifndef UNDER_CE
-#include <signal.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_NETINET_IN6_H
-#include <netinet/in6.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
#ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h> /* for TCP_NODELAY */
#endif
-#include <curlx.h> /* from the private lib dir */
-#include "getpart.h"
-
#undef REQBUFSIZ
#define REQBUFSIZ 150000
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "curl_setup.h"
+#include "first.h"
/* Purpose
*
* it!
*/
-#ifndef UNDER_CE
-#include <signal.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_NETINET_IN6_H
-#include <netinet/in6.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#include <curlx.h> /* from the private lib dir */
/* buffer is this excessively large only to be able to support things like
test 1003 which tests exceedingly large server response lines */
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "curl_setup.h"
+#include "first.h"
+
#include <stdlib.h>
/* Function
/* based on sockfilt.c */
-#ifndef UNDER_CE
-#include <signal.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_NETINET_IN6_H
-#include <netinet/in6.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#include <curlx.h> /* from the private lib dir */
-
static const char *backendaddr = "127.0.0.1";
static unsigned short backendport = 0; /* default is use client's */
#endif /* USE_IPV6 */
#ifdef USE_UNIX_SOCKETS
case AF_UNIX:
- rc = bind_unix_socket(sock, unix_socket, &listener.sau);
+ rc = bind_unix_socket(sock, unix_socket, &listener.sau);
#endif
}
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "curl_setup.h"
+#include "first.h"
/* sws.c: simple (silly?) web server
*/
-#ifndef UNDER_CE
-#include <signal.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_NETINET_IN6_H
-#include <netinet/in6.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
#ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h> /* for TCP_NODELAY */
#endif
-#include <curlx.h> /* from the private lib dir */
-#include "getpart.h"
-
static bool use_gopher = FALSE;
static bool is_proxy = FALSE;
*
* SPDX-License-Identifier: BSD-4-Clause-UC
*/
-
-#include "curl_setup.h"
+#include "first.h"
#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-#ifndef UNDER_CE
-#include <signal.h>
+#include <sys/ioctl.h> /* for ioctl() */
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
#ifdef HAVE_SYS_FILIO_H
#include <sys/filio.h> /* FIONREAD on Solaris 7 */
#endif
#include <ctype.h>
-#include <curlx.h> /* from the private lib dir */
-#include "getpart.h"
-
/*****************************************************************************
* This is a rewrite/clone of the arpa/tftp.h file for systems without it. *
*****************************************************************************/
#define TFTP_EBADID 5
#define TFTP_EEXISTS 6
#define TFTP_ENOUSER 7
-/****************************************************************************/
/*****************************************************************************
* STRUCT DECLARATIONS AND DEFINES *
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include "curl_setup.h"
+#include "first.h"
-#ifndef UNDER_CE
-#include <signal.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_NETINET_IN6_H
-#include <netinet/in6.h>
-#endif
-#ifdef _XOPEN_SOURCE_EXTENDED
-/* This define is "almost" required to build on HP-UX 11 */
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#include <curlx.h> /* from the private lib dir */
-
-/* adjust for old MSVC */
-#if defined(_MSC_VER) && (_MSC_VER < 1900)
-# define snprintf _snprintf
-#endif
-
-#ifdef _WIN32
-# define CURL_STRNICMP(p1, p2, n) _strnicmp(p1, p2, n)
-#elif defined(HAVE_STRCASECMP)
-# ifdef HAVE_STRINGS_H
-# include <strings.h>
-# endif
-# define CURL_STRNICMP(p1, p2, n) strncasecmp(p1, p2, n)
-#elif defined(HAVE_STRCMPI)
-# define CURL_STRNICMP(p1, p2, n) strncmpi(p1, p2, n)
-#elif defined(HAVE_STRICMP)
-# define CURL_STRNICMP(p1, p2, n) strnicmp(p1, p2, n)
-#else
-# error "missing case insensitive comparison function"
-#endif
-
-enum {
- DOCNUMBER_NOTHING = -7,
- DOCNUMBER_QUIT = -6,
- DOCNUMBER_BADCONNECT = -5,
- DOCNUMBER_INTERNAL = -4,
- DOCNUMBER_CONNECT = -3,
- DOCNUMBER_WERULEZ = -2,
- DOCNUMBER_404 = -1
-};
-
-#define SERVERLOGS_LOCKDIR "lock" /* within logdir */
-
-#include "timeval.h"
-
-#include <curl/curl.h> /* for curl_socket_t */
-
-#ifdef USE_UNIX_SOCKETS
-#ifdef HAVE_SYS_UN_H
-#include <sys/un.h> /* for sockaddr_un */
-#endif
-#endif /* USE_UNIX_SOCKETS */
-
-typedef union {
- struct sockaddr sa;
- struct sockaddr_in sa4;
-#ifdef USE_IPV6
- struct sockaddr_in6 sa6;
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
#endif
-#ifdef USE_UNIX_SOCKETS
- struct sockaddr_un sau;
-#endif
-} srvr_sockaddr_union_t;
-
-/* global variables */
-static const char *srcpath = "."; /* pointing to the test dir */
-static const char *pidname = NULL;
-static const char *portname = NULL; /* none by default */
-static const char *serverlogfile = NULL;
-static int serverlogslocked;
-static const char *configfile = NULL;
-static const char *logdir = "log";
-static char loglockfile[256];
-#ifdef USE_IPV6
-static bool use_ipv6 = FALSE;
-#endif
-static const char *ipv_inuse = "IPv4";
-static unsigned short server_port = 0;
-static const char *socket_type = "IPv4";
-static int socket_domain = AF_INET;
/* This function returns a pointer to STATIC memory. It converts the given
* binary lump to a hex formatted string usable for output in logs or
* whatever.
*/
-static char *data_to_hex(char *data, size_t len)
+char *data_to_hex(char *data, size_t len)
{
static char buf[256*3];
size_t i;
return buf;
}
-static void logmsg(const char *msg, ...)
+void loghex(unsigned char *buffer, ssize_t len)
+{
+ char data[12000];
+ ssize_t i;
+ unsigned char *ptr = buffer;
+ char *optr = data;
+ ssize_t width = 0;
+ int left = sizeof(data);
+
+ for(i = 0; i < len && (left >= 0); i++) {
+ snprintf(optr, left, "%02x", ptr[i]);
+ width += 2;
+ optr += 2;
+ left -= 2;
+ }
+ if(width)
+ logmsg("'%s'", data);
+}
+
+void logmsg(const char *msg, ...)
{
va_list ap;
char buffer[2048 + 1];
}
}
-static void loghex(unsigned char *buffer, ssize_t len)
-{
- char data[12000];
- ssize_t i;
- unsigned char *ptr = buffer;
- char *optr = data;
- ssize_t width = 0;
- int left = sizeof(data);
-
- for(i = 0; i < len && (left >= 0); i++) {
- snprintf(optr, left, "%02x", ptr[i]);
- width += 2;
- optr += 2;
- left -= 2;
- }
- if(width)
- logmsg("'%s'", data);
-}
-
-static unsigned char byteval(char *value)
+unsigned char byteval(char *value)
{
unsigned long num = strtoul(value, NULL, 10);
return num & 0xff;
_flushall();
}
-static int win32_init(void)
+int win32_init(void)
{
curlx_now_init();
#ifdef USE_WINSOCK
}
/* socket-safe strerror (works on Winsock errors, too) */
-static const char *sstrerror(int err)
+const char *sstrerror(int err)
{
static char buf[512];
return curlx_winapi_strerror(err, buf, sizeof(buf));
#endif /* _WIN32 */
/* fopens the test case file */
-static FILE *test2fopen(long testno, const char *logdir2)
+FILE *test2fopen(long testno, const char *logdir2)
{
FILE *stream;
char filename[256];
#define t_getpid() getpid()
#endif
-static curl_off_t our_getpid(void)
+curl_off_t our_getpid(void)
{
curl_off_t pid = (curl_off_t)t_getpid();
#ifdef _WIN32
return pid;
}
-static int write_pidfile(const char *filename)
+int write_pidfile(const char *filename)
{
FILE *pidfile;
curl_off_t pid;
}
/* store the used port number in a file */
-static int write_portfile(const char *filename, int port)
+int write_portfile(const char *filename, int port)
{
FILE *portfile = fopen(filename, "wb");
if(!portfile) {
return 1; /* success */
}
-static void set_advisor_read_lock(const char *filename)
+void set_advisor_read_lock(const char *filename)
{
FILE *lockfile;
int error = 0;
filename, errno, strerror(errno));
}
-static void clear_advisor_read_lock(const char *filename)
+void clear_advisor_read_lock(const char *filename)
{
int error = 0;
int res;
static HWND hidden_main_window = NULL;
#endif
-/* global variable which if set indicates that the program should finish */
-static volatile int got_exit_signal = 0;
-
-/* global variable which if set indicates the first signal handled in
- exit_signal_handler */
-static volatile int exit_signal = 0;
-
-#ifdef _WIN32
-/* global event which if set indicates that the program should finish */
-static HANDLE exit_event = NULL;
-#endif
-
/* signal handler that will be triggered to indicate that the program
* should finish its execution in a controlled manner as soon as possible.
* The first time this is called it will set got_exit_signal to one and
}
#endif
-static void install_signal_handlers(bool keep_sigalrm)
+void install_signal_handlers(bool keep_sigalrm)
{
#ifdef _WIN32
/* setup Windows exit event before any signal can trigger */
#endif
}
-static void restore_signal_handlers(bool keep_sigalrm)
+void restore_signal_handlers(bool keep_sigalrm)
{
#ifdef SIGHUP
if(SIG_ERR != old_sighup_handler)
#ifdef USE_UNIX_SOCKETS
-static int bind_unix_socket(curl_socket_t sock, const char *unix_socket,
- struct sockaddr_un *sau)
+int bind_unix_socket(curl_socket_t sock, const char *unix_socket,
+ struct sockaddr_un *sau)
{
int error;
int rc;
#define CURL_MASK_USHORT ((unsigned short)~0)
#define CURL_MASK_SSHORT (CURL_MASK_USHORT >> 1)
-static unsigned short util_ultous(unsigned long ulnum)
+unsigned short util_ultous(unsigned long ulnum)
{
#ifdef __INTEL_COMPILER
# pragma warning(push)