2
0

cf-https-connect.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. /***************************************************************************
  2. * _ _ ____ _
  3. * Project ___| | | | _ \| |
  4. * / __| | | | |_) | |
  5. * | (__| |_| | _ <| |___
  6. * \___|\___/|_| \_\_____|
  7. *
  8. * Copyright (C) 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.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. * SPDX-License-Identifier: curl
  22. *
  23. ***************************************************************************/
  24. #include "curl_setup.h"
  25. #if !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER)
  26. #include "urldata.h"
  27. #include <curl/curl.h>
  28. #include "curl_trc.h"
  29. #include "cfilters.h"
  30. #include "connect.h"
  31. #include "multiif.h"
  32. #include "cf-https-connect.h"
  33. #include "http2.h"
  34. #include "vquic/vquic.h"
  35. /* The last 3 #include files should be in this order */
  36. #include "curl_printf.h"
  37. #include "curl_memory.h"
  38. #include "memdebug.h"
  39. typedef enum {
  40. CF_HC_INIT,
  41. CF_HC_CONNECT,
  42. CF_HC_SUCCESS,
  43. CF_HC_FAILURE
  44. } cf_hc_state;
  45. struct cf_hc_baller {
  46. const char *name;
  47. struct Curl_cfilter *cf;
  48. CURLcode result;
  49. struct curltime started;
  50. int reply_ms;
  51. BIT(enabled);
  52. BIT(shutdown);
  53. };
  54. static void cf_hc_baller_reset(struct cf_hc_baller *b,
  55. struct Curl_easy *data)
  56. {
  57. if(b->cf) {
  58. Curl_conn_cf_close(b->cf, data);
  59. Curl_conn_cf_discard_chain(&b->cf, data);
  60. b->cf = NULL;
  61. }
  62. b->result = CURLE_OK;
  63. b->reply_ms = -1;
  64. }
  65. static bool cf_hc_baller_is_active(struct cf_hc_baller *b)
  66. {
  67. return b->enabled && b->cf && !b->result;
  68. }
  69. static bool cf_hc_baller_has_started(struct cf_hc_baller *b)
  70. {
  71. return !!b->cf;
  72. }
  73. static int cf_hc_baller_reply_ms(struct cf_hc_baller *b,
  74. struct Curl_easy *data)
  75. {
  76. if(b->reply_ms < 0)
  77. b->cf->cft->query(b->cf, data, CF_QUERY_CONNECT_REPLY_MS,
  78. &b->reply_ms, NULL);
  79. return b->reply_ms;
  80. }
  81. static bool cf_hc_baller_data_pending(struct cf_hc_baller *b,
  82. const struct Curl_easy *data)
  83. {
  84. return b->cf && !b->result && b->cf->cft->has_data_pending(b->cf, data);
  85. }
  86. static bool cf_hc_baller_needs_flush(struct cf_hc_baller *b,
  87. struct Curl_easy *data)
  88. {
  89. return b->cf && !b->result && Curl_conn_cf_needs_flush(b->cf, data);
  90. }
  91. static CURLcode cf_hc_baller_cntrl(struct cf_hc_baller *b,
  92. struct Curl_easy *data,
  93. int event, int arg1, void *arg2)
  94. {
  95. if(b->cf && !b->result)
  96. return Curl_conn_cf_cntrl(b->cf, data, FALSE, event, arg1, arg2);
  97. return CURLE_OK;
  98. }
  99. struct cf_hc_ctx {
  100. cf_hc_state state;
  101. const struct Curl_dns_entry *remotehost;
  102. struct curltime started; /* when connect started */
  103. CURLcode result; /* overall result */
  104. struct cf_hc_baller h3_baller;
  105. struct cf_hc_baller h21_baller;
  106. unsigned int soft_eyeballs_timeout_ms;
  107. unsigned int hard_eyeballs_timeout_ms;
  108. };
  109. static void cf_hc_baller_init(struct cf_hc_baller *b,
  110. struct Curl_cfilter *cf,
  111. struct Curl_easy *data,
  112. const char *name,
  113. int transport)
  114. {
  115. struct cf_hc_ctx *ctx = cf->ctx;
  116. struct Curl_cfilter *save = cf->next;
  117. b->name = name;
  118. cf->next = NULL;
  119. b->started = Curl_now();
  120. b->result = Curl_cf_setup_insert_after(cf, data, ctx->remotehost,
  121. transport, CURL_CF_SSL_ENABLE);
  122. b->cf = cf->next;
  123. cf->next = save;
  124. }
  125. static CURLcode cf_hc_baller_connect(struct cf_hc_baller *b,
  126. struct Curl_cfilter *cf,
  127. struct Curl_easy *data,
  128. bool *done)
  129. {
  130. struct Curl_cfilter *save = cf->next;
  131. cf->next = b->cf;
  132. b->result = Curl_conn_cf_connect(cf->next, data, FALSE, done);
  133. b->cf = cf->next; /* it might mutate */
  134. cf->next = save;
  135. return b->result;
  136. }
  137. static void cf_hc_reset(struct Curl_cfilter *cf, struct Curl_easy *data)
  138. {
  139. struct cf_hc_ctx *ctx = cf->ctx;
  140. if(ctx) {
  141. cf_hc_baller_reset(&ctx->h3_baller, data);
  142. cf_hc_baller_reset(&ctx->h21_baller, data);
  143. ctx->state = CF_HC_INIT;
  144. ctx->result = CURLE_OK;
  145. ctx->hard_eyeballs_timeout_ms = data->set.happy_eyeballs_timeout;
  146. ctx->soft_eyeballs_timeout_ms = data->set.happy_eyeballs_timeout / 2;
  147. }
  148. }
  149. static CURLcode baller_connected(struct Curl_cfilter *cf,
  150. struct Curl_easy *data,
  151. struct cf_hc_baller *winner)
  152. {
  153. struct cf_hc_ctx *ctx = cf->ctx;
  154. CURLcode result = CURLE_OK;
  155. DEBUGASSERT(winner->cf);
  156. if(winner != &ctx->h3_baller)
  157. cf_hc_baller_reset(&ctx->h3_baller, data);
  158. if(winner != &ctx->h21_baller)
  159. cf_hc_baller_reset(&ctx->h21_baller, data);
  160. CURL_TRC_CF(data, cf, "connect+handshake %s: %dms, 1st data: %dms",
  161. winner->name, (int)Curl_timediff(Curl_now(), winner->started),
  162. cf_hc_baller_reply_ms(winner, data));
  163. cf->next = winner->cf;
  164. winner->cf = NULL;
  165. switch(cf->conn->alpn) {
  166. case CURL_HTTP_VERSION_3:
  167. break;
  168. case CURL_HTTP_VERSION_2:
  169. #ifdef USE_NGHTTP2
  170. /* Using nghttp2, we add the filter "below" us, so when the conn
  171. * closes, we tear it down for a fresh reconnect */
  172. result = Curl_http2_switch_at(cf, data);
  173. if(result) {
  174. ctx->state = CF_HC_FAILURE;
  175. ctx->result = result;
  176. return result;
  177. }
  178. #endif
  179. break;
  180. default:
  181. break;
  182. }
  183. ctx->state = CF_HC_SUCCESS;
  184. cf->connected = TRUE;
  185. return result;
  186. }
  187. static bool time_to_start_h21(struct Curl_cfilter *cf,
  188. struct Curl_easy *data,
  189. struct curltime now)
  190. {
  191. struct cf_hc_ctx *ctx = cf->ctx;
  192. timediff_t elapsed_ms;
  193. if(!ctx->h21_baller.enabled || cf_hc_baller_has_started(&ctx->h21_baller))
  194. return FALSE;
  195. if(!ctx->h3_baller.enabled || !cf_hc_baller_is_active(&ctx->h3_baller))
  196. return TRUE;
  197. elapsed_ms = Curl_timediff(now, ctx->started);
  198. if(elapsed_ms >= ctx->hard_eyeballs_timeout_ms) {
  199. CURL_TRC_CF(data, cf, "hard timeout of %dms reached, starting h21",
  200. ctx->hard_eyeballs_timeout_ms);
  201. return TRUE;
  202. }
  203. if(elapsed_ms >= ctx->soft_eyeballs_timeout_ms) {
  204. if(cf_hc_baller_reply_ms(&ctx->h3_baller, data) < 0) {
  205. CURL_TRC_CF(data, cf, "soft timeout of %dms reached, h3 has not "
  206. "seen any data, starting h21",
  207. ctx->soft_eyeballs_timeout_ms);
  208. return TRUE;
  209. }
  210. /* set the effective hard timeout again */
  211. Curl_expire(data, ctx->hard_eyeballs_timeout_ms - elapsed_ms,
  212. EXPIRE_ALPN_EYEBALLS);
  213. }
  214. return FALSE;
  215. }
  216. static CURLcode cf_hc_connect(struct Curl_cfilter *cf,
  217. struct Curl_easy *data,
  218. bool blocking, bool *done)
  219. {
  220. struct cf_hc_ctx *ctx = cf->ctx;
  221. struct curltime now;
  222. CURLcode result = CURLE_OK;
  223. (void)blocking;
  224. if(cf->connected) {
  225. *done = TRUE;
  226. return CURLE_OK;
  227. }
  228. *done = FALSE;
  229. now = Curl_now();
  230. switch(ctx->state) {
  231. case CF_HC_INIT:
  232. DEBUGASSERT(!ctx->h3_baller.cf);
  233. DEBUGASSERT(!ctx->h21_baller.cf);
  234. DEBUGASSERT(!cf->next);
  235. CURL_TRC_CF(data, cf, "connect, init");
  236. ctx->started = now;
  237. if(ctx->h3_baller.enabled) {
  238. cf_hc_baller_init(&ctx->h3_baller, cf, data, "h3", TRNSPRT_QUIC);
  239. if(ctx->h21_baller.enabled)
  240. Curl_expire(data, ctx->soft_eyeballs_timeout_ms, EXPIRE_ALPN_EYEBALLS);
  241. }
  242. else if(ctx->h21_baller.enabled)
  243. cf_hc_baller_init(&ctx->h21_baller, cf, data, "h21",
  244. cf->conn->transport);
  245. ctx->state = CF_HC_CONNECT;
  246. FALLTHROUGH();
  247. case CF_HC_CONNECT:
  248. if(cf_hc_baller_is_active(&ctx->h3_baller)) {
  249. result = cf_hc_baller_connect(&ctx->h3_baller, cf, data, done);
  250. if(!result && *done) {
  251. result = baller_connected(cf, data, &ctx->h3_baller);
  252. goto out;
  253. }
  254. }
  255. if(time_to_start_h21(cf, data, now)) {
  256. cf_hc_baller_init(&ctx->h21_baller, cf, data, "h21",
  257. cf->conn->transport);
  258. }
  259. if(cf_hc_baller_is_active(&ctx->h21_baller)) {
  260. CURL_TRC_CF(data, cf, "connect, check h21");
  261. result = cf_hc_baller_connect(&ctx->h21_baller, cf, data, done);
  262. if(!result && *done) {
  263. result = baller_connected(cf, data, &ctx->h21_baller);
  264. goto out;
  265. }
  266. }
  267. if((!ctx->h3_baller.enabled || ctx->h3_baller.result) &&
  268. (!ctx->h21_baller.enabled || ctx->h21_baller.result)) {
  269. /* both failed or disabled. we give up */
  270. CURL_TRC_CF(data, cf, "connect, all failed");
  271. result = ctx->result = ctx->h3_baller.enabled ?
  272. ctx->h3_baller.result : ctx->h21_baller.result;
  273. ctx->state = CF_HC_FAILURE;
  274. goto out;
  275. }
  276. result = CURLE_OK;
  277. *done = FALSE;
  278. break;
  279. case CF_HC_FAILURE:
  280. result = ctx->result;
  281. cf->connected = FALSE;
  282. *done = FALSE;
  283. break;
  284. case CF_HC_SUCCESS:
  285. result = CURLE_OK;
  286. cf->connected = TRUE;
  287. *done = TRUE;
  288. break;
  289. }
  290. out:
  291. CURL_TRC_CF(data, cf, "connect -> %d, done=%d", result, *done);
  292. return result;
  293. }
  294. static CURLcode cf_hc_shutdown(struct Curl_cfilter *cf,
  295. struct Curl_easy *data, bool *done)
  296. {
  297. struct cf_hc_ctx *ctx = cf->ctx;
  298. struct cf_hc_baller *ballers[2];
  299. size_t i;
  300. CURLcode result = CURLE_OK;
  301. DEBUGASSERT(data);
  302. if(cf->connected) {
  303. *done = TRUE;
  304. return CURLE_OK;
  305. }
  306. /* shutdown all ballers that have not done so already. If one fails,
  307. * continue shutting down others until all are shutdown. */
  308. ballers[0] = &ctx->h3_baller;
  309. ballers[1] = &ctx->h21_baller;
  310. for(i = 0; i < sizeof(ballers)/sizeof(ballers[0]); i++) {
  311. struct cf_hc_baller *b = ballers[i];
  312. bool bdone = FALSE;
  313. if(!cf_hc_baller_is_active(b) || b->shutdown)
  314. continue;
  315. b->result = b->cf->cft->do_shutdown(b->cf, data, &bdone);
  316. if(b->result || bdone)
  317. b->shutdown = TRUE; /* treat a failed shutdown as done */
  318. }
  319. *done = TRUE;
  320. for(i = 0; i < sizeof(ballers)/sizeof(ballers[0]); i++) {
  321. if(ballers[i] && !ballers[i]->shutdown)
  322. *done = FALSE;
  323. }
  324. if(*done) {
  325. for(i = 0; i < sizeof(ballers)/sizeof(ballers[0]); i++) {
  326. if(ballers[i] && ballers[i]->result)
  327. result = ballers[i]->result;
  328. }
  329. }
  330. CURL_TRC_CF(data, cf, "shutdown -> %d, done=%d", result, *done);
  331. return result;
  332. }
  333. static void cf_hc_adjust_pollset(struct Curl_cfilter *cf,
  334. struct Curl_easy *data,
  335. struct easy_pollset *ps)
  336. {
  337. if(!cf->connected) {
  338. struct cf_hc_ctx *ctx = cf->ctx;
  339. struct cf_hc_baller *ballers[2];
  340. size_t i;
  341. ballers[0] = &ctx->h3_baller;
  342. ballers[1] = &ctx->h21_baller;
  343. for(i = 0; i < sizeof(ballers)/sizeof(ballers[0]); i++) {
  344. struct cf_hc_baller *b = ballers[i];
  345. if(!cf_hc_baller_is_active(b))
  346. continue;
  347. Curl_conn_cf_adjust_pollset(b->cf, data, ps);
  348. }
  349. CURL_TRC_CF(data, cf, "adjust_pollset -> %d socks", ps->num);
  350. }
  351. }
  352. static bool cf_hc_data_pending(struct Curl_cfilter *cf,
  353. const struct Curl_easy *data)
  354. {
  355. struct cf_hc_ctx *ctx = cf->ctx;
  356. if(cf->connected)
  357. return cf->next->cft->has_data_pending(cf->next, data);
  358. CURL_TRC_CF((struct Curl_easy *)data, cf, "data_pending");
  359. return cf_hc_baller_data_pending(&ctx->h3_baller, data)
  360. || cf_hc_baller_data_pending(&ctx->h21_baller, data);
  361. }
  362. static struct curltime cf_get_max_baller_time(struct Curl_cfilter *cf,
  363. struct Curl_easy *data,
  364. int query)
  365. {
  366. struct cf_hc_ctx *ctx = cf->ctx;
  367. struct Curl_cfilter *cfb;
  368. struct curltime t, tmax;
  369. memset(&tmax, 0, sizeof(tmax));
  370. memset(&t, 0, sizeof(t));
  371. cfb = ctx->h21_baller.enabled ? ctx->h21_baller.cf : NULL;
  372. if(cfb && !cfb->cft->query(cfb, data, query, NULL, &t)) {
  373. if((t.tv_sec || t.tv_usec) && Curl_timediff_us(t, tmax) > 0)
  374. tmax = t;
  375. }
  376. memset(&t, 0, sizeof(t));
  377. cfb = ctx->h3_baller.enabled ? ctx->h3_baller.cf : NULL;
  378. if(cfb && !cfb->cft->query(cfb, data, query, NULL, &t)) {
  379. if((t.tv_sec || t.tv_usec) && Curl_timediff_us(t, tmax) > 0)
  380. tmax = t;
  381. }
  382. return tmax;
  383. }
  384. static CURLcode cf_hc_query(struct Curl_cfilter *cf,
  385. struct Curl_easy *data,
  386. int query, int *pres1, void *pres2)
  387. {
  388. struct cf_hc_ctx *ctx = cf->ctx;
  389. if(!cf->connected) {
  390. switch(query) {
  391. case CF_QUERY_TIMER_CONNECT: {
  392. struct curltime *when = pres2;
  393. *when = cf_get_max_baller_time(cf, data, CF_QUERY_TIMER_CONNECT);
  394. return CURLE_OK;
  395. }
  396. case CF_QUERY_TIMER_APPCONNECT: {
  397. struct curltime *when = pres2;
  398. *when = cf_get_max_baller_time(cf, data, CF_QUERY_TIMER_APPCONNECT);
  399. return CURLE_OK;
  400. }
  401. case CF_QUERY_NEED_FLUSH: {
  402. if(cf_hc_baller_needs_flush(&ctx->h3_baller, data)
  403. || cf_hc_baller_needs_flush(&ctx->h21_baller, data)) {
  404. *pres1 = TRUE;
  405. return CURLE_OK;
  406. }
  407. break;
  408. }
  409. default:
  410. break;
  411. }
  412. }
  413. return cf->next ?
  414. cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  415. CURLE_UNKNOWN_OPTION;
  416. }
  417. static CURLcode cf_hc_cntrl(struct Curl_cfilter *cf,
  418. struct Curl_easy *data,
  419. int event, int arg1, void *arg2)
  420. {
  421. struct cf_hc_ctx *ctx = cf->ctx;
  422. CURLcode result = CURLE_OK;
  423. if(!cf->connected) {
  424. result = cf_hc_baller_cntrl(&ctx->h3_baller, data, event, arg1, arg2);
  425. if(!result || (result == CURLE_AGAIN))
  426. result = cf_hc_baller_cntrl(&ctx->h21_baller, data, event, arg1, arg2);
  427. if(result == CURLE_AGAIN)
  428. result = CURLE_OK;
  429. }
  430. return result;
  431. }
  432. static void cf_hc_close(struct Curl_cfilter *cf, struct Curl_easy *data)
  433. {
  434. CURL_TRC_CF(data, cf, "close");
  435. cf_hc_reset(cf, data);
  436. cf->connected = FALSE;
  437. if(cf->next) {
  438. cf->next->cft->do_close(cf->next, data);
  439. Curl_conn_cf_discard_chain(&cf->next, data);
  440. }
  441. }
  442. static void cf_hc_destroy(struct Curl_cfilter *cf, struct Curl_easy *data)
  443. {
  444. struct cf_hc_ctx *ctx = cf->ctx;
  445. (void)data;
  446. CURL_TRC_CF(data, cf, "destroy");
  447. cf_hc_reset(cf, data);
  448. Curl_safefree(ctx);
  449. }
  450. struct Curl_cftype Curl_cft_http_connect = {
  451. "HTTPS-CONNECT",
  452. 0,
  453. CURL_LOG_LVL_NONE,
  454. cf_hc_destroy,
  455. cf_hc_connect,
  456. cf_hc_close,
  457. cf_hc_shutdown,
  458. Curl_cf_def_get_host,
  459. cf_hc_adjust_pollset,
  460. cf_hc_data_pending,
  461. Curl_cf_def_send,
  462. Curl_cf_def_recv,
  463. cf_hc_cntrl,
  464. Curl_cf_def_conn_is_alive,
  465. Curl_cf_def_conn_keep_alive,
  466. cf_hc_query,
  467. };
  468. static CURLcode cf_hc_create(struct Curl_cfilter **pcf,
  469. struct Curl_easy *data,
  470. const struct Curl_dns_entry *remotehost,
  471. bool try_h3, bool try_h21)
  472. {
  473. struct Curl_cfilter *cf = NULL;
  474. struct cf_hc_ctx *ctx;
  475. CURLcode result = CURLE_OK;
  476. (void)data;
  477. ctx = calloc(1, sizeof(*ctx));
  478. if(!ctx) {
  479. result = CURLE_OUT_OF_MEMORY;
  480. goto out;
  481. }
  482. ctx->remotehost = remotehost;
  483. ctx->h3_baller.enabled = try_h3;
  484. ctx->h21_baller.enabled = try_h21;
  485. result = Curl_cf_create(&cf, &Curl_cft_http_connect, ctx);
  486. if(result)
  487. goto out;
  488. ctx = NULL;
  489. cf_hc_reset(cf, data);
  490. out:
  491. *pcf = result ? NULL : cf;
  492. free(ctx);
  493. return result;
  494. }
  495. static CURLcode cf_http_connect_add(struct Curl_easy *data,
  496. struct connectdata *conn,
  497. int sockindex,
  498. const struct Curl_dns_entry *remotehost,
  499. bool try_h3, bool try_h21)
  500. {
  501. struct Curl_cfilter *cf;
  502. CURLcode result = CURLE_OK;
  503. DEBUGASSERT(data);
  504. result = cf_hc_create(&cf, data, remotehost, try_h3, try_h21);
  505. if(result)
  506. goto out;
  507. Curl_conn_cf_add(data, conn, sockindex, cf);
  508. out:
  509. return result;
  510. }
  511. CURLcode Curl_cf_https_setup(struct Curl_easy *data,
  512. struct connectdata *conn,
  513. int sockindex,
  514. const struct Curl_dns_entry *remotehost)
  515. {
  516. bool try_h3 = FALSE, try_h21 = TRUE; /* defaults, for now */
  517. CURLcode result = CURLE_OK;
  518. (void)sockindex;
  519. (void)remotehost;
  520. if(!conn->bits.tls_enable_alpn)
  521. goto out;
  522. if(data->state.httpwant == CURL_HTTP_VERSION_3ONLY) {
  523. result = Curl_conn_may_http3(data, conn);
  524. if(result) /* cannot do it */
  525. goto out;
  526. try_h3 = TRUE;
  527. try_h21 = FALSE;
  528. }
  529. else if(data->state.httpwant >= CURL_HTTP_VERSION_3) {
  530. /* We assume that silently not even trying H3 is ok here */
  531. /* TODO: should we fail instead? */
  532. try_h3 = (Curl_conn_may_http3(data, conn) == CURLE_OK);
  533. try_h21 = TRUE;
  534. }
  535. result = cf_http_connect_add(data, conn, sockindex, remotehost,
  536. try_h3, try_h21);
  537. out:
  538. return result;
  539. }
  540. #endif /* !defined(CURL_DISABLE_HTTP) && !defined(USE_HYPER) */