4 /* provide a proto for this debug function */
5 extern void curl_memdebug(const char *);
6 extern void curl_memlimit(int);
9 /* test is provided in the test code file */
12 int select_test (int num_fds, fd_set *rd, fd_set *wr, fd_set *exc,
15 #if defined(WIN32) && !defined(__CYGWIN__)
16 /* Winsock doesn't like no socket set in 'rd', 'wr' or 'exc'. This is
17 * case when 'num_fds <= 0. So sleep.
20 Sleep(1000*tv->tv_sec + tv->tv_usec/1000);
24 return select(num_fds, rd, wr, exc, tv);
29 int main(int argc, char **argv)
34 /* this sends all memory debug messages to a logfile named memdump */
35 char *env = curl_getenv("CURL_MEMDEBUG");
37 /* use the value as file name */
38 char *s = strdup(env);
42 /* this weird strdup() and stuff here is to make the curl_free() get
43 called before the memdebug() as otherwise the memdebug tracing will
44 with tracing a free() without an alloc! */
46 /* this enables the fail-on-alloc-number-N functionality */
47 env = curl_getenv("CURL_MEMLIMIT");
49 curl_memlimit(atoi(env));
54 fprintf(stderr, "Pass URL as argument please\n");
60 URL = argv[1]; /* provide this to the rest */
62 fprintf(stderr, "URL: %s\n", URL);