From 8d94688fd1d53841826e72fa87ac6ecd33dcd0cd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 19 Mar 2002 10:34:34 +0000 Subject: moved here from ../../lib/ --- include/curl/multi.h | 189 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 include/curl/multi.h (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h new file mode 100644 index 000000000..42fa1dd4c --- /dev/null +++ b/include/curl/multi.h @@ -0,0 +1,189 @@ +#ifndef __CURL_MULTI_H +#define __CURL_MULTI_H +/***************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * + * In order to be useful for every potential user, curl and libcurl are + * dual-licensed under the MPL and the MIT/X-derivate licenses. + * + * 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 MPL or the MIT/X-derivate + * licenses. You may pick one of these licenses. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + * $Id$ + *****************************************************************************/ +/* + This is meant to be the "external" header file. Don't give away any + internals here! + + This document presents a mixture of ideas from at least: + - Daniel Stenberg + - Steve Dekorte + - Sterling Hughes + - Ben Greear + + ------------------------------------------- + GOALS + + o Enable a "pull" interface. The application that uses libcurl decides where + and when to ask libcurl to get/send data. + + o Enable multiple simultaneous transfers in the same thread without making it + complicated for the application. + + o Enable the application to select() on its own file descriptors and curl's + file descriptors simultaneous easily. + + Example sources using this interface is here: ../multi/ + +*/ +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#include +#endif + +#include + +typedef void CURLM; + +typedef enum { + CURLM_CALL_MULTI_PERFORM=-1, /* please call curl_multi_perform() soon */ + CURLM_OK, + CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ + CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ + CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ + CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ + CURLM_LAST +} CURLMcode; + +typedef enum { + CURLMSG_NONE, /* first, not used */ + CURLMSG_DONE, /* This easy handle has completed. 'whatever' points to + the CURLcode of the transfer */ + CURLMSG_LAST /* last, not used */ +} CURLMSG; + +struct CURLMsg { + CURLMSG msg; /* what this message means */ + CURL *easy_handle; /* the handle it concerns */ + union { + void *whatever; /* message-specific data */ + CURLcode result; /* return code for transfer */ + } data; +}; +typedef struct CURLMsg CURLMsg; + +/* + * Name: curl_multi_init() + * + * Desc: inititalize multi-style curl usage + * Returns: a new CURLM handle to use in all 'curl_multi' functions. + */ +CURLM *curl_multi_init(void); + +/* + * Name: curl_multi_add_handle() + * + * Desc: add a standard curl handle to the multi stack + * Returns: CURLMcode type, general multi error code. + */ +CURLMcode curl_multi_add_handle(CURLM *multi_handle, + CURL *curl_handle); + + /* + * Name: curl_multi_remove_handle() + * + * Desc: removes a curl handle from the multi stack again + * Returns: CURLMcode type, general multi error code. + */ +CURLMcode curl_multi_remove_handle(CURLM *multi_handle, + CURL *curl_handle); + + /* + * Name: curl_multi_fdset() + * + * Desc: Ask curl for its fd_set sets. The app can use these to select() or + * poll() on. We want curl_multi_perform() called as soon as one of + * them are ready. + * Returns: CURLMcode type, general multi error code. + */ +CURLMcode curl_multi_fdset(CURLM *multi_handle, + fd_set *read_fd_set, + fd_set *write_fd_set, + fd_set *exc_fd_set, + int *max_fd); + + /* + * Name: curl_multi_perform() + * + * Desc: When the app thinks there's data available for curl it calls this + * function to read/write whatever there is right now. This returns + * as soon as the reads and writes are done. This function does not + * require that there actually is data available for reading or that + * data can be written, it can be called just in case. It returns + * the number of handles that still transfer data in the second + * argument's integer-pointer. + * + * Returns: CURLMcode type, general multi error code. *NOTE* that this only + * returns errors etc regarding the whole multi stack. There might + * still have occurred problems on invidual transfers even when this + * returns OK. + */ +CURLMcode curl_multi_perform(CURLM *multi_handle, + int *running_handles); + + /* + * Name: curl_multi_cleanup() + * + * Desc: Cleans up and removes a whole multi stack. It does not free or + * touch any individual easy handles in any way. We need to define + * in what state those handles will be if this function is called + * in the middle of a transfer. + * Returns: CURLMcode type, general multi error code. + */ +CURLMcode curl_multi_cleanup(CURLM *multi_handle); + +/* + * Name: curl_multi_info_read() + * + * Desc: Ask the multi handle if there's any messages/informationals from + * the individual transfers. Messages include informationals such as + * error code from the transfer or just the fact that a transfer is + * completed. More details on these should be written down as well. + * + * Repeated calls to this function will return a new struct each + * time, until a special "end of msgs" struct is returned as a signal + * that there is no more to get at this point. + * + * The data the returned pointer points to will not survive calling + * curl_multi_cleanup(). + * + * The 'CURLMsg' struct is meant to be very simple and only contain + * very basic informations. If more involved information is wanted, + * we will provide the particular "transfer handle" in that struct + * and that should/could/would be used in subsequent + * curl_easy_getinfo() calls (or similar). The point being that we + * must never expose complex structs to applications, as then we'll + * undoubtably get backwards compatibility problems in the future. + * + * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out + * of structs. It also writes the number of messages left in the + * queue (after this read) in the integer the second argument points + * to. + */ +CURLMsg *curl_multi_info_read(CURLM *multi_handle, + int *msgs_in_queue); + +#endif -- cgit v1.2.1 From fcb1d3521adf69ad9a8a5b98dc1a77d14e3b6b49 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 31 Jul 2002 23:18:27 +0000 Subject: sys/socket.h without #ifdef include sys/time.h as well --- include/curl/multi.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 42fa1dd4c..b1ca28b21 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -47,11 +47,12 @@ Example sources using this interface is here: ../multi/ */ -#ifdef HAVE_SYS_SOCKET_H -#include -#endif + #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) #include +#else +#include +#include #endif #include -- cgit v1.2.1 From 183f1531d3104acf453ac710b6dfc69b8bfc99a2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 13 Aug 2002 15:03:57 +0000 Subject: include curl-includes "local" instead of --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index b1ca28b21..d84bd36e5 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -55,7 +55,7 @@ #include #endif -#include +#include "curl.h" typedef void CURLM; -- cgit v1.2.1 From ba4e69bebc8f7f32f3bc7faa1e13e7580754075b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 3 Sep 2002 11:52:59 +0000 Subject: updated source code boilerplate/header --- include/curl/multi.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index d84bd36e5..40dd01efd 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -1,6 +1,6 @@ #ifndef __CURL_MULTI_H #define __CURL_MULTI_H -/***************************************************************************** +/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | @@ -9,19 +9,19 @@ * * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. * - * In order to be useful for every potential user, curl and libcurl are - * dual-licensed under the MPL and the MIT/X-derivate licenses. - * + * 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 MPL or the MIT/X-derivate - * licenses. You may pick one of these licenses. + * 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. * * $Id$ - *****************************************************************************/ + ***************************************************************************/ /* This is meant to be the "external" header file. Don't give away any internals here! -- cgit v1.2.1 From f26a338a54e04d0a6907f5d2479d8b0fa9daf297 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 16 Jan 2003 21:08:12 +0000 Subject: copyright year update in the source header --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 40dd01efd..cf418bd5e 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2002, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From 64b0ff875f51b7ba852a6297d74ebba1d66e49d2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 22 Jan 2003 18:30:58 +0000 Subject: extern C this to work in C++ conditions --- include/curl/multi.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index cf418bd5e..19c6553e4 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -44,8 +44,6 @@ o Enable the application to select() on its own file descriptors and curl's file descriptors simultaneous easily. - Example sources using this interface is here: ../multi/ - */ #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) @@ -57,6 +55,10 @@ #include "curl.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef void CURLM; typedef enum { @@ -187,4 +189,8 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle); CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue); +#ifdef __cplusplus +} /* end of extern "C" +#endif + #endif -- cgit v1.2.1 From 543e0b1e0f3a9ff856009514279ca7c4bcd2c2e4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 22 Jan 2003 18:50:51 +0000 Subject: oops, broken comment fixed --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 19c6553e4..365cd40b5 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -190,7 +190,7 @@ CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue); #ifdef __cplusplus -} /* end of extern "C" +} /* end of extern "C" */ #endif #endif -- cgit v1.2.1 From de6008e01ab4658b1b6bd276353ad82590c01d86 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 Feb 2003 18:12:41 +0000 Subject: James Bursa corrected a bad comment --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 365cd40b5..1d3b123a2 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -73,7 +73,7 @@ typedef enum { typedef enum { CURLMSG_NONE, /* first, not used */ - CURLMSG_DONE, /* This easy handle has completed. 'whatever' points to + CURLMSG_DONE, /* This easy handle has completed. 'result' contains the CURLcode of the transfer */ CURLMSG_LAST /* last, not used */ } CURLMSG; -- cgit v1.2.1 From 8c3a10392e39c81c8d1dc561e40182bbea54e6ba Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Mar 2003 12:25:32 +0000 Subject: Include sys/types.h as well. Ray DeGennaro reports successful compiling on AIX when this fix is applied and I cannot see how this will break any systems. --- include/curl/multi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 1d3b123a2..ac114be4d 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -51,6 +51,7 @@ #else #include #include +#include #endif #include "curl.h" -- cgit v1.2.1 From ca04620253b162fedc672695274817d6b3cb3610 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 9 May 2003 07:37:27 +0000 Subject: AIX wants sys/select.h --- include/curl/multi.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index ac114be4d..60291a6f0 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -49,6 +49,7 @@ #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) #include #else +#include #include #include #include -- cgit v1.2.1 From 35a84ad5767689bc6f89ebac87cf862054060391 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 26 May 2003 07:57:53 +0000 Subject: Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 so we make an adjustment to catch this. --- include/curl/multi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 60291a6f0..6e5c933b9 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -45,6 +45,11 @@ file descriptors simultaneous easily. */ +#if defined(_WIN32) && !defined(WIN32) +/* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 + so we make this like adjustment to catch this. */ +#define WIN32 1 +#endif #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) #include -- cgit v1.2.1 From e97fd44151803392da3e5783c2c31c05a06821b9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 26 May 2003 12:32:22 +0000 Subject: language --- include/curl/multi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 6e5c933b9..9209912f2 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -46,8 +46,8 @@ */ #if defined(_WIN32) && !defined(WIN32) -/* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 - so we make this like adjustment to catch this. */ +/* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 so we + make this adjustment to catch this. */ #define WIN32 1 #endif -- cgit v1.2.1 From 18234cbdaced6adb7c4dadd9afbed7476f0f50b1 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 27 May 2003 12:34:48 +0000 Subject: sys/select.h is not present on HPUX, avoid including it --- include/curl/multi.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 9209912f2..4d7e0d900 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -54,7 +54,10 @@ #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) #include #else +#ifndef __hpux +/* HP-UX systems version 9, 10 and 11 lack this header */ #include +#endif #include #include #include -- cgit v1.2.1 From c32390d84c08f2c8e2975994e64babdaacb34de4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 5 Jun 2003 14:04:44 +0000 Subject: Reversed the logic to only include the header on systems known to really NEED it as another system that doesn't have it came up: very old Linux libc5-based systems (as addition to all HPUX versions). The only known system at this point is AIX. --- include/curl/multi.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 4d7e0d900..c5a74815b 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -54,10 +54,14 @@ #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) #include #else -#ifndef __hpux -/* HP-UX systems version 9, 10 and 11 lack this header */ + +#ifdef _AIX +/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish + libc5-based Linux systems. Only include it on system that are known to + require it! */ #include #endif + #include #include #include -- cgit v1.2.1 From 053f6c85efd0bf698f73343989474d672d0563a8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 Jan 2004 09:19:33 +0000 Subject: updated year in the copyright string --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index c5a74815b..04a7dcc33 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From 4515d06465da15340c56d5b4f14ab4950fd59baa Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 26 Feb 2004 16:23:28 +0000 Subject: David Byron's fixes to make the latest curl build fine under MSVC 6. --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 04a7dcc33..0ed48bf2b 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -52,7 +52,7 @@ #endif #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) -#include +#include #else #ifdef _AIX -- cgit v1.2.1 From 5b55f9ecb34a00af236b2275ffa9adab492a93b6 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 17 Mar 2004 12:46:42 +0000 Subject: =?UTF-8?q?G=FCnter=20Knauf's=20NetWare=20changes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 0ed48bf2b..b2d821826 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -55,10 +55,10 @@ #include #else -#ifdef _AIX /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish libc5-based Linux systems. Only include it on system that are known to require it! */ +#if defined(_AIX) || defined(NETWARE) #include #endif -- cgit v1.2.1 From eab8cdc640a1c3b78c5626e197d0c45d093a39b2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2004 22:53:42 +0000 Subject: Added protos for the upcoming curl_*_strerror() functions --- include/curl/multi.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index b2d821826..3a867ab68 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -203,6 +203,17 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle); CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue); +/* + * NAME curl_multi_strerror() + * + * DESCRIPTION + * + * The curl_multi_strerror function may be used to turn a CURLMcode value + * into the equivalent human readable error string. This is useful + * for printing meaningful error messages. + */ +const char *curl_multi_strerror(CURLMcode); + #ifdef __cplusplus } /* end of extern "C" */ #endif -- cgit v1.2.1 From d0dcb3b554c0adef44b8677e0dc257d7ef05c44c Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 17 Aug 2004 19:46:34 +0000 Subject: removed trailing whitespace --- include/curl/multi.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 3a867ab68..37cf6b25a 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -1,10 +1,10 @@ #ifndef __CURL_MULTI_H #define __CURL_MULTI_H /*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. @@ -12,7 +12,7 @@ * 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. @@ -43,7 +43,7 @@ o Enable the application to select() on its own file descriptors and curl's file descriptors simultaneous easily. - + */ #if defined(_WIN32) && !defined(WIN32) /* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 so we @@ -217,5 +217,5 @@ const char *curl_multi_strerror(CURLMcode); #ifdef __cplusplus } /* end of extern "C" */ #endif - + #endif -- cgit v1.2.1 From d4db35c1252a4986247c5ac6c1dbcffa38f8d356 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 30 Sep 2004 19:50:36 +0000 Subject: =?UTF-8?q?G=FCnter=20Knauf=20and=20Casey=20O'Donnell=20worked=20o?= =?UTF-8?q?ut=20an=20extra=20#if=20condition=20for=20the=20curl/multi.h=20?= =?UTF-8?q?header=20to=20work=20better=20in=20winsock-using=20apps.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/curl/multi.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 37cf6b25a..da9df2e15 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -52,7 +52,11 @@ #endif #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) +/* The check above prevents the winsock2 inclusion if winsock.h already was + included, since they can't co-exist without problems */ #include +#endif #else /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish -- cgit v1.2.1 From 24d47a6e07304cf0921f2d30734b3c64360773c3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 2 Nov 2004 10:12:22 +0000 Subject: Paul Nolan fix to make libcurl build nicely on Windows CE --- include/curl/multi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index da9df2e15..65b672d2c 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -51,7 +51,8 @@ #define WIN32 1 #endif -#if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__) +#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) || \ + defined(__MINGW32__) #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) /* The check above prevents the winsock2 inclusion if winsock.h already was included, since they can't co-exist without problems */ -- cgit v1.2.1 From 3ccbed1022b8f0fb00e80564870e7f5aa0120a2a Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Tue, 9 Nov 2004 14:02:58 +0000 Subject: Changes for removing libcurl.def file on Win32. Mark public functions with "CURL_EXTERN". --- include/curl/multi.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 65b672d2c..1e6fc3cc5 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -113,7 +113,7 @@ typedef struct CURLMsg CURLMsg; * Desc: inititalize multi-style curl usage * Returns: a new CURLM handle to use in all 'curl_multi' functions. */ -CURLM *curl_multi_init(void); +CURL_EXTERN CURLM *curl_multi_init(void); /* * Name: curl_multi_add_handle() @@ -121,8 +121,8 @@ CURLM *curl_multi_init(void); * Desc: add a standard curl handle to the multi stack * Returns: CURLMcode type, general multi error code. */ -CURLMcode curl_multi_add_handle(CURLM *multi_handle, - CURL *curl_handle); +CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, + CURL *curl_handle); /* * Name: curl_multi_remove_handle() @@ -130,8 +130,8 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle, * Desc: removes a curl handle from the multi stack again * Returns: CURLMcode type, general multi error code. */ -CURLMcode curl_multi_remove_handle(CURLM *multi_handle, - CURL *curl_handle); +CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, + CURL *curl_handle); /* * Name: curl_multi_fdset() @@ -141,11 +141,11 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle, * them are ready. * Returns: CURLMcode type, general multi error code. */ -CURLMcode curl_multi_fdset(CURLM *multi_handle, - fd_set *read_fd_set, - fd_set *write_fd_set, - fd_set *exc_fd_set, - int *max_fd); +CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, + fd_set *read_fd_set, + fd_set *write_fd_set, + fd_set *exc_fd_set, + int *max_fd); /* * Name: curl_multi_perform() @@ -163,8 +163,8 @@ CURLMcode curl_multi_fdset(CURLM *multi_handle, * still have occurred problems on invidual transfers even when this * returns OK. */ -CURLMcode curl_multi_perform(CURLM *multi_handle, - int *running_handles); +CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, + int *running_handles); /* * Name: curl_multi_cleanup() @@ -175,7 +175,7 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, * in the middle of a transfer. * Returns: CURLMcode type, general multi error code. */ -CURLMcode curl_multi_cleanup(CURLM *multi_handle); +CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); /* * Name: curl_multi_info_read() @@ -205,8 +205,8 @@ CURLMcode curl_multi_cleanup(CURLM *multi_handle); * queue (after this read) in the integer the second argument points * to. */ -CURLMsg *curl_multi_info_read(CURLM *multi_handle, - int *msgs_in_queue); +CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, + int *msgs_in_queue); /* * NAME curl_multi_strerror() @@ -217,7 +217,7 @@ CURLMsg *curl_multi_info_read(CURLM *multi_handle, * into the equivalent human readable error string. This is useful * for printing meaningful error messages. */ -const char *curl_multi_strerror(CURLMcode); +CURL_EXTERN const char *curl_multi_strerror(CURLMcode); #ifdef __cplusplus } /* end of extern "C" */ -- cgit v1.2.1 From 0406b1facf8fa0190806d76bddc0578793f01c39 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Jan 2005 15:13:23 +0000 Subject: skip sys/socket.h on windows CE --- include/curl/multi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 1e6fc3cc5..a9b1c0ea8 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -67,7 +67,9 @@ #include #endif +#ifndef _WIN32_WCE #include +#endif #include #include #endif -- cgit v1.2.1 From ab4086bc244bf3267976e9f0193e5ed4430190d8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 31 Mar 2005 07:02:02 +0000 Subject: Updated the copyright year since changes have been this year. --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index a9b1c0ea8..64ab406aa 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From 9a9c07f5716a02b7c6e6ad16f4c84f75e8804f44 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 18 Apr 2005 11:40:50 +0000 Subject: Initial curl_multi_socket() stuff, #ifdef'ed out for now but committed for documentational purposes. --- include/curl/multi.h | 132 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 118 insertions(+), 14 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 64ab406aa..fe34a423d 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -23,16 +23,8 @@ * $Id$ ***************************************************************************/ /* - This is meant to be the "external" header file. Don't give away any - internals here! + This is an "external" header file. Don't give away any internals here! - This document presents a mixture of ideas from at least: - - Daniel Stenberg - - Steve Dekorte - - Sterling Hughes - - Ben Greear - - ------------------------------------------- GOALS o Enable a "pull" interface. The application that uses libcurl decides where @@ -82,6 +74,22 @@ extern "C" { typedef void CURLM; +#ifdef HAVE_CURL_MULTI_SOCKET /* this is not set by anything yet */ + +#ifndef curl_socket_typedef +/* Public socket typedef */ +#ifdef WIN32 +typedef SOCKET curl_socket_t; +#define CURL_SOCKET_BAD INVALID_SOCKET +#else +typedef int curl_socket_t; +#define CURL_SOCKET_BAD -1 +#endif +#define curl_socket_typedef +#endif /* curl_socket_typedef */ + +#endif /* HAVE_CURL_MULTI_SOCKET */ + typedef enum { CURLM_CALL_MULTI_PERFORM=-1, /* please call curl_multi_perform() soon */ CURLM_OK, @@ -113,6 +121,7 @@ typedef struct CURLMsg CURLMsg; * Name: curl_multi_init() * * Desc: inititalize multi-style curl usage + * * Returns: a new CURLM handle to use in all 'curl_multi' functions. */ CURL_EXTERN CURLM *curl_multi_init(void); @@ -121,6 +130,7 @@ CURL_EXTERN CURLM *curl_multi_init(void); * Name: curl_multi_add_handle() * * Desc: add a standard curl handle to the multi stack + * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, @@ -130,6 +140,7 @@ CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, * Name: curl_multi_remove_handle() * * Desc: removes a curl handle from the multi stack again + * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, @@ -141,6 +152,7 @@ CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, * Desc: Ask curl for its fd_set sets. The app can use these to select() or * poll() on. We want curl_multi_perform() called as soon as one of * them are ready. + * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, @@ -175,6 +187,7 @@ CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, * touch any individual easy handles in any way. We need to define * in what state those handles will be if this function is called * in the middle of a transfer. + * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); @@ -211,16 +224,107 @@ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue); /* - * NAME curl_multi_strerror() + * Name: curl_multi_strerror() * - * DESCRIPTION + * Desc: The curl_multi_strerror function may be used to turn a CURLMcode + * value into the equivalent human readable error string. This is + * useful for printing meaningful error messages. * - * The curl_multi_strerror function may be used to turn a CURLMcode value - * into the equivalent human readable error string. This is useful - * for printing meaningful error messages. + * Returns: A pointer to a zero-terminated error message. */ CURL_EXTERN const char *curl_multi_strerror(CURLMcode); +#ifdef HAVE_CURL_MULTI_SOCKET +/* + * Name: curl_multi_socket() and + * curl_multi_socket_all() + * + * Desc: An alternative version of curl_multi_perform() that allows the + * application to pass in one of the file descriptors that have been + * detected to have "action" on them and let libcurl perform. This + * allows libcurl to not have to scan through all possible file + * descriptors to check for this. The app is recommended to pass in + * the 'easy' argument (or set it to CURL_EASY_NONE) to make libcurl + * figure out the internal structure even faster and easier. If the + * easy argument is set to something else than CURL_EASY_NONE, the + * 's' (socket) argument will be ignored by libcurl. + * + * It also informs the application about updates in the socket (file + * descriptor) status by doing none, one or multiple calls to the + * curl_socket_callback. It thus updates the status with changes + * since the previous time this function was used. If 'callback' is + * NULL, no callback will be called. A status change may also be a + * new timeout only, having the same IN/OUT status as before. + * + * If a previous wait for socket action(s) timed out, you should call + * this function with the socket argument set to + * CURL_SOCKET_TIMEOUT. If you want to force libcurl to (re-)check + * all its internal sockets, and call the callback with status for + * all sockets no matter what the previous state is, you call + * curl_multi_socket_all() instead. + * + * curl_multi_perform() is thus the equivalent of calling + * curl_multi_socket_all(handle, NULL, NULL); + * + * IMPLEMENTATION: libcurl will need an internal hash table to map + * socket numbers to internal easy handles for the cases when 'easy' + * is set to CURL_EASY_NONE. + * + * Regarding the timeout argument in the callback: it is the timeout + * (in milliseconds) for waiting on action on this socket (and the + * given time period starts when the callback is called) until you + * should call curl_multi_socket() with the timeout stuff mentioned + * above. If "actions" happens on the socket before the timeout + * happens, remember that the timout timer keeps ticking until told + * otherwise. + * + * The "what" argument has one of five values: + * + * 0 CURL_POLL_NONE (0) - register, not interested in readiness + * 1 CURL_POLL_IN - register, interested in read readiness + * 2 CURL_POLL_OUT - register, interested in write readiness + * 3 CURL_POLL_INOUT - register, interested in both + * 4 CURL_POLL_REMOVE - deregister + */ +#define CURL_POLL_NONE 0 +#define CURL_POLL_IN 1 +#define CURL_POLL_OUT 2 +#define CURL_POLL_INOUT 3 +#define CURL_POLL_REMOVE 4 + +#define CURL_EASY_NONE (CURL *)0 +#define CURL_EASY_TIMEOUT (CURL *)0 +#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD + +typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ + curl_socket_t s, /* socket */ + int what, /* see above */ + long ms, /* timeout for wait */ + void *userp); /* "private" pointer */ + +CURLMcode curl_multi_socket(CURLM *multi_handle, + curl_socket_t s, + CURL *easy, + curl_socket_callback callback, + void *userp); /* passed to callback */ + +CURLMcode curl_multi_socket_all(CURLM *multi_handle, + curl_socket_callback callback, + void *userp); /* passed to callback */ + +/* + * Name: curl_multi_timeout() + * + * Desc: Returns the maximum number of milliseconds the app is allowed to + * wait before curl_multi_socket() or curl_multi_perform() must be + * called (to allow libcurl's timed events to take place). + * + * Returns: CURLM error code. + */ +CURLMcode curl_multi_timeout(CURLM *multi_handle, long *milliseconds); + +#endif /* HAVE_CURL_MULTI_SOCKET */ + #ifdef __cplusplus } /* end of extern "C" */ #endif -- cgit v1.2.1 From fdef58468100d1a9b6b7f6769f8dbab5d6ff3b23 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Oct 2005 07:26:43 +0000 Subject: Mohun Biswas' suggested change to prevent GNU indent to warn on the =-1 line. --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index fe34a423d..d940571a2 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -91,7 +91,7 @@ typedef int curl_socket_t; #endif /* HAVE_CURL_MULTI_SOCKET */ typedef enum { - CURLM_CALL_MULTI_PERFORM=-1, /* please call curl_multi_perform() soon */ + CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() soon */ CURLM_OK, CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ -- cgit v1.2.1 From fdf9900114a534c6f133b7c496f85cb33d042582 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 28 Nov 2005 07:43:53 +0000 Subject: added note about the inclusion of curl.h from within this file --- include/curl/multi.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index d940571a2..96c2763ef 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -66,6 +66,15 @@ #include #endif +/* + * This header file should not really need to include "curl.h" since curl.h + * itself includes this file and we expect user applications to do #include + * without the need for especially including multi.h. + * + * For some reason we added this include here at one point, and rather than to + * break existing (wrongly written) libcurl applications, we leave it as-is + * but with this warning attached. + */ #include "curl.h" #ifdef __cplusplus -- cgit v1.2.1 From d6c5d24af3627ec12721e7d286d426ed12901b55 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sun, 18 Dec 2005 15:36:14 +0000 Subject: Cleanup windows header includes. Where aplicable, inclusion of windows.h winsock.h winsock2.h ws2tcpip.h is done in setup.h --- include/curl/multi.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 96c2763ef..35cf34885 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -45,11 +45,7 @@ #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) || \ defined(__MINGW32__) -#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) -/* The check above prevents the winsock2 inclusion if winsock.h already was - included, since they can't co-exist without problems */ -#include -#endif + #else /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish -- cgit v1.2.1 From e6b98d315254788e8fabceba840da3f6dfd6fbd5 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Mon, 19 Dec 2005 00:15:04 +0000 Subject: Undo previous change. This header file belongs to the public interface and the change could break the compilation of thrid party apps which link against this library. --- include/curl/multi.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 35cf34885..96c2763ef 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -45,7 +45,11 @@ #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) || \ defined(__MINGW32__) - +#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) +/* The check above prevents the winsock2 inclusion if winsock.h already was + included, since they can't co-exist without problems */ +#include +#endif #else /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish -- cgit v1.2.1 From b6e9229cf0df378185afaced7f63bee0fed21c1a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 2 Jan 2006 23:37:48 +0000 Subject: Removed inaccurate comment for upcoming curl_multi_socket() and family. Modified the callback proto used for it. --- include/curl/multi.h | 47 ++--------------------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 96c2763ef..db3a70ae3 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -250,50 +250,8 @@ CURL_EXTERN const char *curl_multi_strerror(CURLMcode); * * Desc: An alternative version of curl_multi_perform() that allows the * application to pass in one of the file descriptors that have been - * detected to have "action" on them and let libcurl perform. This - * allows libcurl to not have to scan through all possible file - * descriptors to check for this. The app is recommended to pass in - * the 'easy' argument (or set it to CURL_EASY_NONE) to make libcurl - * figure out the internal structure even faster and easier. If the - * easy argument is set to something else than CURL_EASY_NONE, the - * 's' (socket) argument will be ignored by libcurl. - * - * It also informs the application about updates in the socket (file - * descriptor) status by doing none, one or multiple calls to the - * curl_socket_callback. It thus updates the status with changes - * since the previous time this function was used. If 'callback' is - * NULL, no callback will be called. A status change may also be a - * new timeout only, having the same IN/OUT status as before. - * - * If a previous wait for socket action(s) timed out, you should call - * this function with the socket argument set to - * CURL_SOCKET_TIMEOUT. If you want to force libcurl to (re-)check - * all its internal sockets, and call the callback with status for - * all sockets no matter what the previous state is, you call - * curl_multi_socket_all() instead. - * - * curl_multi_perform() is thus the equivalent of calling - * curl_multi_socket_all(handle, NULL, NULL); - * - * IMPLEMENTATION: libcurl will need an internal hash table to map - * socket numbers to internal easy handles for the cases when 'easy' - * is set to CURL_EASY_NONE. - * - * Regarding the timeout argument in the callback: it is the timeout - * (in milliseconds) for waiting on action on this socket (and the - * given time period starts when the callback is called) until you - * should call curl_multi_socket() with the timeout stuff mentioned - * above. If "actions" happens on the socket before the timeout - * happens, remember that the timout timer keeps ticking until told - * otherwise. - * - * The "what" argument has one of five values: - * - * 0 CURL_POLL_NONE (0) - register, not interested in readiness - * 1 CURL_POLL_IN - register, interested in read readiness - * 2 CURL_POLL_OUT - register, interested in write readiness - * 3 CURL_POLL_INOUT - register, interested in both - * 4 CURL_POLL_REMOVE - deregister + * detected to have "action" on them and let libcurl perform. + * See man page for details. */ #define CURL_POLL_NONE 0 #define CURL_POLL_IN 1 @@ -308,7 +266,6 @@ CURL_EXTERN const char *curl_multi_strerror(CURLMcode); typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ curl_socket_t s, /* socket */ int what, /* see above */ - long ms, /* timeout for wait */ void *userp); /* "private" pointer */ CURLMcode curl_multi_socket(CURLM *multi_handle, -- cgit v1.2.1 From bda1e9aeab019d003036a3ec24193605bc191b3a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 9 Jan 2006 13:17:14 +0000 Subject: Made the copyright year match the latest modification's year. --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index db3a70ae3..27d44dca9 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From c44d2498e3aa97740e53920d429e6413b13772d0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 28 Jan 2006 13:13:58 +0000 Subject: include sys/select.h on NetBSD as well --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 27d44dca9..f79dbabb9 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -55,7 +55,7 @@ /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish libc5-based Linux systems. Only include it on system that are known to require it! */ -#if defined(_AIX) || defined(NETWARE) +#if defined(_AIX) || defined(NETWARE) || defined(__NetBSD__) #include #endif -- cgit v1.2.1 From 778b6a86c0f25e6e0862f4b8afae3fdd67ae839b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 10 Apr 2006 13:12:52 +0000 Subject: curl_multi_socket() updates --- include/curl/multi.h | 53 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 16 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index f79dbabb9..6ce682690 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -83,8 +83,6 @@ extern "C" { typedef void CURLM; -#ifdef HAVE_CURL_MULTI_SOCKET /* this is not set by anything yet */ - #ifndef curl_socket_typedef /* Public socket typedef */ #ifdef WIN32 @@ -97,8 +95,6 @@ typedef int curl_socket_t; #define curl_socket_typedef #endif /* curl_socket_typedef */ -#endif /* HAVE_CURL_MULTI_SOCKET */ - typedef enum { CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() soon */ CURLM_OK, @@ -106,6 +102,8 @@ typedef enum { CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ + CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ + CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ CURLM_LAST } CURLMcode; @@ -243,7 +241,6 @@ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, */ CURL_EXTERN const char *curl_multi_strerror(CURLMcode); -#ifdef HAVE_CURL_MULTI_SOCKET /* * Name: curl_multi_socket() and * curl_multi_socket_all() @@ -259,8 +256,6 @@ CURL_EXTERN const char *curl_multi_strerror(CURLMcode); #define CURL_POLL_INOUT 3 #define CURL_POLL_REMOVE 4 -#define CURL_EASY_NONE (CURL *)0 -#define CURL_EASY_TIMEOUT (CURL *)0 #define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ @@ -268,15 +263,9 @@ typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ int what, /* see above */ void *userp); /* "private" pointer */ -CURLMcode curl_multi_socket(CURLM *multi_handle, - curl_socket_t s, - CURL *easy, - curl_socket_callback callback, - void *userp); /* passed to callback */ +CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s); -CURLMcode curl_multi_socket_all(CURLM *multi_handle, - curl_socket_callback callback, - void *userp); /* passed to callback */ +CURLMcode curl_multi_socket_all(CURLM *multi_handle); /* * Name: curl_multi_timeout() @@ -289,7 +278,39 @@ CURLMcode curl_multi_socket_all(CURLM *multi_handle, */ CURLMcode curl_multi_timeout(CURLM *multi_handle, long *milliseconds); -#endif /* HAVE_CURL_MULTI_SOCKET */ +#undef CINIT /* re-using the same name as in curl.h */ + +#ifdef CURL_ISOCPP +#define CINIT(name,type,number) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + number +#else +/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ +#define LONG CURLOPTTYPE_LONG +#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT +#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT +#define OFF_T CURLOPTTYPE_OFF_T +#define CINIT(name,type,number) CURLMOPT_/**/name = type + number +#endif + +typedef enum { + /* This is the socket callback function pointer */ + CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), + + /* This is the argument passed to the socket callback */ + CINIT(SOCKETDATA, OBJECTPOINT, 2), + + CURLMOPT_LASTENTRY /* the last unused */ +} CURLMoption; + + +/* + * Name: curl_multi_setopt() + * + * Desc: Sets options for the multi handle. + * + * Returns: CURLM error code. + */ +CURLMcode curl_multi_setopt(CURLM *multi_handle, + CURLMoption option, ...); #ifdef __cplusplus } /* end of extern "C" */ -- cgit v1.2.1 From bc2f0c7dcbd22ab52971df4a419933e70f263a3f Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 5 Jul 2006 23:10:37 +0000 Subject: Prevent definition of HAVE_WINxxx_H symbols and avoid inclusion of Windows headers when compiled with Cygwin in POSIX emulation mode. --- include/curl/multi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 6ce682690..4fc70640a 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -43,8 +43,8 @@ #define WIN32 1 #endif -#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) || \ - defined(__MINGW32__) +#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \ + !defined(__CYGWIN__) || defined(__MINGW32__) #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) /* The check above prevents the winsock2 inclusion if winsock.h already was included, since they can't co-exist without problems */ -- cgit v1.2.1 From 6f6b93da02019141812b81bfdbb6bcda430c3b4d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 26 Jul 2006 22:19:42 +0000 Subject: [Hiper-related work] Added a function called curl_multi_assign() that will set a private pointer added to the internal libcurl hash table for the particular socket passed in to this function. --- include/curl/multi.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 4fc70640a..eb62446df 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -261,11 +261,14 @@ CURL_EXTERN const char *curl_multi_strerror(CURLMcode); typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ curl_socket_t s, /* socket */ int what, /* see above */ - void *userp); /* "private" pointer */ + void *userp, /* private callback + pointer */ + void *socketp); /* private socket + pointer */ -CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s); +CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s); -CURLMcode curl_multi_socket_all(CURLM *multi_handle); +CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle); /* * Name: curl_multi_timeout() @@ -276,7 +279,8 @@ CURLMcode curl_multi_socket_all(CURLM *multi_handle); * * Returns: CURLM error code. */ -CURLMcode curl_multi_timeout(CURLM *multi_handle, long *milliseconds); +CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, + long *milliseconds); #undef CINIT /* re-using the same name as in curl.h */ @@ -309,8 +313,21 @@ typedef enum { * * Returns: CURLM error code. */ -CURLMcode curl_multi_setopt(CURLM *multi_handle, - CURLMoption option, ...); +CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, + CURLMoption option, ...); + + +/* + * Name: curl_multi_assign() + * + * Desc: This function sets an association in the multi handle between the + * given socket and a private pointer of the application. This is + * (only) useful for curl_multi_socket uses. + * + * Returns: CURLM error code. + */ +CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, + curl_socket_t sockfd, void *sockp); #ifdef __cplusplus } /* end of extern "C" */ -- cgit v1.2.1 From 01b2cf82ec9495f36976710af0015d4cf7f529cd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 30 Jul 2006 22:44:07 +0000 Subject: curl_multi_socket() and curl_multi_socket_all() got modified prototypes: they both now provide the number of running handles back to the calling function. --- include/curl/multi.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index eb62446df..3c8bb9e53 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -266,9 +266,11 @@ typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ void *socketp); /* private socket pointer */ -CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s); +CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, + int *running_handles); -CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle); +CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, + int *running_handles); /* * Name: curl_multi_timeout() -- cgit v1.2.1 From 51f258d1034171173771a4705afee323560dcca3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 3 Aug 2006 21:31:23 +0000 Subject: adding CURLM_CALL_MULTI_SOCKET that's just the same as CURLM_CALL_MULTI_PERFORM --- include/curl/multi.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 3c8bb9e53..61842039d 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -96,7 +96,8 @@ typedef int curl_socket_t; #endif /* curl_socket_typedef */ typedef enum { - CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() soon */ + CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or + curl_multi_socket*() soon */ CURLM_OK, CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ @@ -107,6 +108,11 @@ typedef enum { CURLM_LAST } CURLMcode; +/* just to make code nicer when using curl_multi_socket() you can now check + for CURLM_CALL_MULTI_SOCKET too in the same style it works for + curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ +#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM + typedef enum { CURLMSG_NONE, /* first, not used */ CURLMSG_DONE, /* This easy handle has completed. 'result' contains -- cgit v1.2.1 From c012e2b408db31daf8b581255724d9fde9c37135 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 4 Aug 2006 18:53:47 +0000 Subject: Initial stab at making libcurl compile under Minix 3. --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 61842039d..925d5c007 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -55,7 +55,7 @@ /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish libc5-based Linux systems. Only include it on system that are known to require it! */ -#if defined(_AIX) || defined(NETWARE) || defined(__NetBSD__) +#if defined(_AIX) || defined(NETWARE) || defined(__NetBSD__) || defined(_MINIX) #include #endif -- cgit v1.2.1 From eb26a581f95d208d3abcb1413bcd856a6e85a0e9 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 11 Aug 2006 18:11:42 +0000 Subject: Use __minix to detect Minix, which works on both ACK and GCC. --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 925d5c007..6811ce798 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -55,7 +55,7 @@ /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish libc5-based Linux systems. Only include it on system that are known to require it! */ -#if defined(_AIX) || defined(NETWARE) || defined(__NetBSD__) || defined(_MINIX) +#if defined(_AIX) || defined(NETWARE) || defined(__NetBSD__) || defined(__minix) #include #endif -- cgit v1.2.1 From 5acadc9cd7a1ff40ffa8d57214c90d8c788b2b03 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 29 Aug 2006 14:39:33 +0000 Subject: David McCreedy added CURLOPT_SOCKOPTFUNCTION and CURLOPT_SOCKOPTDATA to allow applications to set their own socket options. --- include/curl/multi.h | 40 ---------------------------------------- 1 file changed, 40 deletions(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 6811ce798..1beda8a92 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -37,34 +37,6 @@ file descriptors simultaneous easily. */ -#if defined(_WIN32) && !defined(WIN32) -/* Chris Lewis mentioned that he doesn't get WIN32 defined, only _WIN32 so we - make this adjustment to catch this. */ -#define WIN32 1 -#endif - -#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \ - !defined(__CYGWIN__) || defined(__MINGW32__) -#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H)) -/* The check above prevents the winsock2 inclusion if winsock.h already was - included, since they can't co-exist without problems */ -#include -#endif -#else - -/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish - libc5-based Linux systems. Only include it on system that are known to - require it! */ -#if defined(_AIX) || defined(NETWARE) || defined(__NetBSD__) || defined(__minix) -#include -#endif - -#ifndef _WIN32_WCE -#include -#endif -#include -#include -#endif /* * This header file should not really need to include "curl.h" since curl.h @@ -83,18 +55,6 @@ extern "C" { typedef void CURLM; -#ifndef curl_socket_typedef -/* Public socket typedef */ -#ifdef WIN32 -typedef SOCKET curl_socket_t; -#define CURL_SOCKET_BAD INVALID_SOCKET -#else -typedef int curl_socket_t; -#define CURL_SOCKET_BAD -1 -#endif -#define curl_socket_typedef -#endif /* curl_socket_typedef */ - typedef enum { CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or curl_multi_socket*() soon */ -- cgit v1.2.1 From b7eeb6e67fca686f840eacd6b8394edb58b07482 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 7 Sep 2006 21:49:20 +0000 Subject: Major overhaul introducing http pipelining support and shared connection cache within the multi handle. --- include/curl/multi.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 1beda8a92..23fe180d3 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -270,6 +270,9 @@ typedef enum { /* This is the argument passed to the socket callback */ CINIT(SOCKETDATA, OBJECTPOINT, 2), + /* set to 1 to enable pipelining for this multi handle */ + CINIT(PIPELINING, LONG, 3), + CURLMOPT_LASTENTRY /* the last unused */ } CURLMoption; -- cgit v1.2.1 From b61c06384ab88baf4b3231e84386c4a70126d888 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 12 Oct 2006 08:36:47 +0000 Subject: Jeff Pohlmeyer has been working with the hiperfifo.c example source code, and while doing so it became apparent that the current timeout system for the socket API really was a bit awkward since it become quite some work to be sure we have the correct timeout set. Jeff then provided the new CURLMOPT_TIMERFUNCTION that is yet another callback the app can set to get to know when the general timeout time changes and thus for an application like hiperfifo.c it makes everything a lot easier and nicer. There's a CURLMOPT_TIMERDATA option too of course in good old libcurl tradition. --- include/curl/multi.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 23fe180d3..d2533728d 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -231,6 +231,20 @@ typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ pointer */ void *socketp); /* private socket pointer */ +/* + * Name: curl_multi_timer_callback + * + * Desc: Called by libcurl whenever the library detects a change in the + * maximum number of milliseconds the app is allowed to wait before + * curl_multi_socket() or curl_multi_perform() must be called + * (to allow libcurl's timed events to take place). + * + * Returns: The callback should return zero. + */ +typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ + long timeout_ms, /* see above */ + void *userp); /* private callback + pointer */ CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, int *running_handles); @@ -273,6 +287,12 @@ typedef enum { /* set to 1 to enable pipelining for this multi handle */ CINIT(PIPELINING, LONG, 3), + /* This is the timer callback function pointer */ + CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), + + /* This is the argument passed to the timer callback */ + CINIT(TIMERDATA, OBJECTPOINT, 5), + CURLMOPT_LASTENTRY /* the last unused */ } CURLMoption; -- cgit v1.2.1 From 76627b322e369c209c60863b9e1f05e3ce02953d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 16 Apr 2007 16:34:08 +0000 Subject: - Robert Iakobashvil added curl_multi_socket_action() to libcurl, which is a function that deprecates the curl_multi_socket() function. Using the new function the application tell libcurl what action that was found in the socket that it passes in. This gives a significant performance boost as it allows libcurl to avoid a call to poll()/select() for every call to curl_multi_socket*(). --- include/curl/multi.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index d2533728d..5eab527ae 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2006, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -224,6 +224,10 @@ CURL_EXTERN const char *curl_multi_strerror(CURLMcode); #define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD +#define CURL_CSELECT_IN 0x01 +#define CURL_CSELECT_OUT 0x02 +#define CURL_CSELECT_ERR 0x04 + typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ curl_socket_t s, /* socket */ int what, /* see above */ @@ -249,9 +253,21 @@ typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, int *running_handles); +CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, + curl_socket_t s, + int ev_bitmask, + int *running_handles); + CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, int *running_handles); +#ifndef CURL_ALLOW_OLD_MULTI_SOCKET +/* This macro below was added in 7.16.3 to push users who recompile to use + the new curl_multi_socket_action() instead of the old curl_multi_socket() +*/ +#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) +#endif + /* * Name: curl_multi_timeout() * -- cgit v1.2.1 From a49e78d9b758cad12d886df2d5c8459a34477bbb Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 30 May 2007 20:04:44 +0000 Subject: Added CURLMOPT_MAXCONNECTS which is a curl_multi_setopt() option for setting the maximum size of the connection cache maximum size of the multi handle. --- include/curl/multi.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 5eab527ae..094c64849 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -309,6 +309,9 @@ typedef enum { /* This is the argument passed to the timer callback */ CINIT(TIMERDATA, OBJECTPOINT, 5), + /* maximum number of entries in the connection cache */ + CINIT(MAXCONNECTS, LONG, 6), + CURLMOPT_LASTENTRY /* the last unused */ } CURLMoption; -- cgit v1.2.1 From 24bf52bc691cca9f8b3a668e26b4dd695ec4991c Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Tue, 20 May 2008 10:21:50 +0000 Subject: Adapting last changes to OS400: _ Updated packages/OS400/curl.inc.in with new definitions. _ New connect/bind/sendto/recvfrom wrappers to support AF_UNIX sockets. _ Include files line length shortened below 100 chars. _ Const parameter in lib/qssl.[ch]. _ Typos in packages/OS400/initscript.sh. --- include/curl/multi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 094c64849..92621aa99 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -283,7 +283,7 @@ CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, #undef CINIT /* re-using the same name as in curl.h */ #ifdef CURL_ISOCPP -#define CINIT(name,type,number) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + number +#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num #else /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ #define LONG CURLOPTTYPE_LONG -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- include/curl/multi.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 92621aa99..f96566669 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -20,7 +20,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ /* This is an "external" header file. Don't give away any internals here! -- cgit v1.2.1 From de24d7bd4c03ea3eeba928edc9ae9e7a826c67c8 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Mon, 27 Aug 2012 12:48:55 -0700 Subject: multi: add curl_multi_wait() /* * Name: curl_multi_wait() * * Desc: Poll on all fds within a CURLM set as well as any * additional fds passed to the function. * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, struct curl_waitfd extra_fds[], unsigned int extra_nfds, int timeout_ms); --- include/curl/multi.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index f96566669..737f17ce2 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -89,6 +89,19 @@ struct CURLMsg { }; typedef struct CURLMsg CURLMsg; +/* Based on poll(2) structure and values. + * We don't use pollfd and POLL* constants explicitly + * to cover platforms without poll(). */ +#define CURL_WAIT_POLLIN 0x0001 +#define CURL_WAIT_POLLPRI 0x0002 +#define CURL_WAIT_POLLOUT 0x0004 + +struct curl_waitfd { + curl_socket_t fd; + short events; + short revents; /* not supported yet */ +}; + /* * Name: curl_multi_init() * @@ -133,6 +146,19 @@ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, fd_set *exc_fd_set, int *max_fd); +/* + * Name: curl_multi_wait() + * + * Desc: Poll on all fds within a CURLM set as well as any + * additional fds passed to the function. + * + * Returns: CURLMcode type, general multi error code. + */ +CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, + struct curl_waitfd extra_fds[], + unsigned int extra_nfds, + int timeout_ms); + /* * Name: curl_multi_perform() * -- cgit v1.2.1 From b78944146a0670b74be00e189f468adfc5fca5b7 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Sat, 15 Sep 2012 10:38:52 -0700 Subject: curl_multi_wait: Add parameter to return number of active sockets Minor change to recently introduced function. BC breaking, but since curl_multi_wait() doesn't exist in any releases that should be fine. --- include/curl/multi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/curl/multi.h') diff --git a/include/curl/multi.h b/include/curl/multi.h index 737f17ce2..6dcd2bac4 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -157,7 +157,8 @@ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, struct curl_waitfd extra_fds[], unsigned int extra_nfds, - int timeout_ms); + int timeout_ms, + int *ret); /* * Name: curl_multi_perform() -- cgit v1.2.1