1 /*****************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
13 #include <locale.h> /* for setlocale() */
17 # define MEMDEBUG_NODEFINES
18 # include "memdebug.h"
21 int select_test (int num_fds, fd_set *rd, fd_set *wr, fd_set *exc,
25 /* Winsock doesn't like no socket set in 'rd', 'wr' or 'exc'. This is
26 * case when 'num_fds <= 0. So sleep.
29 Sleep(1000*tv->tv_sec + tv->tv_usec/1000);
33 return select(num_fds, rd, wr, exc, tv);
36 char *libtest_arg2=NULL;
37 char *libtest_arg3=NULL;
42 int main(int argc, char **argv)
47 /* this sends all memory debug messages to a logfile named memdump */
48 char *env = curl_getenv("CURL_MEMDEBUG");
50 /* use the value as file name */
51 char *s = strdup(env);
55 /* this weird strdup() and stuff here is to make the curl_free() get
56 called before the memdebug() as otherwise the memdebug tracing will
57 with tracing a free() without an alloc! */
59 /* this enables the fail-on-alloc-number-N functionality */
60 env = curl_getenv("CURL_MEMLIMIT");
63 long num = strtol(env, &endptr, 10);
64 if((endptr != env) && (endptr == env + strlen(env)) && (num > 0))
71 * Setup proper locale from environment. This is needed to enable locale-
72 * specific behaviour by the C library in order to test for undesired side
73 * effects that could cause in libcurl.
76 setlocale(LC_ALL, "");
80 fprintf(stderr, "Pass URL as argument please\n");
93 URL = argv[1]; /* provide this to the rest */
95 fprintf(stderr, "URL: %s\n", URL);