• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/curl-7.23.1/lib/

Lines Matching defs:easy

93 /* we support N sockets per easy handle. Set the corresponding bit to what
109 struct SessionHandle *easy_handle; /* the easy handle for this unit */
135 this multi handle with an easy handle. Set this to CURL_MULTI_HANDLE. */
138 /* We have a doubly-linked circular list with easy handles */
139 struct Curl_one_easy easy;
142 int num_alive; /* amount of easy handles that are added but have not yet
158 /* 'sockhash' is the lookup hash for socket descriptor => easy handles (note
159 the pluralis form, there can be more than one easy handle waiting on the
171 /* list of easy handles kept around for doing nice connection closures */
184 struct Curl_one_easy *easy);
227 static void multistate(struct Curl_one_easy *easy, CURLMstate state)
232 CURLMstate oldstate = easy->state;
238 easy->state = state;
241 if(easy->easy_conn) {
242 if(easy->state > CURLM_STATE_CONNECT &&
243 easy->state < CURLM_STATE_COMPLETED)
244 connectindex = easy->easy_conn->connectindex;
246 infof(easy->easy_handle,
248 statename[oldstate], statename[easy->state],
249 (char *)easy, connectindex);
253 /* changing to COMPLETED means there's one less easy handle 'alive' */
254 easy->easy_handle->multi->num_alive--;
262 struct SessionHandle *easy;
290 check->easy = data;
422 multi->easy.next = &multi->easy;
423 multi->easy.prev = &multi->easy;
444 struct Curl_one_easy *easy;
454 /* Verify that we got a somewhat good easy handle too */
458 /* Prevent users from adding same easy handle more than
465 the shared cache every single easy handle had 5 entries in their cache
482 /* Allocate and initialize timeout list for easy handle */
488 Curl_one_easy structs that holds pointers to easy handles */
489 easy = calloc(1, sizeof(struct Curl_one_easy));
490 if(!easy) {
497 ** no modification of easy nor multi handle allowed before this
502 /* Make easy handle use timeout list initialized above */
527 /* set the easy handle */
528 easy->easy_handle = data;
529 multistate(easy, CURLM_STATE_INIT);
532 easy->easy_handle->multi_pos = easy;
535 easy handle's one is currently private. */
536 if(easy->easy_handle->dns.hostcache &&
537 (easy->easy_handle->dns.hostcachetype == HCACHE_PRIVATE)) {
538 Curl_hash_destroy(easy->easy_handle->dns.hostcache);
539 easy->easy_handle->dns.hostcache = NULL;
540 easy->easy_handle->dns.hostcachetype = HCACHE_NONE;
543 if(!easy->easy_handle->dns.hostcache ||
544 (easy->easy_handle->dns.hostcachetype == HCACHE_NONE)) {
545 easy->easy_handle->dns.hostcache = multi->hostcache;
546 easy->easy_handle->dns.hostcachetype = HCACHE_MULTI;
550 is shared between all easy handles within the multi handle. */
551 if(easy->easy_handle->state.connc &&
552 (easy->easy_handle->state.connc->type == CONNCACHE_PRIVATE)) {
554 Curl_rm_connc(easy->easy_handle->state.connc);
555 easy->easy_handle->state.connc = NULL;
558 easy->easy_handle->state.connc = multi->connc;
559 easy->easy_handle->state.connc->type = CONNCACHE_MULTI;
567 easy->next = &multi->easy;
568 easy->prev = multi->easy.prev;
570 /* make 'easy' the last node in the chain */
571 multi->easy.prev = easy;
575 easy->prev->next = easy;
581 easy->easy_handle->set.one_easy = easy;
589 Curl_expire(easy->easy_handle, 1);
605 update_timer() to always trigger a callback to the app when a new easy
624 fprintf(stderr, " [easy %p/magic %x/socket %d]",
625 (void *)sh->easy, sh->easy->magic, (int)sh->socket);
633 struct Curl_one_easy *easy;
640 /* Verify that we got a somewhat good easy handle too */
645 easy = data->multi_pos;
647 if(easy) {
648 bool premature = (easy->state < CURLM_STATE_COMPLETED) ? TRUE : FALSE;
649 bool easy_owns_conn = (easy->easy_conn &&
650 (easy->easy_conn->data == easy->easy_handle)) ?
660 if(easy->easy_conn &&
661 (easy->easy_conn->send_pipe->size +
662 easy->easy_conn->recv_pipe->size > 1) &&
663 easy->state > CURLM_STATE_WAITDO &&
664 easy->state < CURLM_STATE_COMPLETED) {
668 easy->easy_conn->bits.close = TRUE;
671 easy->easy_conn->data = easy->easy_handle;
674 /* The timer must be shut down before easy->multi is set to NULL,
677 Curl_expire(easy->easy_handle, 0);
679 /* destroy the timeout list that is held in the easy handle */
685 if(easy->easy_handle->dns.hostcachetype == HCACHE_MULTI) {
687 easy->easy_handle->dns.hostcache = NULL;
688 easy->easy_handle->dns.hostcachetype = HCACHE_NONE;
691 if(easy->easy_conn) {
698 between the easy handle and the connection
702 (void)Curl_done(&easy->easy_conn, easy->result, premature);
704 if(easy->easy_conn)
707 easy->easy_conn->data = easy->easy_handle;
711 Curl_getoff_all_pipelines(easy->easy_handle, easy->easy_conn);
714 /* figure out if the easy handle is used by one or more connections in the
716 multi_connc_remove_handle(multi, easy->easy_handle);
718 if(easy->easy_handle->state.connc->type == CONNCACHE_MULTI) {
721 easy->easy_handle->state.connc = NULL;
725 easy->easy_handle->state.lastconnect = -1;
732 not need to touch connections like this when we just remove an easy
735 if(easy->easy_conn && easy_owns_conn &&
736 (easy->easy_conn->send_pipe->size +
737 easy->easy_conn->recv_pipe->size == 0))
738 easy->easy_conn->connectindex = -1;
743 easy->state = CURLM_STATE_COMPLETED;
744 singlesocket(multi, easy); /* to let the application know what sockets
747 Curl_easy_addmulti(easy->easy_handle, NULL); /* clear the association
751 /* make sure there's no pending message in the queue sent from this easy
758 if(msg->extmsg.easy_handle == easy->easy_handle) {
767 if(easy->prev)
768 easy->prev->next = easy->next;
770 if(easy->next)
771 easy->next->prev = easy->prev;
773 easy->easy_handle->set.one_easy = NULL; /* detached */
776 easy->easy_handle->multi_pos = NULL;
779 We do not touch the easy handle here! */
780 free(easy);
831 static int multi_getsock(struct Curl_one_easy *easy,
836 /* If the pipe broke, or if there's no connection left for this easy handle,
841 if(easy->easy_handle->state.pipe_broke || !easy->easy_conn)
844 if(easy->state > CURLM_STATE_CONNECT &&
845 easy->state < CURLM_STATE_COMPLETED) {
847 easy->easy_conn->data = easy->easy_handle;
850 switch(easy->state) {
868 return Curl_resolver_getsock(easy->easy_conn, socks, numsocks);
871 return Curl_protocol_getsock(easy->easy_conn, socks, numsocks);
875 return Curl_doing_getsock(easy->easy_conn, socks, numsocks);
879 return waitconnect_getsock(easy->easy_conn, socks, numsocks);
882 return domore_getsock(easy->easy_conn, socks, numsocks);
889 return Curl_single_getsock(easy->easy_conn, socks, numsocks);
898 /* Scan through all the easy handles to get the file descriptors set.
899 Some easy handles may not have connected to the remote host yet,
902 struct Curl_one_easy *easy;
912 easy=multi->easy.next;
913 while(easy != &multi->easy) {
914 bitmap = multi_getsock(easy, sockbunch, MAX_SOCKSPEREASYHANDLE);
936 easy = easy->next; /* check next handle */
946 struct Curl_one_easy *easy)
959 if(!GOOD_EASY_HANDLE(easy->easy_handle))
962 data = easy->easy_handle;
973 easy, data->state.path);
975 if(easy->state < CURLM_STATE_COMPLETED) {
977 multistate(easy, CURLM_STATE_CONNECT);
979 easy->result = CURLE_OK;
983 easy->easy_conn = NULL;
987 if(easy->easy_conn && easy->state > CURLM_STATE_CONNECT &&
988 easy->state < CURLM_STATE_COMPLETED)
990 easy->easy_conn->data = data;
992 if(easy->easy_conn &&
993 (easy->state >= CURLM_STATE_CONNECT) &&
994 (easy->state < CURLM_STATE_COMPLETED)) {
999 (easy->state <= CURLM_STATE_WAITDO)?
1004 if(easy->state == CURLM_STATE_WAITRESOLVE)
1007 else if(easy->state == CURLM_STATE_WAITCONNECT)
1021 easy->easy_conn->bits.close = TRUE;
1022 easy->result = CURLE_OPERATION_TIMEDOUT;
1023 multistate(easy, CURLM_STATE_COMPLETED);
1028 switch(easy->state) {
1031 easy->result=Curl_pretransfer(data);
1033 if(CURLE_OK == easy->result) {
1035 multistate(easy, CURLM_STATE_CONNECT);
1045 easy->result = Curl_connect(data, &easy->easy_conn,
1048 if(CURLE_OK == easy->result) {
1050 easy->result = addHandleToSendOrPendPipeline(data,
1051 easy->easy_conn);
1052 if(CURLE_OK != easy->result)
1057 multistate(easy, CURLM_STATE_WAITRESOLVE);
1065 multistate(easy, multi->pipelining_enabled?
1069 if(easy->easy_conn->bits.tunnel_connecting)
1070 multistate(easy, CURLM_STATE_WAITPROXYCONNECT);
1073 multistate(easy, CURLM_STATE_WAITCONNECT);
1086 easy->result = Curl_resolver_is_resolved(easy->easy_conn, &dns);
1092 singlesocket(multi, easy);
1096 easy->result = Curl_async_resolved(easy->easy_conn,
1099 if(CURLE_OK != easy->result)
1102 easy->easy_conn = NULL; /* no more connection */
1107 multistate(easy, multi->pipelining_enabled?
1111 if(easy->easy_conn->bits.tunnel_connecting)
1112 multistate(easy, CURLM_STATE_WAITPROXYCONNECT);
1115 multistate(easy, CURLM_STATE_WAITCONNECT);
1120 if(CURLE_OK != easy->result) {
1131 easy->result = Curl_http_connect(easy->easy_conn, &protocol_connect);
1133 if(easy->easy_conn->bits.proxy_connect_closed) {
1139 easy->result = CURLE_OK;
1141 multistate(easy, CURLM_STATE_CONNECT);
1143 else if(CURLE_OK == easy->result) {
1144 if(!easy->easy_conn->bits.tunnel_connecting)
1145 multistate(easy, CURLM_STATE_WAITCONNECT);
1152 easy->result = Curl_is_connected(easy->easy_conn,
1157 if(!easy->result)
1160 easy->result = Curl_protocol_connect(easy->easy_conn,
1164 if(CURLE_OK != easy->result) {
1179 if(easy->easy_conn->bits.tunnel_connecting)
1180 multistate(easy, CURLM_STATE_WAITPROXYCONNECT);
1183 multistate(easy, CURLM_STATE_PROTOCONNECT);
1188 multistate(easy, multi->pipelining_enabled?
1197 easy->result = Curl_protocol_connecting(easy->easy_conn,
1199 if((easy->result == CURLE_OK) && protocol_connect) {
1201 multistate(easy, multi->pipelining_enabled?
1205 else if(easy->result) {
1208 Curl_done(&easy->easy_conn, easy->result, TRUE);
1217 easy->easy_conn->connectindex,
1218 easy->easy_conn->send_pipe->size,
1219 easy->easy_conn->writechannel_inuse?1:0,
1221 easy->easy_conn->send_pipe)?1:0);
1223 if(!easy->easy_conn->writechannel_inuse &&
1225 easy->easy_conn->send_pipe)) {
1227 easy->easy_conn->writechannel_inuse = TRUE;
1228 multistate(easy, CURLM_STATE_DO);
1236 easy->easy_conn->bits.close = FALSE;
1237 multistate(easy, CURLM_STATE_DONE);
1238 easy->result = CURLE_OK;
1243 easy->result = Curl_do(&easy->easy_conn,
1246 if(CURLE_OK == easy->result) {
1253 Curl_done(&easy->easy_conn, CURLE_OK, FALSE);
1254 multistate(easy, CURLM_STATE_DONE);
1261 multistate(easy, CURLM_STATE_DOING);
1266 else if(easy->easy_conn->bits.do_more) {
1269 multistate(easy, CURLM_STATE_DO_MORE);
1274 multistate(easy, CURLM_STATE_DO_DONE);
1278 else if((CURLE_SEND_ERROR == easy->result) &&
1279 easy->easy_conn->bits.reuse) {
1290 drc = Curl_retry_request(easy->easy_conn, &newurl);
1293 easy->result = drc;
1300 drc = Curl_done(&easy->easy_conn, easy->result, FALSE);
1309 multistate(easy, CURLM_STATE_CONNECT);
1311 easy->result = CURLE_OK;
1315 easy->result = drc;
1321 easy->result = drc;
1333 Curl_done(&easy->easy_conn, easy->result, FALSE);
1341 easy->result = Curl_protocol_doing(easy->easy_conn,
1343 if(CURLE_OK == easy->result) {
1346 multistate(easy, easy->easy_conn->bits.do_more?
1355 Curl_done(&easy->easy_conn, easy->result, FALSE);
1362 easy->result = Curl_is_connected(easy->easy_conn,
1369 easy->result = Curl_do_more(easy->easy_conn);
1374 if(CURLE_OK == easy->result) {
1375 multistate(easy, CURLM_STATE_DO_DONE);
1381 Curl_done(&easy->easy_conn, easy->result, FALSE);
1389 moveHandleFromSendToRecvPipeline(data, easy->easy_conn);
1391 checkPendPipeline(easy->easy_conn);
1392 multistate(easy, CURLM_STATE_WAITPERFORM);
1398 if(!easy->easy_conn->readchannel_inuse &&
1400 easy->easy_conn->recv_pipe)) {
1402 easy->easy_conn->readchannel_inuse = TRUE;
1403 multistate(easy, CURLM_STATE_PERFORM);
1409 easy->easy_conn->connectindex,
1410 easy->easy_conn->recv_pipe->size,
1411 easy->easy_conn->readchannel_inuse?1:0,
1413 easy->easy_conn->recv_pipe)?1:0);
1420 Curl_pgrsUpdate(easy->easy_conn);
1425 multistate(easy, CURLM_STATE_PERFORM);
1434 multistate(easy, CURLM_STATE_TOOFAST);
1450 multistate(easy, CURLM_STATE_TOOFAST);
1462 easy->result = Curl_readwrite(easy->easy_conn, &done);
1468 easy->easy_conn->readchannel_inuse = FALSE;
1473 easy->easy_conn->writechannel_inuse = FALSE;
1476 if(easy->result) {
1483 if(!(easy->easy_conn->handler->flags & PROTOPT_DUAL))
1484 easy->easy_conn->bits.close = TRUE;
1487 Curl_done(&easy->easy_conn, easy->result, FALSE);
1494 easy->result = Curl_retry_request(easy->easy_conn, &newurl);
1495 if(!easy->result)
1503 easy->easy_conn);
1506 if(easy->easy_conn->recv_pipe->head)
1507 Curl_expire(easy->easy_conn->recv_pipe->head->ptr, 1);
1510 checkPendPipeline(easy->easy_conn);
1524 easy->result = Curl_done(&easy->easy_conn, CURLE_OK, FALSE);
1525 if(easy->result == CURLE_OK)
1526 easy->result = Curl_follow(data, newurl, follow);
1527 if(CURLE_OK == easy->result) {
1528 multistate(easy, CURLM_STATE_CONNECT);
1544 easy->result = Curl_follow(data, newurl, FOLLOW_FAKE);
1545 if(easy->result) {
1551 multistate(easy, CURLM_STATE_DONE);
1560 if(easy->easy_conn) {
1564 easy->easy_conn->recv_pipe);
1566 easy->easy_conn->done_pipe);
1568 checkPendPipeline(easy->easy_conn);
1570 if(easy->easy_conn->bits.stream_was_rewound) {
1578 easy->result = Curl_done(&easy->easy_conn, CURLE_OK, FALSE);
1585 if(easy->easy_conn)
1586 easy->easy_conn = NULL;
1594 multistate(easy, CURLM_STATE_INIT);
1601 multistate(easy, CURLM_STATE_COMPLETED);
1613 easy->easy_conn = NULL;
1625 if(easy->state < CURLM_STATE_COMPLETED) {
1626 if(CURLE_OK != easy->result) {
1637 if(easy->easy_conn) {
1639 easy->easy_conn->writechannel_inuse = FALSE;
1640 easy->easy_conn->readchannel_inuse = FALSE;
1642 easy->easy_conn->send_pipe);
1644 easy->easy_conn->recv_pipe);
1646 easy->easy_conn->done_pipe);
1648 checkPendPipeline(easy->easy_conn);
1652 Curl_disconnect(easy->easy_conn, /* dead_connection */ FALSE);
1657 easy->easy_conn = NULL;
1660 else if(easy->state == CURLM_STATE_CONNECT) {
1665 multistate(easy, CURLM_STATE_COMPLETED);
1668 else if(easy->easy_conn && Curl_pgrsUpdate(easy->easy_conn)) {
1671 easy->easy_conn->bits.close = TRUE;
1674 multistate(easy, (easy->state < CURLM_STATE_DONE)?
1681 if(CURLM_STATE_COMPLETED == easy->state) {
1689 msg = &easy->msg;
1693 msg->extmsg.data.result = easy->result;
1697 multistate(easy, CURLM_STATE_MSGSENT);
1707 struct Curl_one_easy *easy;
1715 easy=multi->easy.next;
1716 while(easy != &multi->easy) {
1718 struct WildcardData *wc = &easy->easy_handle->wildcard;
1720 if(easy->easy_handle->set.wildcardmatch) {
1729 result = multi_runsingle(multi, now, easy);
1732 if(easy->easy_handle->set.wildcardmatch) {
1741 easy = easy->next; /* operate on next handle */
1773 struct Curl_one_easy *easy;
1797 for this easy handle */
1817 /* remove all easy handles */
1818 easy = multi->easy.next;
1819 while(easy != &multi->easy) {
1820 nexteasy=easy->next;
1821 if(easy->easy_handle->dns.hostcachetype == HCACHE_MULTI) {
1823 easy->easy_handle->dns.hostcache = NULL;
1824 easy->easy_handle->dns.hostcachetype = HCACHE_NONE;
1828 easy->easy_handle->state.connc = NULL;
1830 Curl_easy_addmulti(easy->easy_handle, NULL); /* clear the association */
1832 free(easy);
1833 easy = nexteasy;
1887 struct Curl_one_easy *easy)
1903 curraction = multi_getsock(easy, socks, MAX_SOCKSPEREASYHANDLE);
1933 entry = sh_addentry(multi->sockhash, s, easy->easy_handle);
1940 multi->socket_cb(easy->easy_handle,
1953 for(i=0; i< easy->numsocks; i++) {
1955 s = easy->sockets[i];
1971 other easy-s in a pipeline. In this case the socket should not be
1975 easy_by_hash = entry->easy->multi_pos;
1983 for the recv_pipe, or the first (in case this particular easy
1985 if(entry->easy == easy->easy_handle) {
1986 if(isHandleAtHead(easy->easy_handle, easy_conn->recv_pipe))
1987 entry->easy = easy_conn->recv_pipe->head->next->ptr;
1989 entry->easy = easy_conn->recv_pipe->head->ptr;
1997 for the send_pipe, or the first (in case this particular easy
1999 if(entry->easy == easy->easy_handle) {
2000 if(isHandleAtHead(easy->easy_handle, easy_conn->send_pipe))
2001 entry->easy = easy_conn->send_pipe->head->next->ptr;
2003 entry->easy = easy_conn->send_pipe->head->ptr;
2019 multi->socket_cb(easy->easy_handle,
2030 memcpy(easy->sockets, socks, num*sizeof(curl_socket_t));
2031 easy->numsocks = num;
2106 /* walk through each easy handle and do the socket state change magic
2108 easyp=multi->easy.next;
2109 while(easyp != &multi->easy) {
2130 data = entry->easy;
2464 /* Since there's a new easy handle at the start of the send pipeline,
2701 we need to add this handle to the list of "easy handles kept around
2718 /* disconect the easy handle from the connection since the connection
2719 will now remain but this easy handle is going */
2729 that this handle isn't already added, like for the cases when an easy
2763 infof(data, "Delayed kill of easy handle %p\n", cl->easy_handle);
2765 for this easy handle */
2801 struct Curl_one_easy *easy;
2805 for(easy=multi->easy.next; easy != &multi->easy; easy = easy->next) {
2806 if(easy->state < CURLM_STATE_COMPLETED) {
2809 (void *)easy->easy_handle,
2810 statename[easy->state], easy->numsocks);
2811 for(i=0; i < easy->numsocks; i++) {
2812 curl_socket_t s = easy->sockets[i];
2825 if(easy->numsocks)