-/*****************************************************************************
+/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * $Id$
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
- * Example application source code using the multi interface to download many
+ * 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 http://curl.haxx.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.
+ *
+ ***************************************************************************/
+/* Example application source code using the multi interface to download many
* files, but with a capped maximum amount of simultaneous transfers.
*
* Written by Michael Wallner
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
-#include <curl/multi.h>
-#ifdef WIN32
-#include <windows.h>
+#ifndef WIN32
+# include <unistd.h>
#endif
+#include <curl/multi.h>
static const char *urls[] = {
"http://www.microsoft.com",
/* we can optionally limit the total amount of connections this multi handle
uses */
- curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, MAX);
+ curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, (long)MAX);
for (C = 0; C < MAX; ++C) {
init(cm, C);
}
while (U) {
- while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(cm, &U));
+ curl_multi_perform(cm, &U);
if (U) {
FD_ZERO(&R);