484
Curl_expire(data, 0); /* shut off timers */
480
487
/* This handle is still part of a multi handle, take care of this first
481
488
and detach this handle from there. */
482
Curl_multi_rmeasy(data->multi, data);
489
curl_multi_remove_handle(data->multi, data);
491
/* Destroy the timeout list that is held in the easy handle. It is
492
/normally/ done by curl_multi_remove_handle() but this is "just in
494
if(data->state.timeoutlist) {
495
Curl_llist_destroy(data->state.timeoutlist, NULL);
496
data->state.timeoutlist = NULL;
484
499
data->magic = 0; /* force a clear AFTER the possibly enforced removal from
485
500
the multi handle, since that function uses the magic
2686
2700
else if (sval & CURL_CSELECT_IN) {
2687
2701
/* readable with no error. could be closed or could be alive */
2688
long connectinfo = 0;
2689
Curl_getconnectinfo(check->data, &connectinfo, &check);
2690
if(connectinfo != -1) {
2702
curl_socket_t connectinfo =
2703
Curl_getconnectinfo(check->data, &check);
2704
if(connectinfo != CURL_SOCKET_BAD)
2691
2705
ret_val = FALSE;
2695
2708
return ret_val;
4307
4320
*portptr = '\0'; /* cut off the name there */
4308
4321
conn->remote_port = curlx_ultous(port);
4324
/* Browser behavior adaptation. If there's a colon with no digits after,
4325
just cut off the name there which makes us ignore the colon and just
4326
use the default port. Firefox and Chrome both do that. */
4311
4329
return CURLE_OK;
4389
4407
CURLcode result=CURLE_OK;
4390
long shortest = 0; /* default to no timeout */
4392
/*************************************************************
4393
* Set timeout if that is being used
4394
*************************************************************/
4395
if(data->set.timeout || data->set.connecttimeout) {
4397
/* We set the timeout on the name resolving phase first, separately from
4398
* the download/upload part to allow a maximum time on everything. This is
4399
* a signal-based timeout, why it won't work and shouldn't be used in
4400
* multi-threaded environments. */
4402
shortest = data->set.timeout; /* default to this timeout value */
4403
if(shortest && data->set.connecttimeout &&
4404
(data->set.connecttimeout < shortest))
4405
/* if both are set, pick the shortest */
4406
shortest = data->set.connecttimeout;
4408
/* if timeout is not set, use the connect timeout */
4409
shortest = data->set.connecttimeout;
4410
/* We can expect the conn->created time to be "now", as that was just
4411
recently set in the beginning of this function and nothing slow
4412
has been done since then until now. */
4408
long timeout_ms = Curl_timeleft(conn, NULL, TRUE);
4415
4410
/*************************************************************
4416
4411
* Resolve the name of the server or proxy
4438
4433
/* Resolve target host right on */
4439
4434
rc = Curl_resolv_timeout(conn, conn->host.name, (int)conn->port,
4440
&hostaddr, shortest);
4435
&hostaddr, timeout_ms);
4441
4436
if(rc == CURLRESOLV_PENDING)
5292
5285
static void do_complete(struct connectdata *conn)
5294
5287
conn->data->req.chunk=FALSE;
5295
conn->data->req.trailerhdrpresent=FALSE;
5297
5288
conn->data->req.maxfd = (conn->sockfd>conn->writesockfd?
5298
conn->sockfd:conn->writesockfd)+1;
5289
conn->sockfd:conn->writesockfd)+1;
5301
5292
CURLcode Curl_do(struct connectdata **connp, bool *done)