asyn-thread.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. /***************************************************************************
  2. * _ _ ____ _
  3. * Project ___| | | | _ \| |
  4. * / __| | | | |_) | |
  5. * | (__| |_| | _ <| |___
  6. * \___|\___/|_| \_\_____|
  7. *
  8. * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. *
  10. * This software is licensed as described in the file COPYING, which
  11. * you should have received as part of this distribution. The terms
  12. * are also available at https://curl.haxx.se/docs/copyright.html.
  13. *
  14. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. * copies of the Software, and permit persons to whom the Software is
  16. * furnished to do so, under the terms of the COPYING file.
  17. *
  18. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. * KIND, either express or implied.
  20. *
  21. ***************************************************************************/
  22. #include "curl_setup.h"
  23. /***********************************************************************
  24. * Only for threaded name resolves builds
  25. **********************************************************************/
  26. #ifdef CURLRES_THREADED
  27. #ifdef HAVE_NETINET_IN_H
  28. #include <netinet/in.h>
  29. #endif
  30. #ifdef HAVE_NETDB_H
  31. #include <netdb.h>
  32. #endif
  33. #ifdef HAVE_ARPA_INET_H
  34. #include <arpa/inet.h>
  35. #endif
  36. #ifdef __VMS
  37. #include <in.h>
  38. #include <inet.h>
  39. #endif
  40. #if defined(USE_THREADS_POSIX)
  41. # ifdef HAVE_PTHREAD_H
  42. # include <pthread.h>
  43. # endif
  44. #elif defined(USE_THREADS_WIN32)
  45. # ifdef HAVE_PROCESS_H
  46. # include <process.h>
  47. # endif
  48. #endif
  49. #if (defined(NETWARE) && defined(__NOVELL_LIBC__))
  50. #undef in_addr_t
  51. #define in_addr_t unsigned long
  52. #endif
  53. #ifdef HAVE_GETADDRINFO
  54. # define RESOLVER_ENOMEM EAI_MEMORY
  55. #else
  56. # define RESOLVER_ENOMEM ENOMEM
  57. #endif
  58. #include "urldata.h"
  59. #include "sendf.h"
  60. #include "hostip.h"
  61. #include "hash.h"
  62. #include "share.h"
  63. #include "strerror.h"
  64. #include "url.h"
  65. #include "multiif.h"
  66. #include "inet_pton.h"
  67. #include "inet_ntop.h"
  68. #include "curl_threads.h"
  69. #include "connect.h"
  70. /* The last 3 #include files should be in this order */
  71. #include "curl_printf.h"
  72. #include "curl_memory.h"
  73. #include "memdebug.h"
  74. struct resdata {
  75. struct curltime start;
  76. };
  77. /*
  78. * Curl_resolver_global_init()
  79. * Called from curl_global_init() to initialize global resolver environment.
  80. * Does nothing here.
  81. */
  82. int Curl_resolver_global_init(void)
  83. {
  84. return CURLE_OK;
  85. }
  86. /*
  87. * Curl_resolver_global_cleanup()
  88. * Called from curl_global_cleanup() to destroy global resolver environment.
  89. * Does nothing here.
  90. */
  91. void Curl_resolver_global_cleanup(void)
  92. {
  93. }
  94. /*
  95. * Curl_resolver_init()
  96. * Called from curl_easy_init() -> Curl_open() to initialize resolver
  97. * URL-state specific environment ('resolver' member of the UrlState
  98. * structure).
  99. */
  100. CURLcode Curl_resolver_init(void **resolver)
  101. {
  102. *resolver = calloc(1, sizeof(struct resdata));
  103. if(!*resolver)
  104. return CURLE_OUT_OF_MEMORY;
  105. return CURLE_OK;
  106. }
  107. /*
  108. * Curl_resolver_cleanup()
  109. * Called from curl_easy_cleanup() -> Curl_close() to cleanup resolver
  110. * URL-state specific environment ('resolver' member of the UrlState
  111. * structure).
  112. */
  113. void Curl_resolver_cleanup(void *resolver)
  114. {
  115. free(resolver);
  116. }
  117. /*
  118. * Curl_resolver_duphandle()
  119. * Called from curl_easy_duphandle() to duplicate resolver URL state-specific
  120. * environment ('resolver' member of the UrlState structure).
  121. */
  122. int Curl_resolver_duphandle(void **to, void *from)
  123. {
  124. (void)from;
  125. return Curl_resolver_init(to);
  126. }
  127. static void destroy_async_data(struct Curl_async *);
  128. /*
  129. * Cancel all possibly still on-going resolves for this connection.
  130. */
  131. void Curl_resolver_cancel(struct connectdata *conn)
  132. {
  133. destroy_async_data(&conn->async);
  134. }
  135. /* This function is used to init a threaded resolve */
  136. static bool init_resolve_thread(struct connectdata *conn,
  137. const char *hostname, int port,
  138. const struct addrinfo *hints);
  139. /* Data for synchronization between resolver thread and its parent */
  140. struct thread_sync_data {
  141. curl_mutex_t * mtx;
  142. int done;
  143. char *hostname; /* hostname to resolve, Curl_async.hostname
  144. duplicate */
  145. int port;
  146. int sock_error;
  147. Curl_addrinfo *res;
  148. #ifdef HAVE_GETADDRINFO
  149. struct addrinfo hints;
  150. #endif
  151. struct thread_data *td; /* for thread-self cleanup */
  152. };
  153. struct thread_data {
  154. curl_thread_t thread_hnd;
  155. unsigned int poll_interval;
  156. time_t interval_end;
  157. struct thread_sync_data tsd;
  158. };
  159. static struct thread_sync_data *conn_thread_sync_data(struct connectdata *conn)
  160. {
  161. return &(((struct thread_data *)conn->async.os_specific)->tsd);
  162. }
  163. /* Destroy resolver thread synchronization data */
  164. static
  165. void destroy_thread_sync_data(struct thread_sync_data * tsd)
  166. {
  167. if(tsd->mtx) {
  168. Curl_mutex_destroy(tsd->mtx);
  169. free(tsd->mtx);
  170. }
  171. free(tsd->hostname);
  172. if(tsd->res)
  173. Curl_freeaddrinfo(tsd->res);
  174. memset(tsd, 0, sizeof(*tsd));
  175. }
  176. /* Initialize resolver thread synchronization data */
  177. static
  178. int init_thread_sync_data(struct thread_data * td,
  179. const char *hostname,
  180. int port,
  181. const struct addrinfo *hints)
  182. {
  183. struct thread_sync_data *tsd = &td->tsd;
  184. memset(tsd, 0, sizeof(*tsd));
  185. tsd->td = td;
  186. tsd->port = port;
  187. /* Treat the request as done until the thread actually starts so any early
  188. * cleanup gets done properly.
  189. */
  190. tsd->done = 1;
  191. #ifdef HAVE_GETADDRINFO
  192. DEBUGASSERT(hints);
  193. tsd->hints = *hints;
  194. #else
  195. (void) hints;
  196. #endif
  197. tsd->mtx = malloc(sizeof(curl_mutex_t));
  198. if(tsd->mtx == NULL)
  199. goto err_exit;
  200. Curl_mutex_init(tsd->mtx);
  201. tsd->sock_error = CURL_ASYNC_SUCCESS;
  202. /* Copying hostname string because original can be destroyed by parent
  203. * thread during gethostbyname execution.
  204. */
  205. tsd->hostname = strdup(hostname);
  206. if(!tsd->hostname)
  207. goto err_exit;
  208. return 1;
  209. err_exit:
  210. /* Memory allocation failed */
  211. destroy_thread_sync_data(tsd);
  212. return 0;
  213. }
  214. static int getaddrinfo_complete(struct connectdata *conn)
  215. {
  216. struct thread_sync_data *tsd = conn_thread_sync_data(conn);
  217. int rc;
  218. rc = Curl_addrinfo_callback(conn, tsd->sock_error, tsd->res);
  219. /* The tsd->res structure has been copied to async.dns and perhaps the DNS
  220. cache. Set our copy to NULL so destroy_thread_sync_data doesn't free it.
  221. */
  222. tsd->res = NULL;
  223. return rc;
  224. }
  225. #ifdef HAVE_GETADDRINFO
  226. /*
  227. * getaddrinfo_thread() resolves a name and then exits.
  228. *
  229. * For builds without ARES, but with ENABLE_IPV6, create a resolver thread
  230. * and wait on it.
  231. */
  232. static unsigned int CURL_STDCALL getaddrinfo_thread(void *arg)
  233. {
  234. struct thread_sync_data *tsd = (struct thread_sync_data*)arg;
  235. struct thread_data *td = tsd->td;
  236. char service[12];
  237. int rc;
  238. snprintf(service, sizeof(service), "%d", tsd->port);
  239. rc = Curl_getaddrinfo_ex(tsd->hostname, service, &tsd->hints, &tsd->res);
  240. if(rc != 0) {
  241. tsd->sock_error = SOCKERRNO?SOCKERRNO:rc;
  242. if(tsd->sock_error == 0)
  243. tsd->sock_error = RESOLVER_ENOMEM;
  244. }
  245. else {
  246. Curl_addrinfo_set_port(tsd->res, tsd->port);
  247. }
  248. Curl_mutex_acquire(tsd->mtx);
  249. if(tsd->done) {
  250. /* too late, gotta clean up the mess */
  251. Curl_mutex_release(tsd->mtx);
  252. destroy_thread_sync_data(tsd);
  253. free(td);
  254. }
  255. else {
  256. tsd->done = 1;
  257. Curl_mutex_release(tsd->mtx);
  258. }
  259. return 0;
  260. }
  261. #else /* HAVE_GETADDRINFO */
  262. /*
  263. * gethostbyname_thread() resolves a name and then exits.
  264. */
  265. static unsigned int CURL_STDCALL gethostbyname_thread(void *arg)
  266. {
  267. struct thread_sync_data *tsd = (struct thread_sync_data *)arg;
  268. struct thread_data *td = tsd->td;
  269. tsd->res = Curl_ipv4_resolve_r(tsd->hostname, tsd->port);
  270. if(!tsd->res) {
  271. tsd->sock_error = SOCKERRNO;
  272. if(tsd->sock_error == 0)
  273. tsd->sock_error = RESOLVER_ENOMEM;
  274. }
  275. Curl_mutex_acquire(tsd->mtx);
  276. if(tsd->done) {
  277. /* too late, gotta clean up the mess */
  278. Curl_mutex_release(tsd->mtx);
  279. destroy_thread_sync_data(tsd);
  280. free(td);
  281. }
  282. else {
  283. tsd->done = 1;
  284. Curl_mutex_release(tsd->mtx);
  285. }
  286. return 0;
  287. }
  288. #endif /* HAVE_GETADDRINFO */
  289. /*
  290. * destroy_async_data() cleans up async resolver data and thread handle.
  291. */
  292. static void destroy_async_data(struct Curl_async *async)
  293. {
  294. if(async->os_specific) {
  295. struct thread_data *td = (struct thread_data*) async->os_specific;
  296. int done;
  297. /*
  298. * if the thread is still blocking in the resolve syscall, detach it and
  299. * let the thread do the cleanup...
  300. */
  301. Curl_mutex_acquire(td->tsd.mtx);
  302. done = td->tsd.done;
  303. td->tsd.done = 1;
  304. Curl_mutex_release(td->tsd.mtx);
  305. if(!done) {
  306. Curl_thread_destroy(td->thread_hnd);
  307. }
  308. else {
  309. if(td->thread_hnd != curl_thread_t_null)
  310. Curl_thread_join(&td->thread_hnd);
  311. destroy_thread_sync_data(&td->tsd);
  312. free(async->os_specific);
  313. }
  314. }
  315. async->os_specific = NULL;
  316. free(async->hostname);
  317. async->hostname = NULL;
  318. }
  319. /*
  320. * init_resolve_thread() starts a new thread that performs the actual
  321. * resolve. This function returns before the resolve is done.
  322. *
  323. * Returns FALSE in case of failure, otherwise TRUE.
  324. */
  325. static bool init_resolve_thread(struct connectdata *conn,
  326. const char *hostname, int port,
  327. const struct addrinfo *hints)
  328. {
  329. struct thread_data *td = calloc(1, sizeof(struct thread_data));
  330. int err = ENOMEM;
  331. conn->async.os_specific = (void *)td;
  332. if(!td)
  333. goto errno_exit;
  334. conn->async.port = port;
  335. conn->async.done = FALSE;
  336. conn->async.status = 0;
  337. conn->async.dns = NULL;
  338. td->thread_hnd = curl_thread_t_null;
  339. if(!init_thread_sync_data(td, hostname, port, hints)) {
  340. conn->async.os_specific = NULL;
  341. free(td);
  342. goto errno_exit;
  343. }
  344. free(conn->async.hostname);
  345. conn->async.hostname = strdup(hostname);
  346. if(!conn->async.hostname)
  347. goto err_exit;
  348. /* The thread will set this to 1 when complete. */
  349. td->tsd.done = 0;
  350. #ifdef HAVE_GETADDRINFO
  351. td->thread_hnd = Curl_thread_create(getaddrinfo_thread, &td->tsd);
  352. #else
  353. td->thread_hnd = Curl_thread_create(gethostbyname_thread, &td->tsd);
  354. #endif
  355. if(!td->thread_hnd) {
  356. /* The thread never started, so mark it as done here for proper cleanup. */
  357. td->tsd.done = 1;
  358. err = errno;
  359. goto err_exit;
  360. }
  361. return TRUE;
  362. err_exit:
  363. destroy_async_data(&conn->async);
  364. errno_exit:
  365. errno = err;
  366. return FALSE;
  367. }
  368. /*
  369. * resolver_error() calls failf() with the appropriate message after a resolve
  370. * error
  371. */
  372. static CURLcode resolver_error(struct connectdata *conn)
  373. {
  374. const char *host_or_proxy;
  375. CURLcode result;
  376. if(conn->bits.httpproxy) {
  377. host_or_proxy = "proxy";
  378. result = CURLE_COULDNT_RESOLVE_PROXY;
  379. }
  380. else {
  381. host_or_proxy = "host";
  382. result = CURLE_COULDNT_RESOLVE_HOST;
  383. }
  384. failf(conn->data, "Could not resolve %s: %s", host_or_proxy,
  385. conn->async.hostname);
  386. return result;
  387. }
  388. /*
  389. * Curl_resolver_wait_resolv()
  390. *
  391. * waits for a resolve to finish. This function should be avoided since using
  392. * this risk getting the multi interface to "hang".
  393. *
  394. * If 'entry' is non-NULL, make it point to the resolved dns entry
  395. *
  396. * This is the version for resolves-in-a-thread.
  397. */
  398. CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
  399. struct Curl_dns_entry **entry)
  400. {
  401. struct thread_data *td = (struct thread_data*) conn->async.os_specific;
  402. CURLcode result = CURLE_OK;
  403. DEBUGASSERT(conn && td);
  404. /* wait for the thread to resolve the name */
  405. if(Curl_thread_join(&td->thread_hnd)) {
  406. if(entry)
  407. result = getaddrinfo_complete(conn);
  408. }
  409. else
  410. DEBUGASSERT(0);
  411. conn->async.done = TRUE;
  412. if(entry)
  413. *entry = conn->async.dns;
  414. if(!conn->async.dns)
  415. /* a name was not resolved, report error */
  416. result = resolver_error(conn);
  417. destroy_async_data(&conn->async);
  418. if(!conn->async.dns)
  419. connclose(conn, "asynch resolve failed");
  420. return result;
  421. }
  422. /*
  423. * Curl_resolver_is_resolved() is called repeatedly to check if a previous
  424. * name resolve request has completed. It should also make sure to time-out if
  425. * the operation seems to take too long.
  426. */
  427. CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
  428. struct Curl_dns_entry **entry)
  429. {
  430. struct Curl_easy *data = conn->data;
  431. struct thread_data *td = (struct thread_data*) conn->async.os_specific;
  432. int done = 0;
  433. *entry = NULL;
  434. if(!td) {
  435. DEBUGASSERT(td);
  436. return CURLE_COULDNT_RESOLVE_HOST;
  437. }
  438. Curl_mutex_acquire(td->tsd.mtx);
  439. done = td->tsd.done;
  440. Curl_mutex_release(td->tsd.mtx);
  441. if(done) {
  442. getaddrinfo_complete(conn);
  443. if(!conn->async.dns) {
  444. CURLcode result = resolver_error(conn);
  445. destroy_async_data(&conn->async);
  446. return result;
  447. }
  448. destroy_async_data(&conn->async);
  449. *entry = conn->async.dns;
  450. }
  451. else {
  452. /* poll for name lookup done with exponential backoff up to 250ms */
  453. timediff_t elapsed = Curl_timediff(Curl_now(),
  454. data->progress.t_startsingle);
  455. if(elapsed < 0)
  456. elapsed = 0;
  457. if(td->poll_interval == 0)
  458. /* Start at 1ms poll interval */
  459. td->poll_interval = 1;
  460. else if(elapsed >= td->interval_end)
  461. /* Back-off exponentially if last interval expired */
  462. td->poll_interval *= 2;
  463. if(td->poll_interval > 250)
  464. td->poll_interval = 250;
  465. td->interval_end = elapsed + td->poll_interval;
  466. Curl_expire(conn->data, td->poll_interval, EXPIRE_ASYNC_NAME);
  467. }
  468. return CURLE_OK;
  469. }
  470. int Curl_resolver_getsock(struct connectdata *conn,
  471. curl_socket_t *socks,
  472. int numsocks)
  473. {
  474. time_t milli;
  475. timediff_t ms;
  476. struct Curl_easy *data = conn->data;
  477. struct resdata *reslv = (struct resdata *)data->state.resolver;
  478. (void)socks;
  479. (void)numsocks;
  480. ms = Curl_timediff(Curl_now(), reslv->start);
  481. if(ms < 3)
  482. milli = 0;
  483. else if(ms <= 50)
  484. milli = ms/3;
  485. else if(ms <= 250)
  486. milli = 50;
  487. else
  488. milli = 200;
  489. Curl_expire(data, milli, EXPIRE_ASYNC_NAME);
  490. return 0;
  491. }
  492. #ifndef HAVE_GETADDRINFO
  493. /*
  494. * Curl_getaddrinfo() - for platforms without getaddrinfo
  495. */
  496. Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
  497. const char *hostname,
  498. int port,
  499. int *waitp)
  500. {
  501. struct in_addr in;
  502. struct Curl_easy *data = conn->data;
  503. struct resdata *reslv = (struct resdata *)data->state.resolver;
  504. *waitp = 0; /* default to synchronous response */
  505. if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
  506. /* This is a dotted IP address 123.123.123.123-style */
  507. return Curl_ip2addr(AF_INET, &in, hostname, port);
  508. reslv->start = Curl_now();
  509. /* fire up a new resolver thread! */
  510. if(init_resolve_thread(conn, hostname, port, NULL)) {
  511. *waitp = 1; /* expect asynchronous response */
  512. return NULL;
  513. }
  514. failf(conn->data, "getaddrinfo() thread failed\n");
  515. return NULL;
  516. }
  517. #else /* !HAVE_GETADDRINFO */
  518. /*
  519. * Curl_resolver_getaddrinfo() - for getaddrinfo
  520. */
  521. Curl_addrinfo *Curl_resolver_getaddrinfo(struct connectdata *conn,
  522. const char *hostname,
  523. int port,
  524. int *waitp)
  525. {
  526. struct addrinfo hints;
  527. char sbuf[12];
  528. int pf = PF_INET;
  529. struct Curl_easy *data = conn->data;
  530. struct resdata *reslv = (struct resdata *)data->state.resolver;
  531. *waitp = 0; /* default to synchronous response */
  532. #ifndef USE_RESOLVE_ON_IPS
  533. {
  534. struct in_addr in;
  535. /* First check if this is an IPv4 address string */
  536. if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
  537. /* This is a dotted IP address 123.123.123.123-style */
  538. return Curl_ip2addr(AF_INET, &in, hostname, port);
  539. }
  540. #ifdef CURLRES_IPV6
  541. {
  542. struct in6_addr in6;
  543. /* check if this is an IPv6 address string */
  544. if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0)
  545. /* This is an IPv6 address literal */
  546. return Curl_ip2addr(AF_INET6, &in6, hostname, port);
  547. }
  548. #endif /* CURLRES_IPV6 */
  549. #endif /* !USE_RESOLVE_ON_IPS */
  550. #ifdef CURLRES_IPV6
  551. /*
  552. * Check if a limited name resolve has been requested.
  553. */
  554. switch(conn->ip_version) {
  555. case CURL_IPRESOLVE_V4:
  556. pf = PF_INET;
  557. break;
  558. case CURL_IPRESOLVE_V6:
  559. pf = PF_INET6;
  560. break;
  561. default:
  562. pf = PF_UNSPEC;
  563. break;
  564. }
  565. if((pf != PF_INET) && !Curl_ipv6works())
  566. /* The stack seems to be a non-IPv6 one */
  567. pf = PF_INET;
  568. #endif /* CURLRES_IPV6 */
  569. memset(&hints, 0, sizeof(hints));
  570. hints.ai_family = pf;
  571. hints.ai_socktype = conn->socktype;
  572. snprintf(sbuf, sizeof(sbuf), "%d", port);
  573. reslv->start = Curl_now();
  574. /* fire up a new resolver thread! */
  575. if(init_resolve_thread(conn, hostname, port, &hints)) {
  576. *waitp = 1; /* expect asynchronous response */
  577. return NULL;
  578. }
  579. failf(data, "getaddrinfo() thread failed to start\n");
  580. return NULL;
  581. }
  582. #endif /* !HAVE_GETADDRINFO */
  583. CURLcode Curl_set_dns_servers(struct Curl_easy *data,
  584. char *servers)
  585. {
  586. (void)data;
  587. (void)servers;
  588. return CURLE_NOT_BUILT_IN;
  589. }
  590. CURLcode Curl_set_dns_interface(struct Curl_easy *data,
  591. const char *interf)
  592. {
  593. (void)data;
  594. (void)interf;
  595. return CURLE_NOT_BUILT_IN;
  596. }
  597. CURLcode Curl_set_dns_local_ip4(struct Curl_easy *data,
  598. const char *local_ip4)
  599. {
  600. (void)data;
  601. (void)local_ip4;
  602. return CURLE_NOT_BUILT_IN;
  603. }
  604. CURLcode Curl_set_dns_local_ip6(struct Curl_easy *data,
  605. const char *local_ip6)
  606. {
  607. (void)data;
  608. (void)local_ip6;
  609. return CURLE_NOT_BUILT_IN;
  610. }
  611. #endif /* CURLRES_THREADED */