1 /***************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at http://curl.haxx.se/docs/copyright.html.
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ***************************************************************************/
22 /* used for test case 533, 534 and 535 */
32 #define TEST_HANG_TIMEOUT 60 * 1000
44 global_init(CURL_GLOBAL_ALL);
48 easy_setopt(curl, CURLOPT_URL, URL);
49 easy_setopt(curl, CURLOPT_VERBOSE, 1L);
50 easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
54 multi_add_handle(m, curl);
56 fprintf(stderr, "Start at URL 0\n");
59 struct timeval interval;
66 multi_perform(m, &running);
68 abort_on_test_timeout();
72 fprintf(stderr, "Advancing to URL 1\n");
73 /* remove the handle we use */
74 curl_multi_remove_handle(m, curl);
76 /* make us re-use the same handle all the time, and try resetting
77 the handle first too */
78 curl_easy_reset(curl);
79 easy_setopt(curl, CURLOPT_URL, libtest_arg2);
80 easy_setopt(curl, CURLOPT_VERBOSE, 1L);
81 easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
84 multi_add_handle(m, curl);
94 multi_fdset(m, &rd, &wr, &exc, &maxfd);
96 /* At this point, maxfd is guaranteed to be greater or equal than -1. */
98 select_test(maxfd+1, &rd, &wr, &exc, &interval);
100 abort_on_test_timeout();
105 /* undocumented cleanup sequence - type UB */
107 curl_easy_cleanup(curl);
108 curl_multi_cleanup(m);
109 curl_global_cleanup();