cleanup: remove the 'numsocks' argument used in many places

It was used (intended) to pass in the size of the 'socks' array that is
also passed to these functions, but was rarely actually checked/used and
the array is defined to a fixed size of MAX_SOCKSPEREASYHANDLE entries
that should be used instead.

Closes #4169
This commit is contained in:
Daniel Stenberg 2019-07-30 11:02:03 +02:00
parent cb542ac4d0
commit a55faf33d4
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
27 changed files with 88 additions and 201 deletions

View file

@ -1354,20 +1354,14 @@ CURLcode Curl_readwrite(struct connectdata *conn,
* in the proper state to have this information available.
*/
int Curl_single_getsock(const struct connectdata *conn,
curl_socket_t *sock, /* points to numsocks number
of sockets */
int numsocks)
curl_socket_t *sock)
{
const struct Curl_easy *data = conn->data;
int bitmap = GETSOCK_BLANK;
unsigned sockindex = 0;
if(conn->handler->perform_getsock)
return conn->handler->perform_getsock(conn, sock, numsocks);
if(numsocks < 2)
/* simple check but we might need two slots */
return GETSOCK_BLANK;
return conn->handler->perform_getsock(conn, sock);
/* don't include HOLD and PAUSE connections */
if((data->req.keepon & KEEP_RECVBITS) == KEEP_RECV) {