summaryrefslogtreecommitdiff
path: root/lib/multi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/multi.c')
-rwxr-xr-xlib/multi.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/lib/multi.c b/lib/multi.c
index a9fd1f8b6..9b6801db7 100755
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -818,19 +818,15 @@ void Curl_attach_connnection(struct Curl_easy *data,
}
static int waitconnect_getsock(struct connectdata *conn,
- curl_socket_t *sock,
- int numsocks)
+ curl_socket_t *sock)
{
int i;
int s = 0;
int rc = 0;
- if(!numsocks)
- return GETSOCK_BLANK;
-
#ifdef USE_SSL
if(CONNECT_FIRSTSOCKET_PROXY_SSL())
- return Curl_ssl_getsock(conn, sock, numsocks);
+ return Curl_ssl_getsock(conn, sock);
#endif
for(i = 0; i<2; i++) {
@@ -844,12 +840,8 @@ static int waitconnect_getsock(struct connectdata *conn,
}
static int waitproxyconnect_getsock(struct connectdata *conn,
- curl_socket_t *sock,
- int numsocks)
+ curl_socket_t *sock)
{
- if(!numsocks)
- return GETSOCK_BLANK;
-
sock[0] = conn->sock[FIRSTSOCKET];
/* when we've sent a CONNECT to a proxy, we should rather wait for the
@@ -861,19 +853,17 @@ static int waitproxyconnect_getsock(struct connectdata *conn,
}
static int domore_getsock(struct connectdata *conn,
- curl_socket_t *socks,
- int numsocks)
+ curl_socket_t *socks)
{
if(conn && conn->handler->domore_getsock)
- return conn->handler->domore_getsock(conn, socks, numsocks);
+ return conn->handler->domore_getsock(conn, socks);
return GETSOCK_BLANK;
}
-/* returns bitmapped flags for this handle and its sockets */
+/* returns bitmapped flags for this handle and its sockets. The 'socks[]'
+ array contains MAX_SOCKSPEREASYHANDLE entries. */
static int multi_getsock(struct Curl_easy *data,
- curl_socket_t *socks, /* points to numsocks number
- of sockets */
- int numsocks)
+ curl_socket_t *socks)
{
/* The no connection case can happen when this is called from
curl_multi_remove_handle() => singlesocket() => multi_getsock().
@@ -905,30 +895,30 @@ static int multi_getsock(struct Curl_easy *data,
return 0;
case CURLM_STATE_WAITRESOLVE:
- return Curl_resolv_getsock(data->conn, socks, numsocks);
+ return Curl_resolv_getsock(data->conn, socks);
case CURLM_STATE_PROTOCONNECT:
case CURLM_STATE_SENDPROTOCONNECT:
- return Curl_protocol_getsock(data->conn, socks, numsocks);
+ return Curl_protocol_getsock(data->conn, socks);
case CURLM_STATE_DO:
case CURLM_STATE_DOING:
- return Curl_doing_getsock(data->conn, socks, numsocks);
+ return Curl_doing_getsock(data->conn, socks);
case CURLM_STATE_WAITPROXYCONNECT:
- return waitproxyconnect_getsock(data->conn, socks, numsocks);
+ return waitproxyconnect_getsock(data->conn, socks);
case CURLM_STATE_WAITCONNECT:
- return waitconnect_getsock(data->conn, socks, numsocks);
+ return waitconnect_getsock(data->conn, socks);
case CURLM_STATE_DO_MORE:
- return domore_getsock(data->conn, socks, numsocks);
+ return domore_getsock(data->conn, socks);
case CURLM_STATE_DO_DONE: /* since is set after DO is completed, we switch
to waiting for the same as the *PERFORM
states */
case CURLM_STATE_PERFORM:
- return Curl_single_getsock(data->conn, socks, numsocks);
+ return Curl_single_getsock(data->conn, socks);
}
}
@@ -954,7 +944,7 @@ CURLMcode curl_multi_fdset(struct Curl_multi *multi,
data = multi->easyp;
while(data) {
- int bitmap = multi_getsock(data, sockbunch, MAX_SOCKSPEREASYHANDLE);
+ int bitmap = multi_getsock(data, sockbunch);
for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++) {
curl_socket_t s = CURL_SOCKET_BAD;
@@ -1015,7 +1005,7 @@ CURLMcode Curl_multi_wait(struct Curl_multi *multi,
/* Count up how many fds we have from the multi handle */
data = multi->easyp;
while(data) {
- bitmap = multi_getsock(data, sockbunch, MAX_SOCKSPEREASYHANDLE);
+ bitmap = multi_getsock(data, sockbunch);
for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++) {
curl_socket_t s = CURL_SOCKET_BAD;
@@ -1065,7 +1055,7 @@ CURLMcode Curl_multi_wait(struct Curl_multi *multi,
/* Add the curl handles to our pollfds first */
data = multi->easyp;
while(data) {
- bitmap = multi_getsock(data, sockbunch, MAX_SOCKSPEREASYHANDLE);
+ bitmap = multi_getsock(data, sockbunch);
for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++) {
curl_socket_t s = CURL_SOCKET_BAD;
@@ -2236,7 +2226,7 @@ static CURLMcode singlesocket(struct Curl_multi *multi,
/* Fill in the 'current' struct with the state as it is now: what sockets to
supervise and for what actions */
- curraction = multi_getsock(data, socks, MAX_SOCKSPEREASYHANDLE);
+ curraction = multi_getsock(data, socks);
/* We have 0 .. N sockets already and we get to know about the 0 .. M
sockets we should have from now on. Detect the differences, remove no