1 Index: include/curl/multi.h
2 ===================================================================
3 RCS file: /cvsroot/curl/curl/include/curl/multi.h,v
4 retrieving revision 1.45
6 --- curl-old/include/curl/multi.h 20 May 2008 10:21:50 -0000 1.45
7 +++ curl-new/include/curl/multi.h 29 Jan 2010 23:45:18 -0000
12 + * Name: curl_multi_select()
14 + * Desc: Calls select() or poll() internally so app can call
15 + * curl_multi_perform() as soon as one of them is ready. This is to
16 + * fix FD_SETSIZE problem curl_multi_fdset() has.
18 + * Returns: CURLMcode type, general multi error code.
20 +CURL_EXTERN CURLMcode curl_multi_select(CURLM *multi_handle,
25 * Name: curl_multi_perform()
27 * Desc: When the app thinks there's data available for curl it calls this
29 ===================================================================
30 RCS file: /cvsroot/curl/curl/lib/multi.c,v
31 retrieving revision 1.210
32 diff -u -r1.210 multi.c
33 --- curl-old/lib/multi.c 28 Jan 2010 15:34:18 -0000 1.210
34 +++ curl-new/lib/multi.c 29 Jan 2010 23:45:19 -0000
41 #define _MPRINTF_REPLACE /* use our functions only */
42 #include <curl/mprintf.h>
47 +CURLMcode curl_multi_select(CURLM *multi_handle, int timeout_ms, int *ret) {
48 + struct Curl_multi *multi=(struct Curl_multi *)multi_handle;
49 + struct Curl_one_easy *easy;
50 + curl_socket_t sockbunch[MAX_SOCKSPEREASYHANDLE];
53 + unsigned int nfds = 0;
54 + struct pollfd *ufds;
57 + if(!GOOD_MULTI_HANDLE(multi))
58 + return CURLM_BAD_HANDLE;
60 + easy=multi->easy.next;
61 + while(easy != &multi->easy) {
62 + bitmap = multi_getsock(easy, sockbunch, MAX_SOCKSPEREASYHANDLE);
64 + for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++) {
65 + curl_socket_t s = CURL_SOCKET_BAD;
67 + if(bitmap & GETSOCK_READSOCK(i)) {
71 + if(bitmap & GETSOCK_WRITESOCK(i)) {
75 + if(s == CURL_SOCKET_BAD) {
80 + easy = easy->next; /* check next handle */
83 + ufds = (struct pollfd *)malloc(nfds * sizeof(struct pollfd));
86 + easy=multi->easy.next;
87 + while(easy != &multi->easy) {
88 + bitmap = multi_getsock(easy, sockbunch, MAX_SOCKSPEREASYHANDLE);
90 + for(i=0; i< MAX_SOCKSPEREASYHANDLE; i++) {
91 + curl_socket_t s = CURL_SOCKET_BAD;
93 + if(bitmap & GETSOCK_READSOCK(i)) {
94 + ufds[nfds].fd = sockbunch[i];
95 + ufds[nfds].events = POLLIN;
99 + if(bitmap & GETSOCK_WRITESOCK(i)) {
100 + ufds[nfds].fd = sockbunch[i];
101 + ufds[nfds].events = POLLOUT;
105 + if(s == CURL_SOCKET_BAD) {
110 + easy = easy->next; /* check next handle */
113 + nret = Curl_poll(ufds, nfds, timeout_ms);
121 static CURLMcode multi_runsingle(struct Curl_multi *multi,
122 struct Curl_one_easy *easy)