Curl_altsvc_init:
  362|  9.91k|{
  363|  9.91k|  struct altsvcinfo *asi = curlx_calloc(1, sizeof(struct altsvcinfo));
  ------------------
  |  | 1500|  9.91k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  364|  9.91k|  if(!asi)
  ------------------
  |  Branch (364:6): [True: 40, False: 9.87k]
  ------------------
  365|     40|    return NULL;
  366|  9.87k|  Curl_llist_init(&asi->list, NULL);
  367|       |
  368|       |  /* set default behavior */
  369|  9.87k|  asi->flags = CURLALTSVC_H1
  ------------------
  |  | 1045|  9.87k|#define CURLALTSVC_H1           (1L << 3)
  ------------------
  370|  9.87k|#ifdef USE_HTTP2
  371|  9.87k|    | CURLALTSVC_H2
  ------------------
  |  | 1046|  9.87k|#define CURLALTSVC_H2           (1L << 4)
  ------------------
  372|  9.87k|#endif
  373|  9.87k|#ifdef USE_HTTP3
  374|  9.87k|    | CURLALTSVC_H3
  ------------------
  |  | 1047|  9.87k|#define CURLALTSVC_H3           (1L << 5)
  ------------------
  375|  9.87k|#endif
  376|  9.87k|    ;
  377|  9.87k|  return asi;
  378|  9.91k|}
Curl_altsvc_load:
  384|  9.86k|{
  385|  9.86k|  DEBUGASSERT(asi);
  ------------------
  |  | 1016|  9.86k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (385:3): [True: 0, False: 9.86k]
  |  Branch (385:3): [True: 9.86k, False: 0]
  ------------------
  386|  9.86k|  return altsvc_load(asi, file);
  387|  9.86k|}
Curl_altsvc_ctrl:
  393|    822|{
  394|    822|  DEBUGASSERT(data);
  ------------------
  |  | 1016|    822|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (394:3): [True: 0, False: 822]
  |  Branch (394:3): [True: 822, False: 0]
  ------------------
  395|    822|  if(!ctrl)
  ------------------
  |  Branch (395:6): [True: 503, False: 319]
  ------------------
  396|    503|    return CURLE_BAD_FUNCTION_ARGUMENT;
  397|       |
  398|    319|  if(!data->asi) {
  ------------------
  |  Branch (398:6): [True: 3, False: 316]
  ------------------
  399|      3|    data->asi = Curl_altsvc_init();
  400|      3|    if(!data->asi)
  ------------------
  |  Branch (400:8): [True: 0, False: 3]
  ------------------
  401|      0|      return CURLE_OUT_OF_MEMORY;
  402|      3|  }
  403|    319|  data->asi->flags = ctrl;
  404|    319|  return CURLE_OK;
  405|    319|}
Curl_altsvc_cleanup:
  412|  19.7k|{
  413|  19.7k|  if(*asi) {
  ------------------
  |  Branch (413:6): [True: 9.87k, False: 9.86k]
  ------------------
  414|  9.87k|    struct Curl_llist_node *e;
  415|  9.87k|    struct Curl_llist_node *n;
  416|  9.87k|    struct altsvcinfo *altsvc = *asi;
  417|  9.87k|    for(e = Curl_llist_head(&altsvc->list); e; e = n) {
  ------------------
  |  Branch (417:45): [True: 0, False: 9.87k]
  ------------------
  418|      0|      struct altsvc *as = Curl_node_elem(e);
  419|      0|      n = Curl_node_next(e);
  420|      0|      altsvc_free(as);
  ------------------
  |  |   99|      0|#define altsvc_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  421|      0|    }
  422|  9.87k|    curlx_free(altsvc->filename);
  ------------------
  |  | 1503|  9.87k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  423|  9.87k|    curlx_free(altsvc);
  ------------------
  |  | 1503|  9.87k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  424|       |    *asi = NULL; /* clear the pointer */
  425|  9.87k|  }
  426|  19.7k|}
Curl_altsvc_save:
  433|  19.7k|{
  434|  19.7k|  CURLcode result = CURLE_OK;
  435|  19.7k|  FILE *out;
  436|  19.7k|  char *tempstore = NULL;
  437|       |
  438|  19.7k|  if(!asi)
  ------------------
  |  Branch (438:6): [True: 9.86k, False: 9.87k]
  ------------------
  439|       |    /* no cache activated */
  440|  9.86k|    return CURLE_OK;
  441|       |
  442|       |  /* if not new name is given, use the one we stored from the load */
  443|  9.87k|  if(!file && asi->filename)
  ------------------
  |  Branch (443:6): [True: 16, False: 9.86k]
  |  Branch (443:15): [True: 0, False: 16]
  ------------------
  444|      0|    file = asi->filename;
  445|       |
  446|  9.87k|  if((asi->flags & CURLALTSVC_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1044|  9.87k|#define CURLALTSVC_READONLYFILE (1L << 2)
  ------------------
  |  Branch (446:6): [True: 70, False: 9.80k]
  |  Branch (446:48): [True: 13, False: 9.79k]
  |  Branch (446:57): [True: 0, False: 9.79k]
  ------------------
  447|       |    /* marked as read-only, no file or zero length filename */
  448|     83|    return CURLE_OK;
  449|       |
  450|  9.79k|  result = Curl_fopen(data, file, &out, &tempstore);
  451|  9.79k|  if(!result) {
  ------------------
  |  Branch (451:6): [True: 9.79k, False: 0]
  ------------------
  452|  9.79k|    struct Curl_llist_node *e;
  453|  9.79k|    struct Curl_llist_node *n;
  454|  9.79k|    fputs("# Your alt-svc cache. https://curl.se/docs/alt-svc.html\n"
  455|  9.79k|          "# This file was generated by libcurl! Edit at your own risk.\n",
  456|  9.79k|          out);
  457|  9.79k|    for(e = Curl_llist_head(&asi->list); e; e = n) {
  ------------------
  |  Branch (457:42): [True: 0, False: 9.79k]
  ------------------
  458|      0|      struct altsvc *as = Curl_node_elem(e);
  459|      0|      n = Curl_node_next(e);
  460|      0|      result = altsvc_out(as, out);
  461|      0|      if(result)
  ------------------
  |  Branch (461:10): [True: 0, False: 0]
  ------------------
  462|      0|        break;
  463|      0|    }
  464|  9.79k|    if(fflush(out) || ferror(out))
  ------------------
  |  Branch (464:8): [True: 0, False: 9.79k]
  |  Branch (464:23): [True: 0, False: 9.79k]
  ------------------
  465|      0|      result = CURLE_WRITE_ERROR;
  466|  9.79k|    if(curlx_fclose(out))
  ------------------
  |  |   88|  9.79k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  |  |  ------------------
  |  |  |  Branch (88:33): [True: 0, False: 9.79k]
  |  |  ------------------
  ------------------
  467|      0|      result = CURLE_WRITE_ERROR;
  468|  9.79k|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   74|      0|#define curlx_rename            rename
  ------------------
  |  Branch (468:8): [True: 9.79k, False: 0]
  |  Branch (468:19): [True: 0, False: 9.79k]
  |  Branch (468:32): [True: 0, False: 0]
  ------------------
  469|      0|      result = CURLE_WRITE_ERROR;
  470|       |
  471|  9.79k|    if(result && tempstore)
  ------------------
  |  Branch (471:8): [True: 0, False: 9.79k]
  |  Branch (471:18): [True: 0, False: 0]
  ------------------
  472|      0|      unlink(tempstore);
  473|  9.79k|  }
  474|  9.79k|  curlx_free(tempstore);
  ------------------
  |  | 1503|  9.79k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  475|  9.79k|  return result;
  476|  9.87k|}
Curl_altsvc_lookup:
  748|  7.40k|{
  749|  7.40k|  DEBUGASSERT(asi);
  ------------------
  |  | 1016|  7.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (749:3): [True: 0, False: 7.40k]
  |  Branch (749:3): [True: 7.40k, False: 0]
  ------------------
  750|  7.40k|  DEBUGASSERT(origin);
  ------------------
  |  | 1016|  7.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (750:3): [True: 0, False: 7.40k]
  |  Branch (750:3): [True: 7.40k, False: 0]
  ------------------
  751|  7.40k|  DEBUGASSERT(dstentry);
  ------------------
  |  | 1016|  7.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (751:3): [True: 0, False: 7.40k]
  |  Branch (751:3): [True: 7.40k, False: 0]
  ------------------
  752|  7.40k|  *psame_destination = FALSE;
  ------------------
  |  |  989|  7.40k|#define FALSE false
  ------------------
  753|       |
  754|  7.40k|  if(Curl_llist_count(&asi->list)) {
  ------------------
  |  Branch (754:6): [True: 0, False: 7.40k]
  ------------------
  755|      0|    struct Curl_llist_node *e;
  756|      0|    struct Curl_llist_node *n;
  757|      0|    time_t now = time(NULL);
  ------------------
  |  |   75|      0|#define time(x) altsvc_debugtime(x)
  ------------------
  758|       |
  759|      0|    for(e = Curl_llist_head(&asi->list); e; e = n) {
  ------------------
  |  Branch (759:42): [True: 0, False: 0]
  ------------------
  760|      0|      struct altsvc *as = Curl_node_elem(e);
  761|      0|      n = Curl_node_next(e);
  762|      0|      if(as->expires < now) {
  ------------------
  |  Branch (762:10): [True: 0, False: 0]
  ------------------
  763|       |        /* an expired entry, remove */
  764|      0|        Curl_node_remove(e);
  765|      0|        altsvc_free(as);
  ------------------
  |  |   99|      0|#define altsvc_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  766|      0|        continue;
  767|      0|      }
  768|      0|      if((origin_alpnid == as->src.alpnid) &&
  ------------------
  |  Branch (768:10): [True: 0, False: 0]
  ------------------
  769|      0|         (versions & (int)as->dst.alpnid) &&
  ------------------
  |  Branch (769:10): [True: 0, False: 0]
  ------------------
  770|      0|         (origin->port == as->src.port) &&
  ------------------
  |  Branch (770:10): [True: 0, False: 0]
  ------------------
  771|      0|         hostcompare(origin->hostname, as->src.host)) {
  ------------------
  |  Branch (771:10): [True: 0, False: 0]
  ------------------
  772|       |        /* match */
  773|      0|        *dstentry = as;
  774|       |        /* alt-svc on the same host+port or another one? */
  775|      0|        *psame_destination = (origin->port == as->dst.port) &&
  ------------------
  |  Branch (775:30): [True: 0, False: 0]
  ------------------
  776|      0|                             hostcompare(origin->hostname, as->dst.host);
  ------------------
  |  Branch (776:30): [True: 0, False: 0]
  ------------------
  777|      0|        return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  778|      0|      }
  779|      0|    }
  780|      0|  }
  781|  7.40k|  return FALSE;
  ------------------
  |  |  989|  7.40k|#define FALSE false
  ------------------
  782|  7.40k|}
altsvc.c:altsvc_load:
  273|  9.86k|{
  274|  9.86k|  CURLcode result = CURLE_OK;
  275|  9.86k|  FILE *fp;
  276|       |
  277|       |  /* we need a private copy of the filename so that the altsvc cache file
  278|       |     name survives an easy handle reset */
  279|  9.86k|  curlx_free(asi->filename);
  ------------------
  |  | 1503|  9.86k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  280|  9.86k|  asi->filename = curlx_strdup(file);
  ------------------
  |  | 1497|  9.86k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  281|  9.86k|  if(!asi->filename)
  ------------------
  |  Branch (281:6): [True: 11, False: 9.85k]
  ------------------
  282|     11|    return CURLE_OUT_OF_MEMORY;
  283|       |
  284|  9.85k|  fp = curlx_fopen(file, FOPEN_READTEXT);
  ------------------
  |  |   83|  9.85k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
  285|  9.85k|  if(fp) {
  ------------------
  |  Branch (285:6): [True: 9.85k, False: 0]
  ------------------
  286|  9.85k|    curlx_struct_stat stat;
  ------------------
  |  |   67|  9.85k|#define curlx_struct_stat       struct stat
  ------------------
  287|  9.85k|    if((curlx_fstat(fileno(fp), &stat) == -1) || !S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   66|  9.85k|#define curlx_fstat             fstat
  ------------------
  |  Branch (287:8): [True: 0, False: 9.85k]
  |  Branch (287:50): [True: 9.85k, False: 0]
  ------------------
  288|  9.85k|      bool eof = FALSE;
  ------------------
  |  |  989|  9.85k|#define FALSE false
  ------------------
  289|  9.85k|      struct dynbuf buf;
  290|  9.85k|      curlx_dyn_init(&buf, MAX_ALTSVC_LINE);
  ------------------
  |  |   44|  9.85k|#define MAX_ALTSVC_LINE    4095
  ------------------
  291|  9.85k|      do {
  292|  9.85k|        result = Curl_get_line(&buf, fp, &eof);
  293|  9.85k|        if(!result) {
  ------------------
  |  Branch (293:12): [True: 9.83k, False: 18]
  ------------------
  294|  9.83k|          const char *lineptr = curlx_dyn_ptr(&buf);
  295|  9.83k|          curlx_str_passblanks(&lineptr);
  296|  9.83k|          if(curlx_str_single(&lineptr, '#'))
  ------------------
  |  Branch (296:14): [True: 9.83k, False: 0]
  ------------------
  297|  9.83k|            altsvc_add(asi, lineptr);
  298|  9.83k|        }
  299|  9.85k|      } while(!result && !eof);
  ------------------
  |  Branch (299:15): [True: 9.83k, False: 18]
  |  Branch (299:26): [True: 0, False: 9.83k]
  ------------------
  300|  9.85k|      curlx_dyn_free(&buf); /* free the line buffer */
  301|  9.85k|    }
  302|  9.85k|    curlx_fclose(fp);
  ------------------
  |  |   88|  9.85k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  303|  9.85k|  }
  304|  9.85k|  return result;
  305|  9.86k|}
altsvc.c:altsvc_add:
  203|  9.83k|{
  204|       |  /* Example line:
  205|       |     h2 example.com 443 h3 shiny.example.com 8443 "20191231 10:00:00" 1
  206|       |   */
  207|  9.83k|  struct Curl_str srchost;
  208|  9.83k|  struct Curl_str dsthost;
  209|  9.83k|  struct Curl_str srcalpn;
  210|  9.83k|  struct Curl_str dstalpn;
  211|  9.83k|  struct Curl_str date;
  212|  9.83k|  curl_off_t srcport;
  213|  9.83k|  curl_off_t dstport;
  214|  9.83k|  curl_off_t persist;
  215|  9.83k|  curl_off_t prio;
  216|       |
  217|  9.83k|  if(curlx_str_word(&line, &srcalpn, MAX_ALTSVC_ALPNLEN) ||
  ------------------
  |  |   47|  9.83k|#define MAX_ALTSVC_ALPNLEN 10
  ------------------
  |  Branch (217:6): [True: 0, False: 9.83k]
  ------------------
  218|  9.83k|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (218:6): [True: 9.83k, False: 0]
  ------------------
  219|      0|     curlx_str_word(&line, &srchost, MAX_ALTSVC_HOSTLEN) ||
  ------------------
  |  |   46|      0|#define MAX_ALTSVC_HOSTLEN 2048
  ------------------
  |  Branch (219:6): [True: 0, False: 0]
  ------------------
  220|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (220:6): [True: 0, False: 0]
  ------------------
  221|      0|     curlx_str_number(&line, &srcport, 65535) ||
  ------------------
  |  Branch (221:6): [True: 0, False: 0]
  ------------------
  222|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (222:6): [True: 0, False: 0]
  ------------------
  223|      0|     curlx_str_word(&line, &dstalpn, MAX_ALTSVC_ALPNLEN) ||
  ------------------
  |  |   47|      0|#define MAX_ALTSVC_ALPNLEN 10
  ------------------
  |  Branch (223:6): [True: 0, False: 0]
  ------------------
  224|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (224:6): [True: 0, False: 0]
  ------------------
  225|      0|     curlx_str_word(&line, &dsthost, MAX_ALTSVC_HOSTLEN) ||
  ------------------
  |  |   46|      0|#define MAX_ALTSVC_HOSTLEN 2048
  ------------------
  |  Branch (225:6): [True: 0, False: 0]
  ------------------
  226|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (226:6): [True: 0, False: 0]
  ------------------
  227|      0|     curlx_str_number(&line, &dstport, 65535) ||
  ------------------
  |  Branch (227:6): [True: 0, False: 0]
  ------------------
  228|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (228:6): [True: 0, False: 0]
  ------------------
  229|      0|     curlx_str_quotedword(&line, &date, MAX_ALTSVC_DATELEN) ||
  ------------------
  |  |   45|      0|#define MAX_ALTSVC_DATELEN 17
  ------------------
  |  Branch (229:6): [True: 0, False: 0]
  ------------------
  230|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (230:6): [True: 0, False: 0]
  ------------------
  231|      0|     curlx_str_number(&line, &persist, 1) ||
  ------------------
  |  Branch (231:6): [True: 0, False: 0]
  ------------------
  232|      0|     curlx_str_singlespace(&line) ||
  ------------------
  |  Branch (232:6): [True: 0, False: 0]
  ------------------
  233|      0|     curlx_str_number(&line, &prio, 0) ||
  ------------------
  |  Branch (233:6): [True: 0, False: 0]
  ------------------
  234|      0|     curlx_str_newline(&line) ||
  ------------------
  |  Branch (234:6): [True: 0, False: 0]
  ------------------
  235|      0|     !altsvc_valid_host(curlx_str(&dsthost), curlx_strlen(&dsthost)))
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
                   !altsvc_valid_host(curlx_str(&dsthost), curlx_strlen(&dsthost)))
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (235:6): [True: 0, False: 0]
  ------------------
  236|  9.83k|    ;
  237|      0|  else {
  238|      0|    char dbuf[MAX_ALTSVC_DATELEN + 1];
  239|      0|    time_t expires = 0;
  240|      0|    time_t now = time(NULL);
  ------------------
  |  |   75|      0|#define time(x) altsvc_debugtime(x)
  ------------------
  241|       |
  242|       |    /* The date parser works on a null-terminated string. The maximum length
  243|       |       is upheld by curlx_str_quotedword(). */
  244|      0|    memcpy(dbuf, curlx_str(&date), curlx_strlen(&date));
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
                  memcpy(dbuf, curlx_str(&date), curlx_strlen(&date));
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  245|      0|    dbuf[curlx_strlen(&date)] = 0;
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  246|      0|    Curl_getdate_capped(dbuf, &expires);
  247|       |
  248|      0|    if(now < expires) {
  ------------------
  |  Branch (248:8): [True: 0, False: 0]
  ------------------
  249|      0|      struct altsvc *as = altsvc_create(&srchost, &dsthost, &srcalpn, &dstalpn,
  250|      0|                                        (size_t)srcport, (size_t)dstport);
  251|      0|      if(as) {
  ------------------
  |  Branch (251:10): [True: 0, False: 0]
  ------------------
  252|      0|        as->expires = expires;
  253|      0|        as->persist = persist ? 1 : 0;
  ------------------
  |  Branch (253:23): [True: 0, False: 0]
  ------------------
  254|      0|        altsvc_append(asi, as);
  255|      0|      }
  256|      0|      else
  257|      0|        return CURLE_OUT_OF_MEMORY;
  258|      0|    }
  259|      0|  }
  260|       |
  261|  9.83k|  return CURLE_OK;
  262|  9.83k|}

Curl_eapi_enter:
  189|   403k|{
  190|   403k|  struct Curl_easy *data = curl;
  191|   403k|  const struct Curl_eapi_fn_props *fn_props;
  192|   403k|  CURLcode result = CURLE_OK;
  193|       |
  194|   403k|  guard->depth = 0;
  195|       |
  196|       |  /* Verify that we got an easy handle we can work with. */
  197|   403k|  if(!GOOD_EASY_HANDLE(data) || data->state.internal) {
  ------------------
  |  |   34|   807k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|   403k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|   403k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:5): [True: 403k, False: 0]
  |  |  |  Branch (34:12): [True: 403k, False: 0]
  |  |  ------------------
  |  |   35|   807k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (197:6): [True: 0, False: 403k]
  |  Branch (197:7): [True: 0, False: 0]
  |  Branch (197:7): [True: 0, False: 0]
  |  Branch (197:33): [True: 0, False: 403k]
  ------------------
  198|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  199|      0|    goto out;
  200|      0|  }
  201|       |  /* verify that is either not added to a multi handle OR has a
  202|       |   * GOOD multi handle that knows `data` for `data->mid`. */
  203|   403k|  if(data->mid != UINT32_MAX) {
  ------------------
  |  Branch (203:6): [True: 0, False: 403k]
  ------------------
  204|      0|    if(GOOD_MULTI_HANDLE(data->multi)) {
  ------------------
  |  |   48|      0|  (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |   41|      0|#define CURLMULTI_MAGIC_NUMBER 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (48:3): [True: 0, False: 0]
  |  |  |  Branch (48:5): [True: 0, False: 0]
  |  |  |  Branch (48:12): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (204:8): [True: 0, False: 0]
  |  Branch (204:8): [True: 0, False: 0]
  ------------------
  205|      0|      if(!Curl_multi_knows_easy(data->multi, data)) {
  ------------------
  |  Branch (205:10): [True: 0, False: 0]
  ------------------
  206|       |        /* But multi does not know it, something is fishy, better deny call */
  207|      0|        DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (207:9): [Folded, False: 0]
  |  Branch (207:9): [Folded, False: 0]
  ------------------
  208|      0|        result = CURLE_BAD_FUNCTION_ARGUMENT;
  209|      0|        goto out;
  210|      0|      }
  211|      0|    }
  212|      0|    else {
  213|      0|      DEBUGASSERT(0); /* data needs to have a GOOD multi handle */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (213:7): [Folded, False: 0]
  |  Branch (213:7): [Folded, False: 0]
  ------------------
  214|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  215|      0|      goto out;
  216|      0|    }
  217|      0|  }
  218|   403k|  else if(data->multi) {
  ------------------
  |  Branch (218:11): [True: 0, False: 403k]
  ------------------
  219|      0|    DEBUGASSERT(0); /* data should not have a multi handle */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (219:5): [Folded, False: 0]
  |  Branch (219:5): [Folded, False: 0]
  ------------------
  220|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  221|      0|    goto out;
  222|      0|  }
  223|       |  /* verify that the call `fn` we're about to enter is known
  224|       |   * and check call properties to be admitting. */
  225|   403k|  if(fn >= CURL_EAPI_FN_LAST) {
  ------------------
  |  Branch (225:6): [True: 0, False: 403k]
  ------------------
  226|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  227|      0|    goto out;
  228|      0|  }
  229|   403k|  fn_props = &eapi_fn_props[fn];
  230|   403k|  DEBUGASSERT(fn_props->fn == fn);
  ------------------
  |  | 1016|   403k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (230:3): [True: 0, False: 403k]
  |  Branch (230:3): [True: 403k, False: 0]
  ------------------
  231|   403k|  if(!fn_props->recurse) {
  ------------------
  |  Branch (231:6): [True: 9.91k, False: 393k]
  ------------------
  232|  9.91k|    if(data->callstack.count) {
  ------------------
  |  Branch (232:8): [True: 0, False: 9.91k]
  ------------------
  233|      0|#ifdef CURLVERBOSE
  234|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  235|      0|        "EAPI guard: calling %hu with call to %u ongoing\n", (uint16_t)fn,
  236|      0|        data->callstack.calls[data->callstack.count - 1]));
  237|      0|#endif
  238|      0|      result = CURLE_RECURSIVE_API_CALL;
  239|      0|      goto out;
  240|      0|    }
  241|  9.91k|    if(data->multi && data->multi->callstack.count) {
  ------------------
  |  Branch (241:8): [True: 0, False: 9.91k]
  |  Branch (241:23): [True: 0, False: 0]
  ------------------
  242|      0|#ifdef CURLVERBOSE
  243|       |
  244|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  245|      0|        "EAPI guard: calling %hu with multi call to %u ongoing\n",
  246|      0|        (uint16_t)fn,
  247|      0|        data->multi->callstack.calls[data->multi->callstack.count - 1]));
  248|      0|#endif
  249|      0|      result = CURLE_RECURSIVE_API_CALL;
  250|      0|      goto out;
  251|      0|    }
  252|  9.91k|  }
  253|       |
  254|   403k|  if(!fn_props->readonly && eapi_in_readonly_cb(data)) {
  ------------------
  |  Branch (254:6): [True: 320k, False: 83.2k]
  |  Branch (254:29): [True: 0, False: 320k]
  ------------------
  255|       |    /* Not allowed to be invoked while an event cb is ongoing */
  256|      0|#ifdef CURLVERBOSE
  257|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  258|      0|        "EAPI guard: calling %hu in readonly enforcing callback\n",
  259|      0|        (uint16_t)fn));
  260|      0|#endif
  261|      0|    result = CURLE_RECURSIVE_API_CALL;
  262|      0|    goto out;
  263|      0|  }
  264|       |
  265|   403k|#if defined(USE_SSL) && defined(USE_MUTEX)
  266|   403k|  if(fn_props->no_scache_lock &&
  ------------------
  |  Branch (266:6): [True: 0, False: 403k]
  ------------------
  267|      0|     Curl_ssl_scache_is_locked_by_current_thread(data)) {
  ------------------
  |  Branch (267:6): [True: 0, False: 0]
  ------------------
  268|      0|#ifdef CURLVERBOSE
  269|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  270|      0|        "EAPI guard: calling %hu while vtls_scache is locked by "
  271|      0|        "current thread\n", (uint16_t)fn));
  272|      0|#endif
  273|      0|    result = CURLE_RECURSIVE_API_CALL;
  274|      0|    goto out;
  275|      0|  }
  276|   403k|#endif
  277|       |
  278|       |  /* all fine, add to data's callstack */
  279|   403k|  if(data->callstack.count >= CURL_EAPI_MAX_RECURSION) {
  ------------------
  |  |  139|   403k|#define CURL_EAPI_MAX_RECURSION       7
  ------------------
  |  Branch (279:6): [True: 0, False: 403k]
  ------------------
  280|      0|    result = CURLE_RECURSIVE_API_CALL;
  281|      0|    goto out;
  282|      0|  }
  283|   403k|  data->callstack.calls[data->callstack.count] = (uint16_t)fn;
  284|   403k|  ++data->callstack.count;
  285|   403k|  guard->depth = data->callstack.count;
  286|   403k|  guard->data = fn_props->data_is_killed ? NULL : data;
  ------------------
  |  Branch (286:17): [True: 9.91k, False: 393k]
  ------------------
  287|       |
  288|   403k|out:
  289|   403k|  if(presult)
  ------------------
  |  Branch (289:6): [True: 393k, False: 9.91k]
  ------------------
  290|   393k|    *presult = result;
  291|   403k|  return guard->depth > 0;
  292|   403k|}
Curl_eapi_leave:
  295|   403k|{
  296|   403k|  if(guard->depth) {
  ------------------
  |  Branch (296:6): [True: 403k, False: 0]
  ------------------
  297|       |    /* guard->data is set when handle is supposed to stay alive during call */
  298|   403k|    if(guard->data && GOOD_EASY_HANDLE(guard->data)) {
  ------------------
  |  |   34|   393k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|   393k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|   393k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:3): [True: 393k, False: 0]
  |  |  |  Branch (34:5): [True: 393k, False: 0]
  |  |  |  Branch (34:12): [True: 393k, False: 0]
  |  |  ------------------
  |  |   35|   393k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (298:8): [True: 393k, False: 9.91k]
  |  Branch (298:23): [True: 0, False: 0]
  |  Branch (298:23): [True: 0, False: 0]
  ------------------
  299|   393k|      if(guard->depth > guard->data->callstack.count) {
  ------------------
  |  Branch (299:10): [True: 0, False: 393k]
  ------------------
  300|      0|        DEBUGASSERT(0); /* something very wrong */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (300:9): [Folded, False: 0]
  |  Branch (300:9): [Folded, False: 0]
  ------------------
  301|      0|      }
  302|   393k|      else {
  303|   393k|        if(guard->depth < guard->data->callstack.count) {
  ------------------
  |  Branch (303:12): [True: 0, False: 393k]
  ------------------
  304|      0|          DEBUGASSERT(0); /* someone forgot to clean up */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (304:11): [Folded, False: 0]
  |  Branch (304:11): [Folded, False: 0]
  ------------------
  305|      0|        }
  306|       |        /* reset to depth the guard was entered in */
  307|   393k|        guard->data->callstack.count = (uint16_t)(guard->depth - 1);
  308|   393k|      }
  309|   393k|    }
  310|   403k|  }
  311|   403k|}
Curl_mapi_enter:
  335|   309k|{
  336|   309k|  struct Curl_multi *multi = m;
  337|   309k|  const struct Curl_mapi_fn_props *fn_props;
  338|   309k|  CURLMcode mresult = CURLM_OK;
  339|       |
  340|   309k|  guard->depth = 0;
  341|       |
  342|       |  /* Verify that we got an easy handle we can work with. */
  343|   309k|  if(!GOOD_MULTI_HANDLE(multi)) {
  ------------------
  |  |   48|   309k|  (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |   41|   309k|#define CURLMULTI_MAGIC_NUMBER 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|   309k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (48:5): [True: 309k, False: 0]
  |  |  |  Branch (48:12): [True: 309k, False: 0]
  |  |  ------------------
  |  |   49|   309k|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (343:6): [True: 0, False: 309k]
  |  Branch (343:7): [True: 0, False: 0]
  |  Branch (343:7): [True: 0, False: 0]
  ------------------
  344|      0|    mresult = CURLM_BAD_HANDLE;
  345|      0|    goto out;
  346|      0|  }
  347|   309k|  if(fn >= CURL_MAPI_FN_LAST) {
  ------------------
  |  Branch (347:6): [True: 0, False: 309k]
  ------------------
  348|      0|    mresult = CURLM_BAD_FUNCTION_ARGUMENT;
  349|      0|    goto out;
  350|      0|  }
  351|   309k|  fn_props = &mapi_fn_props[fn];
  352|   309k|  DEBUGASSERT(fn_props->fn == fn);
  ------------------
  |  | 1016|   309k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (352:3): [True: 0, False: 309k]
  |  Branch (352:3): [True: 309k, False: 0]
  ------------------
  353|   309k|  if(fn_props->allow_ntfy_cb && mapi_in_ntfy_cb(multi)) {
  ------------------
  |  Branch (353:6): [True: 163k, False: 145k]
  |  Branch (353:33): [True: 0, False: 163k]
  ------------------
  354|       |    /* explicitly allowed, even though normal recursion may not */
  355|      0|  }
  356|   309k|  else if(!fn_props->recurse && multi->callstack.count) {
  ------------------
  |  Branch (356:11): [True: 273k, False: 35.9k]
  |  Branch (356:33): [True: 0, False: 273k]
  ------------------
  357|      0|#ifdef CURLVERBOSE
  358|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  359|      0|        "MAPI guard: calling %hu with call to %u ongoing\n", (uint16_t)fn,
  360|      0|        multi->callstack.calls[multi->callstack.count - 1]));
  361|      0|#endif
  362|      0|    mresult = CURLM_RECURSIVE_API_CALL;
  363|      0|    goto out;
  364|      0|  }
  365|       |
  366|   309k|#if defined(USE_SSL) && defined(USE_MUTEX)
  367|   309k|  if(fn_props->no_scache_lock && multi->ssl_scache &&
  ------------------
  |  Branch (367:6): [True: 189k, False: 119k]
  |  Branch (367:34): [True: 189k, False: 0]
  ------------------
  368|   189k|     Curl_ssl_scache_is_locked_by_current_thread(multi->admin)) {
  ------------------
  |  Branch (368:6): [True: 0, False: 189k]
  ------------------
  369|      0|#ifdef CURLVERBOSE
  370|      0|      DEBUGF(curl_mfprintf(stderr,
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  371|      0|        "MAPI guard: calling %hu while its vtls_scache is locked by "
  372|      0|        "current thread\n", (uint16_t)fn));
  373|      0|#endif
  374|      0|    mresult = CURLM_RECURSIVE_API_CALL;
  375|      0|    goto out;
  376|      0|  }
  377|   309k|#endif
  378|       |
  379|       |  /* all fine, add to data's callstack */
  380|   309k|  if(multi->callstack.count >= CURL_MAPI_MAX_RECURSION) {
  ------------------
  |  |  169|   309k|#define CURL_MAPI_MAX_RECURSION       15
  ------------------
  |  Branch (380:6): [True: 0, False: 309k]
  ------------------
  381|      0|    mresult = CURLM_RECURSIVE_API_CALL;
  382|      0|    goto out;
  383|      0|  }
  384|   309k|  multi->callstack.calls[multi->callstack.count] = (uint8_t)fn;
  385|   309k|  ++multi->callstack.count;
  386|   309k|  guard->depth = multi->callstack.count;
  387|   309k|  guard->multi = fn_props->multi_is_killed ? NULL : multi;
  ------------------
  |  Branch (387:18): [True: 9.76k, False: 299k]
  ------------------
  388|       |
  389|   309k|out:
  390|   309k|  if(pmresult)
  ------------------
  |  Branch (390:6): [True: 281k, False: 27.5k]
  ------------------
  391|   281k|    *pmresult = mresult;
  392|   309k|  return guard->depth > 0;
  393|   309k|}
Curl_mapi_leave:
  396|   895k|{
  397|   895k|  if(guard->depth) {
  ------------------
  |  Branch (397:6): [True: 895k, False: 453]
  ------------------
  398|       |    /* guard->data is set when handle is supposed to stay alive during call */
  399|   895k|    if(guard->multi && GOOD_MULTI_HANDLE(guard->multi)) {
  ------------------
  |  |   48|   885k|  (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |   41|   885k|#define CURLMULTI_MAGIC_NUMBER 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|   885k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (48:3): [True: 885k, False: 0]
  |  |  |  Branch (48:5): [True: 885k, False: 0]
  |  |  |  Branch (48:12): [True: 885k, False: 0]
  |  |  ------------------
  |  |   49|   885k|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (399:8): [True: 885k, False: 9.76k]
  |  Branch (399:24): [True: 0, False: 0]
  |  Branch (399:24): [True: 0, False: 0]
  ------------------
  400|   885k|      if(guard->depth > guard->multi->callstack.count) {
  ------------------
  |  Branch (400:10): [True: 0, False: 885k]
  ------------------
  401|      0|        DEBUGASSERT(0); /* something very wrong */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (401:9): [Folded, False: 0]
  |  Branch (401:9): [Folded, False: 0]
  ------------------
  402|      0|      }
  403|   885k|      else {
  404|   885k|        if(guard->depth < guard->multi->callstack.count) {
  ------------------
  |  Branch (404:12): [True: 0, False: 885k]
  ------------------
  405|      0|          DEBUGASSERT(0); /* someone forgot to clean up */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (405:11): [Folded, False: 0]
  |  Branch (405:11): [Folded, False: 0]
  ------------------
  406|      0|        }
  407|       |        /* reset to depth the guard was entered in */
  408|   885k|        guard->multi->callstack.count = (uint8_t)(guard->depth - 1);
  409|   885k|      }
  410|   885k|    }
  411|   895k|  }
  412|   895k|}
Curl_cbapi_enter:
  418|   586k|{
  419|   586k|  guard->depth = 0;
  420|       |
  421|   586k|  if(!multi)
  ------------------
  |  Branch (421:6): [True: 567k, False: 19.0k]
  ------------------
  422|   567k|    multi = data ? data->multi : NULL;
  ------------------
  |  Branch (422:13): [True: 567k, False: 0]
  ------------------
  423|       |  /* if not multi is involved here, just leave */
  424|   586k|  if(!multi)
  ------------------
  |  Branch (424:6): [True: 453, False: 586k]
  ------------------
  425|    453|    return;
  426|       |  /* invalid callback specifier? */
  427|   586k|  if((fn >= CURL_CBAPI_FN_LAST) || (fn < CURL_CBAPI_FN_START)) {
  ------------------
  |  |  102|   586k|#define CURL_CBAPI_FN_START        128
  ------------------
  |  Branch (427:6): [True: 0, False: 586k]
  |  Branch (427:36): [True: 0, False: 586k]
  ------------------
  428|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (428:5): [Folded, False: 0]
  |  Branch (428:5): [Folded, False: 0]
  ------------------
  429|      0|    return;
  430|      0|  }
  431|   586k|  DEBUGASSERT(cbapi_fn_props[fn - CURL_CBAPI_FN_START].fn == fn);
  ------------------
  |  | 1016|   586k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (431:3): [True: 0, False: 586k]
  |  Branch (431:3): [True: 586k, False: 0]
  ------------------
  432|       |  /* all fine, add to data's callstack */
  433|       |  /* if multi callstack already at max depth, leave */
  434|   586k|  if(multi->callstack.count >= CURL_MAPI_MAX_RECURSION) {
  ------------------
  |  |  169|   586k|#define CURL_MAPI_MAX_RECURSION       15
  ------------------
  |  Branch (434:6): [True: 0, False: 586k]
  ------------------
  435|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (435:5): [Folded, False: 0]
  |  Branch (435:5): [Folded, False: 0]
  ------------------
  436|      0|    return;
  437|      0|  }
  438|   586k|  multi->callstack.calls[multi->callstack.count] = (uint8_t)fn;
  439|   586k|  ++multi->callstack.count;
  440|   586k|  guard->depth = multi->callstack.count;
  441|   586k|  guard->multi = multi;
  442|   586k|}
Curl_cbapi_leave:
  445|   586k|{
  446|   586k|  Curl_mapi_leave(guard);
  447|   586k|}
api.c:eapi_in_readonly_cb:
  139|   320k|{
  140|   320k|  struct Curl_multi *multi = data->multi;
  141|   320k|  if(multi && multi->callstack.count) {
  ------------------
  |  Branch (141:6): [True: 0, False: 320k]
  |  Branch (141:15): [True: 0, False: 0]
  ------------------
  142|      0|    size_t i;
  143|      0|    for(i = 0; i < multi->callstack.count; ++i) {
  ------------------
  |  Branch (143:16): [True: 0, False: 0]
  ------------------
  144|      0|      if(multi->callstack.calls[i] >= CURL_CBAPI_FN_START) {
  ------------------
  |  |  102|      0|#define CURL_CBAPI_FN_START        128
  ------------------
  |  Branch (144:10): [True: 0, False: 0]
  ------------------
  145|      0|        uint8_t fn = multi->callstack.calls[i];
  146|      0|        if((fn < CURL_CBAPI_FN_LAST) &&
  ------------------
  |  Branch (146:12): [True: 0, False: 0]
  ------------------
  147|      0|           cbapi_fn_props[fn - CURL_CBAPI_FN_START].set_readonly)
  ------------------
  |  |  102|      0|#define CURL_CBAPI_FN_START        128
  ------------------
  |  Branch (147:12): [True: 0, False: 0]
  ------------------
  148|      0|          return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  149|      0|      }
  150|      0|    }
  151|      0|  }
  152|   320k|  return FALSE;
  ------------------
  |  |  989|   320k|#define FALSE false
  ------------------
  153|   320k|}
api.c:mapi_in_ntfy_cb:
  156|   163k|{
  157|       |  /* The exception only applies when the notify callback is
  158|       |   * the latest in the callstack, e.g. the application calls
  159|       |   * directly from it and not from some nested callback. */
  160|   163k|  return multi && multi->callstack.count &&
  ------------------
  |  Branch (160:10): [True: 163k, False: 0]
  |  Branch (160:19): [True: 8.33k, False: 155k]
  ------------------
  161|  8.33k|    (multi->callstack.calls[multi->callstack.count - 1] ==
  ------------------
  |  Branch (161:5): [True: 0, False: 8.33k]
  ------------------
  162|  8.33k|     CURL_CBAPI_FN_multi_ntfy_cb);
  163|   163k|}

Curl_bufcp_init:
  148|  3.36k|{
  149|  3.36k|  DEBUGASSERT(chunk_size > 0);
  ------------------
  |  | 1016|  3.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (149:3): [True: 0, False: 3.36k]
  |  Branch (149:3): [True: 3.36k, False: 0]
  ------------------
  150|  3.36k|  DEBUGASSERT(spare_max > 0);
  ------------------
  |  | 1016|  3.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (150:3): [True: 0, False: 3.36k]
  |  Branch (150:3): [True: 3.36k, False: 0]
  ------------------
  151|  3.36k|  memset(pool, 0, sizeof(*pool));
  152|  3.36k|  pool->chunk_size = chunk_size;
  153|  3.36k|  pool->spare_max = spare_max;
  154|  3.36k|}
Curl_bufcp_free:
  201|  3.36k|{
  202|  3.36k|  chunk_list_free(&pool->spare);
  203|  3.36k|  pool->spare_count = 0;
  204|  3.36k|}
Curl_bufq_init2:
  220|  15.8k|{
  221|       |  bufq_init(q, NULL, chunk_size, max_chunks, opts);
  222|  15.8k|}
Curl_bufq_initp:
  231|  1.94k|{
  232|  1.94k|  bufq_init(q, pool, pool->chunk_size, max_chunks, opts);
  233|  1.94k|}
Curl_bufq_free:
  236|  17.8k|{
  237|  17.8k|  chunk_list_free(&q->head);
  238|  17.8k|  chunk_list_free(&q->spare);
  239|       |  q->tail = NULL;
  240|  17.8k|  q->chunk_count = 0;
  241|  17.8k|}
Curl_bufq_reset:
  244|  3.14k|{
  245|  3.14k|  struct buf_chunk *chunk;
  246|  4.73k|  while(q->head) {
  ------------------
  |  Branch (246:9): [True: 1.58k, False: 3.14k]
  ------------------
  247|  1.58k|    chunk = q->head;
  248|  1.58k|    q->head = chunk->next;
  249|  1.58k|    chunk->next = q->spare;
  250|  1.58k|    q->spare = chunk;
  251|  1.58k|  }
  252|       |  q->tail = NULL;
  253|  3.14k|}
Curl_bufq_len:
  256|  65.9k|{
  257|  65.9k|  const struct buf_chunk *chunk = q->head;
  258|  65.9k|  size_t len = 0;
  259|   137k|  while(chunk) {
  ------------------
  |  Branch (259:9): [True: 71.9k, False: 65.9k]
  ------------------
  260|  71.9k|    len += chunk_len(chunk);
  261|  71.9k|    chunk = chunk->next;
  262|  71.9k|  }
  263|  65.9k|  return len;
  264|  65.9k|}
Curl_bufq_is_empty:
  267|   534k|{
  268|   534k|  return !q->head || chunk_is_empty(q->head);
  ------------------
  |  Branch (268:10): [True: 193k, False: 341k]
  |  Branch (268:22): [True: 257k, False: 83.8k]
  ------------------
  269|   534k|}
Curl_bufq_is_full:
  272|   145k|{
  273|   145k|  if(!q->tail || q->spare)
  ------------------
  |  Branch (273:6): [True: 5.42k, False: 140k]
  |  Branch (273:18): [True: 1.26k, False: 138k]
  ------------------
  274|  6.68k|    return FALSE;
  ------------------
  |  |  989|  6.68k|#define FALSE false
  ------------------
  275|   138k|  if(q->chunk_count < q->max_chunks)
  ------------------
  |  Branch (275:6): [True: 137k, False: 953]
  ------------------
  276|   137k|    return FALSE;
  ------------------
  |  |  989|   137k|#define FALSE false
  ------------------
  277|    953|  if(q->chunk_count > q->max_chunks)
  ------------------
  |  Branch (277:6): [True: 1, False: 952]
  ------------------
  278|      1|    return TRUE;
  ------------------
  |  |  986|      1|#define TRUE true
  ------------------
  279|       |  /* we have no spares and cannot make more, is the tail full? */
  280|    952|  return chunk_is_full(q->tail);
  281|    953|}
Curl_bufq_write:
  370|  8.10k|{
  371|  8.10k|  struct buf_chunk *tail;
  372|  8.10k|  size_t n;
  373|       |
  374|  8.10k|  DEBUGASSERT(q->max_chunks > 0);
  ------------------
  |  | 1016|  8.10k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (374:3): [True: 0, False: 8.10k]
  |  Branch (374:3): [True: 8.10k, False: 0]
  ------------------
  375|  8.10k|  *pnwritten = 0;
  376|  16.1k|  while(len) {
  ------------------
  |  Branch (376:9): [True: 8.06k, False: 8.09k]
  ------------------
  377|  8.06k|    tail = get_non_full_tail(q);
  378|  8.06k|    if(!tail) {
  ------------------
  |  Branch (378:8): [True: 4, False: 8.06k]
  ------------------
  379|      4|      if((q->chunk_count < q->max_chunks) || (q->opts & BUFQ_OPT_SOFT_LIMIT))
  ------------------
  |  |  111|      0|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
  |  Branch (379:10): [True: 4, False: 0]
  |  Branch (379:46): [True: 0, False: 0]
  ------------------
  380|       |        /* should have gotten a tail, but did not */
  381|      4|        return CURLE_OUT_OF_MEMORY;
  382|      0|      break;
  383|      4|    }
  384|  8.06k|    n = chunk_append(tail, buf, len);
  385|  8.06k|    if(!n)
  ------------------
  |  Branch (385:8): [True: 0, False: 8.06k]
  ------------------
  386|      0|      break;
  387|  8.06k|    *pnwritten += n;
  388|  8.06k|    buf += n;
  389|  8.06k|    len -= n;
  390|  8.06k|  }
  391|  8.09k|  return (!*pnwritten && len) ? CURLE_AGAIN : CURLE_OK;
  ------------------
  |  Branch (391:11): [True: 51, False: 8.04k]
  |  Branch (391:26): [True: 0, False: 51]
  ------------------
  392|  8.10k|}
Curl_bufq_cwrite:
  397|    428|{
  398|    428|  return Curl_bufq_write(q, (const uint8_t *)buf, len, pnwritten);
  399|    428|}
Curl_bufq_read:
  403|  16.6k|{
  404|  16.6k|  *pnread = 0;
  405|  33.2k|  while(len && q->head) {
  ------------------
  |  Branch (405:9): [True: 16.6k, False: 16.6k]
  |  Branch (405:16): [True: 16.6k, False: 6]
  ------------------
  406|  16.6k|    size_t n = chunk_read(q->head, buf, len);
  407|  16.6k|    if(n) {
  ------------------
  |  Branch (407:8): [True: 16.6k, False: 0]
  ------------------
  408|  16.6k|      *pnread += n;
  409|  16.6k|      buf += n;
  410|  16.6k|      len -= n;
  411|  16.6k|    }
  412|  16.6k|    prune_head(q);
  413|  16.6k|  }
  414|  16.6k|  return (!*pnread) ? CURLE_AGAIN : CURLE_OK;
  ------------------
  |  Branch (414:10): [True: 1, False: 16.6k]
  ------------------
  415|  16.6k|}
Curl_bufq_cread:
  419|      6|{
  420|      6|  return Curl_bufq_read(q, (uint8_t *)buf, len, pnread);
  421|      6|}
Curl_bufq_peek:
  425|   232k|{
  426|   232k|  if(q->head && chunk_is_empty(q->head)) {
  ------------------
  |  Branch (426:6): [True: 202k, False: 30.1k]
  |  Branch (426:17): [True: 116k, False: 85.3k]
  ------------------
  427|   116k|    prune_head(q);
  428|   116k|  }
  429|   232k|  if(q->head && !chunk_is_empty(q->head)) {
  ------------------
  |  Branch (429:6): [True: 85.3k, False: 146k]
  |  Branch (429:17): [True: 85.3k, False: 0]
  ------------------
  430|  85.3k|    chunk_peek(q->head, pbuf, plen);
  431|  85.3k|    return TRUE;
  ------------------
  |  |  986|  85.3k|#define TRUE true
  ------------------
  432|  85.3k|  }
  433|   146k|  *pbuf = NULL;
  434|   146k|  *plen = 0;
  435|       |  return FALSE;
  ------------------
  |  |  989|   146k|#define FALSE false
  ------------------
  436|   232k|}
Curl_bufq_peek_at:
  440|   153k|{
  441|   153k|  struct buf_chunk *c = q->head;
  442|   153k|  size_t clen;
  443|       |
  444|   181k|  while(c) {
  ------------------
  |  Branch (444:9): [True: 155k, False: 25.6k]
  ------------------
  445|   155k|    clen = chunk_len(c);
  446|   155k|    if(!clen)
  ------------------
  |  Branch (446:8): [True: 1.91k, False: 154k]
  ------------------
  447|  1.91k|      break;
  448|   154k|    if(offset >= clen) {
  ------------------
  |  Branch (448:8): [True: 28.2k, False: 125k]
  ------------------
  449|  28.2k|      offset -= clen;
  450|  28.2k|      c = c->next;
  451|  28.2k|      continue;
  452|  28.2k|    }
  453|   125k|    chunk_peek_at(c, offset, pbuf, plen);
  454|   125k|    return TRUE;
  ------------------
  |  |  986|   125k|#define TRUE true
  ------------------
  455|   154k|  }
  456|  27.5k|  *pbuf = NULL;
  457|  27.5k|  *plen = 0;
  458|       |  return FALSE;
  ------------------
  |  |  989|  27.5k|#define FALSE false
  ------------------
  459|   153k|}
Curl_bufq_skip:
  462|  43.2k|{
  463|  43.2k|  size_t n;
  464|       |
  465|  86.4k|  while(amount && q->head) {
  ------------------
  |  Branch (465:9): [True: 43.3k, False: 43.0k]
  |  Branch (465:19): [True: 43.2k, False: 146]
  ------------------
  466|  43.2k|    n = chunk_skip(q->head, amount);
  467|  43.2k|    amount -= n;
  468|  43.2k|    prune_head(q);
  469|  43.2k|  }
  470|  43.2k|}
Curl_bufq_pass:
  474|  8.43k|{
  475|  8.43k|  const uint8_t *buf;
  476|  8.43k|  size_t blen;
  477|  8.43k|  CURLcode result = CURLE_OK;
  478|       |
  479|  8.43k|  *pwritten = 0;
  480|  11.1k|  while(Curl_bufq_peek(q, &buf, &blen)) {
  ------------------
  |  Branch (480:9): [True: 8.44k, False: 2.66k]
  ------------------
  481|  8.44k|    size_t chunk_written;
  482|       |
  483|  8.44k|    result = writer(writer_ctx, buf, blen, &chunk_written);
  484|  8.44k|    if(result) {
  ------------------
  |  Branch (484:8): [True: 5.77k, False: 2.66k]
  ------------------
  485|  5.77k|      if((result == CURLE_AGAIN) && *pwritten) {
  ------------------
  |  Branch (485:10): [True: 5.77k, False: 0]
  |  Branch (485:37): [True: 2, False: 5.77k]
  ------------------
  486|       |        /* blocked on subsequent write, report success */
  487|      2|        result = CURLE_OK;
  488|      2|      }
  489|  5.77k|      break;
  490|  5.77k|    }
  491|  2.66k|    if(!chunk_written) {
  ------------------
  |  Branch (491:8): [True: 0, False: 2.66k]
  ------------------
  492|      0|      if(!*pwritten) {
  ------------------
  |  Branch (492:10): [True: 0, False: 0]
  ------------------
  493|       |        /* treat as blocked */
  494|      0|        result = CURLE_AGAIN;
  495|      0|      }
  496|      0|      break;
  497|      0|    }
  498|  2.66k|    *pwritten += chunk_written;
  499|  2.66k|    Curl_bufq_skip(q, chunk_written);
  500|  2.66k|  }
  501|  8.43k|  return result;
  502|  8.43k|}
Curl_bufq_sipn:
  556|   282k|{
  557|   282k|  struct buf_chunk *tail = NULL;
  558|       |
  559|   282k|  *pnread = 0;
  560|   282k|  tail = get_non_full_tail(q);
  561|   282k|  if(!tail) {
  ------------------
  |  Branch (561:6): [True: 3, False: 282k]
  ------------------
  562|      3|    if(q->chunk_count < q->max_chunks)
  ------------------
  |  Branch (562:8): [True: 3, False: 0]
  ------------------
  563|      3|      return CURLE_OUT_OF_MEMORY;
  564|       |    /* full, blocked */
  565|      0|    return CURLE_AGAIN;
  566|      3|  }
  567|       |
  568|   282k|  return chunk_slurpn(tail, max_len, reader, reader_ctx, pnread);
  569|   282k|}
bufq.c:chunk_list_free:
  137|  39.0k|{
  138|  39.0k|  struct buf_chunk *chunk;
  139|  45.9k|  while(*anchor) {
  ------------------
  |  Branch (139:9): [True: 6.91k, False: 39.0k]
  ------------------
  140|  6.91k|    chunk = *anchor;
  141|  6.91k|    *anchor = chunk->next;
  142|  6.91k|    curlx_free(chunk);
  ------------------
  |  | 1503|  6.91k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  143|  6.91k|  }
  144|  39.0k|}
bufq.c:bufq_init:
  208|  17.8k|{
  209|  17.8k|  DEBUGASSERT(chunk_size > 0);
  ------------------
  |  | 1016|  17.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:3): [True: 0, False: 17.8k]
  |  Branch (209:3): [True: 17.8k, False: 0]
  ------------------
  210|  17.8k|  DEBUGASSERT(max_chunks > 0);
  ------------------
  |  | 1016|  17.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (210:3): [True: 0, False: 17.8k]
  |  Branch (210:3): [True: 17.8k, False: 0]
  ------------------
  211|  17.8k|  memset(q, 0, sizeof(*q));
  212|  17.8k|  q->chunk_size = chunk_size;
  213|  17.8k|  q->max_chunks = max_chunks;
  214|  17.8k|  q->pool = pool;
  215|  17.8k|  q->opts = opts;
  216|  17.8k|}
bufq.c:chunk_len:
   39|   227k|{
   40|   227k|  return chunk->w_offset - chunk->r_offset;
   41|   227k|}
bufq.c:chunk_is_empty:
   29|   805k|{
   30|   805k|  return chunk->r_offset >= chunk->w_offset;
   31|   805k|}
bufq.c:chunk_is_full:
   34|   152k|{
   35|   152k|  return chunk->w_offset >= chunk->dlen;
   36|   152k|}
bufq.c:get_non_full_tail:
  347|   290k|{
  348|   290k|  struct buf_chunk *chunk;
  349|       |
  350|   290k|  if(q->tail && !chunk_is_full(q->tail))
  ------------------
  |  Branch (350:6): [True: 151k, False: 139k]
  |  Branch (350:17): [True: 151k, False: 61]
  ------------------
  351|   151k|    return q->tail;
  352|   139k|  chunk = get_spare(q);
  353|   139k|  if(chunk) {
  ------------------
  |  Branch (353:6): [True: 139k, False: 7]
  ------------------
  354|       |    /* new tail, and possibly new head */
  355|   139k|    if(q->tail) {
  ------------------
  |  Branch (355:8): [True: 61, False: 139k]
  ------------------
  356|     61|      q->tail->next = chunk;
  357|     61|      q->tail = chunk;
  358|     61|    }
  359|   139k|    else {
  360|   139k|      DEBUGASSERT(!q->head);
  ------------------
  |  | 1016|   139k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (360:7): [True: 0, False: 139k]
  |  Branch (360:7): [True: 139k, False: 0]
  ------------------
  361|   139k|      q->head = q->tail = chunk;
  362|   139k|    }
  363|   139k|  }
  364|   139k|  return chunk;
  365|   139k|}
bufq.c:get_spare:
  284|   139k|{
  285|   139k|  struct buf_chunk *chunk = NULL;
  286|       |
  287|   139k|  if(q->spare) {
  ------------------
  |  Branch (287:6): [True: 132k, False: 6.99k]
  ------------------
  288|   132k|    chunk = q->spare;
  289|   132k|    q->spare = chunk->next;
  290|   132k|    chunk_reset(chunk);
  291|   132k|    return chunk;
  292|   132k|  }
  293|       |
  294|  6.99k|  if(q->chunk_count >= q->max_chunks && (!(q->opts & BUFQ_OPT_SOFT_LIMIT)))
  ------------------
  |  |  111|      1|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
  |  Branch (294:6): [True: 1, False: 6.99k]
  |  Branch (294:41): [True: 0, False: 1]
  ------------------
  295|      0|    return NULL;
  296|       |
  297|  6.99k|  if(q->pool) {
  ------------------
  |  Branch (297:6): [True: 511, False: 6.48k]
  ------------------
  298|    511|    if(bufcp_take(q->pool, &chunk))
  ------------------
  |  Branch (298:8): [True: 0, False: 511]
  ------------------
  299|      0|      return NULL;
  300|    511|    ++q->chunk_count;
  301|    511|    return chunk;
  302|    511|  }
  303|  6.48k|  else {
  304|       |    /* Check for integer overflow before allocation */
  305|  6.48k|    if(q->chunk_size > SIZE_MAX - sizeof(*chunk)) {
  ------------------
  |  Branch (305:8): [True: 0, False: 6.48k]
  ------------------
  306|      0|      return NULL;
  307|      0|    }
  308|       |
  309|  6.48k|    chunk = curlx_calloc(1, sizeof(*chunk) + q->chunk_size);
  ------------------
  |  | 1500|  6.48k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  310|  6.48k|    if(!chunk)
  ------------------
  |  Branch (310:8): [True: 7, False: 6.47k]
  ------------------
  311|      7|      return NULL;
  312|  6.47k|    chunk->dlen = q->chunk_size;
  313|  6.47k|    ++q->chunk_count;
  314|  6.47k|    return chunk;
  315|  6.48k|  }
  316|  6.99k|}
bufq.c:chunk_reset:
   44|   133k|{
   45|       |  chunk->next = NULL;
   46|   133k|  chunk->r_offset = chunk->w_offset = 0;
   47|   133k|}
bufq.c:bufcp_take:
  158|    511|{
  159|    511|  struct buf_chunk *chunk = NULL;
  160|       |
  161|    511|  if(pool->spare) {
  ------------------
  |  Branch (161:6): [True: 67, False: 444]
  ------------------
  162|     67|    chunk = pool->spare;
  163|     67|    pool->spare = chunk->next;
  164|     67|    --pool->spare_count;
  165|     67|    chunk_reset(chunk);
  166|     67|    *pchunk = chunk;
  167|     67|    return CURLE_OK;
  168|     67|  }
  169|       |
  170|       |  /* Check for integer overflow before allocation */
  171|    444|  if(pool->chunk_size > SIZE_MAX - sizeof(*chunk)) {
  ------------------
  |  Branch (171:6): [True: 0, False: 444]
  ------------------
  172|      0|    *pchunk = NULL;
  173|      0|    return CURLE_OUT_OF_MEMORY;
  174|      0|  }
  175|       |
  176|    444|  chunk = curlx_calloc(1, sizeof(*chunk) + pool->chunk_size);
  ------------------
  |  | 1500|    444|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  177|    444|  if(!chunk) {
  ------------------
  |  Branch (177:6): [True: 0, False: 444]
  ------------------
  178|      0|    *pchunk = NULL;
  179|      0|    return CURLE_OUT_OF_MEMORY;
  180|      0|  }
  181|    444|  chunk->dlen = pool->chunk_size;
  182|    444|  *pchunk = chunk;
  183|    444|  return CURLE_OK;
  184|    444|}
bufq.c:chunk_append:
   51|  8.06k|{
   52|  8.06k|  uint8_t *p = &chunk->x.data[chunk->w_offset];
   53|  8.06k|  size_t n = chunk->dlen - chunk->w_offset;
   54|  8.06k|  DEBUGASSERT(chunk->dlen >= chunk->w_offset);
  ------------------
  |  | 1016|  8.06k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (54:3): [True: 0, False: 8.06k]
  |  Branch (54:3): [True: 8.06k, False: 0]
  ------------------
   55|  8.06k|  if(n) {
  ------------------
  |  Branch (55:6): [True: 8.06k, False: 0]
  ------------------
   56|  8.06k|    n = CURLMIN(n, len);
  ------------------
  |  | 1315|  8.06k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 18, False: 8.04k]
  |  |  ------------------
  ------------------
   57|  8.06k|    memcpy(p, buf, n);
   58|  8.06k|    chunk->w_offset += n;
   59|  8.06k|  }
   60|  8.06k|  return n;
   61|  8.06k|}
bufq.c:chunk_read:
   65|  16.6k|{
   66|  16.6k|  uint8_t *p = &chunk->x.data[chunk->r_offset];
   67|  16.6k|  size_t n = chunk->w_offset - chunk->r_offset;
   68|  16.6k|  DEBUGASSERT(chunk->w_offset >= chunk->r_offset);
  ------------------
  |  | 1016|  16.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (68:3): [True: 0, False: 16.6k]
  |  Branch (68:3): [True: 16.6k, False: 0]
  ------------------
   69|  16.6k|  if(!n) {
  ------------------
  |  Branch (69:6): [True: 0, False: 16.6k]
  ------------------
   70|      0|    return 0;
   71|      0|  }
   72|  16.6k|  else if(n <= len) {
  ------------------
  |  Branch (72:11): [True: 1.14k, False: 15.4k]
  ------------------
   73|  1.14k|    memcpy(buf, p, n);
   74|  1.14k|    chunk->r_offset = chunk->w_offset = 0;
   75|  1.14k|    return n;
   76|  1.14k|  }
   77|  15.4k|  else {
   78|  15.4k|    memcpy(buf, p, len);
   79|  15.4k|    chunk->r_offset += len;
   80|  15.4k|    return len;
   81|  15.4k|  }
   82|  16.6k|}
bufq.c:prune_head:
  319|   176k|{
  320|   176k|  struct buf_chunk *chunk;
  321|       |
  322|   313k|  while(q->head && chunk_is_empty(q->head)) {
  ------------------
  |  Branch (322:9): [True: 176k, False: 136k]
  |  Branch (322:20): [True: 136k, False: 39.6k]
  ------------------
  323|   136k|    chunk = q->head;
  324|   136k|    q->head = chunk->next;
  325|   136k|    if(q->tail == chunk)
  ------------------
  |  Branch (325:8): [True: 136k, False: 41]
  ------------------
  326|   136k|      q->tail = q->head;
  327|   136k|    if(q->pool) {
  ------------------
  |  Branch (327:8): [True: 471, False: 136k]
  ------------------
  328|    471|      bufcp_put(q->pool, chunk);
  329|    471|      --q->chunk_count;
  330|    471|    }
  331|   136k|    else if((q->chunk_count > q->max_chunks) ||
  ------------------
  |  Branch (331:13): [True: 1, False: 136k]
  ------------------
  332|   136k|            (q->opts & BUFQ_OPT_NO_SPARES)) {
  ------------------
  |  |  115|   136k|#define BUFQ_OPT_NO_SPARES   (1 << 1)
  ------------------
  |  Branch (332:13): [True: 5, False: 136k]
  ------------------
  333|       |      /* SOFT_LIMIT allowed us more than max. free spares until
  334|       |       * we are at max again. Or free them if we are configured
  335|       |       * to not use spares. */
  336|      6|      curlx_free(chunk);
  ------------------
  |  | 1503|      6|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  337|      6|      --q->chunk_count;
  338|      6|    }
  339|   136k|    else {
  340|   136k|      chunk->next = q->spare;
  341|   136k|      q->spare = chunk;
  342|   136k|    }
  343|   136k|  }
  344|   176k|}
bufq.c:bufcp_put:
  188|    471|{
  189|    471|  if(pool->spare_count >= pool->spare_max) {
  ------------------
  |  Branch (189:6): [True: 0, False: 471]
  ------------------
  190|      0|    curlx_free(chunk);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  191|      0|  }
  192|    471|  else {
  193|    471|    chunk_reset(chunk);
  194|    471|    chunk->next = pool->spare;
  195|    471|    pool->spare = chunk;
  196|    471|    ++pool->spare_count;
  197|    471|  }
  198|    471|}
bufq.c:chunk_peek:
  108|  85.3k|{
  109|  85.3k|  DEBUGASSERT(chunk->w_offset >= chunk->r_offset);
  ------------------
  |  | 1016|  85.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (109:3): [True: 0, False: 85.3k]
  |  Branch (109:3): [True: 85.3k, False: 0]
  ------------------
  110|  85.3k|  *pbuf = &chunk->x.data[chunk->r_offset];
  111|  85.3k|  *plen = chunk->w_offset - chunk->r_offset;
  112|  85.3k|}
bufq.c:chunk_peek_at:
  116|   125k|{
  117|   125k|  offset += chunk->r_offset;
  118|   125k|  DEBUGASSERT(chunk->w_offset >= offset);
  ------------------
  |  | 1016|   125k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (118:3): [True: 0, False: 125k]
  |  Branch (118:3): [True: 125k, False: 0]
  ------------------
  119|   125k|  *pbuf = &chunk->x.data[offset];
  120|   125k|  *plen = chunk->w_offset - offset;
  121|   125k|}
bufq.c:chunk_skip:
  124|  43.2k|{
  125|  43.2k|  size_t n = chunk->w_offset - chunk->r_offset;
  126|  43.2k|  DEBUGASSERT(chunk->w_offset >= chunk->r_offset);
  ------------------
  |  | 1016|  43.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (126:3): [True: 0, False: 43.2k]
  |  Branch (126:3): [True: 43.2k, False: 0]
  ------------------
  127|  43.2k|  if(n) {
  ------------------
  |  Branch (127:6): [True: 43.2k, False: 0]
  ------------------
  128|  43.2k|    n = CURLMIN(n, amount);
  ------------------
  |  | 1315|  43.2k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 150, False: 43.0k]
  |  |  ------------------
  ------------------
  129|  43.2k|    chunk->r_offset += n;
  130|  43.2k|    if(chunk->r_offset == chunk->w_offset)
  ------------------
  |  Branch (130:8): [True: 19.0k, False: 24.1k]
  ------------------
  131|  19.0k|      chunk->r_offset = chunk->w_offset = 0;
  132|  43.2k|  }
  133|  43.2k|  return n;
  134|  43.2k|}
bufq.c:chunk_slurpn:
   87|   282k|{
   88|   282k|  uint8_t *p = &chunk->x.data[chunk->w_offset];
   89|   282k|  size_t n = chunk->dlen - chunk->w_offset; /* free amount */
   90|   282k|  CURLcode result;
   91|       |
   92|   282k|  *pnread = 0;
   93|   282k|  DEBUGASSERT(chunk->dlen >= chunk->w_offset);
  ------------------
  |  | 1016|   282k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (93:3): [True: 0, False: 282k]
  |  Branch (93:3): [True: 282k, False: 0]
  ------------------
   94|   282k|  if(!n)
  ------------------
  |  Branch (94:6): [True: 0, False: 282k]
  ------------------
   95|      0|    return CURLE_AGAIN;
   96|   282k|  if(max_len && n > max_len)
  ------------------
  |  Branch (96:6): [True: 151k, False: 131k]
  |  Branch (96:17): [True: 151k, False: 0]
  ------------------
   97|   151k|    n = max_len;
   98|   282k|  result = reader(reader_ctx, p, n, pnread);
   99|   282k|  if(!result) {
  ------------------
  |  Branch (99:6): [True: 149k, False: 133k]
  ------------------
  100|   149k|    DEBUGASSERT(*pnread <= n);
  ------------------
  |  | 1016|   149k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (100:5): [True: 0, False: 149k]
  |  Branch (100:5): [True: 149k, False: 0]
  ------------------
  101|   149k|    chunk->w_offset += *pnread;
  102|   149k|  }
  103|   282k|  return result;
  104|   282k|}

Curl_bufref_init:
   38|  39.4k|{
   39|  39.4k|  DEBUGASSERT(br);
  ------------------
  |  | 1016|  39.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (39:3): [True: 0, False: 39.4k]
  |  Branch (39:3): [True: 39.4k, False: 0]
  ------------------
   40|  39.4k|  br->dtor = NULL;
   41|  39.4k|  br->ptr = NULL;
   42|  39.4k|  br->len = 0;
   43|       |
   44|  39.4k|#ifdef DEBUGBUILD
   45|  39.4k|  br->signature = SIGNATURE;
  ------------------
  |  |   31|  39.4k|#define SIGNATURE 0x5c48e9b2    /* Random pattern. */
  ------------------
   46|  39.4k|#endif
   47|  39.4k|}
Curl_bufref_free:
   55|  98.4k|{
   56|  98.4k|  DEBUGASSERT(br);
  ------------------
  |  | 1016|  98.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (56:3): [True: 0, False: 98.4k]
  |  Branch (56:3): [True: 98.4k, False: 0]
  ------------------
   57|  98.4k|  DEBUGASSERT(br->signature == SIGNATURE);
  ------------------
  |  | 1016|  98.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (57:3): [True: 0, False: 98.4k]
  |  Branch (57:3): [True: 98.4k, False: 0]
  ------------------
   58|  98.4k|  DEBUGASSERT(br->ptr || !br->len);
  ------------------
  |  | 1016|  98.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (58:3): [True: 98.4k, False: 0]
  |  Branch (58:3): [True: 0, False: 0]
  |  Branch (58:3): [True: 29.1k, False: 69.3k]
  |  Branch (58:3): [True: 69.3k, False: 0]
  ------------------
   59|       |
   60|  98.4k|  if(br->ptr && br->dtor)
  ------------------
  |  Branch (60:6): [True: 29.1k, False: 69.3k]
  |  Branch (60:17): [True: 9.46k, False: 19.6k]
  ------------------
   61|  9.46k|    br->dtor(CURL_UNCONST(br->ptr));
  ------------------
  |  |  793|  9.46k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   62|       |
   63|  98.4k|  br->dtor = NULL;
   64|       |  br->ptr = NULL;
   65|  98.4k|  br->len = 0;
   66|  98.4k|}
Curl_bufref_set:
   74|  29.1k|{
   75|  29.1k|  DEBUGASSERT(ptr || !len);
  ------------------
  |  | 1016|  29.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (75:3): [True: 29.1k, False: 0]
  |  Branch (75:3): [True: 0, False: 0]
  |  Branch (75:3): [True: 29.1k, False: 17]
  |  Branch (75:3): [True: 17, False: 0]
  ------------------
   76|  29.1k|  DEBUGASSERT(len <= CURL_MAX_INPUT_LENGTH);
  ------------------
  |  | 1016|  29.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (76:3): [True: 0, False: 29.1k]
  |  Branch (76:3): [True: 29.1k, False: 0]
  ------------------
   77|       |
   78|  29.1k|  Curl_bufref_free(br);
   79|  29.1k|  br->ptr = (const unsigned char *)ptr;
   80|  29.1k|  br->len = len;
   81|  29.1k|  br->dtor = dtor;
   82|  29.1k|}
Curl_bufref_ptr:
  100|  31.3k|{
  101|  31.3k|  DEBUGASSERT(br);
  ------------------
  |  | 1016|  31.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (101:3): [True: 0, False: 31.3k]
  |  Branch (101:3): [True: 31.3k, False: 0]
  ------------------
  102|  31.3k|  DEBUGASSERT(br->signature == SIGNATURE);
  ------------------
  |  | 1016|  31.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (102:3): [True: 0, False: 31.3k]
  |  Branch (102:3): [True: 31.3k, False: 0]
  ------------------
  103|  31.3k|  DEBUGASSERT(br->ptr || !br->len);
  ------------------
  |  | 1016|  31.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (103:3): [True: 31.3k, False: 0]
  |  Branch (103:3): [True: 0, False: 0]
  |  Branch (103:3): [True: 29.3k, False: 1.95k]
  |  Branch (103:3): [True: 1.95k, False: 0]
  ------------------
  104|       |
  105|  31.3k|  return (const char *)br->ptr;
  106|  31.3k|}

Curl_cf_h1_proxy_insert_after:
  943|  7.22k|{
  944|  7.22k|  struct Curl_cfilter *cf;
  945|  7.22k|  struct cf_h1_proxy_ctx *pctx;
  946|  7.22k|  struct h1_tunnel_state *ts;
  947|  7.22k|  CURLcode result;
  948|       |
  949|  7.22k|  (void)data;
  950|  7.22k|  if(!dest)
  ------------------
  |  Branch (950:6): [True: 0, False: 7.22k]
  ------------------
  951|      0|    return CURLE_FAILED_INIT;
  952|  7.22k|  if((httpversion < 10) || (httpversion >= 20))
  ------------------
  |  Branch (952:6): [True: 0, False: 7.22k]
  |  Branch (952:28): [True: 0, False: 7.22k]
  ------------------
  953|      0|    return CURLE_FAILED_INIT;
  954|       |
  955|  7.22k|  ts = curlx_calloc(1, sizeof(*ts));
  ------------------
  |  | 1500|  7.22k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  956|  7.22k|  if(!ts) {
  ------------------
  |  Branch (956:6): [True: 1, False: 7.21k]
  ------------------
  957|      1|    result = CURLE_OUT_OF_MEMORY;
  958|      1|    goto out;
  959|      1|  }
  960|  7.21k|  Curl_peer_link(&ts->dest, dest);
  961|  7.21k|  ts->udp_tunnel = udp_tunnel;
  962|  7.21k|  ts->httpversion = httpversion;
  963|  7.21k|  curlx_dyn_init(&ts->rcvbuf, DYN_PROXY_CONNECT_HEADERS);
  ------------------
  |  |   73|  7.21k|#define DYN_PROXY_CONNECT_HEADERS 16384
  ------------------
  964|  7.21k|  curlx_dyn_init(&ts->request_data, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  7.21k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
  965|  7.21k|  Curl_httpchunk_init(data, &ts->ch, TRUE, TRUE);
  ------------------
  |  |  986|  7.21k|#define TRUE true
  ------------------
                Curl_httpchunk_init(data, &ts->ch, TRUE, TRUE);
  ------------------
  |  |  986|  7.21k|#define TRUE true
  ------------------
  966|       |
  967|  7.21k|  pctx = curlx_calloc(1, sizeof(*pctx));
  ------------------
  |  | 1500|  7.21k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  968|  7.21k|  if(!pctx) {
  ------------------
  |  Branch (968:6): [True: 1, False: 7.21k]
  ------------------
  969|      1|    result = CURLE_OUT_OF_MEMORY;
  970|      1|    goto out;
  971|      1|  }
  972|  7.21k|  Curl_peer_link(&pctx->peer, peer);
  973|  7.21k|  pctx->ts = ts;
  974|  7.21k|  result = Curl_cf_create(&cf, &Curl_cft_h1_proxy, pctx);
  975|  7.21k|  if(result) {
  ------------------
  |  Branch (975:6): [True: 1, False: 7.21k]
  ------------------
  976|      1|    Curl_peer_unlink(&pctx->peer);
  977|      1|    curlx_free(pctx);
  ------------------
  |  | 1503|      1|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  978|      1|    goto out;
  979|      1|  }
  980|  7.21k|  ts = NULL;
  981|  7.21k|  Curl_conn_cf_insert_after(cf_at, cf);
  982|       |
  983|  7.22k|out:
  984|  7.22k|  tunnel_free(ts, data);
  985|  7.22k|  return result;
  986|  7.21k|}
cf-h1-proxy.c:cf_h1_proxy_destroy:
  882|  7.21k|{
  883|  7.21k|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
  884|       |
  885|  7.21k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  7.21k|  do {                                          \
  |  |  154|  7.21k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  7.21k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  14.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.21k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 7.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.21k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.21k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.21k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.21k]
  |  |  ------------------
  ------------------
  886|  7.21k|  if(pctx) {
  ------------------
  |  Branch (886:6): [True: 7.21k, False: 0]
  ------------------
  887|  7.21k|    cf_tunnel_free(cf, data);
  888|  7.21k|    Curl_peer_unlink(&pctx->peer);
  889|       |    curlx_safefree(cf->ctx);
  ------------------
  |  | 1359|  7.21k|  do {                      \
  |  | 1360|  7.21k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  7.21k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  7.21k|    (ptr) = NULL;           \
  |  | 1362|  7.21k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 7.21k]
  |  |  ------------------
  ------------------
  890|  7.21k|  }
  891|  7.21k|}
cf-h1-proxy.c:cf_tunnel_free:
  215|  8.60k|{
  216|  8.60k|  if(cf) {
  ------------------
  |  Branch (216:6): [True: 8.60k, False: 0]
  ------------------
  217|  8.60k|    struct cf_h1_proxy_ctx *pctx = cf->ctx;
  218|  8.60k|    struct h1_tunnel_state *ts = pctx ? pctx->ts : NULL;
  ------------------
  |  Branch (218:34): [True: 8.60k, False: 0]
  ------------------
  219|  8.60k|    if(ts) {
  ------------------
  |  Branch (219:8): [True: 7.21k, False: 1.38k]
  ------------------
  220|  7.21k|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
  221|  7.21k|      tunnel_free(ts, data);
  222|       |      pctx->ts = NULL;
  223|  7.21k|    }
  224|  8.60k|  }
  225|  8.60k|}
cf-h1-proxy.c:h1_tunnel_go_state:
  153|  30.2k|{
  154|  30.2k|  if(ts->tunnel_state == new_state)
  ------------------
  |  Branch (154:6): [True: 5.83k, False: 24.4k]
  ------------------
  155|  5.83k|    return;
  156|       |  /* entering this one */
  157|  24.4k|  switch(new_state) {
  ------------------
  |  Branch (157:10): [True: 24.4k, False: 0]
  ------------------
  158|      0|  case H1_TUNNEL_INIT:
  ------------------
  |  Branch (158:3): [True: 0, False: 24.4k]
  ------------------
  159|      0|    CURL_TRC_CF(data, cf, "new tunnel state 'init'");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  160|      0|    tunnel_reinit(cf, data, ts);
  161|      0|    break;
  162|       |
  163|  7.19k|  case H1_TUNNEL_CONNECT:
  ------------------
  |  Branch (163:3): [True: 7.19k, False: 17.2k]
  ------------------
  164|  7.19k|    CURL_TRC_CF(data, cf, "new tunnel state 'connect'");
  ------------------
  |  |  153|  7.19k|  do {                                          \
  |  |  154|  7.19k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  7.19k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  14.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.19k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 713, False: 6.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 713, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    713|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.19k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    713|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 713, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 150, False: 563]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.19k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.19k]
  |  |  ------------------
  ------------------
  165|  7.19k|    ts->tunnel_state = H1_TUNNEL_CONNECT;
  166|  7.19k|    ts->keepon = KEEPON_CONNECT;
  167|  7.19k|    curlx_dyn_reset(&ts->rcvbuf);
  168|  7.19k|    break;
  169|       |
  170|  7.18k|  case H1_TUNNEL_RECEIVE:
  ------------------
  |  Branch (170:3): [True: 7.18k, False: 17.2k]
  ------------------
  171|  7.18k|    CURL_TRC_CF(data, cf, "new tunnel state 'receive'");
  ------------------
  |  |  153|  7.18k|  do {                                          \
  |  |  154|  7.18k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  7.18k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  14.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.18k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 713, False: 6.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 713, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    713|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.18k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    713|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 713, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 150, False: 563]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.18k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.18k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.18k]
  |  |  ------------------
  ------------------
  172|  7.18k|    ts->tunnel_state = H1_TUNNEL_RECEIVE;
  173|  7.18k|    break;
  174|       |
  175|  1.43k|  case H1_TUNNEL_RESPONSE:
  ------------------
  |  Branch (175:3): [True: 1.43k, False: 22.9k]
  ------------------
  176|  1.43k|    CURL_TRC_CF(data, cf, "new tunnel state 'response'");
  ------------------
  |  |  153|  1.43k|  do {                                          \
  |  |  154|  1.43k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.43k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  2.87k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.43k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 207, False: 1.22k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.87k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 207, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    207|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.43k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    207|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 207, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 70, False: 137]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.43k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.43k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.43k]
  |  |  ------------------
  ------------------
  177|  1.43k|    ts->tunnel_state = H1_TUNNEL_RESPONSE;
  178|  1.43k|    break;
  179|       |
  180|  1.38k|  case H1_TUNNEL_ESTABLISHED:
  ------------------
  |  Branch (180:3): [True: 1.38k, False: 23.0k]
  ------------------
  181|  1.38k|    CURL_TRC_CF(data, cf, "new tunnel state 'established'");
  ------------------
  |  |  153|  1.38k|  do {                                          \
  |  |  154|  1.38k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.38k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  2.76k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.38k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 200, False: 1.18k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.76k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 200, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    200|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.38k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    200|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 200, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 68, False: 132]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.38k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.38k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.38k]
  |  |  ------------------
  ------------------
  182|  1.38k|    infof(data, "CONNECT%s phase completed for HTTP proxy",
  ------------------
  |  |  143|  1.38k|  do {                               \
  |  |  144|  1.38k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  1.38k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.38k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 200, False: 1.18k]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.38k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 200, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    200|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.38k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 200, False: 0]
  |  |  ------------------
  |  |  146|  1.38k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.38k]
  |  |  ------------------
  ------------------
  183|  1.38k|          h1_proxy_is_udp(cf) ? "-UDP" : "");
  184|       |
  185|  1.38k|    data->state.authproxy.done = TRUE;
  ------------------
  |  |  986|  1.38k|#define TRUE true
  ------------------
  186|  1.38k|    data->state.authproxy.multipass = FALSE;
  ------------------
  |  |  989|  1.38k|#define FALSE false
  ------------------
  187|  1.38k|    FALLTHROUGH();
  ------------------
  |  |  752|  1.38k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  188|  8.60k|  case H1_TUNNEL_FAILED:
  ------------------
  |  Branch (188:3): [True: 7.21k, False: 17.1k]
  ------------------
  189|  8.60k|    if(new_state == H1_TUNNEL_FAILED)
  ------------------
  |  Branch (189:8): [True: 7.21k, False: 1.38k]
  ------------------
  190|  7.21k|      CURL_TRC_CF(data, cf, "new tunnel state 'failed'");
  ------------------
  |  |  153|  7.21k|  do {                                          \
  |  |  154|  7.21k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  7.21k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  14.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.21k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 717, False: 6.50k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 717, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    717|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.21k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    717|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 717, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 152, False: 565]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.21k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.21k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.21k]
  |  |  ------------------
  ------------------
  191|  8.60k|    ts->tunnel_state = new_state;
  192|  8.60k|    curlx_dyn_reset(&ts->rcvbuf);
  193|  8.60k|    curlx_dyn_reset(&ts->request_data);
  194|       |    /* restore the protocol pointer */
  195|  8.60k|    data->info.httpcode = 0; /* clear it as it might have been used for the
  196|       |                                proxy */
  197|  8.60k|    break;
  198|  24.4k|  }
  199|  24.4k|}
cf-h1-proxy.c:h1_proxy_is_udp:
   97|  39.5k|{
   98|  39.5k|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
   99|  39.5k|  return (bool)(pctx->ts && pctx->ts->udp_tunnel);
  ------------------
  |  Branch (99:17): [True: 39.5k, False: 0]
  |  Branch (99:29): [True: 39.5k, False: 0]
  ------------------
  100|  39.5k|}
cf-h1-proxy.c:cf_h1_proxy_connect:
  800|  13.1k|{
  801|  13.1k|  CURLcode result;
  802|  13.1k|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
  803|  13.1k|  struct h1_tunnel_state *ts = pctx->ts;
  804|       |
  805|  13.1k|  if(cf->connected) {
  ------------------
  |  Branch (805:6): [True: 0, False: 13.1k]
  ------------------
  806|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  807|      0|    return CURLE_OK;
  808|      0|  }
  809|       |
  810|  13.1k|  CURL_TRC_CF(data, cf, "connect");
  ------------------
  |  |  153|  13.1k|  do {                                          \
  |  |  154|  13.1k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  13.1k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  26.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 13.1k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 2.71k, False: 10.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  26.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 2.71k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  2.71k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  13.1k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  2.71k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 2.71k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 1.13k, False: 1.57k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  13.1k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  13.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 13.1k]
  |  |  ------------------
  ------------------
  811|  13.1k|  result = cf->next->cft->do_connect(cf->next, data, done);
  812|  13.1k|  if(result || !*done)
  ------------------
  |  Branch (812:6): [True: 0, False: 13.1k]
  |  Branch (812:16): [True: 0, False: 13.1k]
  ------------------
  813|      0|    return result;
  814|       |
  815|  13.1k|  *done = FALSE;
  ------------------
  |  |  989|  13.1k|#define FALSE false
  ------------------
  816|  13.1k|  if(!ts) {
  ------------------
  |  Branch (816:6): [True: 0, False: 13.1k]
  ------------------
  817|      0|    result = tunnel_init(cf, data, &ts);
  818|      0|    if(result)
  ------------------
  |  Branch (818:8): [True: 0, False: 0]
  ------------------
  819|      0|      return result;
  820|      0|    pctx->ts = ts;
  821|      0|  }
  822|       |
  823|       |  /* We want "seamless" operations through HTTP proxy tunnel */
  824|       |
  825|  13.1k|  result = H1_CONNECT(cf, data, ts);
  826|  13.1k|  if(result)
  ------------------
  |  Branch (826:6): [True: 5.83k, False: 7.35k]
  ------------------
  827|  5.83k|    goto out;
  828|       |
  829|  13.1k|out:
  830|  13.1k|  *done = (result == CURLE_OK) && tunnel_is_established(pctx->ts);
  ------------------
  |  Branch (830:11): [True: 7.35k, False: 5.83k]
  |  Branch (830:35): [True: 1.38k, False: 5.97k]
  ------------------
  831|  13.1k|  if(*done) {
  ------------------
  |  Branch (831:6): [True: 1.38k, False: 11.8k]
  ------------------
  832|  1.38k|    cf->connected = TRUE;
  ------------------
  |  |  986|  1.38k|#define TRUE true
  ------------------
  833|       |    /* The real request will follow the CONNECT, reset request partially */
  834|  1.38k|    Curl_req_soft_reset(&data->req, data);
  835|  1.38k|    Curl_client_reset(data);
  836|  1.38k|    Curl_pgrsReset(data);
  837|  1.38k|    cf_tunnel_free(cf, data);
  838|  1.38k|  }
  839|  13.1k|  return result;
  840|  13.1k|}
cf-h1-proxy.c:H1_CONNECT:
  678|  13.1k|{
  679|  13.1k|  struct connectdata *conn = CF_CONN(cf);
  ------------------
  |  |  260|  13.1k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  680|  13.1k|  CURLcode result;
  681|  13.1k|  bool done;
  682|       |
  683|  13.1k|  if(tunnel_is_established(ts))
  ------------------
  |  Branch (683:6): [True: 0, False: 13.1k]
  ------------------
  684|      0|    return CURLE_OK;
  685|  13.1k|  if(tunnel_is_failed(ts))
  ------------------
  |  Branch (685:6): [True: 0, False: 13.1k]
  ------------------
  686|      0|    return CURLE_RECV_ERROR; /* Need a cfilter close and new bootstrap */
  687|       |
  688|  13.1k|  do {
  689|       |
  690|  13.1k|    if(Curl_timeleft_ms(data) < 0) {
  ------------------
  |  Branch (690:8): [True: 0, False: 13.1k]
  ------------------
  691|      0|      failf(data, "Proxy CONNECT aborted due to timeout");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  692|      0|      result = CURLE_OPERATION_TIMEDOUT;
  693|      0|      goto out;
  694|      0|    }
  695|       |
  696|  13.1k|    switch(ts->tunnel_state) {
  697|  7.21k|    case H1_TUNNEL_INIT:
  ------------------
  |  Branch (697:5): [True: 7.21k, False: 5.97k]
  ------------------
  698|       |      /* Prepare the CONNECT request and make a first attempt to send. */
  699|  7.21k|      CURL_TRC_CF(data, cf, "CONNECT start");
  ------------------
  |  |  153|  7.21k|  do {                                          \
  |  |  154|  7.21k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  7.21k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  14.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.21k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 717, False: 6.50k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 717, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    717|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.21k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    717|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 717, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 152, False: 565]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.21k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.21k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.21k]
  |  |  ------------------
  ------------------
  700|  7.21k|      result = start_CONNECT(cf, data, ts);
  701|  7.21k|      if(result)
  ------------------
  |  Branch (701:10): [True: 27, False: 7.19k]
  ------------------
  702|     27|        goto out;
  703|  7.19k|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_CONNECT, data);
  704|  7.19k|      FALLTHROUGH();
  ------------------
  |  |  752|  7.19k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  705|       |
  706|  9.77k|    case H1_TUNNEL_CONNECT:
  ------------------
  |  Branch (706:5): [True: 2.58k, False: 10.6k]
  ------------------
  707|       |      /* see that the request is completely sent */
  708|  9.77k|      CURL_TRC_CF(data, cf, "CONNECT send");
  ------------------
  |  |  153|  9.77k|  do {                                          \
  |  |  154|  9.77k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.77k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  19.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.77k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 1.85k, False: 7.91k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  19.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 1.85k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  1.85k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.77k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  1.85k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 1.85k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 729, False: 1.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.77k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.77k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.77k]
  |  |  ------------------
  ------------------
  709|  9.77k|      result = send_CONNECT(cf, data, ts, &done);
  710|  9.77k|      if(result || !done)
  ------------------
  |  Branch (710:10): [True: 0, False: 9.77k]
  |  Branch (710:20): [True: 2.58k, False: 7.18k]
  ------------------
  711|  2.58k|        goto out;
  712|  7.18k|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_RECEIVE, data);
  713|  7.18k|      FALLTHROUGH();
  ------------------
  |  |  752|  7.18k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  714|       |
  715|  10.5k|    case H1_TUNNEL_RECEIVE:
  ------------------
  |  Branch (715:5): [True: 3.39k, False: 9.79k]
  ------------------
  716|       |      /* read what is there */
  717|  10.5k|      CURL_TRC_CF(data, cf, "CONNECT receive");
  ------------------
  |  |  153|  10.5k|  do {                                          \
  |  |  154|  10.5k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  10.5k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  21.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 10.5k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 1.56k, False: 9.01k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  21.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 1.56k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  1.56k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  10.5k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  1.56k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 1.56k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 553, False: 1.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  10.5k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  10.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 10.5k]
  |  |  ------------------
  ------------------
  718|  10.5k|      result = recv_CONNECT_resp(cf, data, ts, &done);
  719|  10.5k|      if(result)
  ------------------
  |  Branch (719:10): [True: 5.75k, False: 4.82k]
  ------------------
  720|  5.75k|        CURL_TRC_CF(data, cf, "error receiving CONNECT response: %d",
  ------------------
  |  |  153|  5.75k|  do {                                          \
  |  |  154|  5.75k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  5.75k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  11.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 5.75k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 506, False: 5.24k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  11.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 506, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    506|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  5.75k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    506|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 506, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 80, False: 426]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  5.75k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  5.75k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 5.75k]
  |  |  ------------------
  ------------------
  721|  10.5k|                    (int)result);
  722|  10.5k|      if(!result)
  ------------------
  |  Branch (722:10): [True: 4.82k, False: 5.75k]
  ------------------
  723|  4.82k|        result = Curl_pgrsUpdate(data);
  724|       |      /* error or not complete yet. return for more multi-multi */
  725|  10.5k|      if(result || !done)
  ------------------
  |  Branch (725:10): [True: 5.75k, False: 4.82k]
  |  Branch (725:20): [True: 3.39k, False: 1.43k]
  ------------------
  726|  9.14k|        goto out;
  727|       |      /* got it */
  728|  1.43k|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_RESPONSE, data);
  729|  1.43k|      FALLTHROUGH();
  ------------------
  |  |  752|  1.43k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  730|       |
  731|  1.43k|    case H1_TUNNEL_RESPONSE:
  ------------------
  |  Branch (731:5): [True: 0, False: 13.1k]
  ------------------
  732|  1.43k|      CURL_TRC_CF(data, cf, "CONNECT response");
  ------------------
  |  |  153|  1.43k|  do {                                          \
  |  |  154|  1.43k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.43k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  2.87k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.43k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 207, False: 1.22k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.87k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 207, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    207|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.43k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    207|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 207, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 70, False: 137]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.43k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.43k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.43k]
  |  |  ------------------
  ------------------
  733|  1.43k|      if(data->req.newurl) {
  ------------------
  |  Branch (733:10): [True: 0, False: 1.43k]
  ------------------
  734|       |        /* not the "final" response, we need to do a follow up request.
  735|       |         * If the other side indicated a connection close, or if someone
  736|       |         * else told us to close this connection, do so now.
  737|       |         */
  738|      0|        Curl_req_soft_reset(&data->req, data);
  739|      0|        if(ts->close_connection || conn->bits.close) {
  ------------------
  |  Branch (739:12): [True: 0, False: 0]
  |  Branch (739:36): [True: 0, False: 0]
  ------------------
  740|       |          /* Close this filter and the sub-chain, re-connect the
  741|       |           * sub-chain and continue. Closing this filter will
  742|       |           * reset our tunnel state. To avoid recursion, we return
  743|       |           * and expect to be called again.
  744|       |           */
  745|      0|          CURL_TRC_CF(data, cf, "CONNECT need to close+open");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  746|      0|          infof(data, "Connect me again please");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  747|      0|          return CURLE_AGAIN;
  748|      0|        }
  749|      0|        else {
  750|       |          /* staying on this connection, reset state */
  751|      0|          h1_tunnel_go_state(cf, ts, H1_TUNNEL_INIT, data);
  752|      0|        }
  753|      0|      }
  754|  1.43k|      break;
  755|       |
  756|  1.43k|    default:
  ------------------
  |  Branch (756:5): [True: 0, False: 13.1k]
  ------------------
  757|      0|      break;
  758|  13.1k|    }
  759|       |
  760|  13.1k|  } while(data->req.newurl);
  ------------------
  |  Branch (760:11): [True: 0, False: 1.43k]
  ------------------
  761|       |
  762|  1.43k|  DEBUGASSERT(ts->tunnel_state == H1_TUNNEL_RESPONSE);
  ------------------
  |  | 1016|  1.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (762:3): [True: 0, False: 1.43k]
  |  Branch (762:3): [True: 1.43k, False: 0]
  ------------------
  763|  1.43k|  if(h1_proxy_is_udp(cf)) {
  ------------------
  |  Branch (763:6): [True: 1.43k, False: 0]
  ------------------
  764|       |    /* RFC 9298: Accept 101 Upgrade for HTTP/1.1 and
  765|       |     * 2xx responses for HTTP/2 and HTTP/3 proxies. */
  766|  1.43k|    if(data->info.httpproxycode / 100 != 2 &&
  ------------------
  |  Branch (766:8): [True: 1.28k, False: 149]
  ------------------
  767|  1.28k|       data->info.httpproxycode != 101) {
  ------------------
  |  Branch (767:8): [True: 52, False: 1.23k]
  ------------------
  768|     52|      curlx_safefree(data->req.newurl);
  ------------------
  |  | 1359|     52|  do {                      \
  |  | 1360|     52|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|     52|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|     52|    (ptr) = NULL;           \
  |  | 1362|     52|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 52]
  |  |  ------------------
  ------------------
  769|     52|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
  770|     52|      failf(data, "CONNECT-UDP tunnel failed, response %d",
  ------------------
  |  |   62|     52|#define failf Curl_failf
  ------------------
  771|     52|            data->req.httpcode);
  772|     52|      return CURLE_COULDNT_CONNECT;
  773|     52|    }
  774|  1.43k|  }
  775|      0|  else {
  776|      0|    if(data->info.httpproxycode / 100 != 2) {
  ------------------
  |  Branch (776:8): [True: 0, False: 0]
  ------------------
  777|       |      /* a non-2xx response and we have no next URL to try. */
  778|      0|      curlx_safefree(data->req.newurl);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  779|      0|      h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
  780|      0|      failf(data, "CONNECT tunnel failed, response %d", data->req.httpcode);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  781|      0|      return CURLE_COULDNT_CONNECT;
  782|      0|    }
  783|      0|  }
  784|       |  /* 2xx response, SUCCESS! */
  785|       |  /* 101 Switching Protocol for CONNECT-UDP */
  786|  1.38k|  h1_tunnel_go_state(cf, ts, H1_TUNNEL_ESTABLISHED, data);
  787|  1.38k|  infof(data, "CONNECT%s tunnel established, response %d",
  ------------------
  |  |  143|  1.38k|  do {                               \
  |  |  144|  1.38k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  1.38k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.38k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 200, False: 1.18k]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.38k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 200, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    200|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.38k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 200, False: 0]
  |  |  ------------------
  |  |  146|  1.38k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.38k]
  |  |  ------------------
  ------------------
  788|  1.38k|        h1_proxy_is_udp(cf) ? "-UDP" : "", data->info.httpproxycode);
  789|  1.38k|  result = CURLE_OK;
  790|       |
  791|  13.1k|out:
  792|  13.1k|  if(result)
  ------------------
  |  Branch (792:6): [True: 5.78k, False: 7.35k]
  ------------------
  793|  5.78k|    h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
  794|  13.1k|  return result;
  795|  1.38k|}
cf-h1-proxy.c:tunnel_is_failed:
   92|  13.1k|{
   93|  13.1k|  return ts && (ts->tunnel_state == H1_TUNNEL_FAILED);
  ------------------
  |  Branch (93:10): [True: 13.1k, False: 0]
  |  Branch (93:16): [True: 0, False: 13.1k]
  ------------------
   94|  13.1k|}
cf-h1-proxy.c:start_CONNECT:
  235|  7.21k|{
  236|  7.21k|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
  237|  7.21k|  struct httpreq *req = NULL;
  238|  7.21k|  int http_minor;
  239|  7.21k|  CURLcode result;
  240|       |
  241|  7.21k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  7.21k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (241:3): [True: 0, False: 7.21k]
  |  Branch (241:3): [True: 7.21k, False: 0]
  ------------------
  242|       |  /* This only happens if we have looped here due to authentication reasons,
  243|       |     and we do not really use the newly cloned URL here then. Free it. */
  244|  7.21k|  curlx_safefree(data->req.newurl);
  ------------------
  |  | 1359|  7.21k|  do {                      \
  |  | 1360|  7.21k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  7.21k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  7.21k|    (ptr) = NULL;           \
  |  | 1362|  7.21k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 7.21k]
  |  |  ------------------
  ------------------
  245|       |
  246|  7.21k|  result = Curl_http_proxy_create_tunnel_request(&req, cf, data,
  247|  7.21k|                                                 pctx->peer, ts->dest,
  248|  7.21k|                                                 PROXY_HTTP_V1,
  249|  7.21k|                                                 h1_proxy_is_udp(cf));
  250|  7.21k|  if(result)
  ------------------
  |  Branch (250:6): [True: 20, False: 7.19k]
  ------------------
  251|     20|    goto out;
  252|       |
  253|  7.19k|  curlx_dyn_reset(&ts->request_data);
  254|  7.19k|  ts->nsent = 0;
  255|  7.19k|  ts->headerlines = 0;
  256|  7.19k|  ts->using_proxy_auth =
  257|  7.19k|    !!Curl_dynhds_get(&req->headers, STRCONST("Proxy-Authorization"));
  ------------------
  |  | 1324|  7.19k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  7.19k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  258|  7.19k|  http_minor = ts->httpversion % 10;
  259|       |
  260|  7.19k|  result = Curl_h1_req_write_head(req, http_minor, &ts->request_data);
  261|  7.19k|  if(!result)
  ------------------
  |  Branch (261:6): [True: 7.19k, False: 6]
  ------------------
  262|  7.19k|    result = Curl_creader_set_null(data);
  263|       |
  264|  7.21k|out:
  265|  7.21k|  if(result)
  ------------------
  |  Branch (265:6): [True: 27, False: 7.19k]
  ------------------
  266|     27|    failf(data, "Failed sending CONNECT to proxy");
  ------------------
  |  |   62|     27|#define failf Curl_failf
  ------------------
  267|  7.21k|  if(req)
  ------------------
  |  Branch (267:6): [True: 7.19k, False: 20]
  ------------------
  268|  7.19k|    Curl_http_req_free(req);
  269|  7.21k|  return result;
  270|  7.19k|}
cf-h1-proxy.c:send_CONNECT:
  276|  9.77k|{
  277|  9.77k|  const uint8_t *buf = curlx_dyn_uptr(&ts->request_data);
  278|  9.77k|  size_t request_len = curlx_dyn_len(&ts->request_data);
  279|  9.77k|  size_t blen = request_len;
  280|  9.77k|  CURLcode result = CURLE_OK;
  281|  9.77k|  size_t nwritten;
  282|       |
  283|  9.77k|  if(blen <= ts->nsent)
  ------------------
  |  Branch (283:6): [True: 0, False: 9.77k]
  ------------------
  284|      0|    goto out;  /* we are done */
  285|       |
  286|  9.77k|  blen -= ts->nsent;
  287|  9.77k|  buf += ts->nsent;
  288|       |
  289|  9.77k|  result = cf->next->cft->do_send(cf->next, data, buf, blen, FALSE, &nwritten);
  ------------------
  |  |  989|  9.77k|#define FALSE false
  ------------------
  290|  9.77k|  if(result) {
  ------------------
  |  Branch (290:6): [True: 2.54k, False: 7.22k]
  ------------------
  291|  2.54k|    if(result == CURLE_AGAIN)
  ------------------
  |  Branch (291:8): [True: 2.54k, False: 0]
  ------------------
  292|  2.54k|      result = CURLE_OK;
  293|  2.54k|    goto out;
  294|  2.54k|  }
  295|       |
  296|  7.22k|  DEBUGASSERT(blen >= nwritten);
  ------------------
  |  | 1016|  7.22k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (296:3): [True: 0, False: 7.22k]
  |  Branch (296:3): [True: 7.22k, False: 0]
  ------------------
  297|  7.22k|  ts->nsent += nwritten;
  298|  7.22k|  Curl_debug(data, CURLINFO_HEADER_OUT, (const char *)buf, nwritten);
  299|       |
  300|  9.77k|out:
  301|  9.77k|  if(result)
  ------------------
  |  Branch (301:6): [True: 0, False: 9.77k]
  ------------------
  302|      0|    failf(data, "Failed sending CONNECT to proxy");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  303|  9.77k|  *done = (!result && (ts->nsent >= request_len));
  ------------------
  |  Branch (303:12): [True: 9.77k, False: 0]
  |  Branch (303:23): [True: 7.18k, False: 2.58k]
  ------------------
  304|  9.77k|  return result;
  305|  7.22k|}
cf-h1-proxy.c:recv_CONNECT_resp:
  519|  10.5k|{
  520|  10.5k|  CURLcode result = CURLE_OK;
  521|  10.5k|  int error;
  522|  10.5k|  size_t taken = 0;
  523|       |
  524|  10.5k|#define SELECT_OK      0
  525|  10.5k|#define SELECT_ERROR   1
  526|       |
  527|  10.5k|  error = SELECT_OK;
  ------------------
  |  |  524|  10.5k|#define SELECT_OK      0
  ------------------
  528|  10.5k|  *done = FALSE;
  ------------------
  |  |  989|  10.5k|#define FALSE false
  ------------------
  529|       |
  530|   858k|  while(ts->keepon) {
  ------------------
  |  Branch (530:9): [True: 857k, False: 1.49k]
  ------------------
  531|   857k|    size_t nread;
  532|   857k|    char byte;
  533|       |
  534|       |    /* Read one byte at a time to avoid a race condition. Wait at most one
  535|       |       second before looping to ensure continuous pgrsUpdates. */
  536|       |
  537|       |    /* Bound the read so other transfers on this multi can run, and ask the
  538|       |       multi to run us again right away instead of waiting for the socket. */
  539|   857k|    if(taken >= 16384) {
  ------------------
  |  Branch (539:8): [True: 2, False: 857k]
  ------------------
  540|      2|      Curl_multi_mark_dirty(data);
  541|      2|      return CURLE_OK;
  542|      2|    }
  543|       |
  544|   857k|    result = Curl_conn_cf_recv(cf->next, data, &byte, 1, &nread);
  545|   857k|    if(result == CURLE_AGAIN)
  ------------------
  |  Branch (545:8): [True: 3.39k, False: 853k]
  ------------------
  546|       |      /* socket buffer drained, return */
  547|  3.39k|      return CURLE_OK;
  548|       |
  549|   853k|    if(!result)
  ------------------
  |  Branch (549:8): [True: 853k, False: 0]
  ------------------
  550|   853k|      result = Curl_pgrsUpdate(data);
  551|       |
  552|   853k|    if(result) {
  ------------------
  |  Branch (552:8): [True: 0, False: 853k]
  ------------------
  553|      0|      ts->keepon = KEEPON_DONE;
  554|      0|      break;
  555|      0|    }
  556|       |
  557|   853k|    if(!nread) {
  ------------------
  |  Branch (557:8): [True: 5.52k, False: 848k]
  ------------------
  558|  5.52k|      if(ts->maybe_folded) {
  ------------------
  |  Branch (558:10): [True: 243, False: 5.28k]
  ------------------
  559|       |        /* EOF right after LF: finalize the pending header line. */
  560|    243|        result = single_header(cf, data, ts);
  561|    243|        if(result)
  ------------------
  |  Branch (561:12): [True: 75, False: 168]
  ------------------
  562|     75|          return result;
  563|    168|        ts->maybe_folded = FALSE;
  ------------------
  |  |  989|    168|#define FALSE false
  ------------------
  564|    168|      }
  565|  5.44k|      if(data->set.proxyauth && data->state.authproxy.avail &&
  ------------------
  |  Branch (565:10): [True: 5.42k, False: 19]
  |  Branch (565:33): [True: 0, False: 5.42k]
  ------------------
  566|      0|         ts->using_proxy_auth) {
  ------------------
  |  Branch (566:10): [True: 0, False: 0]
  ------------------
  567|       |        /* proxy auth was requested and there was proxy auth available,
  568|       |           then deem this as "mere" proxy disconnect */
  569|      0|        ts->close_connection = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  570|      0|        infof(data, "Proxy CONNECT connection closed");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  571|      0|      }
  572|  5.44k|      else {
  573|  5.44k|        error = SELECT_ERROR;
  ------------------
  |  |  525|  5.44k|#define SELECT_ERROR   1
  ------------------
  574|  5.44k|        failf(data, "Proxy CONNECT aborted");
  ------------------
  |  |   62|  5.44k|#define failf Curl_failf
  ------------------
  575|  5.44k|      }
  576|  5.44k|      ts->keepon = KEEPON_DONE;
  577|  5.44k|      break;
  578|  5.52k|    }
  579|       |
  580|   848k|    taken += nread;
  581|       |
  582|   848k|    if(ts->keepon == KEEPON_IGNORE) {
  ------------------
  |  Branch (582:8): [True: 0, False: 848k]
  ------------------
  583|       |      /* This means we are currently ignoring a response-body */
  584|      0|      if(ts->chunked_encoding) {
  ------------------
  |  Branch (584:10): [True: 0, False: 0]
  ------------------
  585|       |        /* chunked-encoded body, so we need to do the chunked dance
  586|       |           properly to know when the end of the body is reached */
  587|      0|        size_t consumed = 0;
  588|       |
  589|       |        /* now parse the chunked piece of data so that we can
  590|       |           properly tell when the stream ends */
  591|      0|        result = Curl_httpchunk_read(data, &ts->ch, &byte, 1, &consumed);
  592|      0|        if(result)
  ------------------
  |  Branch (592:12): [True: 0, False: 0]
  ------------------
  593|      0|          return result;
  594|      0|        if(Curl_httpchunk_is_done(data, &ts->ch)) {
  ------------------
  |  Branch (594:12): [True: 0, False: 0]
  ------------------
  595|       |          /* we are done reading chunks! */
  596|      0|          infof(data, "chunk reading DONE");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  597|      0|          ts->keepon = KEEPON_DONE;
  598|      0|        }
  599|      0|      }
  600|      0|      else if(ts->cl) {
  ------------------
  |  Branch (600:15): [True: 0, False: 0]
  ------------------
  601|       |        /* A Content-Length based body: count down the counter
  602|       |           and make sure to break out of the loop when we are done! */
  603|      0|        ts->cl--;
  604|      0|        if(ts->cl <= 0) {
  ------------------
  |  Branch (604:12): [True: 0, False: 0]
  ------------------
  605|      0|          ts->keepon = KEEPON_DONE;
  606|      0|          break;
  607|      0|        }
  608|      0|      }
  609|      0|      continue;
  610|      0|    }
  611|       |
  612|   848k|    if(ts->maybe_folded) {
  ------------------
  |  Branch (612:8): [True: 32.3k, False: 815k]
  ------------------
  613|  32.3k|      if(ISBLANK(byte)) {
  ------------------
  |  |   43|  32.3k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 288, False: 32.0k]
  |  |  |  Branch (43:38): [True: 1.21k, False: 30.8k]
  |  |  ------------------
  ------------------
  614|  1.50k|        Curl_http_to_fold(&ts->rcvbuf);
  615|  1.50k|        ts->leading_unfold = TRUE;
  ------------------
  |  |  986|  1.50k|#define TRUE true
  ------------------
  616|  1.50k|      }
  617|  30.8k|      else {
  618|  30.8k|        result = single_header(cf, data, ts);
  619|  30.8k|        if(result)
  ------------------
  |  Branch (619:12): [True: 132, False: 30.7k]
  ------------------
  620|    132|          return result;
  621|       |        /* now handle the new byte */
  622|  30.8k|      }
  623|  32.2k|      ts->maybe_folded = FALSE;
  ------------------
  |  |  989|  32.2k|#define FALSE false
  ------------------
  624|  32.2k|    }
  625|       |
  626|   848k|    if(ts->leading_unfold) {
  ------------------
  |  Branch (626:8): [True: 3.85k, False: 844k]
  ------------------
  627|  3.85k|      if(ISBLANK(byte))
  ------------------
  |  |   43|  3.85k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 534, False: 3.32k]
  |  |  |  Branch (43:38): [True: 1.87k, False: 1.44k]
  |  |  ------------------
  ------------------
  628|       |        /* skip a bit brother */
  629|  2.40k|        continue;
  630|       |      /* non-blank, insert a space then continue the unfolding */
  631|  1.44k|      if(curlx_dyn_addn(&ts->rcvbuf, " ", 1)) {
  ------------------
  |  Branch (631:10): [True: 0, False: 1.44k]
  ------------------
  632|      0|        failf(data, "CONNECT response too large");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  633|      0|        return CURLE_RECV_ERROR;
  634|      0|      }
  635|  1.44k|      ts->leading_unfold = FALSE;
  ------------------
  |  |  989|  1.44k|#define FALSE false
  ------------------
  636|  1.44k|    }
  637|   845k|    if(curlx_dyn_addn(&ts->rcvbuf, &byte, 1)) {
  ------------------
  |  Branch (637:8): [True: 3, False: 845k]
  ------------------
  638|      3|      failf(data, "CONNECT response too large");
  ------------------
  |  |   62|      3|#define failf Curl_failf
  ------------------
  639|      3|      return CURLE_RECV_ERROR;
  640|      3|    }
  641|       |
  642|       |    /* if this is not the end of a header line then continue */
  643|   845k|    if(byte != 0x0a)
  ------------------
  |  Branch (643:8): [True: 811k, False: 34.1k]
  ------------------
  644|   811k|      continue;
  645|  34.1k|    else {
  646|  34.1k|      const char *linep = curlx_dyn_ptr(&ts->rcvbuf);
  647|  34.1k|      size_t hlen = curlx_dyn_len(&ts->rcvbuf);
  648|  34.1k|      if(hlen && ISNEWLINE(linep[0])) {
  ------------------
  |  |   48|  34.1k|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (48:26): [True: 722, False: 33.4k]
  |  |  |  Branch (48:43): [True: 809, False: 32.6k]
  |  |  ------------------
  ------------------
  |  Branch (648:10): [True: 34.1k, False: 0]
  ------------------
  649|       |        /* end of headers */
  650|  1.53k|        result = single_header(cf, data, ts);
  651|  1.53k|        if(result)
  ------------------
  |  Branch (651:12): [True: 36, False: 1.49k]
  ------------------
  652|     36|          return result;
  653|  1.53k|      }
  654|  32.6k|      else
  655|  32.6k|        ts->maybe_folded = TRUE;
  ------------------
  |  |  986|  32.6k|#define TRUE true
  ------------------
  656|  34.1k|    }
  657|       |
  658|  34.1k|    if(result)
  ------------------
  |  Branch (658:8): [True: 0, False: 34.1k]
  ------------------
  659|      0|      return result;
  660|  34.1k|  } /* while there is buffer left and loop is requested */
  661|       |
  662|  6.94k|  if(error)
  ------------------
  |  Branch (662:6): [True: 5.44k, False: 1.49k]
  ------------------
  663|  5.44k|    result = CURLE_RECV_ERROR;
  664|  6.94k|  *done = (ts->keepon == KEEPON_DONE);
  665|  6.94k|  if(!result && *done &&
  ------------------
  |  Branch (665:6): [True: 1.49k, False: 5.44k]
  |  Branch (665:17): [True: 1.49k, False: 0]
  ------------------
  666|  1.49k|     data->info.httpproxycode / 100 != 2 &&
  ------------------
  |  Branch (666:6): [True: 1.34k, False: 149]
  ------------------
  667|  1.34k|     !(h1_proxy_is_udp(cf) && data->info.httpproxycode == 101)) {
  ------------------
  |  Branch (667:8): [True: 1.34k, False: 0]
  |  Branch (667:31): [True: 1.23k, False: 111]
  ------------------
  668|       |    /* Deal with the possibly already received authenticate
  669|       |       headers. 'newurl' is set to a new URL if we must loop. */
  670|    111|    result = Curl_http_auth_act(data);
  671|    111|  }
  672|  6.94k|  return result;
  673|  10.5k|}
cf-h1-proxy.c:single_header:
  425|  32.6k|{
  426|  32.6k|  CURLcode result = CURLE_OK;
  427|  32.6k|  const char *linep = curlx_dyn_ptr(&ts->rcvbuf);
  428|  32.6k|  size_t line_len = curlx_dyn_len(&ts->rcvbuf); /* bytes in this line */
  429|  32.6k|  const struct SingleRequest *k = &data->req;
  430|  32.6k|  int writetype;
  431|  32.6k|  ts->headerlines++;
  432|       |
  433|       |  /* output debug if that is requested */
  434|  32.6k|  Curl_debug(data, CURLINFO_HEADER_IN, linep, line_len);
  435|       |
  436|       |  /* a CONNECT response line is handed to the client as a header, so it must
  437|       |     pass the same checks as a regular response header before delivery */
  438|  32.6k|  result = Curl_verify_header(data, linep, line_len);
  439|  32.6k|  if(result)
  ------------------
  |  Branch (439:6): [True: 22, False: 32.6k]
  ------------------
  440|     22|    return result;
  441|       |
  442|       |  /* send the header to the callback */
  443|  32.6k|  writetype = CLIENTWRITE_HEADER | CLIENTWRITE_CONNECT |
  ------------------
  |  |   45|  32.6k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
                writetype = CLIENTWRITE_HEADER | CLIENTWRITE_CONNECT |
  ------------------
  |  |   47|  32.6k|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  444|  32.6k|    (ts->headerlines == 1 ? CLIENTWRITE_STATUS : 0);
  ------------------
  |  |   46|  2.04k|#define CLIENTWRITE_STATUS  (1 << 3) /* a special status HEADER */
  ------------------
  |  Branch (444:6): [True: 2.04k, False: 30.5k]
  ------------------
  445|  32.6k|  result = Curl_client_write(data, writetype, linep, line_len);
  446|  32.6k|  if(result)
  ------------------
  |  Branch (446:6): [True: 54, False: 32.5k]
  ------------------
  447|     54|    return result;
  448|       |
  449|  32.5k|  result = Curl_bump_headersize(data, line_len, TRUE);
  ------------------
  |  |  986|  32.5k|#define TRUE true
  ------------------
  450|  32.5k|  if(result)
  ------------------
  |  Branch (450:6): [True: 0, False: 32.5k]
  ------------------
  451|      0|    return result;
  452|       |
  453|       |  /* Newlines are CRLF, so the CR is ignored as the line is not
  454|       |     really terminated until the LF comes. Treat a following CR
  455|       |     as end-of-headers as well.*/
  456|       |
  457|  32.5k|  if(ISNEWLINE(linep[0])) {
  ------------------
  |  |   48|  32.5k|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (48:26): [True: 722, False: 31.8k]
  |  |  |  Branch (48:43): [True: 806, False: 31.0k]
  |  |  ------------------
  ------------------
  458|       |    /* end of response-headers from the proxy */
  459|  1.52k|    if(ts->has_transfer_encoding) {
  ------------------
  |  Branch (459:8): [True: 0, False: 1.52k]
  ------------------
  460|      0|      if(ts->chunked_encoding) {
  ------------------
  |  Branch (460:10): [True: 0, False: 0]
  ------------------
  461|      0|        CURL_TRC_CF(data, cf, "CONNECT response chunked");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  462|      0|        Curl_httpchunk_reset(data, &ts->ch, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  463|      0|      }
  464|      0|      else {
  465|       |        /* The final transfer coding is not chunked, so the response body
  466|       |           ends at connection close. Do not reuse it for an auth retry. */
  467|      0|        CURL_TRC_CF(data, cf, "CONNECT response close-delimited");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  468|      0|        ts->close_connection = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  469|      0|      }
  470|      0|    }
  471|  1.52k|    if(ts->headerlines == 1) {
  ------------------
  |  Branch (471:8): [True: 33, False: 1.49k]
  ------------------
  472|     33|      ts->keepon = KEEPON_DONE;
  473|     33|      result = CURLE_WEIRD_SERVER_REPLY;
  474|     33|    }
  475|  1.49k|    else if((407 == k->httpcode) && !data->state.authproblem) {
  ------------------
  |  Branch (475:13): [True: 28, False: 1.46k]
  |  Branch (475:37): [True: 28, False: 0]
  ------------------
  476|       |      /* If we get a 407 response code with content length
  477|       |         when we have no auth problem, we must ignore the
  478|       |         whole response-body */
  479|     28|      ts->keepon = KEEPON_IGNORE;
  480|       |
  481|     28|      if(ts->cl) {
  ------------------
  |  Branch (481:10): [True: 0, False: 28]
  ------------------
  482|      0|        infof(data, "Ignore %" FMT_OFF_T " bytes of response-body", ts->cl);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  483|      0|      }
  484|     28|      else if(ts->chunked_encoding) {
  ------------------
  |  Branch (484:15): [True: 0, False: 28]
  ------------------
  485|      0|        infof(data, "Ignore chunked response-body");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  486|      0|      }
  487|     28|      else {
  488|       |        /* without content-length or chunked encoding, we
  489|       |           cannot keep the connection alive since the close is
  490|       |           the end signal so we bail out at once instead */
  491|     28|        CURL_TRC_CF(data, cf, "CONNECT: no content-length or chunked");
  ------------------
  |  |  153|     28|  do {                                          \
  |  |  154|     28|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|     28|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     56|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 28, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 4, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     56|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      4|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     28|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      4|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 4, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 1, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     28|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     28|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 28]
  |  |  ------------------
  ------------------
  492|     28|        ts->keepon = KEEPON_DONE;
  493|     28|      }
  494|     28|    }
  495|  1.46k|    else {
  496|  1.46k|      ts->keepon = KEEPON_DONE;
  497|  1.46k|    }
  498|       |
  499|  1.52k|    DEBUGASSERT(ts->keepon == KEEPON_IGNORE ||
  ------------------
  |  | 1016|  1.52k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (499:5): [True: 1.52k, False: 0]
  |  Branch (499:5): [True: 0, False: 0]
  |  Branch (499:5): [True: 0, False: 1.52k]
  |  Branch (499:5): [True: 1.52k, False: 0]
  ------------------
  500|  1.52k|                ts->keepon == KEEPON_DONE);
  501|  1.52k|    return result;
  502|  1.52k|  }
  503|       |
  504|  31.0k|  if(ts->headerlines == 1)
  ------------------
  |  Branch (504:6): [True: 2.00k, False: 29.0k]
  ------------------
  505|  2.00k|    result = on_resp_status(cf, data, ts, linep);
  506|  29.0k|  else
  507|  29.0k|    result = on_resp_header(cf, data, ts, linep);
  508|  31.0k|  if(result)
  ------------------
  |  Branch (508:6): [True: 134, False: 30.9k]
  ------------------
  509|    134|    return result;
  510|       |
  511|  30.9k|  curlx_dyn_reset(&ts->rcvbuf);
  512|  30.9k|  return result;
  513|  31.0k|}
cf-h1-proxy.c:on_resp_status:
  311|  2.00k|{
  312|  2.00k|  struct SingleRequest *k = &data->req;
  313|       |
  314|  2.00k|  (void)ts;
  315|  2.00k|  if(!strncmp(header, "HTTP/1.", 7) &&
  ------------------
  |  Branch (315:6): [True: 1.89k, False: 104]
  ------------------
  316|  1.89k|          ((header[7] == '0') || (header[7] == '1')) &&
  ------------------
  |  Branch (316:12): [True: 468, False: 1.43k]
  |  Branch (316:34): [True: 1.42k, False: 8]
  ------------------
  317|  1.89k|          (header[8] == ' ') &&
  ------------------
  |  Branch (317:11): [True: 1.88k, False: 6]
  ------------------
  318|  1.88k|          ISDIGIT(header[9]) && ISDIGIT(header[10]) && ISDIGIT(header[11]) &&
  ------------------
  |  |   42|  3.88k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 1.87k, False: 7]
  |  |  |  Branch (42:38): [True: 1.87k, False: 4]
  |  |  ------------------
  ------------------
                        ISDIGIT(header[9]) && ISDIGIT(header[10]) && ISDIGIT(header[11]) &&
  ------------------
  |  |   42|  3.87k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 1.87k, False: 1]
  |  |  |  Branch (42:38): [True: 1.87k, False: 1]
  |  |  ------------------
  ------------------
                        ISDIGIT(header[9]) && ISDIGIT(header[10]) && ISDIGIT(header[11]) &&
  ------------------
  |  |   42|  3.87k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 1.87k, False: 1]
  |  |  |  Branch (42:38): [True: 1.86k, False: 1]
  |  |  ------------------
  ------------------
  319|  1.86k|          !ISDIGIT(header[12])) {
  ------------------
  |  |   42|  1.86k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 111, False: 1.75k]
  |  |  |  Branch (42:38): [True: 1, False: 110]
  |  |  ------------------
  ------------------
  320|       |    /* store the HTTP code from the proxy */
  321|  1.86k|    data->info.httpproxycode = k->httpcode = ((header[9] - '0') * 100) +
  322|  1.86k|      ((header[10] - '0') * 10) + (header[11] - '0');
  323|  1.86k|    CURL_TRC_CF(data, cf, "CONNECT%s HTTP status %d",
  ------------------
  |  |  153|  1.86k|  do {                                          \
  |  |  154|  1.86k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.86k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.73k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.86k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 281, False: 1.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.73k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 281, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    281|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.86k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    281|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 281, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 100, False: 181]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.86k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 100, False: 0]
  |  |  ------------------
  |  |  156|  1.86k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.86k]
  |  |  ------------------
  ------------------
  324|  1.86k|                h1_proxy_is_udp(cf) ? "-UDP" : "", k->httpcode);
  325|  1.86k|    return CURLE_OK;
  326|  1.86k|  }
  327|    134|  failf(data, "Invalid response header");
  ------------------
  |  |   62|    134|#define failf Curl_failf
  ------------------
  328|    134|  return CURLE_WEIRD_SERVER_REPLY;
  329|  2.00k|}
cf-h1-proxy.c:on_resp_header:
  335|  29.0k|{
  336|  29.0k|  CURLcode result = CURLE_OK;
  337|  29.0k|  struct SingleRequest *k = &data->req;
  338|  29.0k|  bool is_udp = h1_proxy_is_udp(cf);
  339|       |
  340|  29.0k|  if(checkprefix("Proxy-authenticate:", header) && (407 == k->httpcode)) {
  ------------------
  |  |   49|  58.0k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1324|  29.0k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1319|  29.0k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (49:27): [True: 0, False: 29.0k]
  |  |  ------------------
  ------------------
  |  Branch (340:52): [True: 0, False: 0]
  ------------------
  341|       |
  342|      0|    bool proxy = (k->httpcode == 407);
  343|      0|    char *auth = Curl_copy_header_value(header);
  344|      0|    if(!auth)
  ------------------
  |  Branch (344:8): [True: 0, False: 0]
  ------------------
  345|      0|      return CURLE_OUT_OF_MEMORY;
  346|       |
  347|      0|    CURL_TRC_CF(data, cf, "CONNECT%s: fwd auth header '%s'",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  348|      0|                is_udp ? "-UDP" : "", header);
  349|      0|    result = Curl_http_input_auth(data, proxy, auth);
  350|       |
  351|      0|    curlx_free(auth);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  352|       |
  353|      0|    if(result)
  ------------------
  |  Branch (353:8): [True: 0, False: 0]
  ------------------
  354|      0|      return result;
  355|      0|  }
  356|  29.0k|  else if(checkprefix("Content-Length:", header)) {
  ------------------
  |  |   49|  29.0k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1324|  29.0k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1319|  29.0k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (49:27): [True: 0, False: 29.0k]
  |  |  ------------------
  ------------------
  357|      0|    if(k->httpcode < 300) {
  ------------------
  |  Branch (357:8): [True: 0, False: 0]
  ------------------
  358|      0|      if(k->httpcode < 200) {
  ------------------
  |  Branch (358:10): [True: 0, False: 0]
  ------------------
  359|       |        /* Informational 1xx responses cannot carry a body. RFC 9110 15.2 */
  360|      0|        failf(data, "Invalid Content-Length: in %03d response", k->httpcode);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  361|      0|        return CURLE_WEIRD_SERVER_REPLY;
  362|      0|      }
  363|       |      /* A client MUST ignore any Content-Length or Transfer-Encoding
  364|       |         header fields received in a successful response to CONNECT.
  365|       |         "Successful" described as: 2xx (Successful). RFC 7231 4.3.6 */
  366|      0|      infof(data, "Ignoring Content-Length in CONNECT%s %03d response",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  367|      0|            is_udp ? "-UDP" : "", k->httpcode);
  368|      0|    }
  369|      0|    else if(!ts->has_transfer_encoding) {
  ------------------
  |  Branch (369:13): [True: 0, False: 0]
  ------------------
  370|      0|      const char *p = header + CURL_CSTRLEN("Content-Length:");
  ------------------
  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
  371|      0|      if(curlx_str_numblanks(&p, &ts->cl)) {
  ------------------
  |  Branch (371:10): [True: 0, False: 0]
  ------------------
  372|      0|        failf(data, "Unsupported Content-Length value");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  373|      0|        return CURLE_WEIRD_SERVER_REPLY;
  374|      0|      }
  375|      0|    }
  376|      0|  }
  377|  29.0k|  else if(Curl_compareheader(header,
  ------------------
  |  Branch (377:11): [True: 0, False: 29.0k]
  ------------------
  378|  29.0k|                             STRCONST("Connection:"), STRCONST("close"))) {
  ------------------
  |  | 1324|  29.0k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  29.0k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
                                           STRCONST("Connection:"), STRCONST("close"))) {
  ------------------
  |  | 1324|  29.0k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  29.0k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  379|      0|    CURL_TRC_CF(data, cf, "CONNECT%s Connection: close", is_udp ? "-UDP" : "");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  380|      0|    ts->close_connection = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  381|      0|  }
  382|  29.0k|  else if(checkprefix("Transfer-Encoding:", header)) {
  ------------------
  |  |   49|  29.0k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1324|  29.0k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1319|  29.0k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (49:27): [True: 0, False: 29.0k]
  |  |  ------------------
  ------------------
  383|      0|    if(k->httpcode < 300) {
  ------------------
  |  Branch (383:8): [True: 0, False: 0]
  ------------------
  384|      0|      if(k->httpcode < 200) {
  ------------------
  |  Branch (384:10): [True: 0, False: 0]
  ------------------
  385|       |        /* Informational 1xx responses cannot carry a body. RFC 9110 15.2 */
  386|      0|        failf(data, "Invalid Transfer-Encoding: in %03d response",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  387|      0|              k->httpcode);
  388|      0|        return CURLE_WEIRD_SERVER_REPLY;
  389|      0|      }
  390|       |      /* A client MUST ignore any Content-Length or Transfer-Encoding
  391|       |         header fields received in a successful response to CONNECT.
  392|       |         "Successful" described as: 2xx (Successful). RFC 7231 4.3.6 */
  393|      0|      infof(data, "Ignoring Transfer-Encoding in "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  394|      0|            "CONNECT%s %03d response", is_udp ? "-UDP" : "", k->httpcode);
  395|      0|    }
  396|      0|    else {
  397|       |      /* Do not use Content-Length to frame a Transfer-Encoding response. */
  398|      0|      ts->has_transfer_encoding = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  399|      0|      ts->cl = 0;
  400|      0|      ts->chunked_encoding = Curl_compareheader(header,
  401|      0|                                                STRCONST("Transfer-Encoding:"),
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  402|      0|                                                STRCONST("chunked"));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  403|      0|    }
  404|      0|  }
  405|  29.0k|  else if(is_udp && checkprefix("Capsule-protocol:", header)) {
  ------------------
  |  |   49|  29.0k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1324|  29.0k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1319|  29.0k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (49:27): [True: 2.19k, False: 26.8k]
  |  |  ------------------
  ------------------
  |  Branch (405:11): [True: 29.0k, False: 0]
  ------------------
  406|  2.19k|    if(Curl_compareheader(header,
  ------------------
  |  Branch (406:8): [True: 1.79k, False: 400]
  ------------------
  407|  2.19k|                           STRCONST("Capsule-protocol:"),
  ------------------
  |  | 1324|  2.19k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  2.19k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  408|  2.19k|                           STRCONST("?1"))) {
  ------------------
  |  | 1324|  2.19k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  2.19k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  409|  1.79k|      CURL_TRC_CF(data, cf, "CONNECT-UDP Response --> Capsule-protocol: ?1");
  ------------------
  |  |  153|  1.79k|  do {                                          \
  |  |  154|  1.79k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.79k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.58k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.79k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 492, False: 1.30k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.58k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 492, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    492|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.79k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    492|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 492, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 280, False: 212]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.79k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.79k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.79k]
  |  |  ------------------
  ------------------
  410|  1.79k|    }
  411|  2.19k|  }
  412|  26.8k|  else if(Curl_compareheader(header,
  ------------------
  |  Branch (412:11): [True: 0, False: 26.8k]
  ------------------
  413|  26.8k|                             STRCONST("Proxy-Connection:"),
  ------------------
  |  | 1324|  26.8k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  26.8k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  414|  26.8k|                             STRCONST("close"))) {
  ------------------
  |  | 1324|  26.8k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  26.8k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  415|      0|    CURL_TRC_CF(data, cf, "CONNECT%s Proxy-Connection: close",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  416|      0|                is_udp ? "-UDP" : "");
  417|      0|    ts->close_connection = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  418|      0|  }
  419|  29.0k|  return result;
  420|  29.0k|}
cf-h1-proxy.c:tunnel_is_established:
   87|  20.5k|{
   88|  20.5k|  return ts && (ts->tunnel_state == H1_TUNNEL_ESTABLISHED);
  ------------------
  |  Branch (88:10): [True: 20.5k, False: 0]
  |  Branch (88:16): [True: 1.38k, False: 19.1k]
  ------------------
   89|  20.5k|}
cf-h1-proxy.c:cf_h1_proxy_adjust_pollset:
  845|  55.2k|{
  846|  55.2k|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
  847|  55.2k|  struct h1_tunnel_state *ts = pctx->ts;
  848|  55.2k|  CURLcode result = CURLE_OK;
  849|       |
  850|  55.2k|  if(!cf->connected) {
  ------------------
  |  Branch (850:6): [True: 186, False: 55.0k]
  ------------------
  851|       |    /* If we are not connected, but the filter "below" is
  852|       |     * and not waiting on something, we are tunneling. */
  853|    186|    curl_socket_t sock = cf->chain->sock;
  854|    186|    if(ts) {
  ------------------
  |  Branch (854:8): [True: 186, False: 0]
  ------------------
  855|       |      /* when we have sent a CONNECT to a proxy, we should rather either
  856|       |         wait for the socket to become readable to be able to get the
  857|       |         response headers or if we are still sending the request, wait
  858|       |         for write. */
  859|    186|      if(tunnel_want_send(ts))
  ------------------
  |  Branch (859:10): [True: 35, False: 151]
  ------------------
  860|     35|        result = Curl_pollset_set_out_only(data, ps, sock);
  ------------------
  |  |  164|     35|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  284|     35|#define CURL_POLL_OUT    2
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|     35|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
  861|    151|      else
  862|    151|        result = Curl_pollset_set_in_only(data, ps, sock);
  ------------------
  |  |  162|    151|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  283|    151|#define CURL_POLL_IN     1
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  284|    151|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
  863|    186|    }
  864|      0|    else
  865|      0|      result = Curl_pollset_set_out_only(data, ps, sock);
  ------------------
  |  |  164|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
  866|    186|  }
  867|  55.0k|  else {
  868|  55.0k|    if(cf->next)
  ------------------
  |  Branch (868:8): [True: 55.0k, False: 0]
  ------------------
  869|  55.0k|      result = cf->next->cft->adjust_pollset(cf->next, data, ps);
  870|  55.0k|  }
  871|  55.2k|  return result;
  872|  55.2k|}
cf-h1-proxy.c:tunnel_want_send:
  228|    186|{
  229|    186|  return ts->tunnel_state == H1_TUNNEL_CONNECT;
  230|    186|}
cf-h1-proxy.c:cf_h1_proxy_query:
  896|   123k|{
  897|   123k|  struct cf_h1_proxy_ctx *pctx = cf->ctx;
  898|   123k|  struct h1_tunnel_state *ts = pctx ? pctx->ts : NULL;
  ------------------
  |  Branch (898:32): [True: 123k, False: 0]
  ------------------
  899|   123k|  switch(query) {
  900|      0|  case CF_QUERY_HOST_PORT:
  ------------------
  |  |  177|      0|#define CF_QUERY_HOST_PORT         11  /* port       const char * */
  ------------------
  |  Branch (900:3): [True: 0, False: 123k]
  ------------------
  901|      0|    if(!ts || !ts->dest)
  ------------------
  |  Branch (901:8): [True: 0, False: 0]
  |  Branch (901:15): [True: 0, False: 0]
  ------------------
  902|      0|      break;
  903|      0|    *pres1 = (int)ts->dest->port;
  904|      0|    *((const char **)pres2) = ts->dest->hostname;
  905|      0|    return CURLE_OK;
  906|      0|  case CF_QUERY_ALPN_NEGOTIATED: {
  ------------------
  |  |  181|      0|#define CF_QUERY_ALPN_NEGOTIATED   15  /* -          const char * */
  ------------------
  |  Branch (906:3): [True: 0, False: 123k]
  ------------------
  907|      0|    const char **palpn = pres2;
  908|      0|    DEBUGASSERT(palpn);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (908:5): [True: 0, False: 0]
  |  Branch (908:5): [True: 0, False: 0]
  ------------------
  909|      0|    *palpn = NULL;
  910|      0|    return CURLE_OK;
  911|      0|  }
  912|   123k|  default:
  ------------------
  |  Branch (912:3): [True: 123k, False: 0]
  ------------------
  913|   123k|    break;
  914|   123k|  }
  915|   123k|  return cf->next ?
  ------------------
  |  Branch (915:10): [True: 123k, False: 0]
  ------------------
  916|   123k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  917|   123k|    CURLE_UNKNOWN_OPTION;
  918|   123k|}
cf-h1-proxy.c:tunnel_free:
  203|  14.4k|{
  204|  14.4k|  if(ts) {
  ------------------
  |  Branch (204:6): [True: 7.21k, False: 7.21k]
  ------------------
  205|  7.21k|    Curl_peer_unlink(&ts->dest);
  206|  7.21k|    curlx_dyn_free(&ts->rcvbuf);
  207|  7.21k|    curlx_dyn_free(&ts->request_data);
  208|  7.21k|    Curl_httpchunk_free(data, &ts->ch);
  209|  7.21k|    curlx_free(ts);
  ------------------
  |  | 1503|  7.21k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  210|  7.21k|  }
  211|  14.4k|}

Curl_cf_https_setup:
  807|  9.39k|{
  808|  9.39k|  struct connectdata *conn = chain->conn;
  809|  9.39k|  CURLcode result = CURLE_OK;
  810|       |
  811|  9.39k|  DEBUGASSERT(conn->scheme->protocol == CURLPROTO_HTTPS);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (811:3): [True: 0, False: 9.39k]
  |  Branch (811:3): [True: 9.39k, False: 0]
  ------------------
  812|       |
  813|       |  /* This filter is intended for HTTPS using ALPN and does
  814|       |   * not support HTTPS Eyeballing to a proxy. */
  815|  9.39k|  if((conn->scheme->protocol != CURLPROTO_HTTPS) ||
  ------------------
  |  | 1089|  9.39k|#define CURLPROTO_HTTPS   (1L << 1)
  ------------------
  |  Branch (815:6): [True: 0, False: 9.39k]
  ------------------
  816|  9.39k|#ifndef CURL_DISABLE_PROXY
  817|  9.39k|     conn->bits.origin_is_proxy ||
  ------------------
  |  Branch (817:6): [True: 0, False: 9.39k]
  ------------------
  818|  9.39k|#endif
  819|  9.39k|     !conn->bits.tls_enable_alpn)
  ------------------
  |  Branch (819:6): [True: 0, False: 9.39k]
  ------------------
  820|      0|    goto out;
  821|       |
  822|  9.39k|  result = cf_hc_add(data, destination, chain,
  823|  9.39k|                     conn->transport_wanted);
  824|       |
  825|  9.39k|out:
  826|  9.39k|  return result;
  827|  9.39k|}
cf-https-connect.c:cf_hc_destroy:
  729|  9.38k|{
  730|  9.38k|  struct cf_hc_ctx *ctx = cf->ctx;
  731|       |
  732|  9.38k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  9.38k|  do {                                          \
  |  |  154|  9.38k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.38k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.38k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 9.24k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.38k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 4, False: 143]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.38k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.38k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.38k]
  |  |  ------------------
  ------------------
  733|  9.38k|  cf_hc_ctx_destroy(data, ctx);
  734|  9.38k|}
cf-https-connect.c:cf_hc_ctx_destroy:
  127|  18.7k|{
  128|  18.7k|  if(ctx) {
  ------------------
  |  Branch (128:6): [True: 9.39k, False: 9.39k]
  ------------------
  129|  9.39k|    size_t i;
  130|  18.6k|    for(i = 0; i < ctx->baller_count; ++i)
  ------------------
  |  Branch (130:16): [True: 9.29k, False: 9.39k]
  ------------------
  131|  9.29k|      cf_hc_baller_discard(&ctx->ballers[i], data);
  132|  9.39k|    Curl_peer_unlink(&ctx->destination);
  133|  9.39k|    curlx_free(ctx);
  ------------------
  |  | 1503|  9.39k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  134|  9.39k|  }
  135|  18.7k|}
cf-https-connect.c:cf_hc_baller_discard:
   63|  9.29k|{
   64|  9.29k|  Curl_cfchain_cleanup(&b->chain, data);
   65|  9.29k|}
cf-https-connect.c:cf_hc_connect:
  487|   127k|{
  488|   127k|  struct cf_hc_ctx *ctx = cf->ctx;
  489|   127k|  CURLcode result = CURLE_OK;
  490|   127k|  const struct curltime *pnow = NULL;
  491|       |
  492|   127k|  if(cf->connected) {
  ------------------
  |  Branch (492:6): [True: 0, False: 127k]
  ------------------
  493|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  494|      0|    return CURLE_OK;
  495|      0|  }
  496|       |
  497|   127k|  *done = FALSE;
  ------------------
  |  |  989|   127k|#define FALSE false
  ------------------
  498|       |
  499|   127k|  if(!ctx->httpsrr_resolved) {
  ------------------
  |  Branch (499:6): [True: 9.29k, False: 118k]
  ------------------
  500|  9.29k|    ctx->httpsrr_resolved =
  501|  9.29k|      Curl_dns_cf_resolved_https(data, cf, ctx->destination);
  502|  9.29k|#ifdef DEBUGBUILD
  503|  9.29k|    if(!ctx->httpsrr_resolved && getenv("CURL_DBG_AWAIT_HTTPSRR")) {
  ------------------
  |  Branch (503:8): [True: 0, False: 9.29k]
  |  Branch (503:34): [True: 0, False: 0]
  ------------------
  504|      0|      CURL_TRC_CF(data, cf, "awaiting HTTPS-RR");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  505|      0|      return CURLE_OK;
  506|      0|    }
  507|  9.29k|#endif
  508|  9.29k|  }
  509|       |
  510|   127k|  switch(ctx->state) {
  ------------------
  |  Branch (510:10): [True: 127k, False: 0]
  ------------------
  511|  9.29k|  case CF_HC_RESOLV:
  ------------------
  |  Branch (511:3): [True: 9.29k, False: 118k]
  ------------------
  512|  9.29k|    ctx->state = CF_HC_INIT;
  513|  9.29k|    FALLTHROUGH();
  ------------------
  |  |  752|  9.29k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  514|       |
  515|  9.29k|  case CF_HC_INIT:
  ------------------
  |  Branch (515:3): [True: 0, False: 127k]
  ------------------
  516|  9.29k|    DEBUGASSERT(!cf->next);
  ------------------
  |  | 1016|  9.29k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (516:5): [True: 0, False: 9.29k]
  |  Branch (516:5): [True: 9.29k, False: 0]
  ------------------
  517|  9.29k|    CURL_TRC_CF(data, cf, "connect, init");
  ------------------
  |  |  153|  9.29k|  do {                                          \
  |  |  154|  9.29k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.29k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.29k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 893, False: 8.40k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 893, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    893|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.29k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    893|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 893, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 164, False: 729]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.29k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.29k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.29k]
  |  |  ------------------
  ------------------
  518|  9.29k|    result = cf_hc_set_baller1(cf, data);
  519|  9.29k|    if(result) {
  ------------------
  |  Branch (519:8): [True: 0, False: 9.29k]
  ------------------
  520|      0|      ctx->result = result;
  521|      0|      ctx->state = CF_HC_FAILURE;
  522|      0|      goto out;
  523|      0|    }
  524|  9.29k|    cf_hc_set_baller2(cf, data);
  525|  9.29k|    pnow = Curl_pgrs_now(data);
  526|  9.29k|    ctx->started = *pnow;
  527|  9.29k|    cf_hc_baller_init(&ctx->ballers[0], data);
  528|  9.29k|    if((ctx->baller_count > 1) || !ctx->ballers_complete) {
  ------------------
  |  Branch (528:8): [True: 0, False: 9.29k]
  |  Branch (528:35): [True: 0, False: 9.29k]
  ------------------
  529|      0|      Curl_expire_set(data, EXPIRE_ALPN_EYEBALLS,
  530|      0|                      ctx->soft_eyeballs_timeout_ms, pnow);
  531|      0|    }
  532|  9.29k|    ctx->state = CF_HC_CONNECT;
  533|  9.29k|    FALLTHROUGH();
  ------------------
  |  |  752|  9.29k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  534|       |
  535|   127k|  case CF_HC_CONNECT:
  ------------------
  |  Branch (535:3): [True: 118k, False: 9.29k]
  ------------------
  536|   127k|    if(!ctx->ballers_complete)
  ------------------
  |  Branch (536:8): [True: 0, False: 127k]
  ------------------
  537|      0|      cf_hc_set_baller2(cf, data);
  538|       |
  539|   127k|    if(cf_hc_baller_is_connecting(&ctx->ballers[0])) {
  ------------------
  |  Branch (539:8): [True: 127k, False: 6]
  ------------------
  540|   127k|      result = cf_hc_baller_connect(&ctx->ballers[0], data, cf, done);
  541|   127k|      if(!result && *done) {
  ------------------
  |  Branch (541:10): [True: 121k, False: 6.41k]
  |  Branch (541:21): [True: 1.95k, False: 119k]
  ------------------
  542|  1.95k|        result = baller_connected(cf, data, &ctx->ballers[0]);
  543|  1.95k|        goto out;
  544|  1.95k|      }
  545|   127k|    }
  546|       |
  547|   126k|    pnow = Curl_pgrs_now(data);
  548|   126k|    if(time_to_start_baller2(cf, data, pnow)) {
  ------------------
  |  Branch (548:8): [True: 0, False: 126k]
  ------------------
  549|      0|      cf_hc_baller_init(&ctx->ballers[1], data);
  550|      0|    }
  551|       |
  552|   126k|    if(cf_hc_baller_is_connecting(&ctx->ballers[1])) {
  ------------------
  |  Branch (552:8): [True: 0, False: 126k]
  ------------------
  553|      0|      result = cf_hc_baller_connect(&ctx->ballers[1], data, cf, done);
  554|      0|      if(!result && *done) {
  ------------------
  |  Branch (554:10): [True: 0, False: 0]
  |  Branch (554:21): [True: 0, False: 0]
  ------------------
  555|      0|        result = baller_connected(cf, data, &ctx->ballers[1]);
  556|      0|        goto out;
  557|      0|      }
  558|      0|    }
  559|       |
  560|   126k|    if(ctx->ballers[0].result &&
  ------------------
  |  Branch (560:8): [True: 6.41k, False: 119k]
  ------------------
  561|  6.41k|       (ctx->ballers[1].result ||
  ------------------
  |  Branch (561:9): [True: 0, False: 6.41k]
  ------------------
  562|  6.41k|        (ctx->ballers_complete && (ctx->baller_count < 2)))) {
  ------------------
  |  Branch (562:10): [True: 6.41k, False: 0]
  |  Branch (562:35): [True: 6.41k, False: 0]
  ------------------
  563|       |      /* all have failed. we give up */
  564|  6.41k|      CURL_TRC_CF(data, cf, "connect, all attempts failed");
  ------------------
  |  |  153|  6.41k|  do {                                          \
  |  |  154|  6.41k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  6.41k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  12.8k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 6.41k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 611, False: 5.80k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  12.8k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 611, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    611|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  6.41k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    611|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 611, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 107, False: 504]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  6.41k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  6.41k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 6.41k]
  |  |  ------------------
  ------------------
  565|  6.41k|      ctx->result = result = ctx->ballers[0].result;
  566|  6.41k|      ctx->state = CF_HC_FAILURE;
  567|  6.41k|      goto out;
  568|  6.41k|    }
  569|   119k|    result = CURLE_OK;
  570|   119k|    *done = FALSE;
  ------------------
  |  |  989|   119k|#define FALSE false
  ------------------
  571|   119k|    break;
  572|       |
  573|      0|  case CF_HC_FAILURE:
  ------------------
  |  Branch (573:3): [True: 0, False: 127k]
  ------------------
  574|      0|    result = ctx->result;
  575|      0|    cf->connected = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  576|      0|    *done = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  577|      0|    break;
  578|       |
  579|      0|  case CF_HC_SUCCESS:
  ------------------
  |  Branch (579:3): [True: 0, False: 127k]
  ------------------
  580|      0|    result = CURLE_OK;
  581|      0|    cf->connected = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  582|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  583|      0|    break;
  584|   127k|  }
  585|       |
  586|   127k|out:
  587|   127k|  CURL_TRC_CF(data, cf, "connect -> %d, done=%d", (int)result, *done);
  ------------------
  |  |  153|   127k|  do {                                          \
  |  |  154|   127k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|   127k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|   255k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 127k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 35.6k, False: 92.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   255k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 35.6k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  35.6k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|   127k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  35.6k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 35.6k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 17.9k, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   127k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|   127k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 127k]
  |  |  ------------------
  ------------------
  588|   127k|  return result;
  589|   127k|}
cf-https-connect.c:cf_hc_set_baller1:
  389|  9.29k|{
  390|  9.29k|  struct cf_hc_ctx *ctx = cf->ctx;
  391|  9.29k|  enum alpnid alpn1 = ALPN_none;
  392|  9.29k|  VERBOSE(const char *source = "HTTPS-RR");
  ------------------
  |  | 1637|  9.29k|#define VERBOSE(x) x
  ------------------
  393|       |
  394|  9.29k|  DEBUGASSERT(CF_CONN(cf)->bits.tls_enable_alpn);
  ------------------
  |  | 1016|  9.29k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (394:3): [True: 0, False: 9.29k]
  |  Branch (394:3): [True: 9.29k, False: 0]
  ------------------
  395|       |
  396|  9.29k|  alpn1 = cf_hc_get_httpsrr_alpn(cf, data, ALPN_none);
  397|  9.29k|  if(alpn1 == ALPN_none) {
  ------------------
  |  Branch (397:6): [True: 9.29k, False: 0]
  ------------------
  398|       |    /* preference is configured and allowed, can we use it? */
  399|  9.29k|    VERBOSE(source = "preferred version");
  ------------------
  |  | 1637|  9.29k|#define VERBOSE(x) x
  ------------------
  400|  9.29k|    alpn1 = cf_hc_get_pref_alpn(cf, data, ALPN_none);
  401|  9.29k|  }
  402|  9.29k|  if(alpn1 == ALPN_none) {
  ------------------
  |  Branch (402:6): [True: 9.29k, False: 0]
  ------------------
  403|  9.29k|    VERBOSE(source = "wanted versions");
  ------------------
  |  | 1637|  9.29k|#define VERBOSE(x) x
  ------------------
  404|  9.29k|    alpn1 = cf_hc_get_first_alpn(cf, data,
  405|  9.29k|                                 data->state.http_neg.wanted,
  406|  9.29k|                                 ALPN_none);
  407|  9.29k|  }
  408|  9.29k|  if(alpn1 == ALPN_none) {
  ------------------
  |  Branch (408:6): [True: 0, False: 9.29k]
  ------------------
  409|      0|    VERBOSE(source = "allowed versions");
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  ------------------
  410|      0|    alpn1 = cf_hc_get_first_alpn(cf, data,
  411|      0|                                 data->state.http_neg.allowed,
  412|      0|                                 ALPN_none);
  413|      0|  }
  414|       |
  415|  9.29k|  if(alpn1 == ALPN_none) {
  ------------------
  |  Branch (415:6): [True: 0, False: 9.29k]
  ------------------
  416|       |    /* None of the wanted/allowed HTTP versions could be chosen */
  417|      0|    if(ctx->check_h3_result) {
  ------------------
  |  Branch (417:8): [True: 0, False: 0]
  ------------------
  418|      0|      CURL_TRC_CF(data, cf, "unable to use HTTP/3");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  419|      0|      return ctx->check_h3_result;
  420|      0|    }
  421|      0|    CURL_TRC_CF(data, cf, "unable to select HTTP version");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  422|      0|    return CURLE_FAILED_INIT;
  423|      0|  }
  424|       |
  425|  9.29k|  cf_hc_baller_assign(&ctx->ballers[0], cf, alpn1, ctx->def_transport);
  426|  9.29k|  ctx->baller_count = 1;
  427|  9.29k|  CURL_TRC_CF(data, cf, "1st attempt uses %s from %s",
  ------------------
  |  |  153|  9.29k|  do {                                          \
  |  |  154|  9.29k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.29k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.29k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 893, False: 8.40k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 893, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    893|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.29k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    893|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 893, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 164, False: 729]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.29k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.29k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.29k]
  |  |  ------------------
  ------------------
  428|  9.29k|              ctx->ballers[0].name, source);
  429|       |
  430|  9.29k|  switch(alpn1) {
  431|      0|  case ALPN_h1:
  ------------------
  |  Branch (431:3): [True: 0, False: 9.29k]
  ------------------
  432|       |    /* We really want h1, switch off h2 to make it disappear in ALPN */
  433|      0|    data->state.http_neg.wanted &= (uint8_t)~CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  434|      0|    break;
  435|  9.29k|  default:
  ------------------
  |  Branch (435:3): [True: 9.29k, False: 0]
  ------------------
  436|  9.29k|    break;
  437|  9.29k|  }
  438|       |
  439|  9.29k|  return CURLE_OK;
  440|  9.29k|}
cf-https-connect.c:cf_hc_get_httpsrr_alpn:
  290|  9.29k|{
  291|  9.29k|#ifdef USE_HTTPSRR
  292|  9.29k|  struct cf_hc_ctx *ctx = cf->ctx;
  293|       |  /* Is there an HTTPSRR use its ALPNs here.
  294|       |   * We are here after having selected a connection to a host+port and
  295|       |   * can no longer change that. Any HTTPSRR advice for other hosts and ports
  296|       |   * we need to ignore. */
  297|  9.29k|  const struct Curl_https_rrinfo *rr;
  298|  9.29k|  size_t i;
  299|       |
  300|       |  /* Do we have HTTPS-RR information? */
  301|  9.29k|  rr = Curl_dns_cf_get_https(data, cf, ctx->destination);
  302|       |
  303|  9.29k|  CURL_TRC_CF(data, cf, "HTTPS-RR %savailable", rr ? "" : "not ");
  ------------------
  |  |  153|  9.29k|  do {                                          \
  |  |  154|  9.29k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.29k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.29k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 893, False: 8.40k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 893, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    893|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.29k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    893|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 893, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 164, False: 729]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.29k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 164]
  |  |  ------------------
  |  |  156|  9.29k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.29k]
  |  |  ------------------
  ------------------
  304|       |  /* We do not support `rr->no_def_alpn`. */
  305|  9.29k|  if(Curl_httpsrr_applicable(data, rr) && !rr->no_def_alpn) {
  ------------------
  |  Branch (305:6): [True: 0, False: 9.29k]
  |  Branch (305:43): [True: 0, False: 0]
  ------------------
  306|      0|    for(i = 0; i < CURL_ARRAYSIZE(rr->alpns); ++i) {
  ------------------
  |  | 1326|      0|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (306:16): [True: 0, False: 0]
  ------------------
  307|      0|      enum alpnid alpn_rr = (enum alpnid)rr->alpns[i];
  308|      0|      if(alpn_rr == not_this_one) /* do not want this one */
  ------------------
  |  Branch (308:10): [True: 0, False: 0]
  ------------------
  309|      0|        continue;
  310|      0|      switch(alpn_rr) {
  311|      0|      case ALPN_h3:
  ------------------
  |  Branch (311:7): [True: 0, False: 0]
  ------------------
  312|      0|        if((data->state.http_neg.allowed & CURL_HTTP_V3x) &&
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (312:12): [True: 0, False: 0]
  ------------------
  313|      0|           cf_hc_may_h3(cf, data)) {
  ------------------
  |  Branch (313:12): [True: 0, False: 0]
  ------------------
  314|      0|          return alpn_rr;
  315|      0|        }
  316|      0|        break;
  317|      0|      case ALPN_h2:
  ------------------
  |  Branch (317:7): [True: 0, False: 0]
  ------------------
  318|      0|        if(data->state.http_neg.allowed & CURL_HTTP_V2x) {
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (318:12): [True: 0, False: 0]
  ------------------
  319|      0|          return alpn_rr;
  320|      0|        }
  321|      0|        break;
  322|      0|      case ALPN_h1:
  ------------------
  |  Branch (322:7): [True: 0, False: 0]
  ------------------
  323|      0|        if(data->state.http_neg.allowed & CURL_HTTP_V1x) {
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (323:12): [True: 0, False: 0]
  ------------------
  324|      0|          return alpn_rr;
  325|      0|        }
  326|      0|        break;
  327|      0|      default: /* ignore */
  ------------------
  |  Branch (327:7): [True: 0, False: 0]
  ------------------
  328|      0|        break;
  329|      0|      }
  330|      0|    }
  331|      0|  }
  332|       |#else
  333|       |  (void)cf;
  334|       |  (void)data;
  335|       |  (void)not_this_one;
  336|       |#endif
  337|  9.29k|  return ALPN_none;
  338|  9.29k|}
cf-https-connect.c:cf_hc_may_h3:
  256|  9.29k|{
  257|  9.29k|  struct cf_hc_ctx *ctx = cf->ctx;
  258|  9.29k|  if(!ctx->checked_h3) {
  ------------------
  |  Branch (258:6): [True: 9.29k, False: 0]
  ------------------
  259|  9.29k|    ctx->check_h3_result =
  260|  9.29k|      Curl_conn_may_http3(data, CF_CONN(cf));
  ------------------
  |  |  260|  9.29k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  261|       |    ctx->checked_h3 = TRUE;
  ------------------
  |  |  986|  9.29k|#define TRUE true
  ------------------
  262|  9.29k|  }
  263|  9.29k|  return !ctx->check_h3_result;
  264|  9.29k|}
cf-https-connect.c:cf_hc_get_pref_alpn:
  343|  9.29k|{
  344|  9.29k|  if((data->state.http_neg.preferred & data->state.http_neg.allowed)) {
  ------------------
  |  Branch (344:6): [True: 0, False: 9.29k]
  ------------------
  345|      0|    switch(data->state.http_neg.preferred) {
  346|      0|    case CURL_HTTP_V3x:
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (346:5): [True: 0, False: 0]
  ------------------
  347|      0|      if(cf_hc_may_h3(cf, data) && (ALPN_h3 != not_this_one))
  ------------------
  |  Branch (347:10): [True: 0, False: 0]
  |  Branch (347:36): [True: 0, False: 0]
  ------------------
  348|      0|        return ALPN_h3;
  349|      0|      break;
  350|      0|    case CURL_HTTP_V2x:
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (350:5): [True: 0, False: 0]
  ------------------
  351|      0|      if(ALPN_h2 != not_this_one)
  ------------------
  |  Branch (351:10): [True: 0, False: 0]
  ------------------
  352|      0|        return ALPN_h2;
  353|      0|      break;
  354|      0|    case CURL_HTTP_V1x:
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (354:5): [True: 0, False: 0]
  ------------------
  355|       |      /* If we are trying h2 already, h1 is already used as fallback */
  356|      0|      if((ALPN_h1 != not_this_one) && (ALPN_h2 != not_this_one))
  ------------------
  |  Branch (356:10): [True: 0, False: 0]
  |  Branch (356:39): [True: 0, False: 0]
  ------------------
  357|      0|        return ALPN_h1;
  358|      0|      break;
  359|      0|    default:
  ------------------
  |  Branch (359:5): [True: 0, False: 0]
  ------------------
  360|      0|      break;
  361|      0|    }
  362|      0|  }
  363|  9.29k|  return ALPN_none;
  364|  9.29k|}
cf-https-connect.c:cf_hc_get_first_alpn:
  370|  9.29k|{
  371|       |  /* When told to not try h2, we also do not try h1 and vice versa */
  372|  9.29k|  bool allow_h1_or_h2 = (not_this_one != ALPN_h1) &&
  ------------------
  |  Branch (372:25): [True: 9.29k, False: 0]
  ------------------
  373|  9.29k|                        (not_this_one != ALPN_h2);
  ------------------
  |  Branch (373:25): [True: 9.29k, False: 0]
  ------------------
  374|  9.29k|  if((ALPN_h3 != not_this_one) && (choices & CURL_HTTP_V3x) &&
  ------------------
  |  |   42|  9.29k|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (374:6): [True: 9.29k, False: 0]
  |  Branch (374:35): [True: 9.29k, False: 0]
  ------------------
  375|  9.29k|     cf_hc_may_h3(cf, data)) {
  ------------------
  |  Branch (375:6): [True: 9.29k, False: 0]
  ------------------
  376|  9.29k|    return ALPN_h3;
  377|  9.29k|  }
  378|      0|  if(allow_h1_or_h2 && (choices & CURL_HTTP_V2x)) {
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (378:6): [True: 0, False: 0]
  |  Branch (378:24): [True: 0, False: 0]
  ------------------
  379|      0|    return ALPN_h2;
  380|      0|  }
  381|      0|  if(allow_h1_or_h2 && (choices & CURL_HTTP_V1x)) {
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (381:6): [True: 0, False: 0]
  |  Branch (381:24): [True: 0, False: 0]
  ------------------
  382|      0|    return ALPN_h1;
  383|      0|  }
  384|      0|  return ALPN_none;
  385|      0|}
cf-https-connect.c:cf_hc_baller_assign:
  141|  9.29k|{
  142|  9.29k|  b->alpn_id = alpn_id;
  143|  9.29k|  b->transport = def_transport;
  144|  9.29k|  b->result = CURLE_OK;
  145|  9.29k|  b->reply_ms = -1;
  146|  9.29k|  b->shutdown = FALSE;
  ------------------
  |  |  989|  9.29k|#define FALSE false
  ------------------
  147|  9.29k|  Curl_cfchain_init_child(&b->chain, cf->chain);
  148|  9.29k|  switch(b->alpn_id) {
  149|  9.29k|  case ALPN_h3:
  ------------------
  |  Branch (149:3): [True: 9.29k, False: 0]
  ------------------
  150|  9.29k|    b->name = "h3";
  151|  9.29k|    b->transport = TRNSPRT_QUIC;
  ------------------
  |  |  227|  9.29k|#define TRNSPRT_QUIC 5
  ------------------
  152|  9.29k|    break;
  153|      0|  case ALPN_h2:
  ------------------
  |  Branch (153:3): [True: 0, False: 9.29k]
  ------------------
  154|      0|    b->name = "h2";
  155|      0|    break;
  156|      0|  case ALPN_h1:
  ------------------
  |  Branch (156:3): [True: 0, False: 9.29k]
  ------------------
  157|      0|    b->name = "h1";
  158|      0|    break;
  159|      0|  case ALPN_none:
  ------------------
  |  Branch (159:3): [True: 0, False: 9.29k]
  ------------------
  160|      0|    b->name = "no-alpn";
  161|      0|    break;
  162|      0|  default:
  ------------------
  |  Branch (162:3): [True: 0, False: 9.29k]
  ------------------
  163|      0|    b->result = CURLE_FAILED_INIT;
  164|      0|    break;
  165|  9.29k|  }
  166|  9.29k|}
cf-https-connect.c:cf_hc_set_baller2:
  444|  9.29k|{
  445|  9.29k|  struct cf_hc_ctx *ctx = cf->ctx;
  446|  9.29k|  enum alpnid alpn2 = ALPN_none, alpn1 = ctx->ballers[0].alpn_id;
  447|  9.29k|  VERBOSE(const char *source = "HTTPS-RR");
  ------------------
  |  | 1637|  9.29k|#define VERBOSE(x) x
  ------------------
  448|       |
  449|  9.29k|  if(ctx->ballers_complete)
  ------------------
  |  Branch (449:6): [True: 0, False: 9.29k]
  ------------------
  450|      0|    return; /* already done */
  451|       |  /* HTTPS-RR can select h1 and h2 as separate attempts. Only finish
  452|       |   * selection early when no other allowed ALPN can be used. */
  453|  9.29k|  if(!cf_hc_may_choose_alpn(cf, data, ALPN_h1, alpn1) &&
  ------------------
  |  Branch (453:6): [True: 9.29k, False: 0]
  ------------------
  454|  9.29k|     !cf_hc_may_choose_alpn(cf, data, ALPN_h2, alpn1) &&
  ------------------
  |  Branch (454:6): [True: 9.29k, False: 0]
  ------------------
  455|  9.29k|     !cf_hc_may_choose_alpn(cf, data, ALPN_h3, alpn1)) {
  ------------------
  |  Branch (455:6): [True: 9.29k, False: 0]
  ------------------
  456|  9.29k|    ctx->ballers_complete = TRUE;
  ------------------
  |  |  986|  9.29k|#define TRUE true
  ------------------
  457|  9.29k|    return;
  458|  9.29k|  }
  459|      0|  if(!ctx->httpsrr_resolved)
  ------------------
  |  Branch (459:6): [True: 0, False: 0]
  ------------------
  460|      0|    return; /* HTTPS-RR pending */
  461|       |
  462|      0|  alpn2 = cf_hc_get_httpsrr_alpn(cf, data, alpn1);
  463|      0|  if(alpn2 == ALPN_none) {
  ------------------
  |  Branch (463:6): [True: 0, False: 0]
  ------------------
  464|       |    /* preference is configured and allowed, can we use it? */
  465|      0|    VERBOSE(source = "preferred version");
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  ------------------
  466|      0|    alpn2 = cf_hc_get_pref_alpn(cf, data, alpn1);
  467|      0|  }
  468|      0|  if(alpn2 == ALPN_none) {
  ------------------
  |  Branch (468:6): [True: 0, False: 0]
  ------------------
  469|      0|    VERBOSE(source = "wanted versions");
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  ------------------
  470|      0|    alpn2 = cf_hc_get_first_alpn(cf, data,
  471|      0|                                 data->state.http_neg.wanted,
  472|      0|                                 alpn1);
  473|      0|  }
  474|       |
  475|      0|  if(alpn2 != ALPN_none) {
  ------------------
  |  Branch (475:6): [True: 0, False: 0]
  ------------------
  476|      0|    cf_hc_baller_assign(&ctx->ballers[1], cf, alpn2, ctx->def_transport);
  477|      0|    ctx->baller_count = 2;
  478|      0|    CURL_TRC_CF(data, cf, "2nd attempt uses %s from %s",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  479|      0|                ctx->ballers[1].name, source);
  480|      0|  }
  481|       |  ctx->ballers_complete = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  482|      0|}
cf-https-connect.c:cf_hc_may_choose_alpn:
  270|  27.8k|{
  271|  27.8k|  http_majors allowed = data->state.http_neg.allowed;
  272|       |
  273|  27.8k|  if(maybe == already_using)
  ------------------
  |  Branch (273:6): [True: 9.29k, False: 18.5k]
  ------------------
  274|  9.29k|    return FALSE;
  ------------------
  |  |  989|  9.29k|#define FALSE false
  ------------------
  275|  18.5k|  switch(maybe) {
  276|  9.29k|  case ALPN_h1:
  ------------------
  |  Branch (276:3): [True: 9.29k, False: 9.29k]
  ------------------
  277|  9.29k|    return (allowed & CURL_HTTP_V1x) != 0;
  ------------------
  |  |   40|  9.29k|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  278|  9.29k|  case ALPN_h2:
  ------------------
  |  Branch (278:3): [True: 9.29k, False: 9.29k]
  ------------------
  279|  9.29k|    return (allowed & CURL_HTTP_V2x) != 0;
  ------------------
  |  |   41|  9.29k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  280|      0|  case ALPN_h3:
  ------------------
  |  Branch (280:3): [True: 0, False: 18.5k]
  ------------------
  281|      0|    return (allowed & CURL_HTTP_V3x) && cf_hc_may_h3(cf, data);
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (281:12): [True: 0, False: 0]
  |  Branch (281:41): [True: 0, False: 0]
  ------------------
  282|      0|  default:
  ------------------
  |  Branch (282:3): [True: 0, False: 18.5k]
  ------------------
  283|       |    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  284|  18.5k|  }
  285|  18.5k|}
cf-https-connect.c:cf_hc_baller_init:
  170|  9.29k|{
  171|  9.29k|  DEBUGASSERT(b->chain.conn);
  ------------------
  |  | 1016|  9.29k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (171:3): [True: 0, False: 9.29k]
  |  Branch (171:3): [True: 9.29k, False: 0]
  ------------------
  172|  9.29k|  b->result = Curl_cf_setup_add(&b->chain, data, b->transport,
  173|  9.29k|                                CURL_CF_SSL_ENABLE);
  ------------------
  |  |  378|  9.29k|#define CURL_CF_SSL_ENABLE   1
  ------------------
  174|  9.29k|}
cf-https-connect.c:cf_hc_baller_is_connecting:
   68|   313k|{
   69|   313k|  return b->chain.cf && !b->result;
  ------------------
  |  Branch (69:10): [True: 187k, False: 126k]
  |  Branch (69:25): [True: 187k, False: 0]
  ------------------
   70|   313k|}
cf-https-connect.c:cf_hc_baller_connect:
  180|   127k|{
  181|   127k|  (void)cf;
  182|   127k|  VERBOSE(Curl_cfchain_trc(data, cf, &b->chain, b->name));
  ------------------
  |  | 1637|   127k|#define VERBOSE(x) x
  ------------------
  183|   127k|  b->result = Curl_conn_cf_connect(b->chain.cf, data, done);
  184|   127k|  return b->result;
  185|   127k|}
cf-https-connect.c:baller_connected:
  190|  1.95k|{
  191|  1.95k|  struct cf_hc_ctx *ctx = cf->ctx;
  192|       |
  193|       |  /* Make the winner's connection filter out own sub-filter, check, move,
  194|       |   * close all remaining. */
  195|  1.95k|  if(cf->next) {
  ------------------
  |  Branch (195:6): [True: 0, False: 1.95k]
  ------------------
  196|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (196:5): [Folded, False: 0]
  |  Branch (196:5): [Folded, False: 0]
  ------------------
  197|      0|    return CURLE_FAILED_INIT;
  198|      0|  }
  199|  1.95k|  if(!winner->chain.cf) {
  ------------------
  |  Branch (199:6): [True: 0, False: 1.95k]
  ------------------
  200|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (200:5): [Folded, False: 0]
  |  Branch (200:5): [Folded, False: 0]
  ------------------
  201|      0|    return CURLE_FAILED_INIT;
  202|      0|  }
  203|       |
  204|  1.95k|  Curl_cfchain_merge(cf->chain, &winner->chain);
  205|  1.95k|  ctx->state = CF_HC_SUCCESS;
  206|  1.95k|  cf->connected = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
  207|  1.95k|  VERBOSE(Curl_cfchain_trc(data, cf, cf->chain, "merged winner"));
  ------------------
  |  | 1637|  1.95k|#define VERBOSE(x) x
  ------------------
  208|       |
  209|       |  /* ballers may have failf()'d, the winner resets it, so our
  210|       |   * errorbuf is clean again. */
  211|  1.95k|  Curl_reset_fail(data);
  212|  1.95k|  return CURLE_OK;
  213|  1.95k|}
cf-https-connect.c:time_to_start_baller2:
  218|   126k|{
  219|   126k|  struct cf_hc_ctx *ctx = cf->ctx;
  220|   126k|  timediff_t elapsed_ms;
  221|       |
  222|   126k|  if(ctx->baller_count < 2)
  ------------------
  |  Branch (222:6): [True: 126k, False: 0]
  ------------------
  223|   126k|    return FALSE;
  ------------------
  |  |  989|   126k|#define FALSE false
  ------------------
  224|      0|  else if(cf_hc_baller_has_started(&ctx->ballers[1]))
  ------------------
  |  Branch (224:11): [True: 0, False: 0]
  ------------------
  225|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  226|      0|  else if(ctx->ballers[0].result) {
  ------------------
  |  Branch (226:11): [True: 0, False: 0]
  ------------------
  227|      0|    CURL_TRC_CF(data, cf, "%s baller failed, starting %s",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  228|      0|                ctx->ballers[0].name, ctx->ballers[1].name);
  229|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  230|      0|  }
  231|       |
  232|      0|  elapsed_ms = curlx_ptimediff_ms(pnow, &ctx->started);
  233|      0|  if(elapsed_ms >= ctx->hard_eyeballs_timeout_ms) {
  ------------------
  |  Branch (233:6): [True: 0, False: 0]
  ------------------
  234|      0|    CURL_TRC_CF(data, cf, "%s inconclusive after %" FMT_TIMEDIFF_T ", "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  235|      0|                "starting %s", ctx->ballers[0].name,
  236|      0|                ctx->hard_eyeballs_timeout_ms, ctx->ballers[1].name);
  237|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  238|      0|  }
  239|      0|  else if(elapsed_ms >= ctx->soft_eyeballs_timeout_ms) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|    if(cf_hc_baller_reply_ms(&ctx->ballers[0], data) < 0) {
  ------------------
  |  Branch (240:8): [True: 0, False: 0]
  ------------------
  241|      0|      CURL_TRC_CF(data, cf, "%s has not seen any data after %"
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  242|      0|                  FMT_TIMEDIFF_T "ms, starting %s",
  243|      0|                  ctx->ballers[0].name, ctx->soft_eyeballs_timeout_ms,
  244|      0|                  ctx->ballers[1].name);
  245|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  246|      0|    }
  247|       |    /* set the effective hard timeout again */
  248|      0|    Curl_expire_set(data, EXPIRE_ALPN_EYEBALLS,
  249|      0|                    ctx->hard_eyeballs_timeout_ms - elapsed_ms, pnow);
  250|      0|  }
  251|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  252|      0|}
cf-https-connect.c:cf_hc_adjust_pollset:
  634|  59.3k|{
  635|  59.3k|  CURLcode result = CURLE_OK;
  636|  59.3k|  if(!cf->connected) {
  ------------------
  |  Branch (636:6): [True: 59.3k, False: 0]
  ------------------
  637|  59.3k|    struct cf_hc_ctx *ctx = cf->ctx;
  638|  59.3k|    size_t i;
  639|       |
  640|   118k|    for(i = 0; (i < ctx->baller_count) && !result; i++) {
  ------------------
  |  Branch (640:16): [True: 59.1k, False: 59.3k]
  |  Branch (640:43): [True: 59.1k, False: 0]
  ------------------
  641|  59.1k|      struct cf_hc_baller *b = &ctx->ballers[i];
  642|  59.1k|      if(!cf_hc_baller_is_connecting(b))
  ------------------
  |  Branch (642:10): [True: 0, False: 59.1k]
  ------------------
  643|      0|        continue;
  644|  59.1k|      result = Curl_conn_cf_adjust_pollset(b->chain.cf, data, ps);
  645|  59.1k|    }
  646|  59.3k|    CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %u socks", (int)result,
  ------------------
  |  |  153|  59.3k|  do {                                          \
  |  |  154|  59.3k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  59.3k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|   118k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 59.3k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 15.6k, False: 43.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   118k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 15.6k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  15.6k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  59.3k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  15.6k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 15.6k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 7.55k, False: 8.11k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  59.3k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  59.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 59.3k]
  |  |  ------------------
  ------------------
  647|  59.3k|                ps->n);
  648|  59.3k|  }
  649|  59.3k|  return result;
  650|  59.3k|}
cf-https-connect.c:cf_hc_cntrl:
  696|  30.1k|{
  697|  30.1k|  struct cf_hc_ctx *ctx = cf->ctx;
  698|  30.1k|  CURLcode result = CURLE_OK;
  699|  30.1k|  size_t i;
  700|       |
  701|  30.1k|  if(!cf->connected) {
  ------------------
  |  Branch (701:6): [True: 26.2k, False: 3.91k]
  ------------------
  702|  26.2k|    switch(event) {
  703|  6.52k|    case CF_CTRL_REPORT_STATS:
  ------------------
  |  |  124|  6.52k|#define CF_CTRL_REPORT_STATS     (256 + 3) /* 0          NULL     ignored */
  ------------------
  |  Branch (703:5): [True: 6.52k, False: 19.6k]
  ------------------
  704|  13.0k|    case CF_CTRL_CONN_INFO_UPDATE:
  ------------------
  |  |  121|  13.0k|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  |  Branch (704:5): [True: 6.52k, False: 19.6k]
  ------------------
  705|  13.2k|      for(i = 0; i < ctx->baller_count; i++) {
  ------------------
  |  Branch (705:18): [True: 12.9k, False: 322]
  ------------------
  706|       |        /* Make the first baller that connected at network level report */
  707|  12.9k|        if(Curl_conn_cf_is_ip_connected(ctx->ballers[i].chain.cf, data)) {
  ------------------
  |  Branch (707:12): [True: 12.7k, False: 194]
  ------------------
  708|  12.7k|          Curl_conn_cf_cntrl(ctx->ballers[i].chain.cf, data, TRUE,
  ------------------
  |  |  986|  12.7k|#define TRUE true
  ------------------
  709|  12.7k|                             event, arg1, arg2);
  710|  12.7k|          break;
  711|  12.7k|        }
  712|  12.9k|      }
  713|  13.0k|      break;
  714|  13.1k|    default:
  ------------------
  |  Branch (714:5): [True: 13.1k, False: 13.0k]
  ------------------
  715|  26.2k|      for(i = 0; i < ctx->baller_count; i++) {
  ------------------
  |  Branch (715:18): [True: 13.0k, False: 13.1k]
  ------------------
  716|  13.0k|        result = cf_hc_baller_cntrl(&ctx->ballers[i], data, event, arg1, arg2);
  717|  13.0k|        if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (717:12): [True: 5.72k, False: 7.36k]
  |  Branch (717:22): [True: 0, False: 5.72k]
  ------------------
  718|      0|          goto out;
  719|  13.0k|      }
  720|  13.1k|      result = CURLE_OK;
  721|  13.1k|      break;
  722|  26.2k|    }
  723|  26.2k|  }
  724|  30.1k|out:
  725|  30.1k|  return result;
  726|  30.1k|}
cf-https-connect.c:cf_hc_baller_cntrl:
  103|  13.0k|{
  104|  13.0k|  if(b->chain.cf && !b->result)
  ------------------
  |  Branch (104:6): [True: 13.0k, False: 6]
  |  Branch (104:21): [True: 6.67k, False: 6.41k]
  ------------------
  105|  6.67k|    return Curl_conn_cf_cntrl(b->chain.cf, data, FALSE, event, arg1, arg2);
  ------------------
  |  |  989|  6.67k|#define FALSE false
  ------------------
  106|  6.41k|  return CURLE_OK;
  107|  13.0k|}
cf-https-connect.c:cf_hc_query:
  670|   128k|{
  671|   128k|  struct cf_hc_ctx *ctx = cf->ctx;
  672|   128k|  size_t i;
  673|       |
  674|   128k|  if(!cf->connected) {
  ------------------
  |  Branch (674:6): [True: 128k, False: 147]
  ------------------
  675|   128k|    switch(query) {
  676|   128k|    case CF_QUERY_NEED_FLUSH: {
  ------------------
  |  |  171|   128k|#define CF_QUERY_NEED_FLUSH         7  /* TRUE/FALSE - */
  ------------------
  |  Branch (676:5): [True: 128k, False: 0]
  ------------------
  677|   241k|      for(i = 0; i < ctx->baller_count; i++)
  ------------------
  |  Branch (677:18): [True: 118k, False: 122k]
  ------------------
  678|   118k|        if(cf_hc_baller_needs_flush(&ctx->ballers[i], data)) {
  ------------------
  |  Branch (678:12): [True: 5.75k, False: 112k]
  ------------------
  679|  5.75k|          *pres1 = TRUE;
  ------------------
  |  |  986|  5.75k|#define TRUE true
  ------------------
  680|  5.75k|          return CURLE_OK;
  681|  5.75k|        }
  682|   122k|      break;
  683|   128k|    }
  684|   122k|    default:
  ------------------
  |  Branch (684:5): [True: 0, False: 128k]
  ------------------
  685|      0|      break;
  686|   128k|    }
  687|   128k|  }
  688|   122k|  return cf->next ?
  ------------------
  |  Branch (688:10): [True: 147, False: 122k]
  ------------------
  689|    147|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  690|   122k|    CURLE_UNKNOWN_OPTION;
  691|   128k|}
cf-https-connect.c:cf_hc_baller_needs_flush:
   95|   118k|{
   96|   118k|  return b->chain.cf && !b->result &&
  ------------------
  |  Branch (96:10): [True: 118k, False: 0]
  |  Branch (96:25): [True: 118k, False: 0]
  ------------------
   97|   118k|         Curl_cfchain_needs_flush(data, &b->chain);
  ------------------
  |  Branch (97:10): [True: 5.75k, False: 112k]
  ------------------
   98|   118k|}
cf-https-connect.c:cf_hc_add:
  787|  9.39k|{
  788|  9.39k|  struct Curl_cfilter *cf;
  789|  9.39k|  CURLcode result = CURLE_OK;
  790|       |
  791|  9.39k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (791:3): [True: 0, False: 9.39k]
  |  Branch (791:3): [True: 9.39k, False: 0]
  ------------------
  792|  9.39k|  result = cf_hc_create(&cf, data, destination, def_transport);
  793|  9.39k|  if(result)
  ------------------
  |  Branch (793:6): [True: 8, False: 9.38k]
  ------------------
  794|      8|    goto out;
  795|  9.38k|  Curl_cfchain_add(chain, cf);
  796|       |
  797|  9.38k|#ifdef USE_HTTPSRR
  798|  9.38k|  result = Curl_dns_cf_add_https_resolve(data, cf, destination);
  799|  9.38k|#endif
  800|  9.39k|out:
  801|  9.39k|  return result;
  802|  9.38k|}
cf-https-connect.c:cf_hc_create:
  757|  9.39k|{
  758|  9.39k|  struct Curl_cfilter *cf = NULL;
  759|  9.39k|  struct cf_hc_ctx *ctx;
  760|  9.39k|  CURLcode result = CURLE_OK;
  761|       |
  762|  9.39k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|  9.39k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  763|  9.39k|  if(!ctx) {
  ------------------
  |  Branch (763:6): [True: 6, False: 9.39k]
  ------------------
  764|      6|    result = CURLE_OUT_OF_MEMORY;
  765|      6|    goto out;
  766|      6|  }
  767|  9.39k|  Curl_peer_link(&ctx->destination, destination);
  768|  9.39k|  ctx->def_transport = def_transport;
  769|  9.39k|  ctx->hard_eyeballs_timeout_ms = data->set.happy_eyeballs_timeout;
  770|  9.39k|  ctx->soft_eyeballs_timeout_ms = data->set.happy_eyeballs_timeout / 2;
  771|       |
  772|  9.39k|  result = Curl_cf_create(&cf, &Curl_cft_http_connect, ctx);
  773|  9.39k|  if(result)
  ------------------
  |  Branch (773:6): [True: 2, False: 9.38k]
  ------------------
  774|      2|    goto out;
  775|  9.38k|  ctx = NULL;
  776|       |
  777|  9.39k|out:
  778|  9.39k|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (778:10): [True: 8, False: 9.38k]
  ------------------
  779|  9.39k|  cf_hc_ctx_destroy(data, ctx);
  780|  9.39k|  return result;
  781|  9.38k|}

Curl_cf_ip_happy_insert_after:
 1010|  9.28k|{
 1011|  9.28k|  struct Curl_cfilter *cf;
 1012|  9.28k|  CURLcode result;
 1013|       |
 1014|       |  /* Need to be first */
 1015|  9.28k|  DEBUGASSERT(cf_at);
  ------------------
  |  | 1016|  9.28k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1015:3): [True: 0, False: 9.28k]
  |  Branch (1015:3): [True: 9.28k, False: 0]
  ------------------
 1016|  9.28k|  result = cf_ip_happy_create(&cf, data, origin, peer, transport_peer,
 1017|  9.28k|                              CF_CONN(cf_at), tunnel_peer, tunnel_transport);
  ------------------
  |  |  260|  9.28k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
 1018|  9.28k|  if(result)
  ------------------
  |  Branch (1018:6): [True: 8, False: 9.27k]
  ------------------
 1019|      8|    return result;
 1020|       |
 1021|  9.27k|  Curl_conn_cf_insert_after(cf_at, cf);
 1022|  9.27k|  return CURLE_OK;
 1023|  9.28k|}
cf-ip-happy.c:cf_ip_happy_destroy:
  938|  9.27k|{
  939|  9.27k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  940|       |
  941|  9.27k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  9.27k|  do {                                          \
  |  |  154|  9.27k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.27k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.27k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 9.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.27k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 4, False: 143]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.27k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.27k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.27k]
  |  |  ------------------
  ------------------
  942|  9.27k|  if(ctx) {
  ------------------
  |  Branch (942:6): [True: 9.27k, False: 0]
  ------------------
  943|  9.27k|    cf_ip_happy_ctx_clear(ctx, data);
  944|  9.27k|    cf_ip_happy_ctx_destroy(ctx, data);
  945|  9.27k|  }
  946|  9.27k|}
cf-ip-happy.c:cf_ip_happy_ctx_clear:
  774|  27.7k|{
  775|  27.7k|  DEBUGASSERT(ctx);
  ------------------
  |  | 1016|  27.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (775:3): [True: 0, False: 27.7k]
  |  Branch (775:3): [True: 27.7k, False: 0]
  ------------------
  776|  27.7k|  if(ctx)
  ------------------
  |  Branch (776:6): [True: 27.7k, False: 0]
  ------------------
  777|  27.7k|    cf_ip_ballers_clear(data, &ctx->ballers);
  778|  27.7k|}
cf-ip-happy.c:cf_ip_ballers_clear:
  301|  27.7k|{
  302|  27.7k|  while(bs->running) {
  ------------------
  |  Branch (302:9): [True: 2, False: 27.7k]
  ------------------
  303|      2|    struct cf_ip_attempt *a = bs->running;
  304|      2|    bs->running = a->next;
  305|      2|    cf_ip_attempt_free(a, data);
  306|      2|  }
  307|  27.7k|  bs->running_tail = &bs->running;
  308|  27.7k|  cf_ip_attempt_free(bs->winner, data);
  309|       |  bs->winner = NULL;
  310|  27.7k|  Curl_peer_unlink(&bs->origin);
  311|  27.7k|  Curl_peer_unlink(&bs->peer);
  312|  27.7k|  Curl_peer_unlink(&bs->tunnel_peer);
  313|  27.7k|}
cf-ip-happy.c:cf_ip_attempt_free:
  176|  27.7k|{
  177|  27.7k|  if(a) {
  ------------------
  |  Branch (177:6): [True: 9.21k, False: 18.5k]
  ------------------
  178|  9.21k|    Curl_cfchain_cleanup(&a->chain, data);
  179|  9.21k|    Curl_peer_unlink(&a->origin);
  180|  9.21k|    Curl_peer_unlink(&a->peer);
  181|  9.21k|    Curl_peer_unlink(&a->tunnel_peer);
  182|  9.21k|    curlx_free(a);
  ------------------
  |  | 1503|  9.21k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  183|  9.21k|  }
  184|  27.7k|}
cf-ip-happy.c:cf_ip_happy_ctx_destroy:
  782|  9.28k|{
  783|  9.28k|  if(ctx) {
  ------------------
  |  Branch (783:6): [True: 9.28k, False: 4]
  ------------------
  784|  9.28k|    cf_ip_happy_ctx_clear(ctx, data);
  785|  9.28k|    curlx_free(ctx);
  ------------------
  |  | 1503|  9.28k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  786|  9.28k|  }
  787|  9.28k|}
cf-ip-happy.c:cf_ip_happy_connect:
  825|  33.5k|{
  826|  33.5k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  827|  33.5k|  CURLcode result = CURLE_OK;
  828|       |
  829|       |  /* -Werror=null-dereference finds false positives suddenly. */
  830|  33.5k|  if(!data)
  ------------------
  |  Branch (830:6): [True: 0, False: 33.5k]
  ------------------
  831|      0|    return CURLE_FAILED_INIT;
  832|       |
  833|  33.5k|  if(cf->connected) {
  ------------------
  |  Branch (833:6): [True: 20.4k, False: 13.1k]
  ------------------
  834|  20.4k|    *done = TRUE;
  ------------------
  |  |  986|  20.4k|#define TRUE true
  ------------------
  835|  20.4k|    return CURLE_OK;
  836|  20.4k|  }
  837|       |
  838|  13.1k|  DEBUGASSERT(ctx);
  ------------------
  |  | 1016|  13.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (838:3): [True: 0, False: 13.1k]
  |  Branch (838:3): [True: 13.1k, False: 0]
  ------------------
  839|  13.1k|  *done = FALSE;
  ------------------
  |  |  989|  13.1k|#define FALSE false
  ------------------
  840|       |
  841|  13.1k|  if(!ctx->dns_resolved) {
  ------------------
  |  Branch (841:6): [True: 9.30k, False: 3.87k]
  ------------------
  842|  9.30k|    result = Curl_dns_cf_addr_result(cf, ctx->ballers.peer);
  843|  9.30k|    if(!result)
  ------------------
  |  Branch (843:8): [True: 9.22k, False: 86]
  ------------------
  844|  9.22k|      ctx->dns_resolved = TRUE;
  ------------------
  |  |  986|  9.22k|#define TRUE true
  ------------------
  845|     86|    else if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (845:13): [True: 86, False: 0]
  ------------------
  846|     86|      result = CURLE_OK;
  847|     86|    }
  848|      0|    else /* real error */
  849|      0|      goto out;
  850|  9.30k|  }
  851|       |
  852|  13.1k|  switch(ctx->state) {
  ------------------
  |  Branch (852:10): [True: 13.1k, False: 0]
  ------------------
  853|  9.27k|  case SCFST_INIT:
  ------------------
  |  Branch (853:3): [True: 9.27k, False: 3.90k]
  ------------------
  854|  9.27k|    DEBUGASSERT(CURL_SOCKET_BAD == cf->chain->sock);
  ------------------
  |  | 1016|  9.27k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (854:5): [True: 0, False: 9.27k]
  |  Branch (854:5): [True: 9.27k, False: 0]
  ------------------
  855|  9.27k|    DEBUGASSERT(!cf->connected);
  ------------------
  |  | 1016|  9.27k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (855:5): [True: 0, False: 9.27k]
  |  Branch (855:5): [True: 9.27k, False: 0]
  ------------------
  856|  9.27k|    result = cf_ip_happy_init(cf, data);
  857|  9.27k|    if(result)
  ------------------
  |  Branch (857:8): [True: 0, False: 9.27k]
  ------------------
  858|      0|      goto out;
  859|  9.27k|    ctx->state = SCFST_WAITING;
  860|  9.27k|    FALLTHROUGH();
  ------------------
  |  |  752|  9.27k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  861|  13.1k|  case SCFST_WAITING:
  ------------------
  |  Branch (861:3): [True: 3.90k, False: 9.27k]
  ------------------
  862|  13.1k|    result = is_connected(cf, data, done);
  863|  13.1k|    if(!result && *done) {
  ------------------
  |  Branch (863:8): [True: 13.1k, False: 37]
  |  Branch (863:19): [True: 9.18k, False: 3.96k]
  ------------------
  864|  9.18k|      DEBUGASSERT(ctx->ballers.winner);
  ------------------
  |  | 1016|  9.18k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (864:7): [True: 0, False: 9.18k]
  |  Branch (864:7): [True: 9.18k, False: 0]
  ------------------
  865|  9.18k|      DEBUGASSERT(ctx->ballers.winner->chain.cf);
  ------------------
  |  | 1016|  9.18k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (865:7): [True: 0, False: 9.18k]
  |  Branch (865:7): [True: 9.18k, False: 0]
  ------------------
  866|  9.18k|      DEBUGASSERT(ctx->ballers.winner->chain.cf->connected);
  ------------------
  |  | 1016|  9.18k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (866:7): [True: 0, False: 9.18k]
  |  Branch (866:7): [True: 9.18k, False: 0]
  ------------------
  867|       |      /* we have a winner. Install and activate it.
  868|       |       * close/free all others. */
  869|  9.18k|      ctx->state = SCFST_DONE;
  870|  9.18k|      cf->connected = TRUE;
  ------------------
  |  |  986|  9.18k|#define TRUE true
  ------------------
  871|  9.18k|      Curl_cfchain_merge(cf->chain, &ctx->ballers.winner->chain);
  872|  9.18k|      VERBOSE(Curl_cfchain_trc(data, cf, cf->chain, "merged winner"));
  ------------------
  |  | 1637|  9.18k|#define VERBOSE(x) x
  ------------------
  873|       |
  874|  9.18k|      if(CF_CONN(cf)->scheme->protocol & PROTO_FAMILY_SSH)
  ------------------
  |  |  260|  9.18k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
                    if(CF_CONN(cf)->scheme->protocol & PROTO_FAMILY_SSH)
  ------------------
  |  |   88|  9.18k|#define PROTO_FAMILY_SSH  (CURLPROTO_SCP | CURLPROTO_SFTP)
  |  |  ------------------
  |  |  |  | 1092|  9.18k|#define CURLPROTO_SCP     (1L << 4)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_SSH  (CURLPROTO_SCP | CURLPROTO_SFTP)
  |  |  ------------------
  |  |  |  | 1093|  9.18k|#define CURLPROTO_SFTP    (1L << 5)
  |  |  ------------------
  ------------------
  |  Branch (874:10): [True: 0, False: 9.18k]
  ------------------
  875|      0|        Curl_pgrsTime(data, TIMER_APPCONNECT); /* we are connected already */
  876|  9.18k|#ifdef CURLVERBOSE
  877|  9.18k|      if(Curl_trc_cf_is_verbose(cf, data)) {
  ------------------
  |  |  326|  9.18k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  ------------------
  |  |  |  |  322|  18.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 9.18k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 866, False: 8.31k]
  |  |  |  |  ------------------
  |  |  |  |  323|  18.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 866, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    866|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  327|  9.18k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|    866|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (327:4): [True: 866, False: 0]
  |  |  |  Branch (327:12): [True: 157, False: 709]
  |  |  ------------------
  ------------------
  878|    157|        struct ip_quadruple ipquad;
  879|    157|        bool is_ipv6;
  880|    157|        if(!Curl_conn_cf_get_ip_info(cf->next, data, &is_ipv6, &ipquad)) {
  ------------------
  |  Branch (880:12): [True: 157, False: 0]
  ------------------
  881|    157|          CURL_TRC_CF(data, cf, "Connected to %s (%s) port %u",
  ------------------
  |  |  153|    157|  do {                                          \
  |  |  154|    157|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    157|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    314|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 157, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 157, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    314|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 157, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    157|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    157|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    157|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 157, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 157, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    157|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    157|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 157]
  |  |  ------------------
  ------------------
  882|    157|                      ctx->ballers.peer->hostname,
  883|    157|                      ipquad.remote_ip, ipquad.remote_port);
  884|    157|        }
  885|    157|      }
  886|  9.18k|#endif
  887|  9.18k|      cf_ip_happy_ctx_clear(ctx, data);
  888|  9.18k|      Curl_expire_clear(data, EXPIRE_HAPPY_EYEBALLS);
  889|       |      /* whatever errors were reported by ballers, clear our errorbuf */
  890|  9.18k|      Curl_reset_fail(data);
  891|  9.18k|      data->info.numconnects++; /* to track the # of connections made */
  892|  9.18k|    }
  893|  13.1k|    break;
  894|  13.1k|  case SCFST_DONE:
  ------------------
  |  Branch (894:3): [True: 0, False: 13.1k]
  ------------------
  895|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  896|      0|    break;
  897|  13.1k|  }
  898|  13.1k|out:
  899|  13.1k|  return result;
  900|  13.1k|}
cf-ip-happy.c:cf_ip_happy_init:
  744|  9.27k|{
  745|  9.27k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  746|       |
  747|  9.27k|  if(Curl_timeleft_ms(data) < 0) {
  ------------------
  |  Branch (747:6): [True: 0, False: 9.27k]
  ------------------
  748|       |    /* a precaution, no need to continue if time already is up */
  749|      0|    failf(data, "Connection time-out");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  750|      0|    return CURLE_OPERATION_TIMEDOUT;
  751|      0|  }
  752|       |
  753|  9.27k|  if(ctx->ballers.transport_peer == TRNSPRT_UNIX) {
  ------------------
  |  |  228|  9.27k|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (753:6): [True: 0, False: 9.27k]
  ------------------
  754|      0|#ifdef USE_UNIX_SOCKETS
  755|      0|    cf_ai_iter_init(&ctx->ballers.addr_iter, cf, ctx->ballers.peer, AF_UNIX);
  756|       |#else
  757|       |    return CURLE_UNSUPPORTED_PROTOCOL;
  758|       |#endif
  759|      0|  }
  760|  9.27k|  else { /* TCP/UDP/QUIC */
  761|  9.27k|#ifdef USE_IPV6
  762|  9.27k|    cf_ai_iter_init(&ctx->ballers.ipv6_iter, cf, ctx->ballers.peer, AF_INET6);
  763|  9.27k|#endif
  764|  9.27k|    cf_ai_iter_init(&ctx->ballers.addr_iter, cf, ctx->ballers.peer, AF_INET);
  765|  9.27k|  }
  766|       |
  767|  9.27k|  CURL_TRC_CF(data, cf, "init ip ballers for transport %u",
  ------------------
  |  |  153|  9.27k|  do {                                          \
  |  |  154|  9.27k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.27k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.27k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 888, False: 8.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 888, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    888|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.27k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    888|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 888, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 161, False: 727]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.27k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.27k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.27k]
  |  |  ------------------
  ------------------
  768|  9.27k|              ctx->ballers.transport_peer);
  769|  9.27k|  return CURLE_OK;
  770|  9.27k|}
cf-ip-happy.c:cf_ai_iter_init:
  125|  18.5k|{
  126|  18.5k|  iter->cf = cf;
  127|  18.5k|  iter->peer = peer; /* not linked, ctx->ballers owns and has same lifetime */
  128|  18.5k|  iter->ai_family = ai_family;
  129|  18.5k|  iter->n = 0;
  130|  18.5k|}
cf-ip-happy.c:is_connected:
  684|  13.1k|{
  685|  13.1k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  686|  13.1k|  struct connectdata *conn = CF_CONN(cf);
  ------------------
  |  |  260|  13.1k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  687|  13.1k|  CURLcode result;
  688|       |
  689|  13.1k|  result = cf_ip_ballers_run(&ctx->ballers, cf, data,
  690|  13.1k|                             (bool)ctx->dns_resolved, connected);
  691|       |
  692|  13.1k|  if(!result)
  ------------------
  |  Branch (692:6): [True: 13.1k, False: 37]
  ------------------
  693|  13.1k|    return CURLE_OK;
  694|     37|  else {
  695|     37|    struct Curl_peer *peer = NULL, *proxy_peer = NULL;
  696|     37|    char viamsg[160];
  697|       |
  698|     37|    peer = Curl_cf_get_first_peer(cf);
  699|     37|    if(!conn->origin || !peer)
  ------------------
  |  Branch (699:8): [True: 0, False: 37]
  |  Branch (699:25): [True: 0, False: 37]
  ------------------
  700|      0|      return CURLE_FAILED_INIT;
  701|       |
  702|     37|#ifndef CURL_DISABLE_PROXY
  703|     37|    if(conn->socks_proxy.peer)
  ------------------
  |  Branch (703:8): [True: 0, False: 37]
  ------------------
  704|      0|      proxy_peer = conn->socks_proxy.peer;
  705|     37|    else if(conn->http_proxy.peer)
  ------------------
  |  Branch (705:13): [True: 5, False: 32]
  ------------------
  706|      5|      proxy_peer = conn->http_proxy.peer;
  707|     37|#endif
  708|       |
  709|     37|    viamsg[0] = 0;
  710|     37|    if(!Curl_peer_equal(peer, conn->origin) &&
  ------------------
  |  Branch (710:8): [True: 31, False: 6]
  ------------------
  711|     31|       !Curl_peer_equal(peer, proxy_peer)) {
  ------------------
  |  Branch (711:8): [True: 26, False: 5]
  ------------------
  712|     26|#ifdef USE_UNIX_SOCKETS
  713|     26|      if(peer->unix_socket)
  ------------------
  |  Branch (713:10): [True: 0, False: 26]
  ------------------
  714|      0|        curl_msnprintf(viamsg, sizeof(viamsg), " over unix://%s",
  715|      0|                       peer->hostname);
  716|     26|      else
  717|     26|#endif
  718|     26|      curl_msnprintf(viamsg, sizeof(viamsg), " via %s:%u",
  719|     26|                     peer->hostname, peer->port);
  720|     26|    }
  721|       |
  722|     37|    failf(data, "Failed to connect to %s:%u%s %s%s%safter "
  ------------------
  |  |   62|     37|#define failf Curl_failf
  ------------------
  723|     37|          "%" FMT_TIMEDIFF_T " ms: %s",
  724|     37|          conn->origin->hostname, conn->origin->port, viamsg,
  725|     37|          proxy_peer ? "over proxy " : "",
  ------------------
  |  Branch (725:11): [True: 5, False: 32]
  ------------------
  726|     37|          proxy_peer ? proxy_peer->hostname : "",
  ------------------
  |  Branch (726:11): [True: 5, False: 32]
  ------------------
  727|     37|          proxy_peer ? " " : "",
  ------------------
  |  Branch (727:11): [True: 5, False: 32]
  ------------------
  728|     37|          Curl_pgrs_since_ms(data, NULL, TIMER_STARTSINGLE),
  729|     37|          curl_easy_strerror(result));
  730|       |
  731|     37|#ifdef SOCKETIMEDOUT
  732|     37|    if(SOCKETIMEDOUT == data->state.os_errno)
  ------------------
  |  | 1145|     37|#define SOCKETIMEDOUT     ETIMEDOUT
  ------------------
  |  Branch (732:8): [True: 0, False: 37]
  ------------------
  733|      0|      result = CURLE_OPERATION_TIMEDOUT;
  734|     37|#endif
  735|       |
  736|     37|    return result;
  737|     37|  }
  738|  13.1k|}
cf-ip-happy.c:cf_ip_ballers_run:
  380|  13.1k|{
  381|  13.1k|  CURLcode result = CURLE_OK;
  382|  13.1k|  struct cf_ip_attempt *a = NULL, **panchor;
  383|  13.1k|  bool do_more;
  384|  13.1k|  timediff_t next_expire_ms;
  385|  13.1k|  uint32_t inconclusive, ongoing;
  386|  13.1k|  const struct curltime *pnow = NULL;
  387|  13.1k|  VERBOSE(int i);
  ------------------
  |  | 1637|  13.1k|#define VERBOSE(x) x
  ------------------
  388|       |
  389|  13.1k|  if(bs->winner)
  ------------------
  |  Branch (389:6): [True: 0, False: 13.1k]
  ------------------
  390|      0|    return CURLE_OK;
  391|       |
  392|  22.3k|evaluate:
  393|  22.3k|  ongoing = inconclusive = 0;
  394|       |
  395|       |  /* check if a running baller connects now */
  396|  22.3k|  VERBOSE(i = -1);
  ------------------
  |  | 1637|  22.3k|#define VERBOSE(x) x
  ------------------
  397|  26.2k|  for(panchor = &bs->running; *panchor;) {
  ------------------
  |  Branch (397:31): [True: 13.0k, False: 13.2k]
  ------------------
  398|  13.0k|    VERBOSE(++i);
  ------------------
  |  | 1637|  13.0k|#define VERBOSE(x) x
  ------------------
  399|  13.0k|    a = *panchor;
  400|  13.0k|    a->result = cf_ip_attempt_connect(a, data, cf, connected);
  401|  13.0k|    if(!a->result) {
  ------------------
  |  Branch (401:8): [True: 13.0k, False: 20]
  ------------------
  402|  13.0k|      if(*connected) {
  ------------------
  |  Branch (402:10): [True: 9.18k, False: 3.87k]
  ------------------
  403|       |        /* connected, declare the winner, remove from running,
  404|       |         * clear remaining running list. */
  405|  9.18k|        CURL_TRC_CF(data, cf, "connect attempt #%d successful", i);
  ------------------
  |  |  153|  9.18k|  do {                                          \
  |  |  154|  9.18k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.18k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.18k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 866, False: 8.31k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 866, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    866|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.18k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    866|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 866, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 157, False: 709]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.18k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.18k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.18k]
  |  |  ------------------
  ------------------
  406|  9.18k|        bs->winner = a;
  407|  9.18k|        *panchor = a->next;
  408|  9.18k|        a->next = NULL;
  409|  9.18k|        while(bs->running) {
  ------------------
  |  Branch (409:15): [True: 0, False: 9.18k]
  ------------------
  410|      0|          a = bs->running;
  411|      0|          bs->running = a->next;
  412|      0|          cf_ip_attempt_free(a, data);
  413|      0|        }
  414|  9.18k|        bs->running_tail = &bs->running;
  415|  9.18k|        return CURLE_OK;
  416|  9.18k|      }
  417|       |      /* still running */
  418|  3.87k|      ++ongoing;
  419|  3.87k|      panchor = &(*panchor)->next;
  420|  3.87k|    }
  421|     20|    else if(a->inconclusive) { /* failed, but inconclusive */
  ------------------
  |  Branch (421:13): [True: 0, False: 20]
  ------------------
  422|      0|      ++inconclusive;
  423|      0|      panchor = &(*panchor)->next;
  424|      0|    }
  425|     20|    else {
  426|       |      /* hard failure, discard right away */
  427|     20|      *panchor = a->next;
  428|     20|      if(!a->next)
  ------------------
  |  Branch (428:10): [True: 20, False: 0]
  ------------------
  429|     20|        bs->running_tail = panchor;
  430|     20|      a->next = NULL;
  431|     20|      bs->last_dead_result = a->result;
  432|     20|      bs->had_dead = TRUE;
  ------------------
  |  |  986|     20|#define TRUE true
  ------------------
  433|     20|      cf_ip_attempt_free(a, data);
  434|     20|    }
  435|  13.0k|  }
  436|  13.2k|  if(bs->running)
  ------------------
  |  Branch (436:6): [True: 3.87k, False: 9.32k]
  ------------------
  437|  3.87k|    CURL_TRC_CF(data, cf, "checked connect attempts: "
  ------------------
  |  |  153|  3.87k|  do {                                          \
  |  |  154|  3.87k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.87k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  7.75k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.87k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 294, False: 3.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  7.75k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 294, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    294|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  3.87k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    294|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 294, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 8, False: 286]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.87k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.87k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.87k]
  |  |  ------------------
  ------------------
  438|  13.2k|                "%u ongoing, %u inconclusive", ongoing, inconclusive);
  439|       |
  440|       |  /* Nothing connected. Only now check the time: an attempt that completed
  441|       |     since we were last called must be accepted even if the application
  442|       |     was late in calling us. */
  443|  13.2k|  pnow = Curl_pgrs_now(data);
  444|  13.2k|  if(Curl_timeleft_now_ms(data, pnow) < 0) {
  ------------------
  |  Branch (444:6): [True: 0, False: 13.2k]
  ------------------
  445|      0|    failf(data, "Connection timeout after %" FMT_OFF_T " ms",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  446|      0|          Curl_pgrs_since_ms(data, NULL, TIMER_STARTSINGLE));
  447|      0|    return CURLE_OPERATION_TIMEDOUT;
  448|      0|  }
  449|       |
  450|       |  /* no attempt connected yet, start another one? */
  451|  13.2k|  if(!ongoing) {
  ------------------
  |  Branch (451:6): [True: 9.32k, False: 3.87k]
  ------------------
  452|  9.32k|    do_more = TRUE;
  ------------------
  |  |  986|  9.32k|#define TRUE true
  ------------------
  453|  9.32k|  }
  454|  3.87k|  else {
  455|  3.87k|    bool more_possible = cf_ai_iter_has_more(&bs->addr_iter, data);
  456|  3.87k|#ifdef USE_IPV6
  457|  3.87k|    if(!more_possible)
  ------------------
  |  Branch (457:8): [True: 3.87k, False: 0]
  ------------------
  458|  3.87k|      more_possible = cf_ai_iter_has_more(&bs->ipv6_iter, data);
  459|  3.87k|#endif
  460|  3.87k|    do_more = more_possible &&
  ------------------
  |  Branch (460:15): [True: 0, False: 3.87k]
  ------------------
  461|      0|      (curlx_ptimediff_ms(pnow, &bs->last_attempt_started) >=
  ------------------
  |  Branch (461:7): [True: 0, False: 0]
  ------------------
  462|      0|       bs->attempt_delay_ms);
  463|  3.87k|    if(do_more)
  ------------------
  |  Branch (463:8): [True: 0, False: 3.87k]
  ------------------
  464|      0|      CURL_TRC_CF(data, cf, "happy eyeballs timeout expired, "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  465|  3.87k|                  "start next attempt");
  466|  3.87k|  }
  467|       |
  468|  13.2k|  if(do_more) {
  ------------------
  |  Branch (468:6): [True: 9.32k, False: 3.87k]
  ------------------
  469|       |    /* start the next attempt if there is another ip address to try.
  470|       |     * Alternate between address families when possible. */
  471|  9.32k|    const struct Curl_addrinfo *ai = NULL;
  472|  9.32k|    int ai_family = 0;
  473|  9.32k|    CURL_TRC_CF(data, cf, "want to do more");
  ------------------
  |  |  153|  9.32k|  do {                                          \
  |  |  154|  9.32k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.32k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.32k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 898, False: 8.42k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 898, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    898|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.32k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    898|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 898, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 163, False: 735]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.32k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.32k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.32k]
  |  |  ------------------
  ------------------
  474|  9.32k|#ifdef USE_IPV6
  475|  9.32k|    if((bs->last_attempt_ai_family == AF_INET) ||
  ------------------
  |  Branch (475:8): [True: 9.32k, False: 6]
  ------------------
  476|  9.32k|       !cf_ai_iter_has_more(&bs->addr_iter, data)) {
  ------------------
  |  Branch (476:8): [True: 6, False: 0]
  ------------------
  477|  9.32k|      ai = cf_ai_iter_next(&bs->ipv6_iter, data);
  478|  9.32k|      ai_family = bs->ipv6_iter.ai_family;
  479|  9.32k|      CURL_TRC_CF(data, cf, "check for next AAAA address: %s",
  ------------------
  |  |  153|  9.32k|  do {                                          \
  |  |  154|  9.32k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.32k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.32k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 898, False: 8.42k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 898, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    898|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.32k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    898|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 898, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 163, False: 735]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.32k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 163]
  |  |  ------------------
  |  |  156|  9.32k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.32k]
  |  |  ------------------
  ------------------
  480|  9.32k|                  ai ? "found" : "none");
  481|  9.32k|    }
  482|  9.32k|#endif
  483|  9.32k|    if(!ai) {
  ------------------
  |  Branch (483:8): [True: 9.32k, False: 6]
  ------------------
  484|  9.32k|      ai = cf_ai_iter_next(&bs->addr_iter, data);
  485|  9.32k|      ai_family = bs->addr_iter.ai_family;
  486|  9.32k|      CURL_TRC_CF(data, cf, "check for next A address: %s",
  ------------------
  |  |  153|  9.32k|  do {                                          \
  |  |  154|  9.32k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.32k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.32k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 897, False: 8.42k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 897, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    897|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.32k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    897|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 897, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 163, False: 734]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.32k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 159, False: 4]
  |  |  ------------------
  |  |  156|  9.32k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.32k]
  |  |  ------------------
  ------------------
  487|  9.32k|                  ai ? "found" : "none");
  488|  9.32k|    }
  489|       |    /* We are (re-)starting attempts. We are not interested in
  490|       |     * keeping old failure information. The new attempt will either
  491|       |     * succeed or persist new failure. */
  492|  9.32k|    Curl_reset_fail(data);
  493|       |
  494|  9.32k|    if(ai) {  /* try another address */
  ------------------
  |  Branch (494:8): [True: 9.22k, False: 106]
  ------------------
  495|  9.22k|      struct Curl_sockaddr_ex addr;
  496|       |
  497|       |      /* Discard oldest to make room for new attempt */
  498|  9.22k|      if(bs->max_concurrent)
  ------------------
  |  Branch (498:10): [True: 9.22k, False: 0]
  ------------------
  499|  9.22k|        cf_ip_ballers_prune(bs, cf, data, bs->max_concurrent - 1);
  500|       |
  501|  9.22k|      result = Curl_socket_addr_from_ai(&addr, ai, bs->transport_peer);
  502|  9.22k|      if(result)
  ------------------
  |  Branch (502:10): [True: 0, False: 9.22k]
  ------------------
  503|      0|        goto out;
  504|       |
  505|  9.22k|      result = cf_ip_attempt_new(&a, data, cf, bs->origin, bs->peer,
  506|  9.22k|                                 bs->transport_peer, &addr, ai_family,
  507|  9.22k|                                 bs->tunnel_peer, bs->tunnel_transport,
  508|  9.22k|                                 bs->cf_create);
  509|  9.22k|      CURL_TRC_CF(data, cf, "starting %s attempt for ipv%s -> %d",
  ------------------
  |  |  153|  9.22k|  do {                                          \
  |  |  154|  9.22k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.22k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.22k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 872, False: 8.34k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 872, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    872|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.22k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    872|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 872, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 159, False: 713]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.22k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 159]
  |  |  |  Branch (155:35): [True: 159, False: 0]
  |  |  ------------------
  |  |  156|  9.22k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.22k]
  |  |  ------------------
  ------------------
  510|  9.22k|                  bs->running ? "next" : "first",
  511|  9.22k|                  (ai_family == AF_INET) ? "4" : "6", (int)result);
  512|  9.22k|      if(result)
  ------------------
  |  Branch (512:10): [True: 17, False: 9.20k]
  ------------------
  513|     17|        goto out;
  514|  9.20k|      DEBUGASSERT(a);
  ------------------
  |  | 1016|  9.20k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (514:7): [True: 0, False: 9.20k]
  |  Branch (514:7): [True: 9.20k, False: 0]
  ------------------
  515|       |
  516|       |      /* append to running list */
  517|  9.20k|      *bs->running_tail = a;
  518|  9.20k|      a->next = NULL;
  519|  9.20k|      bs->running_tail = &a->next;
  520|  9.20k|      bs->last_attempt_started = *pnow;
  521|  9.20k|      bs->last_attempt_ai_family = ai_family;
  522|       |      /* and run everything again */
  523|  9.20k|      goto evaluate;
  524|  9.20k|    }
  525|    106|    else if(inconclusive) {
  ------------------
  |  Branch (525:13): [True: 0, False: 106]
  ------------------
  526|       |      /* tried all addresses, no success but some where inconclusive.
  527|       |       * Let's restart the inconclusive ones. */
  528|      0|      timediff_t since_ms =
  529|      0|        curlx_ptimediff_ms(pnow, &bs->last_attempt_started);
  530|      0|      timediff_t delay_ms = bs->attempt_delay_ms - since_ms;
  531|      0|      if(delay_ms <= 0) {
  ------------------
  |  Branch (531:10): [True: 0, False: 0]
  ------------------
  532|      0|        CURL_TRC_CF(data, cf, "all attempts inconclusive, restarting one");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  533|      0|        VERBOSE(i = -1);
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  ------------------
  534|      0|        for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (534:30): [True: 0, False: 0]
  ------------------
  535|      0|          VERBOSE(++i);
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  ------------------
  536|      0|          if(!a->inconclusive)
  ------------------
  |  Branch (536:14): [True: 0, False: 0]
  ------------------
  537|      0|            continue;
  538|      0|          result = cf_ip_attempt_restart(a, cf, data);
  539|      0|          CURL_TRC_CF(data, cf, "restarted baller %d -> %d", i, (int)result);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  540|      0|          if(result) /* serious failure */
  ------------------
  |  Branch (540:14): [True: 0, False: 0]
  ------------------
  541|      0|            goto out;
  542|      0|          bs->last_attempt_started = *pnow;
  543|      0|          goto evaluate;
  544|      0|        }
  545|      0|        DEBUGASSERT(0); /* should not come here */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (545:9): [Folded, False: 0]
  |  Branch (545:9): [Folded, False: 0]
  ------------------
  546|      0|      }
  547|      0|      else {
  548|       |        /* let's wait some more before restarting */
  549|      0|        infof(data, "connect attempts inconclusive, retrying "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  550|      0|                    "in %" FMT_TIMEDIFF_T "ms", delay_ms);
  551|      0|        Curl_expire_set(data, EXPIRE_HAPPY_EYEBALLS, delay_ms, pnow);
  552|      0|      }
  553|       |      /* attempt timeout for restart has not expired yet */
  554|      0|      goto out;
  555|      0|    }
  556|    106|    else if(!ongoing && dns_resolved) {
  ------------------
  |  Branch (556:13): [True: 106, False: 0]
  |  Branch (556:25): [True: 20, False: 86]
  ------------------
  557|       |      /* no more addresses, no inconclusive attempts */
  558|     20|      CURL_TRC_CF(data, cf, "no more attempts to try");
  ------------------
  |  |  153|     20|  do {                                          \
  |  |  154|     20|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|     20|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     40|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 20, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 2, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     40|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     20|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      2|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     20|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     20|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 20]
  |  |  ------------------
  ------------------
  559|     20|      DEBUGASSERT(!bs->running);
  ------------------
  |  | 1016|     20|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (559:7): [True: 0, False: 20]
  |  Branch (559:7): [True: 20, False: 0]
  ------------------
  560|     20|      result = bs->had_dead ? bs->last_dead_result : CURLE_COULDNT_CONNECT;
  ------------------
  |  Branch (560:16): [True: 20, False: 0]
  ------------------
  561|     20|    }
  562|  9.32k|  }
  563|       |
  564|  3.99k|out:
  565|  3.99k|  if(!result) {
  ------------------
  |  Branch (565:6): [True: 3.96k, False: 37]
  ------------------
  566|  3.96k|    bool more_possible;
  567|       |
  568|       |    /* when do we need to be called again? */
  569|  3.96k|    pnow = Curl_pgrs_now(data);
  570|  3.96k|    next_expire_ms = Curl_timeleft_now_ms(data, pnow);
  571|  3.96k|    if(next_expire_ms < 0) {
  ------------------
  |  Branch (571:8): [True: 0, False: 3.96k]
  ------------------
  572|      0|      failf(data, "Connection timeout after %" FMT_OFF_T " ms",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  573|      0|            Curl_pgrs_since_ms(data, NULL, TIMER_STARTSINGLE));
  574|      0|      return CURLE_OPERATION_TIMEDOUT;
  575|      0|    }
  576|       |
  577|  3.96k|    more_possible = cf_ai_iter_has_more(&bs->addr_iter, data);
  578|  3.96k|#ifdef USE_IPV6
  579|  3.96k|    if(!more_possible)
  ------------------
  |  Branch (579:8): [True: 3.96k, False: 0]
  ------------------
  580|  3.96k|      more_possible = cf_ai_iter_has_more(&bs->ipv6_iter, data);
  581|  3.96k|#endif
  582|  3.96k|    if(more_possible) {
  ------------------
  |  Branch (582:8): [True: 0, False: 3.96k]
  ------------------
  583|      0|      timediff_t expire_ms, elapsed_ms;
  584|       |
  585|      0|      elapsed_ms = curlx_ptimediff_ms(pnow, &bs->last_attempt_started);
  586|      0|      expire_ms = CURLMAX(bs->attempt_delay_ms - elapsed_ms, 0);
  ------------------
  |  | 1314|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1314:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  587|      0|      next_expire_ms = CURLMIN(next_expire_ms, expire_ms);
  ------------------
  |  | 1315|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  588|      0|      if(next_expire_ms <= 0) {
  ------------------
  |  Branch (588:10): [True: 0, False: 0]
  ------------------
  589|      0|        CURL_TRC_CF(data, cf, "HAPPY_EYEBALLS timeout due, re-evaluate");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  590|      0|        goto evaluate;
  591|      0|      }
  592|      0|      CURL_TRC_CF(data, cf, "next HAPPY_EYEBALLS timeout in %" FMT_TIMEDIFF_T
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  593|      0|                  "ms", next_expire_ms);
  594|      0|      Curl_expire_set(data, EXPIRE_HAPPY_EYEBALLS, next_expire_ms, pnow);
  595|      0|    }
  596|  3.96k|  }
  597|  3.99k|  return result;
  598|  3.99k|}
cf-ip-happy.c:cf_ip_attempt_connect:
  232|  13.0k|{
  233|  13.0k|  (void)cf;
  234|  13.0k|  *connected = (bool)a->connected;
  235|  13.0k|  if(!a->result && !*connected) {
  ------------------
  |  Branch (235:6): [True: 13.0k, False: 0]
  |  Branch (235:20): [True: 13.0k, False: 0]
  ------------------
  236|       |    /* evaluate again */
  237|  13.0k|    VERBOSE(Curl_cfchain_trc(data, cf, &a->chain, "attempt"));
  ------------------
  |  | 1637|  13.0k|#define VERBOSE(x) x
  ------------------
  238|  13.0k|    a->result = Curl_conn_cf_connect(a->chain.cf, data, connected);
  239|       |
  240|  13.0k|    if(!a->result) {
  ------------------
  |  Branch (240:8): [True: 13.0k, False: 20]
  ------------------
  241|  13.0k|      if(*connected) {
  ------------------
  |  Branch (241:10): [True: 9.18k, False: 3.87k]
  ------------------
  242|  9.18k|        a->connected = TRUE;
  ------------------
  |  |  986|  9.18k|#define TRUE true
  ------------------
  243|  9.18k|      }
  244|  13.0k|    }
  245|     20|    else {
  246|     20|      if(a->result == CURLE_WEIRD_SERVER_REPLY)
  ------------------
  |  Branch (246:10): [True: 0, False: 20]
  ------------------
  247|      0|        a->inconclusive = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  248|     20|      Curl_cfchain_reset(&a->chain, data);
  249|     20|    }
  250|  13.0k|  }
  251|  13.0k|  return a->result;
  252|  13.0k|}
cf-ip-happy.c:cf_ai_iter_has_more:
  149|  15.6k|{
  150|  15.6k|  return (iter->cf &&
  ------------------
  |  Branch (150:11): [True: 15.6k, False: 0]
  ------------------
  151|  15.6k|          !!Curl_dns_cf_get_ai(data, iter->cf, iter->peer,
  ------------------
  |  Branch (151:11): [True: 0, False: 15.6k]
  ------------------
  152|  15.6k|                                 iter->ai_family, iter->n));
  153|  15.6k|}
cf-ip-happy.c:cf_ai_iter_next:
  134|  18.6k|{
  135|  18.6k|  const struct Curl_addrinfo *addr;
  136|       |
  137|  18.6k|  if(!iter->cf)
  ------------------
  |  Branch (137:6): [True: 0, False: 18.6k]
  ------------------
  138|      0|    return NULL;
  139|       |
  140|  18.6k|  addr = Curl_dns_cf_get_ai(data, iter->cf, iter->peer,
  141|  18.6k|                            iter->ai_family, iter->n);
  142|  18.6k|  if(addr)
  ------------------
  |  Branch (142:6): [True: 9.22k, False: 9.42k]
  ------------------
  143|  9.22k|    iter->n++;
  144|  18.6k|  return addr;
  145|  18.6k|}
cf-ip-happy.c:cf_ip_ballers_prune:
  348|  9.22k|{
  349|  9.22k|  struct cf_ip_attempt *a = NULL, **panchor;
  350|  9.22k|  uint32_t ongoing = 0;
  351|       |
  352|  9.22k|  for(a = bs->running; a; a = a->next) {
  ------------------
  |  Branch (352:24): [True: 0, False: 9.22k]
  ------------------
  353|      0|    if(!a->result && !a->connected)
  ------------------
  |  Branch (353:8): [True: 0, False: 0]
  |  Branch (353:22): [True: 0, False: 0]
  ------------------
  354|      0|      ++ongoing;
  355|      0|  }
  356|       |
  357|  9.22k|  panchor = &bs->running;
  358|  9.22k|  while(*panchor && (ongoing > max_concurrent)) {
  ------------------
  |  Branch (358:9): [True: 0, False: 9.22k]
  |  Branch (358:21): [True: 0, False: 0]
  ------------------
  359|      0|    a = *panchor;
  360|      0|    if(!a->result && !a->connected) {
  ------------------
  |  Branch (360:8): [True: 0, False: 0]
  |  Branch (360:22): [True: 0, False: 0]
  ------------------
  361|      0|      *panchor = a->next;
  362|      0|      if(!a->next)
  ------------------
  |  Branch (362:10): [True: 0, False: 0]
  ------------------
  363|      0|        bs->running_tail = panchor;
  364|      0|      a->next = NULL;
  365|      0|      cf_ip_attempt_free(a, data);
  366|      0|      --ongoing;
  367|      0|      CURL_TRC_CF(data, cf, "discarding oldest attempt to keep limit");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  368|      0|    }
  369|      0|    else {
  370|      0|      panchor = &a->next;
  371|      0|    }
  372|      0|  }
  373|  9.22k|}
cf-ip-happy.c:cf_ip_attempt_new:
  197|  9.22k|{
  198|  9.22k|  struct cf_ip_attempt *a;
  199|  9.22k|  CURLcode result = CURLE_OK;
  200|       |
  201|  9.22k|  *pa = NULL;
  202|  9.22k|  a = curlx_calloc(1, sizeof(*a));
  ------------------
  |  | 1500|  9.22k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  203|  9.22k|  if(!a)
  ------------------
  |  Branch (203:6): [True: 3, False: 9.21k]
  ------------------
  204|      3|    return CURLE_OUT_OF_MEMORY;
  205|       |
  206|  9.21k|  Curl_peer_link(&a->origin, origin);
  207|  9.21k|  Curl_peer_link(&a->peer, peer);
  208|  9.21k|  a->transport_peer = transport_peer;
  209|  9.21k|  Curl_peer_link(&a->tunnel_peer, tunnel_peer);
  210|  9.21k|  a->tunnel_transport = tunnel_transport;
  211|  9.21k|  a->addr = *addr;
  212|  9.21k|  a->ai_family = ai_family;
  213|  9.21k|  a->result = CURLE_OK;
  214|  9.21k|  a->cf_create = cf_create;
  215|  9.21k|  Curl_cfchain_init_child(&a->chain, cf->chain);
  216|  9.21k|  *pa = a;
  217|       |
  218|  9.21k|  result = a->cf_create(&a->chain, data, a->origin, a->peer,
  219|  9.21k|                        a->transport_peer, &a->addr, a->tunnel_peer,
  220|  9.21k|                        a->tunnel_transport);
  221|  9.21k|  if(result) {
  ------------------
  |  Branch (221:6): [True: 14, False: 9.20k]
  ------------------
  222|     14|    cf_ip_attempt_free(a, data);
  223|       |    *pa = NULL;
  224|     14|  }
  225|  9.21k|  return result;
  226|  9.22k|}
cf-ip-happy.c:cf_ip_happy_adjust_pollset:
  810|   114k|{
  811|   114k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  812|   114k|  CURLcode result = CURLE_OK;
  813|       |
  814|   114k|  if(!cf->connected) {
  ------------------
  |  Branch (814:6): [True: 3.96k, False: 110k]
  ------------------
  815|  3.96k|    result = cf_ip_ballers_pollset(&ctx->ballers, data, ps);
  816|  3.96k|    CURL_TRC_CF(data, cf, "adjust_pollset -> %d, %u socks", (int)result,
  ------------------
  |  |  153|  3.96k|  do {                                          \
  |  |  154|  3.96k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.96k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  7.92k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.96k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 318, False: 3.64k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  7.92k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 318, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    318|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  3.96k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    318|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 318, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 12, False: 306]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.96k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.96k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.96k]
  |  |  ------------------
  ------------------
  817|  3.96k|                ps->n);
  818|  3.96k|  }
  819|   114k|  return result;
  820|   114k|}
cf-ip-happy.c:cf_ip_ballers_pollset:
  625|  3.96k|{
  626|  3.96k|  struct cf_ip_attempt *a;
  627|  3.96k|  CURLcode result = CURLE_OK;
  628|  7.83k|  for(a = bs->running; a && !result; a = a->next) {
  ------------------
  |  Branch (628:24): [True: 3.87k, False: 3.96k]
  |  Branch (628:29): [True: 3.87k, False: 0]
  ------------------
  629|  3.87k|    if(a->result)
  ------------------
  |  Branch (629:8): [True: 0, False: 3.87k]
  ------------------
  630|      0|      continue;
  631|  3.87k|    result = Curl_conn_cf_adjust_pollset(a->chain.cf, data, ps);
  632|  3.87k|  }
  633|  3.96k|  return result;
  634|  3.96k|}
cf-ip-happy.c:cf_ip_happy_query:
  916|   136k|{
  917|   136k|  struct cf_ip_happy_ctx *ctx = cf->ctx;
  918|       |
  919|   136k|  if(!cf->connected) {
  ------------------
  |  Branch (919:6): [True: 4.11k, False: 132k]
  ------------------
  920|  4.11k|    switch(query) {
  921|      0|    case CF_QUERY_CONNECT_REPLY_MS: {
  ------------------
  |  |  168|      0|#define CF_QUERY_CONNECT_REPLY_MS   2  /* number     -        */
  ------------------
  |  Branch (921:5): [True: 0, False: 4.11k]
  ------------------
  922|      0|      *pres1 = cf_ip_ballers_min_reply_ms(&ctx->ballers, data);
  923|      0|      CURL_TRC_CF(data, cf, "query connect reply: %dms", *pres1);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  924|      0|      return CURLE_OK;
  925|      0|    }
  926|  4.11k|    default:
  ------------------
  |  Branch (926:5): [True: 4.11k, False: 0]
  ------------------
  927|  4.11k|      break;
  928|  4.11k|    }
  929|  4.11k|  }
  930|       |
  931|   136k|  return cf->next ?
  ------------------
  |  Branch (931:10): [True: 132k, False: 4.11k]
  ------------------
  932|   132k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  933|   136k|    CURLE_UNKNOWN_OPTION;
  934|   136k|}
cf-ip-happy.c:cf_ip_happy_create:
  973|  9.28k|{
  974|  9.28k|  struct cf_ip_happy_ctx *ctx = NULL;
  975|  9.28k|  CURLcode result;
  976|       |
  977|  9.28k|  (void)data;
  978|  9.28k|  (void)conn;
  979|  9.28k|  *pcf = NULL;
  980|  9.28k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|  9.28k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  981|  9.28k|  if(!ctx) {
  ------------------
  |  Branch (981:6): [True: 4, False: 9.28k]
  ------------------
  982|      4|    result = CURLE_OUT_OF_MEMORY;
  983|      4|    goto out;
  984|      4|  }
  985|  9.28k|  result = cf_ip_ballers_init(&ctx->ballers, data,
  986|  9.28k|                              origin, peer, transport_peer,
  987|  9.28k|                              tunnel_peer, tunnel_transport,
  988|  9.28k|                              data->set.happy_eyeballs_timeout,
  989|  9.28k|                              IP_HE_MAX_CONCURRENT_ATTEMPTS);
  ------------------
  |  |  740|  9.28k|#define IP_HE_MAX_CONCURRENT_ATTEMPTS     6
  ------------------
  990|  9.28k|  if(result)
  ------------------
  |  Branch (990:6): [True: 0, False: 9.28k]
  ------------------
  991|      0|    goto out;
  992|       |
  993|  9.28k|  result = Curl_cf_create(pcf, &Curl_cft_ip_happy, ctx);
  994|       |
  995|  9.28k|out:
  996|  9.28k|  if(result) {
  ------------------
  |  Branch (996:6): [True: 8, False: 9.27k]
  ------------------
  997|       |    curlx_safefree(*pcf);
  ------------------
  |  | 1359|      8|  do {                      \
  |  | 1360|      8|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      8|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      8|    (ptr) = NULL;           \
  |  | 1362|      8|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 8]
  |  |  ------------------
  ------------------
  998|      8|    cf_ip_happy_ctx_destroy(ctx, data);
  999|      8|  }
 1000|  9.28k|  return result;
 1001|  9.28k|}
cf-ip-happy.c:cf_ip_ballers_init:
  324|  9.28k|{
  325|  9.28k|  memset(bs, 0, sizeof(*bs));
  326|  9.28k|  bs->running_tail = &bs->running;
  327|  9.28k|  bs->cf_create = get_cf_create(transport_peer, !!tunnel_peer);
  328|  9.28k|  if(!bs->cf_create) {
  ------------------
  |  Branch (328:6): [True: 0, False: 9.28k]
  ------------------
  329|      0|    failf(data, "unsupported transport type %u%s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  330|      0|          transport_peer, tunnel_peer ? " to proxy" : "");
  ------------------
  |  Branch (330:27): [True: 0, False: 0]
  ------------------
  331|      0|    return CURLE_UNSUPPORTED_PROTOCOL;
  332|      0|  }
  333|  9.28k|  Curl_peer_link(&bs->origin, origin);
  334|  9.28k|  Curl_peer_link(&bs->peer, peer);
  335|  9.28k|  bs->transport_peer = transport_peer;
  336|  9.28k|  Curl_peer_link(&bs->tunnel_peer, tunnel_peer);
  337|  9.28k|  bs->tunnel_transport = tunnel_transport;
  338|  9.28k|  bs->attempt_delay_ms = attempt_delay_ms;
  339|  9.28k|  bs->max_concurrent = max_concurrent;
  340|       |  bs->last_attempt_ai_family = AF_INET; /* so AF_INET6 is next */
  341|  9.28k|  return CURLE_OK;
  342|  9.28k|}
cf-ip-happy.c:get_cf_create:
   88|  9.28k|{
   89|  9.28k|  size_t i;
   90|  20.6k|  for(i = 0; i < CURL_ARRAYSIZE(transport_providers); ++i) {
  ------------------
  |  | 1326|  20.6k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (90:14): [True: 20.6k, False: 0]
  ------------------
   91|  20.6k|    if((transport == transport_providers[i].transport) &&
  ------------------
  |  Branch (91:8): [True: 16.5k, False: 4.10k]
  ------------------
   92|  16.5k|       (tunnel == transport_providers[i].tunnel))
  ------------------
  |  Branch (92:8): [True: 9.28k, False: 7.23k]
  ------------------
   93|  9.28k|      return transport_providers[i].cf_create;
   94|  20.6k|  }
   95|      0|  return NULL;
   96|  9.28k|}

Curl_cf_setup_add:
  476|  9.29k|{
  477|  9.29k|  struct Curl_cfilter *cf;
  478|  9.29k|  CURLcode result = CURLE_OK;
  479|       |
  480|  9.29k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.29k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (480:3): [True: 0, False: 9.29k]
  |  Branch (480:3): [True: 9.29k, False: 0]
  ------------------
  481|  9.29k|  result = cf_setup_create(&cf, data, transport, ssl_mode);
  482|  9.29k|  if(result)
  ------------------
  |  Branch (482:6): [True: 6, False: 9.28k]
  ------------------
  483|      6|    goto out;
  484|  9.28k|  Curl_cfchain_add(chain, cf);
  485|  9.29k|out:
  486|  9.29k|  return result;
  487|  9.28k|}
cf-setup.c:cf_setup_destroy:
  416|  9.28k|{
  417|  9.28k|  struct cf_setup_ctx *ctx = cf->ctx;
  418|       |
  419|  9.28k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  9.28k|  do {                                          \
  |  |  154|  9.28k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.28k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.28k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 9.14k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.28k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 4, False: 143]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.28k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.28k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.28k]
  |  |  ------------------
  ------------------
  420|       |  curlx_safefree(ctx);
  ------------------
  |  | 1359|  9.28k|  do {                      \
  |  | 1360|  9.28k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.28k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.28k|    (ptr) = NULL;           \
  |  | 1362|  9.28k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.28k]
  |  |  ------------------
  ------------------
  421|  9.28k|}
cf-setup.c:cf_setup_connect:
  390|   127k|{
  391|   127k|  struct cf_setup_ctx *ctx = cf->ctx;
  392|   127k|  CURLcode result;
  393|       |
  394|       |  /* In some situations, a server/proxy may close the connection and
  395|       |   * we need to connect again (HTTP/1.x proxy auth, for example).
  396|       |   * We used to close the filters and reuse them for another attempt,
  397|       |   * however that complicates filter code and it is simpler to tear them
  398|       |   * all down and start over. */
  399|   127k|retry:
  400|   127k|  result = cf_setup_connect_steps(cf, data, done);
  401|       |
  402|   127k|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (402:6): [True: 0, False: 127k]
  ------------------
  403|      0|    ++ctx->retry_count;
  404|      0|    if(ctx->retry_count > 5) /* arbitrary limit, better just timeout? */
  ------------------
  |  Branch (404:8): [True: 0, False: 0]
  ------------------
  405|      0|      return CURLE_COULDNT_CONNECT;
  406|       |
  407|      0|    CURL_TRC_CF(data, cf, "retrying connect, %d. time", ctx->retry_count);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  408|      0|    Curl_conn_cf_discard_chain(&cf->next, data);
  409|      0|    ctx->state = CF_SETUP_INIT;
  410|      0|    goto retry;
  411|      0|  }
  412|   127k|  return result;
  413|   127k|}
cf-setup.c:cf_setup_connect_steps:
  322|   127k|{
  323|   127k|  struct cf_setup_ctx *ctx = cf->ctx;
  324|   127k|  CURLcode result = CURLE_OK;
  325|       |
  326|   127k|  if(cf->connected) {
  ------------------
  |  Branch (326:6): [True: 0, False: 127k]
  ------------------
  327|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  328|      0|    return CURLE_OK;
  329|      0|  }
  330|       |
  331|       |  /* connect current sub-chain */
  332|   145k|connect_sub_chain:
  333|   145k|  VERBOSE(Curl_cfchain_trc(data, cf, cf->chain, "connect"));
  ------------------
  |  | 1637|   145k|#define VERBOSE(x) x
  ------------------
  334|       |
  335|   145k|  if(cf->next && !cf->next->connected) {
  ------------------
  |  Branch (335:6): [True: 136k, False: 9.28k]
  |  Branch (335:18): [True: 136k, False: 0]
  ------------------
  336|   136k|    result = Curl_conn_cf_connect(cf->next, data, done);
  337|   136k|    if(result || !*done)
  ------------------
  |  Branch (337:8): [True: 6.38k, False: 130k]
  |  Branch (337:18): [True: 119k, False: 10.5k]
  ------------------
  338|   125k|      return result;
  339|   136k|  }
  340|       |
  341|  19.8k|  result = cf_setup_add_ip_happy(cf, data);
  342|  19.8k|  if(result)
  ------------------
  |  Branch (342:6): [True: 8, False: 19.8k]
  ------------------
  343|      8|    return result;
  344|  19.8k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (344:6): [True: 0, False: 19.8k]
  |  Branch (344:19): [True: 9.27k, False: 10.5k]
  ------------------
  345|  9.27k|    goto connect_sub_chain;
  346|       |
  347|  10.5k|#ifndef CURL_DISABLE_PROXY
  348|  10.5k|  result = cf_setup_add_socks(cf, data);
  349|  10.5k|  if(result)
  ------------------
  |  Branch (349:6): [True: 0, False: 10.5k]
  ------------------
  350|      0|    return result;
  351|  10.5k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (351:6): [True: 0, False: 10.5k]
  |  Branch (351:19): [True: 0, False: 10.5k]
  ------------------
  352|      0|    goto connect_sub_chain;
  353|       |
  354|  10.5k|#ifndef CURL_DISABLE_HTTP
  355|  10.5k|  result = cf_setup_add_http_proxy(cf, data);
  356|  10.5k|  if(result)
  ------------------
  |  Branch (356:6): [True: 4, False: 10.5k]
  ------------------
  357|      4|    return result;
  358|  10.5k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (358:6): [True: 0, False: 10.5k]
  |  Branch (358:19): [True: 7.22k, False: 3.34k]
  ------------------
  359|  7.22k|    goto connect_sub_chain;
  360|  3.34k|#endif /* !CURL_DISABLE_HTTP */
  361|       |
  362|  3.34k|  result = cf_setup_add_haproxy(cf, data);
  363|  3.34k|  if(result)
  ------------------
  |  Branch (363:6): [True: 0, False: 3.34k]
  ------------------
  364|      0|    return result;
  365|  3.34k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (365:6): [True: 0, False: 3.34k]
  |  Branch (365:19): [True: 0, False: 3.34k]
  ------------------
  366|      0|    goto connect_sub_chain;
  367|  3.34k|#endif /* !CURL_DISABLE_PROXY */
  368|       |
  369|  3.34k|  result = cf_setup_add_origin_filters(cf, data);
  370|  3.34k|  if(result)
  ------------------
  |  Branch (370:6): [True: 10, False: 3.33k]
  ------------------
  371|     10|    return result;
  372|  3.33k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (372:6): [True: 0, False: 3.33k]
  |  Branch (372:19): [True: 1.37k, False: 1.95k]
  ------------------
  373|  1.37k|    goto connect_sub_chain;
  374|       |
  375|  1.95k|  result = cf_setup_add_protocol_filters(cf, data);
  376|  1.95k|  if(result)
  ------------------
  |  Branch (376:6): [True: 0, False: 1.95k]
  ------------------
  377|      0|    return result;
  378|  1.95k|  if(!cf->next || !cf->next->connected)
  ------------------
  |  Branch (378:6): [True: 0, False: 1.95k]
  |  Branch (378:19): [True: 0, False: 1.95k]
  ------------------
  379|      0|    goto connect_sub_chain;
  380|       |
  381|  1.95k|  ctx->state = CF_SETUP_DONE;
  382|  1.95k|  cf->connected = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
  383|       |  *done = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
  384|  1.95k|  return CURLE_OK;
  385|  1.95k|}
cf-setup.c:cf_setup_add_ip_happy:
  176|  19.8k|{
  177|  19.8k|  struct connectdata *conn = CF_CONN(cf);
  ------------------
  |  |  260|  19.8k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  178|  19.8k|  struct cf_setup_ctx *ctx = cf->ctx;
  179|  19.8k|  CURLcode result = CURLE_OK;
  180|       |
  181|  19.8k|  if(ctx->state < CF_SETUP_CNNCT_EYEBALLS) {
  ------------------
  |  Branch (181:6): [True: 9.28k, False: 10.5k]
  ------------------
  182|       |    /* What is the first hop we directly connect to and what transport
  183|       |     * do we use for it? Only on the first hop we can do Happy Eyeballs.
  184|       |     * first_origin and first_peer differ on --connect-to. */
  185|  9.28k|    struct Curl_peer *first_origin = cf_get_first_origin(cf);
  186|  9.28k|    struct Curl_peer *first_peer = Curl_cf_get_first_peer(cf);
  187|  9.28k|    struct Curl_peer *tunnel_peer = NULL;
  188|  9.28k|    uint8_t first_transport = ctx->transport;
  189|       |
  190|  9.28k|    if(!first_peer)
  ------------------
  |  Branch (190:8): [True: 0, False: 9.28k]
  ------------------
  191|      0|      return CURLE_FAILED_INIT;
  192|       |
  193|  9.28k|#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP)
  194|  9.28k|    if(conn->http_proxy.peer && !conn->bits.origin_is_proxy) {
  ------------------
  |  Branch (194:8): [True: 7.23k, False: 2.05k]
  |  Branch (194:33): [True: 7.23k, False: 0]
  ------------------
  195|  7.23k|      first_transport = Curl_http_proxy_transport(conn->http_proxy.proxytype);
  196|  7.23k|      tunnel_peer = Curl_cf_get_destination(cf);
  197|  7.23k|      if((first_transport == TRNSPRT_QUIC) && conn->socks_proxy.peer) {
  ------------------
  |  |  227|  7.23k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (197:10): [True: 0, False: 7.23k]
  |  Branch (197:47): [True: 0, False: 0]
  ------------------
  198|      0|        failf(data, "HTTP/3 proxy not possible via SOCKS");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  199|      0|        return CURLE_UNSUPPORTED_PROTOCOL;
  200|      0|      }
  201|  7.23k|    }
  202|       |#else
  203|       |    (void)conn;
  204|       |#endif /* !CURL_DISABLE_PROXY && !CURL_DISABLE_HTTP */
  205|       |
  206|  9.28k|    result = Curl_cf_ip_happy_insert_after(cf, data, first_origin, first_peer,
  207|  9.28k|                                           first_transport,
  208|  9.28k|                                           tunnel_peer, ctx->transport);
  209|  9.28k|    if(result) {
  ------------------
  |  Branch (209:8): [True: 8, False: 9.27k]
  ------------------
  210|      8|      CURL_TRC_CF(data, cf, "adding happy eyeballs failed -> %d", (int)result);
  ------------------
  |  |  153|      8|  do {                                          \
  |  |  154|      8|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      8|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     16|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 8, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     16|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      3|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      8|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      3|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 2, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      8|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      8|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 8]
  |  |  ------------------
  ------------------
  211|      8|      return result;
  212|      8|    }
  213|       |
  214|  9.27k|    if(tunnel_peer && (first_transport == TRNSPRT_QUIC)) {
  ------------------
  |  |  227|  7.22k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (214:8): [True: 7.22k, False: 2.05k]
  |  Branch (214:23): [True: 0, False: 7.22k]
  ------------------
  215|      0|      CURL_TRC_CF(data, cf, "happy eyeballing to HTTP/3 proxy %s:%u",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  216|      0|                  first_peer->hostname, first_peer->port);
  217|      0|      ctx->state = CF_SETUP_CNNCT_HTTP_PROXY;
  218|      0|    }
  219|  9.27k|    else {
  220|  9.27k|      CURL_TRC_CF(data, cf, "happy eyeballing to %s %s:%u",
  ------------------
  |  |  153|  9.27k|  do {                                          \
  |  |  154|  9.27k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.27k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.27k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 888, False: 8.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 888, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    888|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.27k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    888|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 888, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 161, False: 727]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.27k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 153, False: 8]
  |  |  ------------------
  |  |  156|  9.27k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.27k]
  |  |  ------------------
  ------------------
  221|  9.27k|                  tunnel_peer ? "proxy" : "origin",
  222|  9.27k|                  first_peer->hostname, first_peer->port);
  223|  9.27k|      ctx->state = CF_SETUP_CNNCT_EYEBALLS;
  224|  9.27k|    }
  225|  9.27k|  }
  226|  19.8k|  return result;
  227|  19.8k|}
cf-setup.c:cf_get_first_origin:
  163|  9.28k|{
  164|  9.28k|  struct connectdata *conn = CF_CONN(cf);
  ------------------
  |  |  260|  9.28k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  165|  9.28k|#ifndef CURL_DISABLE_PROXY
  166|  9.28k|  if(conn->socks_proxy.peer)
  ------------------
  |  Branch (166:6): [True: 0, False: 9.28k]
  ------------------
  167|      0|    return conn->socks_proxy.peer;
  168|  9.28k|  if(conn->http_proxy.peer)
  ------------------
  |  Branch (168:6): [True: 7.23k, False: 2.05k]
  ------------------
  169|  7.23k|    return conn->http_proxy.peer;
  170|  2.05k|#endif
  171|  2.05k|  return CF_IS_PRIMARY(cf) ? conn->origin : conn->origin2;
  ------------------
  |  |  261|  2.05k|#define CF_IS_PRIMARY(cf)       (bool)(cf)->chain->primary
  |  |  ------------------
  |  |  |  Branch (261:33): [True: 2.05k, False: 0]
  |  |  ------------------
  ------------------
  172|  9.28k|}
cf-setup.c:cf_setup_add_socks:
   87|  10.5k|{
   88|  10.5k|  struct cf_setup_ctx *ctx = cf->ctx;
   89|  10.5k|  CURLcode result = CURLE_OK;
   90|  10.5k|  if(ctx->state < CF_SETUP_CNNCT_SOCKS && CF_CONN(cf)->socks_proxy.peer) {
  ------------------
  |  |  260|  9.18k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  |  Branch (90:6): [True: 9.18k, False: 1.38k]
  |  Branch (90:43): [True: 0, False: 9.18k]
  ------------------
   91|       |    /* Add a SOCKS proxy to go through `first_peer` to `second_peer`*/
   92|      0|    struct Curl_peer *second_peer;
   93|       |
   94|      0|    if(CF_CONN(cf)->http_proxy.peer)
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  |  Branch (94:8): [True: 0, False: 0]
  ------------------
   95|      0|      second_peer = CF_CONN(cf)->http_proxy.peer;
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
   96|      0|    else
   97|      0|      second_peer = Curl_cf_get_destination(cf);
   98|      0|    if(!second_peer)
  ------------------
  |  Branch (98:8): [True: 0, False: 0]
  ------------------
   99|      0|      return CURLE_FAILED_INIT;
  100|       |
  101|      0|    result = Curl_cf_socks_proxy_insert_after(
  102|      0|      cf, data, CF_CONN(cf)->socks_proxy.peer, second_peer,
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  103|      0|      CF_CONN(cf)->ip_version, CF_CONN(cf)->socks_proxy.proxytype,
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
                    CF_CONN(cf)->ip_version, CF_CONN(cf)->socks_proxy.proxytype,
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  104|      0|      CF_CONN(cf)->socks_proxy.creds);
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  105|      0|    if(result) {
  ------------------
  |  Branch (105:8): [True: 0, False: 0]
  ------------------
  106|      0|      CURL_TRC_CF(data, cf, "adding SOCKS filter failed -> %d", (int)result);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  107|      0|      return result;
  108|      0|    }
  109|       |
  110|      0|    CURL_TRC_CF(data, cf, "added SOCKS filter to %s:%u",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  111|      0|                second_peer->hostname, second_peer->port);
  112|      0|    ctx->state = CF_SETUP_CNNCT_SOCKS;
  113|      0|  }
  114|  10.5k|  return result;
  115|  10.5k|}
cf-setup.c:cf_setup_add_http_proxy:
  120|  10.5k|{
  121|  10.5k|  struct connectdata *conn = CF_CONN(cf);
  ------------------
  |  |  260|  10.5k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  122|  10.5k|  struct cf_setup_ctx *ctx = cf->ctx;
  123|  10.5k|  CURLcode result = CURLE_OK;
  124|       |
  125|  10.5k|  if(ctx->state < CF_SETUP_CNNCT_HTTP_PROXY &&
  ------------------
  |  Branch (125:6): [True: 9.18k, False: 1.38k]
  ------------------
  126|  9.18k|     conn->http_proxy.peer && !conn->bits.origin_is_proxy) {
  ------------------
  |  Branch (126:6): [True: 7.22k, False: 1.95k]
  |  Branch (126:31): [True: 7.22k, False: 0]
  ------------------
  127|  7.22k|    struct Curl_peer *peer = conn->http_proxy.peer;
  128|  7.22k|    struct Curl_peer *tunnel_peer = Curl_cf_get_destination(cf);
  129|       |
  130|  7.22k|#ifdef USE_SSL
  131|  7.22k|    if(CURL_PROXY_IS_HTTPS(conn->http_proxy.proxytype) &&
  ------------------
  |  |   42|  14.4k|  (((t) == CURLPROXY_HTTPS) ||  \
  |  |  ------------------
  |  |  |  |  796|  7.22k|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  |  |  ------------------
  |  |  |  Branch (42:4): [True: 0, False: 7.22k]
  |  |  ------------------
  |  |   43|  7.22k|   ((t) == CURLPROXY_HTTPS2) || \
  |  |  ------------------
  |  |  |  |  798|  7.22k|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  |  |  ------------------
  |  |  |  Branch (43:4): [True: 0, False: 7.22k]
  |  |  ------------------
  |  |   44|  14.4k|   ((t) == CURLPROXY_HTTPS3))
  |  |  ------------------
  |  |  |  |  807|  7.22k|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 0, False: 7.22k]
  |  |  ------------------
  ------------------
  132|      0|       !Curl_cfchain_is_ssl(cf->chain)) {
  ------------------
  |  Branch (132:8): [True: 0, False: 0]
  ------------------
  133|      0|      result = Curl_cf_ssl_proxy_insert_after(
  134|      0|        cf, data, conn->http_proxy.peer);
  135|      0|      if(result) {
  ------------------
  |  Branch (135:10): [True: 0, False: 0]
  ------------------
  136|      0|        CURL_TRC_CF(data, cf, "adding SSL filter for HTTP proxy failed -> %d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  137|      0|                    (int)result);
  138|      0|        return result;
  139|      0|      }
  140|      0|      CURL_TRC_CF(data, cf, "added SSL filter for HTTP proxy");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  141|      0|    }
  142|  7.22k|#endif /* USE_SSL */
  143|       |
  144|  7.22k|    result = Curl_cf_http_proxy_insert_after(
  145|  7.22k|      cf, data, peer, tunnel_peer,
  146|  7.22k|      ctx->transport, conn->http_proxy.proxytype);
  147|  7.22k|    if(result) {
  ------------------
  |  Branch (147:8): [True: 4, False: 7.22k]
  ------------------
  148|      4|      CURL_TRC_CF(data, cf, "adding HTTP proxy tunnel filter failed -> %d",
  ------------------
  |  |  153|      4|  do {                                          \
  |  |  154|      4|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      4|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      8|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 4, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 2, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      8|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      4|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      2|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      4|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      4|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 4]
  |  |  ------------------
  ------------------
  149|      4|                  (int)result);
  150|      4|      return result;
  151|      4|    }
  152|  7.22k|    CURL_TRC_CF(data, cf, "added HTTP proxy tunnel filter");
  ------------------
  |  |  153|  7.22k|  do {                                          \
  |  |  154|  7.22k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  7.22k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  14.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.22k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 717, False: 6.50k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 717, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    717|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.22k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    717|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 717, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 152, False: 565]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.22k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.22k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.22k]
  |  |  ------------------
  ------------------
  153|  7.22k|    ctx->state = CF_SETUP_CNNCT_HTTP_PROXY;
  154|  7.22k|  }
  155|  10.5k|  return result;
  156|  10.5k|}
cf-setup.c:cf_setup_add_haproxy:
   62|  3.34k|{
   63|  3.34k|  struct cf_setup_ctx *ctx = cf->ctx;
   64|  3.34k|  CURLcode result = CURLE_OK;
   65|       |
   66|  3.34k|  if(ctx->state < CF_SETUP_CNNCT_HAPROXY) {
  ------------------
  |  Branch (66:6): [True: 3.34k, False: 0]
  ------------------
   67|  3.34k|    if(data->set.haproxyprotocol) {
  ------------------
  |  Branch (67:8): [True: 0, False: 3.34k]
  ------------------
   68|      0|      if(ctx->transport == TRNSPRT_QUIC) {
  ------------------
  |  |  227|      0|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (68:10): [True: 0, False: 0]
  ------------------
   69|      0|        failf(data, "haproxy protocol does not support QUIC");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
   70|      0|        return CURLE_UNSUPPORTED_PROTOCOL;
   71|      0|      }
   72|      0|      result = Curl_cf_haproxy_insert_after(cf, data);
   73|      0|      if(result) {
  ------------------
  |  Branch (73:10): [True: 0, False: 0]
  ------------------
   74|      0|        CURL_TRC_CF(data, cf, "adding HAPROXY filter failed -> %d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
   75|      0|                    (int)result);
   76|      0|        return result;
   77|      0|      }
   78|      0|      CURL_TRC_CF(data, cf, "added HAPROXY filter");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
   79|      0|    }
   80|  3.34k|    ctx->state = CF_SETUP_CNNCT_HAPROXY;
   81|  3.34k|  }
   82|  3.34k|  return result;
   83|  3.34k|}
cf-setup.c:cf_setup_add_origin_filters:
  231|  3.34k|{
  232|  3.34k|  struct cf_setup_ctx *ctx = cf->ctx;
  233|  3.34k|  CURLcode result = CURLE_OK;
  234|       |
  235|  3.34k|  (void)data; /* not used in all builds */
  236|  3.34k|  if(ctx->state < CF_SETUP_CNNCT_SSL) {
  ------------------
  |  Branch (236:6): [True: 3.34k, False: 0]
  ------------------
  237|  3.34k|#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) && \
  238|  3.34k|    !defined(CURL_DISABLE_PROXY)
  239|       |
  240|       |    /* Wanting QUIC with an HTTP tunneling filter, we now need to add
  241|       |     * the QUIC filter on top. Without tunneling, this has already
  242|       |     * happened in the Happy Eyeball filter. */
  243|  3.34k|    if(ctx->transport == TRNSPRT_QUIC &&
  ------------------
  |  |  227|  6.68k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (243:8): [True: 3.34k, False: 0]
  ------------------
  244|  3.34k|       CF_CONN(cf)->http_proxy.peer && !CF_CONN(cf)->bits.origin_is_proxy) {
  ------------------
  |  |  260|  3.34k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
                     CF_CONN(cf)->http_proxy.peer && !CF_CONN(cf)->bits.origin_is_proxy) {
  ------------------
  |  |  260|  1.38k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  |  Branch (244:8): [True: 1.38k, False: 1.95k]
  |  Branch (244:40): [True: 1.38k, False: 0]
  ------------------
  245|  1.38k|      struct Curl_peer *origin = Curl_cf_get_origin(cf);
  246|  1.38k|      struct Curl_peer *peer = Curl_cf_get_destination(cf);
  247|       |
  248|  1.38k|      result = Curl_cf_capsule_insert_after(cf, data);
  249|  1.38k|      if(result) {
  ------------------
  |  Branch (249:10): [True: 2, False: 1.38k]
  ------------------
  250|      2|        CURL_TRC_CF(data, cf, "adding capsule filter failed -> %d",
  ------------------
  |  |  153|      2|  do {                                          \
  |  |  154|      2|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      2|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      4|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 2, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      4|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      2|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      2|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      2|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
  251|      2|                    (int)result);
  252|      2|        return result;
  253|      2|      }
  254|  1.38k|      result = Curl_cf_quic_insert_after(cf, data, origin, peer);
  255|  1.38k|      if(result) {
  ------------------
  |  Branch (255:10): [True: 8, False: 1.37k]
  ------------------
  256|      8|        CURL_TRC_CF(data, cf, "adding QUIC filter failed -> %d", (int)result);
  ------------------
  |  |  153|      8|  do {                                          \
  |  |  154|      8|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      8|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     16|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 8, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 2, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     16|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      8|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      2|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      8|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      8|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 8]
  |  |  ------------------
  ------------------
  257|      8|        return result;
  258|      8|      }
  259|  1.37k|      CURL_TRC_CF(data, cf, "added QUIC filter for origin");
  ------------------
  |  |  153|  1.37k|  do {                                          \
  |  |  154|  1.37k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.37k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  2.74k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.37k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 196, False: 1.17k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.74k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 196, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    196|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.37k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    196|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 196, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 66, False: 130]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.37k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
  260|  1.37k|    }
  261|  1.95k|    else
  262|  1.95k|#endif /* !CURL_DISABLE_HTTP && USE_HTTP3 && CURL_DISABLE_PROXY */
  263|  1.95k|#ifdef USE_SSL
  264|  1.95k|    if((ctx->ssl_mode == CURL_CF_SSL_ENABLE ||
  ------------------
  |  |  378|  3.91k|#define CURL_CF_SSL_ENABLE   1
  ------------------
  |  Branch (264:9): [True: 1.95k, False: 0]
  ------------------
  265|      0|        (ctx->ssl_mode != CURL_CF_SSL_DISABLE &&
  ------------------
  |  |  377|      0|#define CURL_CF_SSL_DISABLE  0
  ------------------
  |  Branch (265:10): [True: 0, False: 0]
  ------------------
  266|      0|         CF_CONN(cf)->scheme->flags & PROTOPT_SSL)) && /* we want SSL */
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
                       CF_CONN(cf)->scheme->flags & PROTOPT_SSL)) && /* we want SSL */
  ------------------
  |  |  214|      0|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  |  Branch (266:10): [True: 0, False: 0]
  ------------------
  267|  1.95k|       !Curl_cfchain_is_ssl(cf->chain)) { /* it is missing */
  ------------------
  |  Branch (267:8): [True: 0, False: 1.95k]
  ------------------
  268|       |
  269|      0|#ifndef CURL_DISABLE_PROXY
  270|      0|      if(CF_CONN(cf)->bits.origin_is_proxy) {
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  |  Branch (270:10): [True: 0, False: 0]
  ------------------
  271|      0|        result = Curl_cf_ssl_proxy_insert_after(cf, data, CF_CONN(cf)->origin);
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  272|      0|      }
  273|      0|      else
  274|      0|#endif
  275|      0|      {
  276|       |        /* FTP is a bitch. Wherever we really connect to on the DATA
  277|       |         * (secondary) connection, many servers require TLS sessions reuse
  278|       |         * to prove they are talking to the same client.
  279|       |         * For the TLS session lookup to work, we need to instantiate
  280|       |         * the SSL filter with the primary peers. See #22225 */
  281|      0|        result = Curl_ssl_cf_insert_after(cf, data,
  282|      0|          Curl_conn_get_origin(CF_CONN(cf)),
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  283|      0|          Curl_conn_get_destination(CF_CONN(cf)));
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  284|      0|      }
  285|      0|      if(result) {
  ------------------
  |  Branch (285:10): [True: 0, False: 0]
  ------------------
  286|      0|        CURL_TRC_CF(data, cf, "adding SSL filter for origin failed -> %d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  287|      0|                    (int)result);
  288|      0|        return result;
  289|      0|      }
  290|      0|      CURL_TRC_CF(data, cf, "added SSL filter for origin");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  291|      0|    }
  292|  3.33k|#endif /* USE_SSL */
  293|  3.33k|    ctx->state = CF_SETUP_CNNCT_SSL;
  294|  3.33k|  }
  295|  3.33k|  return result;
  296|  3.34k|}
cf-setup.c:cf_setup_add_protocol_filters:
  300|  1.95k|{
  301|  1.95k|  struct cf_setup_ctx *ctx = cf->ctx;
  302|  1.95k|  CURLcode result = CURLE_OK;
  303|       |
  304|  1.95k|  (void)data; /* not used in all builds */
  305|  1.95k|  if(ctx->state < CF_SETUP_CNNCT_PROTOCOL) {
  ------------------
  |  Branch (305:6): [True: 1.95k, False: 0]
  ------------------
  306|  1.95k|    if(CF_CONN(cf)->scheme->run->setup_filters) {
  ------------------
  |  |  260|  1.95k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  |  Branch (306:8): [True: 1.95k, False: 0]
  ------------------
  307|  1.95k|      result = CF_CONN(cf)->scheme->run->setup_filters(data, cf);
  ------------------
  |  |  260|  1.95k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  308|  1.95k|      if(result) {
  ------------------
  |  Branch (308:10): [True: 0, False: 1.95k]
  ------------------
  309|      0|        CURL_TRC_CF(data, cf, "adding protocol filters failed -> %d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  310|      0|                    (int)result);
  311|      0|        return result;
  312|      0|      }
  313|  1.95k|    }
  314|  1.95k|    ctx->state = CF_SETUP_CNNCT_PROTOCOL;
  315|  1.95k|  }
  316|  1.95k|  return result;
  317|  1.95k|}
cf-setup.c:cf_setup_create:
  444|  9.29k|{
  445|  9.29k|  struct Curl_cfilter *cf = NULL;
  446|  9.29k|  struct cf_setup_ctx *ctx;
  447|  9.29k|  CURLcode result = CURLE_OK;
  448|       |
  449|  9.29k|  (void)data;
  450|  9.29k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|  9.29k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  451|  9.29k|  if(!ctx) {
  ------------------
  |  Branch (451:6): [True: 4, False: 9.28k]
  ------------------
  452|      4|    result = CURLE_OUT_OF_MEMORY;
  453|      4|    goto out;
  454|      4|  }
  455|  9.28k|  ctx->state = CF_SETUP_INIT;
  456|  9.28k|  ctx->ssl_mode = ssl_mode;
  457|  9.28k|  ctx->transport = transport;
  458|       |
  459|  9.28k|  result = Curl_cf_create(&cf, &Curl_cft_setup, ctx);
  460|  9.28k|  if(result)
  ------------------
  |  Branch (460:6): [True: 2, False: 9.28k]
  ------------------
  461|      2|    goto out;
  462|  9.28k|  ctx = NULL;
  463|       |
  464|  9.29k|out:
  465|  9.29k|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (465:10): [True: 6, False: 9.28k]
  ------------------
  466|  9.29k|  if(ctx) {
  ------------------
  |  Branch (466:6): [True: 2, False: 9.29k]
  ------------------
  467|      2|    curlx_free(ctx);
  ------------------
  |  | 1503|      2|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  468|      2|  }
  469|  9.29k|  return result;
  470|  9.28k|}

sockaddr2string:
  101|  18.4k|{
  102|  18.4k|  CURLcode result;
  103|  18.4k|  struct sockaddr_in *si = NULL;
  104|  18.4k|#ifdef USE_IPV6
  105|  18.4k|  struct sockaddr_in6 *si6 = NULL;
  106|  18.4k|#endif
  107|  18.4k|#ifdef USE_UNIX_SOCKETS
  108|  18.4k|  struct sockaddr_un *su = NULL;
  109|       |#else
  110|       |  (void)salen;
  111|       |#endif
  112|       |
  113|  18.4k|  switch(sa->sa_family) {
  114|  11.1k|  case AF_INET:
  ------------------
  |  Branch (114:3): [True: 11.1k, False: 7.23k]
  ------------------
  115|  11.1k|    si = (struct sockaddr_in *)(void *)sa;
  116|  11.1k|    result = curlx_inet_ntop(sa->sa_family, &si->sin_addr, addr,
  117|  11.1k|                             MAX_IPADR_LEN);
  ------------------
  |  |   41|  11.1k|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  118|  11.1k|    if(!result) {
  ------------------
  |  Branch (118:8): [True: 11.1k, False: 0]
  ------------------
  119|  11.1k|      *port = ntohs(si->sin_port);
  120|  11.1k|      return result;
  121|  11.1k|    }
  122|      0|    break;
  123|      0|#ifdef USE_IPV6
  124|      6|  case AF_INET6:
  ------------------
  |  Branch (124:3): [True: 6, False: 18.4k]
  ------------------
  125|      6|    si6 = (struct sockaddr_in6 *)(void *)sa;
  126|      6|    result = curlx_inet_ntop(sa->sa_family, &si6->sin6_addr, addr,
  127|      6|                             MAX_IPADR_LEN);
  ------------------
  |  |   41|      6|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  128|      6|    if(!result) {
  ------------------
  |  Branch (128:8): [True: 6, False: 0]
  ------------------
  129|      6|      *port = ntohs(si6->sin6_port);
  130|      6|      return result;
  131|      6|    }
  132|      0|    break;
  133|      0|#endif
  134|      0|#ifdef USE_UNIX_SOCKETS
  135|  7.23k|  case AF_UNIX:
  ------------------
  |  Branch (135:3): [True: 7.23k, False: 11.1k]
  ------------------
  136|  7.23k|    if(salen > (curl_socklen_t)sizeof(CURL_SA_FAMILY_T)) {
  ------------------
  |  Branch (136:8): [True: 0, False: 7.23k]
  ------------------
  137|      0|      su = (struct sockaddr_un *)sa;
  138|      0|      curl_msnprintf(addr, MAX_IPADR_LEN, "%s", su->sun_path);
  ------------------
  |  |   41|      0|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  139|      0|    }
  140|  7.23k|    else
  141|  7.23k|      addr[0] = 0; /* socket with no name */
  142|  7.23k|    *port = 0;
  143|  7.23k|    return CURLE_OK;
  144|      0|#endif
  145|      0|  default:
  ------------------
  |  Branch (145:3): [True: 0, False: 18.4k]
  ------------------
  146|      0|    result = CURLE_UNSUPPORTED_PROTOCOL;
  147|      0|    break;
  148|  18.4k|  }
  149|       |
  150|      0|  addr[0] = '\0';
  151|      0|  *port = 0;
  152|      0|  return result;
  153|  18.4k|}
Curl_socket_addr_from_ai:
  358|  9.22k|{
  359|       |  /*
  360|       |   * The Curl_sockaddr_ex structure is libcurl's external API
  361|       |   * curl_sockaddr structure with enough space available to directly hold
  362|       |   * any protocol-specific address structures. The variable declared here
  363|       |   * will be used to pass / receive data to/from the fopensocket callback
  364|       |   * if this has been set, before that, it is initialized from parameters.
  365|       |   */
  366|  9.22k|  addr->family = ai->ai_family;
  367|  9.22k|  addr->socktype = Curl_socktype_for_transport(transport);
  368|  9.22k|  addr->protocol = Curl_protocol_for_transport(transport);
  369|  9.22k|  addr->addrlen = (unsigned int)ai->ai_addrlen;
  370|       |
  371|  9.22k|  DEBUGASSERT(addr->addrlen <= sizeof(addr->curl_sa_addrbuf));
  ------------------
  |  | 1016|  9.22k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (371:3): [True: 0, False: 9.22k]
  |  Branch (371:3): [True: 9.22k, False: 0]
  ------------------
  372|  9.22k|  if(addr->addrlen > sizeof(addr->curl_sa_addrbuf))
  ------------------
  |  |   37|  9.22k|#define curl_sa_addrbuf addr.buf
  ------------------
  |  Branch (372:6): [True: 0, False: 9.22k]
  ------------------
  373|      0|    return CURLE_TOO_LARGE;
  374|       |
  375|  9.22k|  memcpy(&addr->curl_sa_addrbuf, ai->ai_addr, addr->addrlen);
  ------------------
  |  |   37|  9.22k|#define curl_sa_addrbuf addr.buf
  ------------------
  376|  9.22k|  return CURLE_OK;
  377|  9.22k|}
Curl_cf_tcp_create:
 1934|  7.22k|{
 1935|  7.22k|  struct cf_socket_ctx *ctx = NULL;
 1936|  7.22k|  struct Curl_cfilter *cf = NULL;
 1937|  7.22k|  CURLcode result;
 1938|       |
 1939|  7.22k|  (void)data;
 1940|  7.22k|  (void)origin;
 1941|  7.22k|  (void)tunnel_peer;
 1942|  7.22k|  (void)tunnel_transport;
 1943|  7.22k|  DEBUGASSERT(transport_peer == TRNSPRT_TCP);
  ------------------
  |  | 1016|  7.22k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1943:3): [True: 0, False: 7.22k]
  |  Branch (1943:3): [True: 7.22k, False: 0]
  ------------------
 1944|  7.22k|  if(!addr) {
  ------------------
  |  Branch (1944:6): [True: 0, False: 7.22k]
  ------------------
 1945|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
 1946|      0|    goto out;
 1947|      0|  }
 1948|       |
 1949|  7.22k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|  7.22k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1950|  7.22k|  if(!ctx) {
  ------------------
  |  Branch (1950:6): [True: 3, False: 7.22k]
  ------------------
 1951|      3|    result = CURLE_OUT_OF_MEMORY;
 1952|      3|    goto out;
 1953|      3|  }
 1954|       |
 1955|  7.22k|  result = cf_socket_ctx_init(ctx, peer, addr, transport_peer);
 1956|  7.22k|  if(result)
  ------------------
  |  Branch (1956:6): [True: 0, False: 7.22k]
  ------------------
 1957|      0|    goto out;
 1958|       |
 1959|  7.22k|  result = Curl_cf_create(&chain->cf, &Curl_cft_tcp, ctx);
 1960|  7.22k|  if(!result)
  ------------------
  |  Branch (1960:6): [True: 7.22k, False: 1]
  ------------------
 1961|  7.22k|    chain->cf->chain = chain;
 1962|       |
 1963|  7.22k|out:
 1964|  7.22k|  if(result) {
  ------------------
  |  Branch (1964:6): [True: 4, False: 7.22k]
  ------------------
 1965|      4|    curlx_safefree(cf);
  ------------------
  |  | 1359|      4|  do {                      \
  |  | 1360|      4|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      4|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      4|    (ptr) = NULL;           \
  |  | 1362|      4|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1966|      4|    cf_socket_ctx_free(ctx);
 1967|      4|  }
 1968|       |
 1969|  7.22k|  return result;
 1970|  7.22k|}
Curl_cf_udp_create:
 2149|  1.99k|{
 2150|  1.99k|  struct cf_socket_ctx *ctx = NULL;
 2151|  1.99k|  struct Curl_cfilter *cf = NULL;
 2152|  1.99k|  CURLcode result;
 2153|       |
 2154|  1.99k|  (void)data;
 2155|  1.99k|  (void)origin;
 2156|  1.99k|  (void)tunnel_peer;
 2157|  1.99k|  (void)tunnel_transport;
 2158|  1.99k|  DEBUGASSERT(transport_peer == TRNSPRT_UDP || transport_peer == TRNSPRT_QUIC);
  ------------------
  |  | 1016|  1.99k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2158:3): [True: 1.99k, False: 0]
  |  Branch (2158:3): [True: 0, False: 0]
  |  Branch (2158:3): [True: 0, False: 1.99k]
  |  Branch (2158:3): [True: 1.99k, False: 0]
  ------------------
 2159|  1.99k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|  1.99k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 2160|  1.99k|  if(!ctx) {
  ------------------
  |  Branch (2160:6): [True: 0, False: 1.99k]
  ------------------
 2161|      0|    result = CURLE_OUT_OF_MEMORY;
 2162|      0|    goto out;
 2163|      0|  }
 2164|       |
 2165|  1.99k|  result = cf_socket_ctx_init(ctx, peer, addr, transport_peer);
 2166|  1.99k|  if(result)
  ------------------
  |  Branch (2166:6): [True: 0, False: 1.99k]
  ------------------
 2167|      0|    goto out;
 2168|       |
 2169|  1.99k|  result = Curl_cf_create(&cf, &Curl_cft_udp, ctx);
 2170|       |
 2171|  1.99k|out:
 2172|  1.99k|  Curl_cfchain_add(chain, cf);
 2173|  1.99k|  if(result) {
  ------------------
  |  Branch (2173:6): [True: 0, False: 1.99k]
  ------------------
 2174|      0|    curlx_safefree(cf);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2175|      0|    cf_socket_ctx_free(ctx);
 2176|      0|  }
 2177|       |
 2178|  1.99k|  return result;
 2179|  1.99k|}
Curl_cf_socket_peek:
 2503|  3.36k|{
 2504|  3.36k|  (void)data;
 2505|  3.36k|  if(cf_is_socket(cf) && cf->ctx) {
  ------------------
  |  Branch (2505:6): [True: 1.98k, False: 1.37k]
  |  Branch (2505:26): [True: 1.98k, False: 0]
  ------------------
 2506|  1.98k|    struct cf_socket_ctx *ctx = cf->ctx;
 2507|       |
 2508|  1.98k|    if(psock)
  ------------------
  |  Branch (2508:8): [True: 1.97k, False: 14]
  ------------------
 2509|  1.97k|      *psock = ctx->sock;
 2510|  1.98k|    if(paddr)
  ------------------
  |  Branch (2510:8): [True: 1.97k, False: 14]
  ------------------
 2511|  1.97k|      *paddr = &ctx->addr;
 2512|  1.98k|    if(pip)
  ------------------
  |  Branch (2512:8): [True: 14, False: 1.97k]
  ------------------
 2513|     14|      *pip = ctx->ip;
 2514|  1.98k|    return CURLE_OK;
 2515|  1.98k|  }
 2516|  1.37k|  return CURLE_FAILED_INIT;
 2517|  3.36k|}
cf-socket.c:socket_open:
  434|  9.20k|{
  435|  9.20k|  char errbuf[STRERROR_LEN];
  436|       |
  437|  9.20k|#ifdef SOCK_CLOEXEC
  438|  9.20k|  addr->socktype |= SOCK_CLOEXEC;
  439|  9.20k|#endif
  440|       |
  441|  9.20k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.20k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (441:3): [True: 0, False: 9.20k]
  |  Branch (441:3): [True: 9.20k, False: 0]
  ------------------
  442|  9.20k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  9.20k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (442:3): [True: 0, False: 9.20k]
  |  Branch (442:3): [True: 9.20k, False: 0]
  ------------------
  443|  9.20k|  if(data->set.fopensocket) {
  ------------------
  |  Branch (443:6): [True: 9.20k, False: 0]
  ------------------
  444|       |    /*
  445|       |     * If the opensocket callback is set, all the destination address
  446|       |     * information is passed to the callback. Depending on this information the
  447|       |     * callback may opt to abort the connection, this is indicated returning
  448|       |     * CURL_SOCKET_BAD; otherwise it will return a not-connected socket. When
  449|       |     * the callback returns a valid socket the destination address information
  450|       |     * might have been changed and this 'new' address will actually be used
  451|       |     * here to connect.
  452|       |     */
  453|  9.20k|    struct Curl_mapi_guard guard;
  454|  9.20k|    CURL_CBAPI_START(&guard, data, easy_fopensocket);
  ------------------
  |  |  201|  9.20k|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
  455|  9.20k|    *sockfd = data->set.fopensocket(data->set.opensocket_client,
  456|  9.20k|                                    CURLSOCKTYPE_IPCXN,
  457|  9.20k|                                    (struct curl_sockaddr *)addr);
  458|  9.20k|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|  9.20k|  Curl_cbapi_leave(g)
  ------------------
  459|  9.20k|  }
  460|      0|  else {
  461|       |    /* opensocket callback not set, so create the socket now */
  462|      0|#ifdef DEBUGBUILD
  463|      0|    if((addr->family == AF_INET6) && getenv("CURL_DBG_SOCK_FAIL_IPV6")) {
  ------------------
  |  Branch (463:8): [True: 0, False: 0]
  |  Branch (463:38): [True: 0, False: 0]
  ------------------
  464|      0|      failf(data, "CURL_DBG_SOCK_FAIL_IPV6: failed to open socket");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  465|      0|      return CURLE_COULDNT_CONNECT;
  466|      0|    }
  467|      0|#endif
  468|      0|    *sockfd = CURL_SOCKET(addr->family, addr->socktype, addr->protocol);
  ------------------
  |  | 1456|      0|  curl_dbg_socket((int)(domain), type, protocol, __LINE__, __FILE__)
  ------------------
  469|      0|    if((*sockfd == CURL_SOCKET_BAD) && (SOCKERRNO == SOCKENOMEM))
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
                  if((*sockfd == CURL_SOCKET_BAD) && (SOCKERRNO == SOCKENOMEM))
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
                  if((*sockfd == CURL_SOCKET_BAD) && (SOCKERRNO == SOCKENOMEM))
  ------------------
  |  | 1143|      0|#define SOCKENOMEM        ENOMEM
  ------------------
  |  Branch (469:8): [True: 0, False: 0]
  |  Branch (469:40): [True: 0, False: 0]
  ------------------
  470|      0|      return CURLE_OUT_OF_MEMORY;
  471|      0|  }
  472|       |
  473|  9.20k|  if(*sockfd == CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  9.20k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (473:6): [True: 0, False: 9.20k]
  ------------------
  474|       |    /* no socket, no connection */
  475|      0|    failf(data, "failed to open socket: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  476|      0|          curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf)));
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
  477|      0|    return CURLE_COULDNT_CONNECT;
  478|      0|  }
  479|       |
  480|       |#ifdef USE_SO_NOSIGPIPE
  481|       |  if(Curl_sock_nosigpipe(*sockfd) < 0) {
  482|       |    failf(data, "setsockopt enable SO_NOSIGPIPE: %s",
  483|       |          curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf)));
  484|       |    sclose(*sockfd);
  485|       |    *sockfd = CURL_SOCKET_BAD;
  486|       |    return CURLE_COULDNT_CONNECT;
  487|       |  }
  488|       |#endif /* USE_SO_NOSIGPIPE */
  489|       |
  490|       |#if defined(HAVE_FCNTL) && !defined(SOCK_CLOEXEC)
  491|       |  if(fcntl(*sockfd, F_SETFD, FD_CLOEXEC) < 0) {
  492|       |    failf(data, "fcntl set CLOEXEC: %s",
  493|       |          curlx_strerror(SOCKERRNO, errbuf, sizeof(errbuf)));
  494|       |    sclose(*sockfd);
  495|       |    *sockfd = CURL_SOCKET_BAD;
  496|       |    return CURLE_COULDNT_CONNECT;
  497|       |  }
  498|       |#endif
  499|       |
  500|  9.20k|#if defined(USE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
  501|  9.20k|  if(addr->family == AF_INET6) {
  ------------------
  |  Branch (501:6): [True: 6, False: 9.19k]
  ------------------
  502|      6|    struct sockaddr_in6 * const sa6 = (void *)&addr->curl_sa_addr;
  ------------------
  |  |   36|      6|#define curl_sa_addr    addr.sa
  ------------------
  503|      6|    sa6->sin6_scope_id = get_scope_id(data, sa6);
  504|      6|  }
  505|  9.20k|#endif
  506|  9.20k|  return CURLE_OK;
  507|  9.20k|}
cf-socket.c:get_scope_id:
  391|      6|{
  392|      6|  uint32_t scope_id = 0;
  393|      6|  if(data->conn->scope_id)
  ------------------
  |  Branch (393:6): [True: 0, False: 6]
  ------------------
  394|      0|    return data->conn->scope_id;
  395|       |  /* NOLINTNEXTLINE(clang-analyzer-core.uninitialized.Assign) */
  396|      6|  scope_id = sa6->sin6_scope_id;
  397|      6|  if(!scope_id && IN6_IS_ADDR_LINKLOCAL(&sa6->sin6_addr)) {
  ------------------
  |  Branch (397:6): [True: 6, False: 0]
  |  Branch (397:19): [True: 0, False: 6]
  ------------------
  398|       |    /* The resolver did not set scope_id for this link-local address.
  399|       |     * Try to determine it from the system's network interfaces.
  400|       |     * Without a scope_id, connect() to a link-local address fails
  401|       |     * with EINVAL on Linux.
  402|       |     * NOTE: On multi-homed hosts with several interfaces having
  403|       |     * link-local addresses, this picks the first one found, which
  404|       |     * may not be the correct outgoing interface. */
  405|      0|#if defined(HAVE_GETIFADDRS) && defined(HAVE_NET_IF_H)
  406|      0|    struct ifaddrs *ifa, *ifa_list;
  407|      0|    if(getifaddrs(&ifa_list) == 0) {
  ------------------
  |  Branch (407:8): [True: 0, False: 0]
  ------------------
  408|      0|      for(ifa = ifa_list; ifa; ifa = ifa->ifa_next) {
  ------------------
  |  Branch (408:27): [True: 0, False: 0]
  ------------------
  409|      0|        if(ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET6 &&
  ------------------
  |  Branch (409:12): [True: 0, False: 0]
  |  Branch (409:29): [True: 0, False: 0]
  ------------------
  410|      0|           (ifa->ifa_flags & IFF_UP) &&
  ------------------
  |  Branch (410:12): [True: 0, False: 0]
  ------------------
  411|      0|           !(ifa->ifa_flags & IFF_LOOPBACK)) {
  ------------------
  |  Branch (411:12): [True: 0, False: 0]
  ------------------
  412|      0|          struct sockaddr_in6 *s6 = (void *)ifa->ifa_addr;
  413|      0|          if(IN6_IS_ADDR_LINKLOCAL(&s6->sin6_addr) && s6->sin6_scope_id) {
  ------------------
  |  Branch (413:14): [True: 0, False: 0]
  |  Branch (413:55): [True: 0, False: 0]
  ------------------
  414|      0|            scope_id = s6->sin6_scope_id;
  415|      0|            infof(data,
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  416|      0|                  "determined scope_id=%lu for link-local address "
  417|      0|                  "from local interface",
  418|      0|                  (unsigned long)scope_id);
  419|      0|            break;
  420|      0|          }
  421|      0|        }
  422|      0|      }
  423|      0|      freeifaddrs(ifa_list);
  424|      0|    }
  425|      0|#endif /* HAVE_GETIFADDRS && HAVE_NET_IF_H */
  426|      0|  }
  427|      6|  return scope_id;
  428|      6|}
cf-socket.c:socket_close:
  540|  9.20k|{
  541|  9.20k|  if(sock == CURL_SOCKET_BAD)
  ------------------
  |  |  147|  9.20k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (541:6): [True: 0, False: 9.20k]
  ------------------
  542|      0|    return 0;
  543|       |
  544|  9.20k|  if(use_callback && conn && conn->fclosesocket) {
  ------------------
  |  Branch (544:6): [True: 9.20k, False: 0]
  |  Branch (544:22): [True: 9.20k, False: 0]
  |  Branch (544:30): [True: 0, False: 9.20k]
  ------------------
  545|      0|    struct Curl_mapi_guard guard;
  546|      0|    int rc;
  547|      0|    Curl_multi_will_close(data, sock);
  548|      0|    CURL_CBAPI_START(&guard, data, easy_closesocket);
  ------------------
  |  |  201|      0|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
  549|      0|    rc = conn->fclosesocket(conn->closesocket_client, sock);
  550|      0|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|      0|  Curl_cbapi_leave(g)
  ------------------
  551|      0|    return rc;
  552|      0|  }
  553|       |
  554|  9.20k|  if(conn)
  ------------------
  |  Branch (554:6): [True: 9.20k, False: 0]
  ------------------
  555|       |    /* tell the multi-socket code about this */
  556|  9.20k|    Curl_multi_will_close(data, sock);
  557|       |
  558|  9.20k|  sclose(sock);
  ------------------
  |  | 1448|  9.20k|#define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__)
  ------------------
  559|       |
  560|  9.20k|  return 0;
  561|  9.20k|}
cf-socket.c:cf_socket_destroy:
 1126|  9.21k|{
 1127|  9.21k|  struct cf_socket_ctx *ctx = cf->ctx;
 1128|       |
 1129|  9.21k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  9.21k|  do {                                          \
  |  |  154|  9.21k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.21k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.21k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 4, False: 9.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      4|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.21k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      4|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 4, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 1, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.21k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.21k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.21k]
  |  |  ------------------
  ------------------
 1130|  9.21k|  if(ctx) {
  ------------------
  |  Branch (1130:6): [True: 9.21k, False: 0]
  ------------------
 1131|  9.21k|    if(ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  9.21k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1131:8): [True: 9.20k, False: 10]
  ------------------
 1132|  9.20k|      CURL_TRC_CF(data, cf, "cf_socket_close, fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|  9.20k|  do {                                          \
  |  |  154|  9.20k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.20k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.20k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 2, False: 9.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.20k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      2|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.20k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.20k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.20k]
  |  |  ------------------
  ------------------
 1133|  9.20k|      if(ctx->sock == cf->chain->sock)
  ------------------
  |  Branch (1133:10): [True: 9.20k, False: 0]
  ------------------
 1134|  9.20k|        cf->chain->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  9.20k|#define CURL_SOCKET_BAD (-1)
  ------------------
 1135|  9.20k|      socket_close(data, CF_CONN(cf), !ctx->accepted, ctx->sock);
  ------------------
  |  |  260|  9.20k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
 1136|  9.20k|    }
 1137|  9.21k|    cf_socket_ctx_free(ctx);
 1138|  9.21k|  }
 1139|  9.21k|}
cf-socket.c:cf_tcp_connect:
 1482|  7.22k|{
 1483|  7.22k|  struct cf_socket_ctx *ctx = cf->ctx;
 1484|  7.22k|  CURLcode result = CURLE_COULDNT_CONNECT;
 1485|  7.22k|  int rc = 0;
 1486|       |
 1487|  7.22k|  if(cf->connected) {
  ------------------
  |  Branch (1487:6): [True: 0, False: 7.22k]
  ------------------
 1488|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1489|      0|    return CURLE_OK;
 1490|      0|  }
 1491|       |
 1492|  7.22k|  *done = FALSE; /* a negative world view is best */
  ------------------
  |  |  989|  7.22k|#define FALSE false
  ------------------
 1493|  7.22k|  if(ctx->sock == CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  7.22k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1493:6): [True: 7.22k, False: 0]
  ------------------
 1494|  7.22k|    int sockerr;
 1495|       |
 1496|  7.22k|    result = cf_socket_open(cf, data);
 1497|  7.22k|    if(result)
  ------------------
  |  Branch (1497:8): [True: 0, False: 7.22k]
  ------------------
 1498|      0|      goto out;
 1499|       |
 1500|  7.22k|    if(cf->connected) {
  ------------------
  |  Branch (1500:8): [True: 7.22k, False: 0]
  ------------------
 1501|  7.22k|      *done = TRUE;
  ------------------
  |  |  986|  7.22k|#define TRUE true
  ------------------
 1502|  7.22k|      return CURLE_OK;
 1503|  7.22k|    }
 1504|       |
 1505|       |    /* Connect TCP socket */
 1506|      0|    rc = do_connect(cf, data, (bool)CF_CONN(cf)->bits.tcp_fastopen);
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
 1507|      0|    sockerr = SOCKERRNO;
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
 1508|      0|    set_local_ip(cf, data);
 1509|      0|    CURL_TRC_CF(data, cf, "local address %s port %d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1510|      0|                ctx->ip.local_ip, ctx->ip.local_port);
 1511|      0|#ifdef DEBUGBUILD
 1512|      0|    if(ctx->connect_wait_ms > 0) {
  ------------------
  |  Branch (1512:8): [True: 0, False: 0]
  ------------------
 1513|      0|      CURL_TRC_CF(data, cf, "debug connect wait %d ms", ctx->connect_wait_ms);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1514|      0|      curlx_wait_ms(ctx->connect_wait_ms);
 1515|      0|    }
 1516|      0|#endif
 1517|      0|    if(rc == -1) {
  ------------------
  |  Branch (1517:8): [True: 0, False: 0]
  ------------------
 1518|      0|      ctx->sockerr = sockerr;
 1519|      0|      result = socket_connect_result(data, ctx->ip.remote_ip, sockerr);
 1520|      0|      goto out;
 1521|      0|    }
 1522|      0|  }
 1523|       |
 1524|       |#ifdef mpeix
 1525|       |  /* Call this function once now, and ignore the results. We do this to
 1526|       |     "clear" the error state on the socket so that we can later read it
 1527|       |     reliably. This is reported necessary on the MPE/iX operating
 1528|       |     system. */
 1529|       |  (void)verifyconnect(ctx->sock, NULL);
 1530|       |#endif
 1531|       |  /* check socket for connect */
 1532|      0|  rc = SOCKET_WRITABLE(ctx->sock, 0);
  ------------------
  |  |   71|      0|#define SOCKET_WRITABLE(x, z)  Curl_socket_check(CURL_SOCKET_BAD, x, z)
  |  |  ------------------
  |  |  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  |  |  ------------------
  ------------------
 1533|       |
 1534|      0|  if(rc == 0) { /* no connection yet */
  ------------------
  |  Branch (1534:6): [True: 0, False: 0]
  ------------------
 1535|      0|    CURL_TRC_CF(data, cf, "not connected yet on fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1536|      0|    return CURLE_OK;
 1537|      0|  }
 1538|      0|  else if(rc == CURL_CSELECT_OUT ||
  ------------------
  |  |  291|      0|#define CURL_CSELECT_OUT  0x02
  ------------------
  |  Branch (1538:11): [True: 0, False: 0]
  ------------------
 1539|       |#ifdef __APPLE__
 1540|       |          /* macOS reports select errors when the peer already
 1541|       |           * sent us data and closed the connection normally. Do
 1542|       |           * not treat that as error. See #23482 and #23445 */
 1543|       |          (rc > 0 && (rc & CURL_CSELECT_ERR)) ||
 1544|       |#endif
 1545|      0|          CF_CONN(cf)->bits.tcp_fastopen) {
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  |  Branch (1545:11): [True: 0, False: 0]
  ------------------
 1546|      0|    if(verifyconnect(ctx->sock, &ctx->sockerr)) {
  ------------------
  |  Branch (1546:8): [True: 0, False: 0]
  ------------------
 1547|       |      /* we are connected with TCP, awesome! */
 1548|      0|      ctx->connected_at = *Curl_pgrs_now(data);
 1549|      0|      set_local_ip(cf, data);
 1550|      0|      *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1551|      0|      cf->connected = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1552|      0|      CURL_TRC_CF(data, cf, "connected on fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1553|      0|      return CURLE_OK;
 1554|      0|    }
 1555|      0|    result = CURLE_COULDNT_CONNECT;
 1556|      0|  }
 1557|      0|  else if(rc & CURL_CSELECT_ERR) {
  ------------------
  |  |  292|      0|#define CURL_CSELECT_ERR  0x04
  ------------------
  |  Branch (1557:11): [True: 0, False: 0]
  ------------------
 1558|      0|    CURL_TRC_CF(data, cf, "poll/select error on fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1559|      0|    (void)verifyconnect(ctx->sock, &ctx->sockerr);
 1560|      0|    result = CURLE_COULDNT_CONNECT;
 1561|      0|  }
 1562|       |
 1563|      0|out:
 1564|      0|  if(result) {
  ------------------
  |  Branch (1564:6): [True: 0, False: 0]
  ------------------
 1565|      0|    VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  ------------------
 1566|      0|    set_local_ip(cf, data);
 1567|      0|    if(ctx->sockerr) {
  ------------------
  |  Branch (1567:8): [True: 0, False: 0]
  ------------------
 1568|      0|      data->state.os_errno = ctx->sockerr;
 1569|      0|      SET_SOCKERRNO(ctx->sockerr);
  ------------------
  |  | 1106|      0|#define SET_SOCKERRNO(x)  (errno = (x))
  ------------------
 1570|      0|      VERBOSE(curlx_strerror(ctx->sockerr, buffer, sizeof(buffer)));
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  ------------------
 1571|      0|    }
 1572|      0|    else {
 1573|      0|      VERBOSE(curlx_strcopy(buffer, sizeof(buffer), STRCONST("peer closed")));
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  ------------------
 1574|      0|    }
 1575|      0|    if(ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1575:8): [True: 0, False: 0]
  ------------------
 1576|      0|      socket_close(data, CF_CONN(cf), TRUE, ctx->sock);
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
                    socket_close(data, CF_CONN(cf), TRUE, ctx->sock);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1577|      0|      ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
 1578|      0|    }
 1579|      0|    infof(data, "connect to %s port %u from %s port %d failed: %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1580|      0|          ctx->ip.remote_ip, ctx->ip.remote_port,
 1581|      0|          ctx->ip.local_ip, ctx->ip.local_port,
 1582|      0|          curlx_strerror(ctx->sockerr, buffer, sizeof(buffer)));
 1583|       |    *done = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1584|      0|  }
 1585|      0|  return result;
 1586|      0|}
cf-socket.c:cf_socket_open:
 1259|  9.20k|{
 1260|  9.20k|  struct cf_socket_ctx *ctx = cf->ctx;
 1261|  9.20k|  int error = 0;
 1262|  9.20k|  bool isconnected = FALSE;
  ------------------
  |  |  989|  9.20k|#define FALSE false
  ------------------
 1263|  9.20k|  CURLcode result = CURLE_COULDNT_CONNECT;
 1264|  9.20k|  bool is_tcp;
 1265|       |
 1266|  9.20k|  DEBUGASSERT(ctx->sock == CURL_SOCKET_BAD);
  ------------------
  |  | 1016|  9.20k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1266:3): [True: 0, False: 9.20k]
  |  Branch (1266:3): [True: 9.20k, False: 0]
  ------------------
 1267|  9.20k|  ctx->started_at = *Curl_pgrs_now(data);
 1268|  9.20k|#ifdef CURL_USE_SOCK_NONBLOCK
 1269|       |  /* Do not tuck SOCK_NONBLOCK into socktype when opensocket callback is set
 1270|       |   * because we would not know how socktype is about to be used in the
 1271|       |   * callback, SOCK_NONBLOCK might get factored out before calling socket().
 1272|       |   */
 1273|  9.20k|  if(!data->set.fopensocket)
  ------------------
  |  Branch (1273:6): [True: 0, False: 9.20k]
  ------------------
 1274|      0|    ctx->addr.socktype |= SOCK_NONBLOCK;
 1275|  9.20k|#endif
 1276|  9.20k|  result = socket_open(data, &ctx->addr, &ctx->sock);
 1277|  9.20k|#ifdef CURL_USE_SOCK_NONBLOCK
 1278|       |  /* Restore the socktype after the socket is created. */
 1279|  9.20k|  if(!data->set.fopensocket)
  ------------------
  |  Branch (1279:6): [True: 0, False: 9.20k]
  ------------------
 1280|      0|    ctx->addr.socktype &= ~SOCK_NONBLOCK;
 1281|  9.20k|#endif
 1282|  9.20k|  if(result)
  ------------------
  |  Branch (1282:6): [True: 0, False: 9.20k]
  ------------------
 1283|      0|    goto out;
 1284|       |
 1285|  9.20k|  result = set_remote_ip(cf, data);
 1286|  9.20k|  if(result)
  ------------------
  |  Branch (1286:6): [True: 0, False: 9.20k]
  ------------------
 1287|      0|    goto out;
 1288|       |
 1289|  9.20k|#ifdef USE_IPV6
 1290|  9.20k|  if(ctx->addr.family == AF_INET6) {
  ------------------
  |  Branch (1290:6): [True: 6, False: 9.19k]
  ------------------
 1291|       |#ifdef USE_WINSOCK
 1292|       |    /* Turn on support for IPv4-mapped IPv6 addresses.
 1293|       |     * Linux kernel, NetBSD, FreeBSD, Darwin, lwIP: default is off;
 1294|       |     * Windows Vista and later: default is on;
 1295|       |     * DragonFly BSD: acts like off, and dummy setting;
 1296|       |     * OpenBSD and earlier Windows: unsupported.
 1297|       |     * Linux: controlled by /proc/sys/net/ipv6/bindv6only.
 1298|       |     */
 1299|       |    int on = 0;
 1300|       |    (void)setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_V6ONLY,
 1301|       |                     (void *)&on, sizeof(on));
 1302|       |#endif
 1303|      6|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
 1304|      6|    {
 1305|      6|      struct sockaddr_in6 *sa6 = (void *)&ctx->addr.curl_sa_addr;
  ------------------
  |  |   36|      6|#define curl_sa_addr    addr.sa
  ------------------
 1306|      6|      if(sa6->sin6_scope_id)
  ------------------
  |  Branch (1306:10): [True: 0, False: 6]
  ------------------
 1307|      0|        infof(data, "  Trying [%s]:%d scope_id=%lu...",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1308|      6|              ctx->ip.remote_ip, ctx->ip.remote_port,
 1309|      6|              (unsigned long)sa6->sin6_scope_id);
 1310|      6|      else
 1311|      6|#endif
 1312|      6|        infof(data, "  Trying [%s]:%d...",
  ------------------
  |  |  143|      6|  do {                               \
  |  |  144|      6|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      6|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 6, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 1, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  323|      6|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      1|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      6|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      6|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1313|      6|              ctx->ip.remote_ip, ctx->ip.remote_port);
 1314|      6|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
 1315|      6|    }
 1316|      6|#endif
 1317|      6|  }
 1318|  9.19k|  else
 1319|  9.19k|#endif
 1320|  9.19k|    infof(data, "  Trying %s:%d...", ctx->ip.remote_ip, ctx->ip.remote_port);
  ------------------
  |  |  143|  9.19k|  do {                               \
  |  |  144|  9.19k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  9.19k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 9.19k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 867, False: 8.33k]
  |  |  |  |  ------------------
  |  |  |  |  323|  9.19k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 867, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    867|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  9.19k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  9.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 9.19k]
  |  |  ------------------
  ------------------
 1321|       |
 1322|  9.20k|#ifdef USE_IPV6
 1323|  9.20k|  is_tcp = (ctx->addr.family == AF_INET ||
  ------------------
  |  Branch (1323:13): [True: 9.19k, False: 6]
  ------------------
 1324|      6|            ctx->addr.family == AF_INET6) &&
  ------------------
  |  Branch (1324:13): [True: 6, False: 0]
  ------------------
 1325|  9.20k|    cf_socktype(ctx->addr.socktype) == SOCK_STREAM;
  ------------------
  |  Branch (1325:5): [True: 7.22k, False: 1.98k]
  ------------------
 1326|       |#else
 1327|       |  is_tcp = (ctx->addr.family == AF_INET) &&
 1328|       |    cf_socktype(ctx->addr.socktype) == SOCK_STREAM;
 1329|       |#endif
 1330|  9.20k|  if(is_tcp) {
  ------------------
  |  Branch (1330:6): [True: 7.22k, False: 1.98k]
  ------------------
 1331|  7.22k|    if(data->set.tcp_nodelay)
  ------------------
  |  Branch (1331:8): [True: 7.22k, False: 0]
  ------------------
 1332|  7.22k|      tcpnodelay(cf, data, ctx->sock);
 1333|       |
 1334|  7.22k|    if(data->set.tcp_keepalive)
  ------------------
  |  Branch (1334:8): [True: 0, False: 7.22k]
  ------------------
 1335|      0|      tcpkeepalive(cf, data, ctx->sock);
 1336|       |
 1337|  7.22k|    tcplocalhost(cf, ctx->sock);
 1338|  7.22k|  }
 1339|       |
 1340|  9.20k|  if(data->set.fsockopt) {
  ------------------
  |  Branch (1340:6): [True: 9.20k, False: 0]
  ------------------
 1341|       |    /* activate callback for setting socket options */
 1342|  9.20k|    struct Curl_mapi_guard guard;
 1343|  9.20k|    CURL_CBAPI_START(&guard, data, easy_fsockopt);
  ------------------
  |  |  201|  9.20k|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
 1344|  9.20k|    error = data->set.fsockopt(data->set.sockopt_client,
 1345|  9.20k|                               ctx->sock,
 1346|  9.20k|                               CURLSOCKTYPE_IPCXN);
 1347|  9.20k|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|  9.20k|  Curl_cbapi_leave(g)
  ------------------
 1348|       |
 1349|  9.20k|    if(error == CURL_SOCKOPT_ALREADY_CONNECTED)
  ------------------
  |  |  423|  9.20k|#define CURL_SOCKOPT_ALREADY_CONNECTED 2
  ------------------
  |  Branch (1349:8): [True: 7.23k, False: 1.97k]
  ------------------
 1350|  7.23k|      isconnected = TRUE;
  ------------------
  |  |  986|  7.23k|#define TRUE true
  ------------------
 1351|  1.97k|    else if(error) {
  ------------------
  |  Branch (1351:13): [True: 0, False: 1.97k]
  ------------------
 1352|      0|      result = CURLE_ABORTED_BY_CALLBACK;
 1353|      0|      goto out;
 1354|      0|    }
 1355|  9.20k|  }
 1356|       |
 1357|  9.20k|#ifndef CURL_DISABLE_BINDLOCAL
 1358|       |  /* possibly bind the local end to an IP, interface or port */
 1359|  9.20k|  if(ctx->addr.family == AF_INET
  ------------------
  |  Branch (1359:6): [True: 9.19k, False: 6]
  ------------------
 1360|      6|#ifdef USE_IPV6
 1361|      6|     || ctx->addr.family == AF_INET6
  ------------------
  |  Branch (1361:9): [True: 6, False: 0]
  ------------------
 1362|  9.20k|#endif
 1363|  9.20k|    ) {
 1364|  9.20k|    result = bindlocal(data, CF_CONN(cf), ctx->sock, ctx->addr.family,
  ------------------
  |  |  260|  9.20k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
 1365|  9.20k|                       Curl_ipv6_scope(&ctx->addr.curl_sa_addr),
  ------------------
  |  |   36|  9.20k|#define curl_sa_addr    addr.sa
  ------------------
 1366|  9.20k|                       ctx->transport);
 1367|  9.20k|    if(result) {
  ------------------
  |  Branch (1367:8): [True: 0, False: 9.20k]
  ------------------
 1368|      0|      if(result == CURLE_UNSUPPORTED_PROTOCOL) {
  ------------------
  |  Branch (1368:10): [True: 0, False: 0]
  ------------------
 1369|       |        /* The address family is not supported on this interface.
 1370|       |           We can continue trying addresses */
 1371|      0|        result = CURLE_COULDNT_CONNECT;
 1372|      0|      }
 1373|      0|      goto out;
 1374|      0|    }
 1375|  9.20k|  }
 1376|  9.20k|#endif
 1377|       |
 1378|       |#ifndef CURL_USE_SOCK_NONBLOCK
 1379|       |  /* Set socket non-blocking, must be a non-blocking socket for
 1380|       |   * a non-blocking connect. */
 1381|       |  error = curlx_nonblock(ctx->sock, TRUE);
 1382|       |  if(error < 0) {
 1383|       |    result = CURLE_UNSUPPORTED_PROTOCOL;
 1384|       |    ctx->sockerr = SOCKERRNO;
 1385|       |    goto out;
 1386|       |  }
 1387|       |#else
 1388|  9.20k|  if(data->set.fopensocket) {
  ------------------
  |  Branch (1388:6): [True: 9.20k, False: 0]
  ------------------
 1389|       |    /* Set socket non-blocking, must be a non-blocking socket for
 1390|       |     * a non-blocking connect. */
 1391|  9.20k|    error = curlx_nonblock(ctx->sock, TRUE);
  ------------------
  |  |  986|  9.20k|#define TRUE true
  ------------------
 1392|  9.20k|    if(error < 0) {
  ------------------
  |  Branch (1392:8): [True: 0, False: 9.20k]
  ------------------
 1393|      0|      result = CURLE_UNSUPPORTED_PROTOCOL;
 1394|      0|      ctx->sockerr = SOCKERRNO;
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
 1395|      0|      goto out;
 1396|      0|    }
 1397|  9.20k|  }
 1398|  9.20k|#endif
 1399|  9.20k|  ctx->sock_connected = (cf_socktype(ctx->addr.socktype) != SOCK_DGRAM);
 1400|  9.20k|out:
 1401|  9.20k|  if(result) {
  ------------------
  |  Branch (1401:6): [True: 0, False: 9.20k]
  ------------------
 1402|      0|    if(ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1402:8): [True: 0, False: 0]
  ------------------
 1403|      0|      socket_close(data, CF_CONN(cf), TRUE, ctx->sock);
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
                    socket_close(data, CF_CONN(cf), TRUE, ctx->sock);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1404|      0|      ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
 1405|      0|    }
 1406|      0|  }
 1407|  9.20k|  else {
 1408|  9.20k|    cf->chain->sock = ctx->sock;
 1409|  9.20k|#ifdef USE_IPV6
 1410|  9.20k|    cf->chain->ipv6 = (ctx->addr.family == AF_INET6);
 1411|  9.20k|#endif
 1412|       |
 1413|  9.20k|    if(isconnected) {
  ------------------
  |  Branch (1413:8): [True: 7.23k, False: 1.97k]
  ------------------
 1414|  7.23k|      set_local_ip(cf, data);
 1415|  7.23k|      ctx->connected_at = *Curl_pgrs_now(data);
 1416|  7.23k|      cf->connected = TRUE;
  ------------------
  |  |  986|  7.23k|#define TRUE true
  ------------------
 1417|  7.23k|    }
 1418|  9.20k|  }
 1419|  9.20k|  CURL_TRC_CF(data, cf, "cf_socket_open() -> %d, fd=%" FMT_SOCKET_T,
  ------------------
  |  |  153|  9.20k|  do {                                          \
  |  |  154|  9.20k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.20k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.20k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 868, False: 8.33k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 868, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    868|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.20k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    868|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 868, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 193, False: 675]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.20k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.20k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.20k]
  |  |  ------------------
  ------------------
 1420|  9.20k|              (int)result, ctx->sock);
 1421|  9.20k|  return result;
 1422|  9.20k|}
cf-socket.c:set_remote_ip:
 1176|  9.20k|{
 1177|  9.20k|  struct cf_socket_ctx *ctx = cf->ctx;
 1178|  9.20k|  CURLcode result;
 1179|       |
 1180|       |  /* store remote address and port used in this connection attempt */
 1181|  9.20k|  ctx->ip.transport = ctx->transport;
 1182|  9.20k|  result = sockaddr2string(&ctx->addr.curl_sa_addr,
  ------------------
  |  |   36|  9.20k|#define curl_sa_addr    addr.sa
  ------------------
 1183|  9.20k|                           (curl_socklen_t)ctx->addr.addrlen,
 1184|  9.20k|                           ctx->ip.remote_ip, &ctx->ip.remote_port);
 1185|  9.20k|  if(result) {
  ------------------
  |  Branch (1185:6): [True: 0, False: 9.20k]
  ------------------
 1186|      0|    ctx->sockerr = SOCKEAFNOSUPPORT;
  ------------------
  |  | 1134|      0|#define SOCKEAFNOSUPPORT  EAFNOSUPPORT
  ------------------
 1187|       |    /* malformed address or bug in inet_ntop, try next address */
 1188|      0|    failf(data, "curl_sa_addr inet_ntop() failed with %d", (int)result);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1189|      0|    return CURLE_FAILED_INIT;
 1190|      0|  }
 1191|  9.20k|  return CURLE_OK;
 1192|  9.20k|}
cf-socket.c:cf_socktype:
 1197|  18.4k|{
 1198|  18.4k|#ifdef SOCK_CLOEXEC
 1199|  18.4k|  x &= ~SOCK_CLOEXEC;
 1200|  18.4k|#endif
 1201|  18.4k|#ifdef CURL_USE_SOCK_NONBLOCK
 1202|       |  x &= ~SOCK_NONBLOCK;
 1203|  18.4k|#endif
 1204|  18.4k|  return x;
 1205|  18.4k|}
cf-socket.c:tcpnodelay:
  158|  7.22k|{
  159|  7.22k|#if defined(TCP_NODELAY) && defined(CURL_TCP_NODELAY_SUPPORTED)
  160|  7.22k|  curl_socklen_t onoff = (curl_socklen_t)1;
  161|  7.22k|  int level = IPPROTO_TCP;
  162|  7.22k|  VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1637|  7.22k|#define VERBOSE(x) x
  ------------------
  163|       |
  164|  7.22k|  if(setsockopt(sockfd, level, TCP_NODELAY, (void *)&onoff, sizeof(onoff)) < 0)
  ------------------
  |  Branch (164:6): [True: 7.22k, False: 0]
  ------------------
  165|  7.22k|    CURL_TRC_CF(data, cf, "Could not set TCP_NODELAY: %s",
  ------------------
  |  |  153|  7.22k|  do {                                          \
  |  |  154|  7.22k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  7.22k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  14.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.22k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 719, False: 6.50k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 719, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    719|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.22k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    719|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 719, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 187, False: 532]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.22k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.22k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.22k]
  |  |  ------------------
  ------------------
  166|  7.22k|                curlx_strerror(SOCKERRNO, buffer, sizeof(buffer)));
  167|       |#else
  168|       |  (void)cf;
  169|       |  (void)data;
  170|       |  (void)sockfd;
  171|       |#endif
  172|  7.22k|}
cf-socket.c:bindlocal:
  677|  9.20k|{
  678|  9.20k|  struct Curl_sockaddr_storage sa;
  679|  9.20k|  struct sockaddr *sock = (struct sockaddr *)&sa;  /* bind to this address */
  680|  9.20k|  curl_socklen_t sizeof_sa = 0; /* size of the data sock points to */
  681|  9.20k|  struct sockaddr_in *si4 = (struct sockaddr_in *)&sa;
  682|  9.20k|#ifdef USE_IPV6
  683|  9.20k|  struct sockaddr_in6 *si6 = (struct sockaddr_in6 *)&sa;
  684|  9.20k|#endif
  685|  9.20k|  struct Curl_dns_entry *h = NULL;
  686|  9.20k|  unsigned short port = data->set.localport; /* use this port number, 0 for
  687|       |                                                "random" */
  688|       |  /* how many port numbers to try to bind to, increasing one at a time */
  689|  9.20k|  int portnum = data->set.localportrange;
  690|  9.20k|  char *dev_in = NULL, *iface_in = NULL, *host_in = NULL;
  691|  9.20k|  const char *iface = NULL, *host = NULL;
  692|  9.20k|  int sockerr;
  693|  9.20k|#ifdef IP_BIND_ADDRESS_NO_PORT
  694|  9.20k|  int on = 1;
  695|  9.20k|#endif
  696|  9.20k|  CURLcode result = CURLE_OK;
  697|       |
  698|       |#ifndef USE_IPV6
  699|       |  (void)scope;
  700|       |#endif
  701|  9.20k|  if(conn->interface_opts) {
  ------------------
  |  Branch (701:6): [True: 0, False: 9.20k]
  ------------------
  702|       |    /*************************************************************
  703|       |     * Select device to bind socket to
  704|       |     *************************************************************/
  705|      0|    result = Curl_parse_interface(conn->interface_opts,
  706|      0|                                  &dev_in, &iface_in, &host_in);
  707|      0|    if(result)
  ------------------
  |  Branch (707:8): [True: 0, False: 0]
  ------------------
  708|      0|      goto out;
  709|       |    /* This is how we use the values */
  710|      0|    iface = iface_in ? iface_in : dev_in;
  ------------------
  |  Branch (710:13): [True: 0, False: 0]
  ------------------
  711|      0|    host = host_in ? host_in : dev_in;
  ------------------
  |  Branch (711:12): [True: 0, False: 0]
  ------------------
  712|      0|  }
  713|       |
  714|  9.20k|  if(!iface && !host && !port)
  ------------------
  |  Branch (714:6): [True: 9.20k, False: 0]
  |  Branch (714:16): [True: 9.20k, False: 0]
  |  Branch (714:25): [True: 9.20k, False: 0]
  ------------------
  715|  9.20k|    goto out;
  716|       |
  717|      0|  if(iface && (strlen(iface) >= 255)) {
  ------------------
  |  Branch (717:6): [True: 0, False: 0]
  |  Branch (717:15): [True: 0, False: 0]
  ------------------
  718|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  719|      0|    goto out;
  720|      0|  }
  721|      0|  memset(&sa, 0, sizeof(struct Curl_sockaddr_storage));
  722|       |
  723|      0|  if(iface || host) {
  ------------------
  |  Branch (723:6): [True: 0, False: 0]
  |  Branch (723:15): [True: 0, False: 0]
  ------------------
  724|      0|    char myhost[256] = "";
  725|      0|    int done = 0; /* -1 for error, 1 for address found */
  726|      0|    if2ip_result_t if2ip_result = IF2IP_NOT_FOUND;
  727|       |
  728|      0|#ifdef SO_BINDTODEVICE
  729|       |    /*
  730|       |     * This binds the local socket to a particular interface. This will
  731|       |     * force even requests to other local interfaces to go out the external
  732|       |     * interface. Only bind to the interface when specified as interface,
  733|       |     * not as a hostname or ip address.
  734|       |     *
  735|       |     * The interface might be a VRF, eg: vrf-blue, which means it cannot be
  736|       |     * converted to an IP address and would fail Curl_if2ip. Try to
  737|       |     * use it straight away.
  738|       |     */
  739|      0|    if(iface &&
  ------------------
  |  Branch (739:8): [True: 0, False: 0]
  ------------------
  740|      0|       setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
  ------------------
  |  Branch (740:8): [True: 0, False: 0]
  ------------------
  741|      0|                  iface, (curl_socklen_t)strlen(iface) + 1) == 0 &&
  742|       |       /* This is often "errno 1, error: Operation not permitted" if you are
  743|       |        * not running as root or another suitable privileged user. If it
  744|       |        * succeeds it means the parameter was a valid interface and not an IP
  745|       |        * address. Return immediately.
  746|       |        */
  747|      0|       !host_in) {
  ------------------
  |  Branch (747:8): [True: 0, False: 0]
  ------------------
  748|      0|      infof(data, "socket successfully bound to interface '%s'", iface);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  749|      0|      result = CURLE_OK;
  750|      0|      goto out;
  751|      0|    }
  752|      0|#endif
  753|      0|    if(!host_in) {
  ------------------
  |  Branch (753:8): [True: 0, False: 0]
  ------------------
  754|       |      /* Discover IP from input device, then bind to it */
  755|      0|      if2ip_result = Curl_if2ip(af,
  756|      0|#ifdef USE_IPV6
  757|      0|                                scope, conn->scope_id,
  758|      0|#endif
  759|      0|                                iface, myhost, sizeof(myhost));
  760|      0|    }
  761|      0|    switch(if2ip_result) {
  ------------------
  |  Branch (761:12): [True: 0, False: 0]
  ------------------
  762|      0|    case IF2IP_NOT_FOUND:
  ------------------
  |  Branch (762:5): [True: 0, False: 0]
  ------------------
  763|      0|      if(iface_in && !host_in) {
  ------------------
  |  Branch (763:10): [True: 0, False: 0]
  |  Branch (763:22): [True: 0, False: 0]
  ------------------
  764|       |        /* Do not fall back to treating it as a hostname */
  765|      0|        char buffer[STRERROR_LEN];
  766|      0|        data->state.os_errno = sockerr = SOCKERRNO;
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
  767|      0|        failf(data, "Could not bind to interface '%s' with errno %d: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  768|      0|              iface, sockerr, curlx_strerror(sockerr, buffer, sizeof(buffer)));
  769|      0|        result = CURLE_INTERFACE_FAILED;
  770|      0|        goto out;
  771|      0|      }
  772|      0|      break;
  773|      0|    case IF2IP_AF_NOT_SUPPORTED:
  ------------------
  |  Branch (773:5): [True: 0, False: 0]
  ------------------
  774|       |      /* Signal the caller to try another address family if available */
  775|      0|      result = CURLE_UNSUPPORTED_PROTOCOL;
  776|      0|      goto out;
  777|      0|    case IF2IP_FOUND:
  ------------------
  |  Branch (777:5): [True: 0, False: 0]
  ------------------
  778|       |      /*
  779|       |       * We now have the numerical IP address in the 'myhost' buffer
  780|       |       */
  781|      0|      host = myhost;
  782|      0|      infof(data, "Local Interface %s is ip %s using address family %d",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  783|      0|            iface, host, af);
  784|      0|      done = 1;
  785|      0|      break;
  786|      0|    }
  787|      0|    if(!iface_in || host_in) {
  ------------------
  |  Branch (787:8): [True: 0, False: 0]
  |  Branch (787:21): [True: 0, False: 0]
  ------------------
  788|       |      /*
  789|       |       * This was not an interface, resolve the name as a hostname
  790|       |       * or IP number
  791|       |       *
  792|       |       * Temporarily force name resolution to use only the address type
  793|       |       * of the connection. The resolve functions should really be changed
  794|       |       * to take a type parameter instead.
  795|       |       */
  796|      0|      uint8_t dns_queries = (af == AF_INET) ?
  ------------------
  |  Branch (796:29): [True: 0, False: 0]
  ------------------
  797|      0|                            CURL_DNSQ_A : (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                                          CURL_DNSQ_A : (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                                          CURL_DNSQ_A : (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  798|      0|#ifdef USE_IPV6
  799|      0|      if(af == AF_INET6)
  ------------------
  |  Branch (799:10): [True: 0, False: 0]
  ------------------
  800|      0|        dns_queries = CURL_DNSQ_AAAA;
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  801|      0|#endif
  802|       |
  803|      0|      (void)Curl_resolv_blocking(data, dns_queries, host, 80, transport, &h);
  804|      0|      if(h) {
  ------------------
  |  Branch (804:10): [True: 0, False: 0]
  ------------------
  805|      0|        int h_af = h->addr->ai_family;
  806|       |        /* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */
  807|      0|        Curl_printable_address(h->addr, myhost, sizeof(myhost));
  808|      0|        infof(data, "Name '%s' family %d resolved to '%s' family %d",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  809|      0|              host, af, myhost, h_af);
  810|      0|        Curl_dns_entry_unlink(data, &h); /* this will NULL, potential free h */
  811|      0|        if(af != h_af) {
  ------------------
  |  Branch (811:12): [True: 0, False: 0]
  ------------------
  812|       |          /* bad IP version combo, signal the caller to try another address
  813|       |             family if available */
  814|      0|          result = CURLE_UNSUPPORTED_PROTOCOL;
  815|      0|          goto out;
  816|      0|        }
  817|      0|        done = 1;
  818|      0|      }
  819|      0|      else {
  820|       |        /*
  821|       |         * provided dev was no interface (or interfaces are not supported
  822|       |         * e.g. Solaris) no ip address and no domain we fail here
  823|       |         */
  824|      0|        done = -1;
  825|      0|      }
  826|      0|    }
  827|       |
  828|      0|    if(done > 0) {
  ------------------
  |  Branch (828:8): [True: 0, False: 0]
  ------------------
  829|      0|#ifdef USE_IPV6
  830|       |      /* IPv6 address */
  831|      0|      if(af == AF_INET6) {
  ------------------
  |  Branch (831:10): [True: 0, False: 0]
  ------------------
  832|      0|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
  833|      0|        char *scope_ptr = strchr(myhost, '%');
  834|      0|        if(scope_ptr)
  ------------------
  |  Branch (834:12): [True: 0, False: 0]
  ------------------
  835|      0|          *(scope_ptr++) = '\0';
  836|      0|#endif
  837|      0|        if(curlx_inet_pton(AF_INET6, myhost, &si6->sin6_addr) > 0) {
  ------------------
  |  Branch (837:12): [True: 0, False: 0]
  ------------------
  838|      0|          si6->sin6_family = AF_INET6;
  839|      0|          si6->sin6_port = htons(port);
  840|      0|#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
  841|      0|          if(scope_ptr) {
  ------------------
  |  Branch (841:14): [True: 0, False: 0]
  ------------------
  842|       |            /* The "myhost" string either comes from Curl_if2ip or from
  843|       |               Curl_printable_address. The latter returns only numeric scope
  844|       |               IDs and the former returns none at all. Making the scope ID,
  845|       |               if present, known to be numeric */
  846|      0|            curl_off_t scope_id;
  847|      0|            if(curlx_str_number((const char **)CURL_UNCONST(&scope_ptr),
  ------------------
  |  |  793|      0|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  |  Branch (847:16): [True: 0, False: 0]
  ------------------
  848|      0|                                &scope_id, UINT_MAX)) {
  849|      0|              result = CURLE_UNSUPPORTED_PROTOCOL;
  850|      0|              goto out;
  851|      0|            }
  852|      0|            si6->sin6_scope_id = (unsigned int)scope_id;
  853|      0|          }
  854|      0|#endif
  855|      0|        }
  856|      0|        sizeof_sa = sizeof(struct sockaddr_in6);
  857|      0|      }
  858|      0|      else
  859|      0|#endif
  860|       |      /* IPv4 address */
  861|      0|      if((af == AF_INET) &&
  ------------------
  |  Branch (861:10): [True: 0, False: 0]
  ------------------
  862|      0|         (curlx_inet_pton(AF_INET, myhost, &si4->sin_addr) > 0)) {
  ------------------
  |  Branch (862:10): [True: 0, False: 0]
  ------------------
  863|      0|        si4->sin_family = AF_INET;
  864|      0|        si4->sin_port = htons(port);
  865|      0|        sizeof_sa = sizeof(struct sockaddr_in);
  866|      0|      }
  867|      0|    }
  868|       |
  869|      0|    if(done < 1) {
  ------------------
  |  Branch (869:8): [True: 0, False: 0]
  ------------------
  870|       |      /* errorbuf is set false so failf will overwrite any message already in
  871|       |         the error buffer, so the user receives this error message instead of a
  872|       |         generic resolve error. */
  873|      0|      char buffer[STRERROR_LEN];
  874|      0|      data->state.errorbuf = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  875|      0|      data->state.os_errno = sockerr = SOCKERRNO;
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
  876|      0|      failf(data, "Could not bind to '%s' with errno %d: %s", host,
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  877|      0|            sockerr, curlx_strerror(sockerr, buffer, sizeof(buffer)));
  878|      0|      result = CURLE_INTERFACE_FAILED;
  879|      0|      goto out;
  880|      0|    }
  881|      0|  }
  882|      0|  else {
  883|       |    /* no device was given, prepare sa to match af's needs */
  884|      0|#ifdef USE_IPV6
  885|      0|    if(af == AF_INET6) {
  ------------------
  |  Branch (885:8): [True: 0, False: 0]
  ------------------
  886|      0|      si6->sin6_family = AF_INET6;
  887|      0|      si6->sin6_port = htons(port);
  888|      0|      sizeof_sa = sizeof(struct sockaddr_in6);
  889|      0|    }
  890|      0|    else
  891|      0|#endif
  892|      0|    if(af == AF_INET) {
  ------------------
  |  Branch (892:8): [True: 0, False: 0]
  ------------------
  893|      0|      si4->sin_family = AF_INET;
  894|      0|      si4->sin_port = htons(port);
  895|      0|      sizeof_sa = sizeof(struct sockaddr_in);
  896|      0|    }
  897|      0|  }
  898|      0|#ifdef IP_BIND_ADDRESS_NO_PORT
  899|      0|  (void)setsockopt(sockfd, SOL_IP, IP_BIND_ADDRESS_NO_PORT, &on, sizeof(on));
  900|      0|#endif
  901|      0|  for(;;) {
  902|      0|    if(bind(sockfd, sock, sizeof_sa) >= 0) {
  ------------------
  |  Branch (902:8): [True: 0, False: 0]
  ------------------
  903|       |      /* we succeeded to bind */
  904|      0|      infof(data, "Local port: %hu", port);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  905|      0|      conn->bits.bound = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  906|      0|      result = CURLE_OK;
  907|      0|      goto out;
  908|      0|    }
  909|       |
  910|      0|    if(--portnum > 0) {
  ------------------
  |  Branch (910:8): [True: 0, False: 0]
  ------------------
  911|      0|      port++; /* try next port */
  912|      0|      if(port == 0)
  ------------------
  |  Branch (912:10): [True: 0, False: 0]
  ------------------
  913|      0|        break;
  914|      0|      infof(data, "Bind to local port %d failed, trying next", port - 1);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  915|       |      /* We reuse/clobber the port variable here below */
  916|      0|      if(sock->sa_family == AF_INET)
  ------------------
  |  Branch (916:10): [True: 0, False: 0]
  ------------------
  917|      0|        si4->sin_port = htons(port);
  918|      0|#ifdef USE_IPV6
  919|      0|      else
  920|      0|        si6->sin6_port = htons(port);
  921|      0|#endif
  922|      0|    }
  923|      0|    else
  924|      0|      break;
  925|      0|  }
  926|      0|  {
  927|      0|    char buffer[STRERROR_LEN];
  928|      0|    data->state.os_errno = sockerr = SOCKERRNO;
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
  929|      0|    failf(data, "bind failed with errno %d: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  930|      0|          sockerr, curlx_strerror(sockerr, buffer, sizeof(buffer)));
  931|      0|  }
  932|       |
  933|      0|  result = CURLE_INTERFACE_FAILED;
  934|       |
  935|  9.20k|out:
  936|  9.20k|  curlx_free(dev_in);
  ------------------
  |  | 1503|  9.20k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  937|  9.20k|  curlx_free(iface_in);
  ------------------
  |  | 1503|  9.20k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  938|  9.20k|  curlx_free(host_in);
  ------------------
  |  | 1503|  9.20k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  939|  9.20k|  return result;
  940|      0|}
cf-socket.c:socket_connect_result:
 1002|      6|{
 1003|      6|  if(sockerr == SOCKEINPROGRESS || SOCK_EAGAIN(sockerr))
  ------------------
  |  | 1138|     12|#define SOCKEINPROGRESS   EINPROGRESS
  ------------------
                if(sockerr == SOCKEINPROGRESS || SOCK_EAGAIN(sockerr))
  ------------------
  |  | 1156|      6|#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
  |  |  ------------------
  |  |  |  | 1147|      6|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  |  |  ------------------
  |  |  |  Branch (1156:24): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  |  Branch (1003:6): [True: 0, False: 6]
  ------------------
 1004|      0|    return CURLE_OK;
 1005|       |
 1006|       |  /* unknown error, fallthrough and try another address! */
 1007|      6|  {
 1008|      6|    VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1637|      6|#define VERBOSE(x) x
  ------------------
 1009|      6|    infof(data, "Immediate connect fail for %s: %s", ipaddress,
  ------------------
  |  |  143|      6|  do {                               \
  |  |  144|      6|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      6|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 6, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 1, False: 5]
  |  |  |  |  ------------------
  |  |  |  |  323|      6|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      1|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      6|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      6|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 6]
  |  |  ------------------
  ------------------
 1010|      6|          curlx_strerror(sockerr, buffer, sizeof(buffer)));
 1011|      6|    NOVERBOSE((void)ipaddress);
  ------------------
  |  | 1638|      6|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1199|      6|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:35): [Folded, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1012|      6|  }
 1013|      6|  data->state.os_errno = sockerr;
 1014|       |  /* connect failed */
 1015|      6|  return CURLE_COULDNT_CONNECT;
 1016|      6|}
cf-socket.c:cf_socket_shutdown:
 1106|  1.57k|{
 1107|  1.57k|  if(cf->connected) {
  ------------------
  |  Branch (1107:6): [True: 1.57k, False: 0]
  ------------------
 1108|  1.57k|    struct cf_socket_ctx *ctx = cf->ctx;
 1109|       |
 1110|  1.57k|    CURL_TRC_CF(data, cf, "cf_socket_shutdown, fd=%" FMT_SOCKET_T, ctx->sock);
  ------------------
  |  |  153|  1.57k|  do {                                          \
  |  |  154|  1.57k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.57k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.14k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.57k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 1.57k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.14k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.57k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.57k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.57k]
  |  |  ------------------
  ------------------
 1111|       |    /* On TCP, and when the socket looks well and non-blocking mode
 1112|       |     * can be enabled, receive dangling bytes before close to avoid
 1113|       |     * entering RST states unnecessarily. */
 1114|  1.57k|    if(ctx->sock != CURL_SOCKET_BAD &&
  ------------------
  |  |  147|  3.14k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1114:8): [True: 1.57k, False: 0]
  ------------------
 1115|  1.57k|       ctx->transport == TRNSPRT_TCP &&
  ------------------
  |  |  225|  3.14k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (1115:8): [True: 0, False: 1.57k]
  ------------------
 1116|      0|       (curlx_nonblock(ctx->sock, TRUE) >= 0)) {
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  |  Branch (1116:8): [True: 0, False: 0]
  ------------------
 1117|      0|      unsigned char buf[1024];
 1118|      0|      (void)sread(ctx->sock, buf, sizeof(buf));
  ------------------
  |  |  881|      0|#define sread(x, y, z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
  |  |  882|      0|                                     (RECV_TYPE_ARG2)(y), \
  |  |  883|      0|                                     (RECV_TYPE_ARG3)(z), \
  |  |  884|      0|                                     (RECV_TYPE_ARG4)(0))
  ------------------
 1119|      0|    }
 1120|  1.57k|  }
 1121|       |  *done = TRUE;
  ------------------
  |  |  986|  1.57k|#define TRUE true
  ------------------
 1122|  1.57k|  return CURLE_OK;
 1123|  1.57k|}
cf-socket.c:cf_socket_adjust_pollset:
 1591|  67.6k|{
 1592|  67.6k|  struct cf_socket_ctx *ctx = cf->ctx;
 1593|  67.6k|  CURLcode result = CURLE_OK;
 1594|       |
 1595|  67.6k|  if(ctx->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  67.6k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1595:6): [True: 67.6k, False: 0]
  ------------------
 1596|       |    /* A listening socket filter needs to be connected before the accept
 1597|       |     * for some weird FTP interaction. This should be rewritten, so that
 1598|       |     * FTP no longer does the socket checks and accept calls and delegates
 1599|       |     * all that to the filter. */
 1600|  67.6k|    if(ctx->listening) {
  ------------------
  |  Branch (1600:8): [True: 0, False: 67.6k]
  ------------------
 1601|      0|      result = Curl_pollset_set_in_only(data, ps, ctx->sock);
  ------------------
  |  |  162|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
 1602|      0|      CURL_TRC_CF(data, cf, "adjust_pollset, listening, POLLIN fd=%"
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1603|      0|                  FMT_SOCKET_T, ctx->sock);
 1604|      0|    }
 1605|  67.6k|    else if(!cf->connected) {
  ------------------
  |  Branch (1605:13): [True: 0, False: 67.6k]
  ------------------
 1606|      0|      result = Curl_pollset_set_out_only(data, ps, ctx->sock);
  ------------------
  |  |  164|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1607|      0|      CURL_TRC_CF(data, cf, "adjust_pollset, !connected, POLLOUT fd=%"
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1608|      0|                  FMT_SOCKET_T, ctx->sock);
 1609|      0|    }
 1610|  67.6k|    else if(cf->chain && cf->chain->parent) {
  ------------------
  |  Branch (1610:13): [True: 67.6k, False: 0]
  |  Branch (1610:26): [True: 59.1k, False: 8.50k]
  ------------------
 1611|       |      /* still in its own eyeballing filter chain */
 1612|  59.1k|      result = Curl_pollset_add_in(data, ps, ctx->sock);
  ------------------
  |  |  152|  59.1k|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0)
  |  |  ------------------
  |  |  |  |  283|  59.1k|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1613|  59.1k|      CURL_TRC_CF(data, cf, "adjust_pollset, sub-chain, POLLIN fd=%"
  ------------------
  |  |  153|  59.1k|  do {                                          \
  |  |  154|  59.1k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  59.1k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|   118k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 59.1k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 15.6k, False: 43.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   118k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 15.6k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  15.6k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  59.1k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  15.6k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 15.6k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 7.69k, False: 7.92k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  59.1k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  59.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 59.1k]
  |  |  ------------------
  ------------------
 1614|  59.1k|                  FMT_SOCKET_T, ctx->sock);
 1615|  59.1k|    }
 1616|  67.6k|  }
 1617|  67.6k|  return result;
 1618|  67.6k|}
cf-socket.c:cf_socket_send:
 1651|  18.2k|{
 1652|  18.2k|  struct cf_socket_ctx *ctx = cf->ctx;
 1653|  18.2k|  curl_socket_t fdsave;
 1654|  18.2k|  ssize_t rv;
 1655|  18.2k|  CURLcode result = CURLE_OK;
 1656|  18.2k|  VERBOSE(size_t orig_len = len);
  ------------------
  |  | 1637|  18.2k|#define VERBOSE(x) x
  ------------------
 1657|       |
 1658|  18.2k|  (void)eos;
 1659|  18.2k|  *pnwritten = 0;
 1660|       |
 1661|  18.2k|#ifdef DEBUGBUILD
 1662|       |  /* simulate network blocking/partial writes */
 1663|  18.2k|  if(ctx->wblock_percent > 0) {
  ------------------
  |  Branch (1663:6): [True: 0, False: 18.2k]
  ------------------
 1664|      0|    unsigned char c = 0;
 1665|      0|    Curl_rand_bytes(data, FALSE, &c, 1);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1666|      0|    if(c >= ((100 - ctx->wblock_percent) * 256 / 100)) {
  ------------------
  |  Branch (1666:8): [True: 0, False: 0]
  ------------------
 1667|      0|      CURL_TRC_CF(data, cf, "send(len=%zu) SIMULATE EWOULDBLOCK", orig_len);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1668|      0|      return CURLE_AGAIN;
 1669|      0|    }
 1670|      0|  }
 1671|  18.2k|  if(cf->cft != &Curl_cft_udp && ctx->wpartial_percent > 0 && len > 8) {
  ------------------
  |  Branch (1671:6): [True: 18.2k, False: 0]
  |  Branch (1671:34): [True: 0, False: 18.2k]
  |  Branch (1671:63): [True: 0, False: 0]
  ------------------
 1672|      0|    len = len * ctx->wpartial_percent / 100;
 1673|      0|    if(!len)
  ------------------
  |  Branch (1673:8): [True: 0, False: 0]
  ------------------
 1674|      0|      len = 1;
 1675|      0|    CURL_TRC_CF(data, cf, "send(len=%zu) SIMULATE partial write of %zu bytes",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1676|      0|                orig_len, len);
 1677|      0|  }
 1678|  18.2k|#endif
 1679|       |
 1680|  18.2k|  fdsave = cf->chain->sock;
 1681|  18.2k|  cf->chain->sock = ctx->sock;
 1682|       |
 1683|       |#if defined(MSG_FASTOPEN) && !defined(TCP_FASTOPEN_CONNECT) /* Linux */
 1684|       |  if(CF_CONN(cf)->bits.tcp_fastopen) {
 1685|       |    rv = sendto(ctx->sock, buf, len, MSG_FASTOPEN,
 1686|       |                &ctx->addr.curl_sa_addr, ctx->addr.addrlen);
 1687|       |    CF_CONN(cf)->bits.tcp_fastopen = FALSE;
 1688|       |  }
 1689|       |  else
 1690|       |#endif
 1691|  18.2k|    rv = swrite(ctx->sock, buf, len);
  ------------------
  |  |  903|  18.2k|#define swrite(x, y, z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
  |  |  904|  18.2k|                                      (const SEND_TYPE_ARG2)(y), \
  |  |  905|  18.2k|                                      (SEND_TYPE_ARG3)(z), \
  |  |  906|  18.2k|                                      (SEND_TYPE_ARG4)(SEND_4TH_ARG))
  |  |  ------------------
  |  |  |  |  846|  18.2k|#define SEND_4TH_ARG MSG_NOSIGNAL
  |  |  ------------------
  ------------------
 1692|       |
 1693|  18.2k|  if(!curlx_sztouz(rv, pnwritten)) {
  ------------------
  |  Branch (1693:6): [True: 8.31k, False: 9.89k]
  ------------------
 1694|  8.31k|    int sockerr = SOCKERRNO;
  ------------------
  |  | 1105|  8.31k|#define SOCKERRNO         errno
  ------------------
 1695|  8.31k|    if(SOCK_EAGAIN(sockerr)
  ------------------
  |  | 1156|  16.6k|#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
  |  |  ------------------
  |  |  |  | 1147|  8.31k|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  |  |  ------------------
  |  |  |  Branch (1156:24): [True: 8.31k, False: 0]
  |  |  ------------------
  ------------------
 1696|      0|#ifndef USE_WINSOCK
 1697|      0|       || (sockerr == SOCKEINTR) || (sockerr == SOCKEINPROGRESS)
  ------------------
  |  | 1139|      0|#define SOCKEINTR         EINTR
  ------------------
                     || (sockerr == SOCKEINTR) || (sockerr == SOCKEINPROGRESS)
  ------------------
  |  | 1138|      0|#define SOCKEINPROGRESS   EINPROGRESS
  ------------------
  |  Branch (1697:11): [True: 0, False: 0]
  |  Branch (1697:37): [True: 0, False: 0]
  ------------------
 1698|  8.31k|#endif
 1699|  8.31k|      ) {
 1700|  8.31k|      result = CURLE_AGAIN;  /* EWOULDBLOCK */
 1701|  8.31k|    }
 1702|      0|    else {
 1703|      0|      char buffer[STRERROR_LEN];
 1704|      0|      failf(data, "Send failure: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1705|      0|            curlx_strerror(sockerr, buffer, sizeof(buffer)));
 1706|      0|      data->state.os_errno = sockerr;
 1707|      0|      result = CURLE_SEND_ERROR;
 1708|      0|    }
 1709|  8.31k|  }
 1710|       |
 1711|       |#ifdef USE_WINSOCK
 1712|       |  if(!result)
 1713|       |    win_update_sndbuf_size(data, ctx);
 1714|       |#endif
 1715|       |
 1716|  18.2k|  CURL_TRC_CF(data, cf, "send(len=%zu) -> %d, %zu",
  ------------------
  |  |  153|  18.2k|  do {                                          \
  |  |  154|  18.2k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  18.2k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  36.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 18.2k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 5.08k, False: 13.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  36.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 5.08k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  5.08k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  18.2k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  5.08k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 5.08k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 2.34k, False: 2.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  18.2k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  18.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 18.2k]
  |  |  ------------------
  ------------------
 1717|  18.2k|              orig_len, (int)result, *pnwritten);
 1718|  18.2k|  cf->chain->sock = fdsave;
 1719|  18.2k|  return result;
 1720|  18.2k|}
cf-socket.c:cf_socket_recv:
 1724|   986k|{
 1725|   986k|  struct cf_socket_ctx *ctx = cf->ctx;
 1726|   986k|  CURLcode result = CURLE_OK;
 1727|   986k|  ssize_t rv;
 1728|       |
 1729|   986k|  *pnread = 0;
 1730|   986k|#ifdef DEBUGBUILD
 1731|       |  /* simulate network blocking/partial reads */
 1732|   986k|  if(cf->cft != &Curl_cft_udp && ctx->rblock_percent > 0) {
  ------------------
  |  Branch (1732:6): [True: 986k, False: 0]
  |  Branch (1732:34): [True: 0, False: 986k]
  ------------------
 1733|      0|    unsigned char c = 0;
 1734|      0|    Curl_rand(data, &c, 1);
  ------------------
  |  |   35|      0|#define Curl_rand(a, b, c) Curl_rand_bytes(a, TRUE, b, c)
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  ------------------
 1735|      0|    if(c >= ((100 - ctx->rblock_percent) * 256 / 100)) {
  ------------------
  |  Branch (1735:8): [True: 0, False: 0]
  ------------------
 1736|      0|      CURL_TRC_CF(data, cf, "recv(len=%zu) SIMULATE EWOULDBLOCK", len);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1737|      0|      return CURLE_AGAIN;
 1738|      0|    }
 1739|      0|  }
 1740|   986k|  if(cf->cft != &Curl_cft_udp && ctx->recv_max && ctx->recv_max < len) {
  ------------------
  |  Branch (1740:6): [True: 986k, False: 0]
  |  Branch (1740:34): [True: 0, False: 986k]
  |  Branch (1740:51): [True: 0, False: 0]
  ------------------
 1741|      0|    CURL_TRC_CF(data, cf, "recv(len=%zu) SIMULATE max read of %zu bytes",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1742|      0|                len, ctx->recv_max);
 1743|      0|    len = ctx->recv_max;
 1744|      0|  }
 1745|   986k|#endif
 1746|       |
 1747|   986k|  rv = sread(ctx->sock, buf, len);
  ------------------
  |  |  881|   986k|#define sread(x, y, z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
  |  |  882|   986k|                                     (RECV_TYPE_ARG2)(y), \
  |  |  883|   986k|                                     (RECV_TYPE_ARG3)(z), \
  |  |  884|   986k|                                     (RECV_TYPE_ARG4)(0))
  ------------------
 1748|       |
 1749|   986k|  if(!curlx_sztouz(rv, pnread)) {
  ------------------
  |  Branch (1749:6): [True: 8.38k, False: 978k]
  ------------------
 1750|  8.38k|    int sockerr = SOCKERRNO;
  ------------------
  |  | 1105|  8.38k|#define SOCKERRNO         errno
  ------------------
 1751|  8.38k|    if(SOCK_EAGAIN(sockerr)
  ------------------
  |  | 1156|  16.7k|#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
  |  |  ------------------
  |  |  |  | 1147|  8.38k|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  |  |  ------------------
  |  |  |  Branch (1156:24): [True: 8.38k, False: 0]
  |  |  ------------------
  ------------------
 1752|      0|#ifndef USE_WINSOCK
 1753|      0|       || (sockerr == SOCKEINTR)
  ------------------
  |  | 1139|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (1753:11): [True: 0, False: 0]
  ------------------
 1754|  8.38k|#endif
 1755|  8.38k|      ) {
 1756|  8.38k|      result = CURLE_AGAIN;  /* EWOULDBLOCK */
 1757|  8.38k|    }
 1758|      0|    else {
 1759|      0|      char buffer[STRERROR_LEN];
 1760|      0|      failf(data, "Recv failure: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1761|      0|            curlx_strerror(sockerr, buffer, sizeof(buffer)));
 1762|      0|      data->state.os_errno = sockerr;
 1763|      0|      result = CURLE_RECV_ERROR;
 1764|      0|    }
 1765|  8.38k|  }
 1766|       |
 1767|   986k|  CURL_TRC_CF(data, cf, "recv(len=%zu) -> %d, %zu", len, (int)result, *pnread);
  ------------------
  |  |  153|   986k|  do {                                          \
  |  |  154|   986k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|   986k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.97M|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 986k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 368k, False: 618k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.97M|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 368k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|   368k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|   986k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|   368k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 368k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 252k, False: 115k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   986k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|   986k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 986k]
  |  |  ------------------
  ------------------
 1768|   986k|  if(!result && !ctx->got_first_byte) {
  ------------------
  |  Branch (1768:6): [True: 978k, False: 8.38k]
  |  Branch (1768:17): [True: 7.18k, False: 971k]
  ------------------
 1769|  7.18k|    ctx->first_byte_at = *Curl_pgrs_now(data);
 1770|       |    ctx->got_first_byte = TRUE;
  ------------------
  |  |  986|  7.18k|#define TRUE true
  ------------------
 1771|  7.18k|  }
 1772|   986k|  return result;
 1773|   986k|}
cf-socket.c:cf_socket_cntrl:
 1788|  19.4k|{
 1789|  19.4k|  struct cf_socket_ctx *ctx = cf->ctx;
 1790|       |
 1791|  19.4k|  (void)arg1;
 1792|  19.4k|  (void)arg2;
 1793|  19.4k|  switch(event) {
  ------------------
  |  Branch (1793:10): [True: 16.6k, False: 2.84k]
  ------------------
 1794|  8.32k|  case CF_CTRL_CONN_INFO_UPDATE:
  ------------------
  |  |  121|  8.32k|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  |  Branch (1794:3): [True: 8.32k, False: 11.1k]
  ------------------
 1795|  8.32k|  case CF_CTRL_DATA_SETUP:
  ------------------
  |  |  115|  8.32k|#define CF_CTRL_DATA_SETUP              4  /* 0          NULL     first fail */
  ------------------
  |  Branch (1795:3): [True: 0, False: 19.4k]
  ------------------
 1796|  8.32k|    cf_socket_update_data(cf, data);
 1797|  8.32k|    break;
 1798|      0|  case CF_CTRL_FORGET_SOCKET:
  ------------------
  |  |  122|      0|#define CF_CTRL_FORGET_SOCKET    (256 + 1) /* 0          NULL     ignored */
  ------------------
  |  Branch (1798:3): [True: 0, False: 19.4k]
  ------------------
 1799|      0|    ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
 1800|      0|    break;
 1801|  8.32k|  case CF_CTRL_REPORT_STATS:
  ------------------
  |  |  124|  8.32k|#define CF_CTRL_REPORT_STATS     (256 + 3) /* 0          NULL     ignored */
  ------------------
  |  Branch (1801:3): [True: 8.32k, False: 11.1k]
  ------------------
 1802|  8.32k|    if(cf->connected && !ctx->stats_reported) {
  ------------------
  |  Branch (1802:8): [True: 8.32k, False: 0]
  |  Branch (1802:25): [True: 8.32k, False: 0]
  ------------------
 1803|  8.32k|      struct curltime *ts = NULL;
 1804|  8.32k|      switch(ctx->transport) {
 1805|      0|      case TRNSPRT_UDP:
  ------------------
  |  |  226|      0|#define TRNSPRT_UDP  4
  ------------------
  |  Branch (1805:7): [True: 0, False: 8.32k]
  ------------------
 1806|  1.95k|      case TRNSPRT_QUIC:
  ------------------
  |  |  227|  1.95k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (1806:7): [True: 1.95k, False: 6.36k]
  ------------------
 1807|       |        /* Since UDP connected sockets work different from TCP, we use the
 1808|       |         * time of the first byte from the peer as the "connect" time. */
 1809|  1.95k|        if(ctx->got_first_byte)
  ------------------
  |  Branch (1809:12): [True: 0, False: 1.95k]
  ------------------
 1810|      0|          ts = &ctx->first_byte_at;
 1811|  1.95k|        break;
 1812|  6.36k|      default:
  ------------------
  |  Branch (1812:7): [True: 6.36k, False: 1.95k]
  ------------------
 1813|  6.36k|        ts = &ctx->connected_at;
 1814|  6.36k|        break;
 1815|  8.32k|      }
 1816|  8.32k|      if(ts) {
  ------------------
  |  Branch (1816:10): [True: 6.36k, False: 1.95k]
  ------------------
 1817|  6.36k|        Curl_pgrsTimeWas(data, TIMER_CONNECT, *ts);
 1818|  6.36k|        ctx->stats_reported = TRUE;
  ------------------
  |  |  986|  6.36k|#define TRUE true
  ------------------
 1819|  6.36k|      }
 1820|  8.32k|    }
 1821|  19.4k|  }
 1822|  19.4k|  return CURLE_OK;
 1823|  19.4k|}
cf-socket.c:cf_socket_update_data:
 1777|  8.32k|{
 1778|       |  /* Update the IP info held in the transfer, if we have that. */
 1779|  8.32k|  if(cf->connected && CF_IS_PRIMARY(cf)) {
  ------------------
  |  |  261|  8.32k|#define CF_IS_PRIMARY(cf)       (bool)(cf)->chain->primary
  |  |  ------------------
  |  |  |  Branch (261:33): [True: 8.32k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1779:6): [True: 8.32k, False: 0]
  ------------------
 1780|  8.32k|    struct cf_socket_ctx *ctx = cf->ctx;
 1781|  8.32k|    data->info.primary = ctx->ip;
 1782|  8.32k|  }
 1783|  8.32k|}
cf-socket.c:cf_socket_query:
 1865|   147k|{
 1866|   147k|  struct cf_socket_ctx *ctx = cf->ctx;
 1867|       |
 1868|   147k|  switch(query) {
 1869|      0|  case CF_QUERY_TRANSPORT:
  ------------------
  |  |  180|      0|#define CF_QUERY_TRANSPORT         14  /* TRNSPRT_*  - * */
  ------------------
  |  Branch (1869:3): [True: 0, False: 147k]
  ------------------
 1870|      0|    DEBUGASSERT(pres1);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1870:5): [True: 0, False: 0]
  |  Branch (1870:5): [True: 0, False: 0]
  ------------------
 1871|      0|    *pres1 = ctx->transport;
 1872|      0|    return CURLE_OK;
 1873|  1.37k|  case CF_QUERY_REMOTE_ADDR:
  ------------------
  |  |  176|  1.37k|#define CF_QUERY_REMOTE_ADDR       10  /* -          `Curl_sockaddr_ex *` */
  ------------------
  |  Branch (1873:3): [True: 1.37k, False: 146k]
  ------------------
 1874|  1.37k|    DEBUGASSERT(pres2);
  ------------------
  |  | 1016|  1.37k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1874:5): [True: 0, False: 1.37k]
  |  Branch (1874:5): [True: 1.37k, False: 0]
  ------------------
 1875|  1.37k|    *((const struct Curl_sockaddr_ex **)pres2) = cf->connected ?
  ------------------
  |  Branch (1875:50): [True: 1.37k, False: 0]
  ------------------
 1876|  1.37k|                                                 &ctx->addr : NULL;
 1877|  1.37k|    return CURLE_OK;
 1878|      0|  case CF_QUERY_CONNECT_REPLY_MS:
  ------------------
  |  |  168|      0|#define CF_QUERY_CONNECT_REPLY_MS   2  /* number     -        */
  ------------------
  |  Branch (1878:3): [True: 0, False: 147k]
  ------------------
 1879|      0|    if(ctx->got_first_byte) {
  ------------------
  |  Branch (1879:8): [True: 0, False: 0]
  ------------------
 1880|      0|      timediff_t ms = curlx_ptimediff_ms(&ctx->first_byte_at,
 1881|      0|                                         &ctx->started_at);
 1882|      0|      *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX;
  ------------------
  |  Branch (1882:16): [True: 0, False: 0]
  ------------------
 1883|      0|    }
 1884|      0|    else
 1885|      0|      *pres1 = -1;
 1886|      0|    return CURLE_OK;
 1887|    304|  case CF_QUERY_IP_INFO:
  ------------------
  |  |  172|    304|#define CF_QUERY_IP_INFO            8  /* TRUE/FALSE struct ip_quadruple */
  ------------------
  |  Branch (1887:3): [True: 304, False: 147k]
  ------------------
 1888|    304|#ifdef USE_IPV6
 1889|    304|    *pres1 = (ctx->addr.family == AF_INET6);
 1890|       |#else
 1891|       |    *pres1 = FALSE;
 1892|       |#endif
 1893|    304|    *(struct ip_quadruple *)pres2 = ctx->ip;
 1894|    304|    return CURLE_OK;
 1895|  12.7k|  case CF_QUERY_REALLY_CONNECTED:
  ------------------
  |  |  182|  12.7k|#define CF_QUERY_REALLY_CONNECTED  16  /* TRUE/FALSE - */
  ------------------
  |  Branch (1895:3): [True: 12.7k, False: 135k]
  ------------------
 1896|  12.7k|    if(cf->cft != &Curl_cft_udp)
  ------------------
  |  Branch (1896:8): [True: 12.7k, False: 0]
  ------------------
 1897|  12.7k|      *pres1 = cf->connected;
 1898|      0|    else
 1899|      0|      *pres1 = ctx->got_first_byte;
 1900|  12.7k|    return CURLE_OK;
 1901|   133k|  default:
  ------------------
  |  Branch (1901:3): [True: 133k, False: 14.4k]
  ------------------
 1902|   133k|    break;
 1903|   147k|  }
 1904|   133k|  return cf->next ?
  ------------------
  |  Branch (1904:10): [True: 0, False: 133k]
  ------------------
 1905|      0|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
 1906|   133k|    CURLE_UNKNOWN_OPTION;
 1907|   147k|}
cf-socket.c:cf_socket_ctx_init:
 1050|  9.21k|{
 1051|  9.21k|  memset(ctx, 0, sizeof(*ctx));
 1052|  9.21k|  Curl_peer_link(&ctx->peer, peer);
 1053|  9.21k|  ctx->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  9.21k|#define CURL_SOCKET_BAD (-1)
  ------------------
 1054|  9.21k|  ctx->transport = transport;
 1055|  9.21k|  ctx->addr = *addr;
 1056|       |
 1057|  9.21k|#ifdef DEBUGBUILD
 1058|  9.21k|  {
 1059|  9.21k|    const char *p = getenv("CURL_DBG_SOCK_WBLOCK");
 1060|  9.21k|    if(p) {
  ------------------
  |  Branch (1060:8): [True: 0, False: 9.21k]
  ------------------
 1061|      0|      curl_off_t l;
 1062|      0|      if(!curlx_str_number(&p, &l, 100))
  ------------------
  |  Branch (1062:10): [True: 0, False: 0]
  ------------------
 1063|      0|        ctx->wblock_percent = (int)l;
 1064|      0|    }
 1065|  9.21k|    p = getenv("CURL_DBG_SOCK_WPARTIAL");
 1066|  9.21k|    if(p) {
  ------------------
  |  Branch (1066:8): [True: 0, False: 9.21k]
  ------------------
 1067|      0|      curl_off_t l;
 1068|      0|      if(!curlx_str_number(&p, &l, 100))
  ------------------
  |  Branch (1068:10): [True: 0, False: 0]
  ------------------
 1069|      0|        ctx->wpartial_percent = (int)l;
 1070|      0|    }
 1071|  9.21k|    p = getenv("CURL_DBG_SOCK_RBLOCK");
 1072|  9.21k|    if(p) {
  ------------------
  |  Branch (1072:8): [True: 0, False: 9.21k]
  ------------------
 1073|      0|      curl_off_t l;
 1074|      0|      if(!curlx_str_number(&p, &l, 100))
  ------------------
  |  Branch (1074:10): [True: 0, False: 0]
  ------------------
 1075|      0|        ctx->rblock_percent = (int)l;
 1076|      0|    }
 1077|  9.21k|    p = getenv("CURL_DBG_SOCK_RMAX");
 1078|  9.21k|    if(p) {
  ------------------
  |  Branch (1078:8): [True: 0, False: 9.21k]
  ------------------
 1079|      0|      curl_off_t l;
 1080|      0|      if(!curlx_str_number(&p, &l, CURL_OFF_T_MAX))
  ------------------
  |  |  539|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (1080:10): [True: 0, False: 0]
  ------------------
 1081|      0|        ctx->recv_max = (size_t)l;
 1082|      0|    }
 1083|  9.21k|    p = getenv("CURL_DBG_SOCK_CONNECT_WAIT_MS");
 1084|  9.21k|    if(p) {
  ------------------
  |  Branch (1084:8): [True: 0, False: 9.21k]
  ------------------
 1085|      0|      curl_off_t l;
 1086|      0|      if(!curlx_str_number(&p, &l, INT_MAX))
  ------------------
  |  Branch (1086:10): [True: 0, False: 0]
  ------------------
 1087|      0|        ctx->connect_wait_ms = (int)l;
 1088|      0|    }
 1089|  9.21k|  }
 1090|  9.21k|#endif
 1091|       |
 1092|  9.21k|  return CURLE_OK;
 1093|  9.21k|}
cf-socket.c:cf_socket_ctx_free:
 1096|  9.21k|{
 1097|  9.21k|  if(ctx) {
  ------------------
  |  Branch (1097:6): [True: 9.21k, False: 3]
  ------------------
 1098|  9.21k|    Curl_peer_unlink(&ctx->peer);
 1099|  9.21k|    curlx_free(ctx);
  ------------------
  |  | 1503|  9.21k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1100|  9.21k|  }
 1101|  9.21k|}
cf-socket.c:cf_udp_connect:
 2091|  1.98k|{
 2092|  1.98k|  struct cf_socket_ctx *ctx = cf->ctx;
 2093|  1.98k|  CURLcode result = CURLE_COULDNT_CONNECT;
 2094|       |
 2095|  1.98k|  if(cf->connected) {
  ------------------
  |  Branch (2095:6): [True: 0, False: 1.98k]
  ------------------
 2096|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2097|      0|    return CURLE_OK;
 2098|      0|  }
 2099|       |
 2100|  1.98k|  *done = FALSE;
  ------------------
  |  |  989|  1.98k|#define FALSE false
  ------------------
 2101|  1.98k|  if(ctx->sock == CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  1.98k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (2101:6): [True: 1.98k, False: 0]
  ------------------
 2102|  1.98k|    result = cf_socket_open(cf, data);
 2103|  1.98k|    if(result) {
  ------------------
  |  Branch (2103:8): [True: 0, False: 1.98k]
  ------------------
 2104|      0|      CURL_TRC_CF(data, cf, "cf_udp_connect(), open failed -> %d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2105|      0|                  (int)result);
 2106|      0|      goto out;
 2107|      0|    }
 2108|       |
 2109|  1.98k|    if(ctx->transport == TRNSPRT_QUIC) {
  ------------------
  |  |  227|  1.98k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (2109:8): [True: 1.98k, False: 0]
  ------------------
 2110|  1.98k|      result = cf_udp_setup_quic(cf, data);
 2111|  1.98k|      if(result)
  ------------------
  |  Branch (2111:10): [True: 6, False: 1.97k]
  ------------------
 2112|      6|        goto out;
 2113|  1.97k|      CURL_TRC_CF(data, cf, "cf_udp_connect(), opened socket=%"
  ------------------
  |  |  153|  1.97k|  do {                                          \
  |  |  154|  1.97k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.97k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.94k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.97k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 148, False: 1.82k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.94k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 148, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    148|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.97k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    148|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 148, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 6, False: 142]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.97k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.97k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.97k]
  |  |  ------------------
  ------------------
 2114|  1.97k|                  FMT_SOCKET_T " (%s:%d)",
 2115|  1.97k|                  ctx->sock, ctx->ip.local_ip, ctx->ip.local_port);
 2116|  1.97k|    }
 2117|  1.97k|    *done = TRUE;
  ------------------
  |  |  986|  1.97k|#define TRUE true
  ------------------
 2118|  1.97k|    cf->connected = TRUE;
  ------------------
  |  |  986|  1.97k|#define TRUE true
  ------------------
 2119|  1.97k|  }
 2120|  1.98k|out:
 2121|  1.98k|  return result;
 2122|  1.98k|}
cf-socket.c:cf_udp_setup_quic:
 2053|  1.98k|{
 2054|  1.98k|  struct cf_socket_ctx *ctx = cf->ctx;
 2055|  1.98k|  int rc;
 2056|       |
 2057|       |  /* QUIC needs a connected socket, nonblocking */
 2058|  1.98k|  DEBUGASSERT(ctx->sock != CURL_SOCKET_BAD);
  ------------------
  |  | 1016|  1.98k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2058:3): [True: 0, False: 1.98k]
  |  Branch (2058:3): [True: 1.98k, False: 0]
  ------------------
 2059|       |
 2060|       |  /* error: The 1st argument to 'connect' is -1 but should be >= 0
 2061|       |     NOLINTNEXTLINE(clang-analyzer-unix.StdCLibraryFunctions) */
 2062|  1.98k|  rc = connect(ctx->sock, &ctx->addr.curl_sa_addr,
  ------------------
  |  |   36|  1.98k|#define curl_sa_addr    addr.sa
  ------------------
 2063|  1.98k|               (curl_socklen_t)ctx->addr.addrlen);
 2064|  1.98k|  if(rc == -1) {
  ------------------
  |  Branch (2064:6): [True: 6, False: 1.97k]
  ------------------
 2065|      6|    return socket_connect_result(data, ctx->ip.remote_ip, SOCKERRNO);
  ------------------
  |  | 1105|      6|#define SOCKERRNO         errno
  ------------------
 2066|      6|  }
 2067|  1.97k|  ctx->sock_connected = TRUE;
  ------------------
  |  |  986|  1.97k|#define TRUE true
  ------------------
 2068|  1.97k|  set_local_ip(cf, data);
 2069|  1.97k|  CURL_TRC_CF(data, cf, "%s socket %" FMT_SOCKET_T
  ------------------
  |  |  153|  1.97k|  do {                                          \
  |  |  154|  1.97k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.97k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.94k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.97k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 148, False: 1.82k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.94k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 148, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    148|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.97k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    148|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 148, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 6, False: 142]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.97k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 6, False: 0]
  |  |  ------------------
  |  |  156|  1.97k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.97k]
  |  |  ------------------
  ------------------
 2070|  1.97k|              " connected: [%s:%d] -> [%s:%d]",
 2071|  1.97k|              (ctx->transport == TRNSPRT_QUIC) ? "QUIC" : "UDP",
 2072|  1.97k|              ctx->sock, ctx->ip.local_ip, ctx->ip.local_port,
 2073|  1.97k|              ctx->ip.remote_ip, ctx->ip.remote_port);
 2074|       |
 2075|       |  /* Currently, cf->ctx->sock is always non-blocking because the only
 2076|       |   * caller to cf_udp_setup_quic() is cf_udp_connect() that passes the
 2077|       |   * non-blocking socket created by cf_socket_open() to it. Thus, we
 2078|       |   * do not need to call curlx_nonblock() in cf_udp_setup_quic() anymore.
 2079|       |   */
 2080|  1.97k|  linux_quic_ecn(ctx);
 2081|  1.97k|  linux_quic_mtu(ctx);
 2082|  1.97k|  linux_ip_dontfrag(ctx);
 2083|  1.97k|  linux_quic_gro(ctx);
 2084|       |
 2085|  1.97k|  return CURLE_OK;
 2086|  1.98k|}
cf-socket.c:linux_quic_ecn:
 2012|  1.97k|{
 2013|  1.97k|  unsigned int tos = 1;
 2014|  1.97k|  switch(ctx->addr.family) {
  ------------------
  |  Branch (2014:10): [True: 1.97k, False: 0]
  ------------------
 2015|  1.97k|  case AF_INET:
  ------------------
  |  Branch (2015:3): [True: 1.97k, False: 0]
  ------------------
 2016|  1.97k|    (void)setsockopt(ctx->sock, IPPROTO_IP, IP_RECVTOS, &tos, sizeof(tos));
 2017|  1.97k|    break;
 2018|      0|#ifdef IPV6_RECVTCLASS
 2019|      0|  case AF_INET6:
  ------------------
  |  Branch (2019:3): [True: 0, False: 1.97k]
  ------------------
 2020|      0|    (void)setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_RECVTCLASS,
 2021|      0|                     &tos, sizeof(tos));
 2022|      0|    break;
 2023|  1.97k|#endif
 2024|  1.97k|  }
 2025|  1.97k|}
cf-socket.c:linux_quic_mtu:
 1974|  1.97k|{
 1975|  1.97k|  int val;
 1976|  1.97k|  switch(ctx->addr.family) {
  ------------------
  |  Branch (1976:10): [True: 1.97k, False: 0]
  ------------------
 1977|      0|#ifdef IP_MTU_DISCOVER
 1978|  1.97k|  case AF_INET:
  ------------------
  |  Branch (1978:3): [True: 1.97k, False: 0]
  ------------------
 1979|  1.97k|    val = IP_PMTUDISC_DO;
 1980|  1.97k|    (void)setsockopt(ctx->sock, IPPROTO_IP, IP_MTU_DISCOVER, &val,
 1981|  1.97k|                     sizeof(val));
 1982|  1.97k|    break;
 1983|      0|#endif
 1984|      0|#ifdef IPV6_MTU_DISCOVER
 1985|      0|  case AF_INET6:
  ------------------
  |  Branch (1985:3): [True: 0, False: 1.97k]
  ------------------
 1986|      0|    val = IPV6_PMTUDISC_DO;
 1987|      0|    (void)setsockopt(ctx->sock, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &val,
 1988|      0|                     sizeof(val));
 1989|      0|    break;
 1990|  1.97k|#endif
 1991|  1.97k|  }
 1992|  1.97k|}
cf-socket.c:linux_quic_gro:
 2001|  1.97k|{
 2002|  1.97k|  int one = 1;
 2003|  1.97k|  (void)setsockopt(ctx->sock, IPPROTO_UDP, UDP_GRO, &one,
 2004|  1.97k|                   (socklen_t)sizeof(one));
 2005|  1.97k|}
cf-socket.c:set_local_ip:
 1143|  9.20k|{
 1144|  9.20k|  struct cf_socket_ctx *ctx = cf->ctx;
 1145|  9.20k|  ctx->ip.local_ip[0] = 0;
 1146|  9.20k|  ctx->ip.local_port = 0;
 1147|       |
 1148|  9.20k|#ifdef HAVE_GETSOCKNAME
 1149|  9.20k|  if((ctx->sock != CURL_SOCKET_BAD) &&
  ------------------
  |  |  147|  9.20k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1149:6): [True: 9.20k, False: 0]
  ------------------
 1150|  9.20k|     !(data->conn->scheme->protocol & CURLPROTO_TFTP)) {
  ------------------
  |  | 1099|  9.20k|#define CURLPROTO_TFTP    (1L << 11)
  ------------------
  |  Branch (1150:6): [True: 9.20k, False: 0]
  ------------------
 1151|       |    /* TFTP does not connect, so it cannot get the IP like this */
 1152|  9.20k|    struct Curl_sockaddr_storage ssloc;
 1153|  9.20k|    curl_socklen_t slen = sizeof(struct Curl_sockaddr_storage);
 1154|       |
 1155|  9.20k|    memset(&ssloc, 0, sizeof(ssloc));
 1156|  9.20k|    if(getsockname(ctx->sock, (struct sockaddr *)&ssloc, &slen)) {
  ------------------
  |  Branch (1156:8): [True: 0, False: 9.20k]
  ------------------
 1157|      0|      VERBOSE(char buffer[STRERROR_LEN]);
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  ------------------
 1158|      0|      VERBOSE(int sockerr = SOCKERRNO);
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  ------------------
 1159|      0|      infof(data, "getsockname() failed with errno %d: %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1160|      0|            sockerr, curlx_strerror(sockerr, buffer, sizeof(buffer)));
 1161|      0|    }
 1162|  9.20k|    else {
 1163|  9.20k|      CURLcode result = sockaddr2string((struct sockaddr *)&ssloc, slen,
 1164|  9.20k|                                        ctx->ip.local_ip, &ctx->ip.local_port);
 1165|  9.20k|      if(result)
  ------------------
  |  Branch (1165:10): [True: 0, False: 9.20k]
  ------------------
 1166|      0|        infof(data, "ssloc inet_ntop() failed with %d", (int)result);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1167|  9.20k|    }
 1168|  9.20k|  }
 1169|       |#else
 1170|       |  (void)data;
 1171|       |#endif
 1172|  9.20k|}
cf-socket.c:cf_is_socket:
 2491|  3.36k|{
 2492|  3.36k|  return cf && (cf->cft == &Curl_cft_tcp ||
  ------------------
  |  Branch (2492:10): [True: 3.36k, False: 0]
  |  Branch (2492:17): [True: 0, False: 3.36k]
  ------------------
 2493|  3.36k|                cf->cft == &Curl_cft_udp ||
  ------------------
  |  Branch (2493:17): [True: 1.98k, False: 1.37k]
  ------------------
 2494|  1.37k|                cf->cft == &Curl_cft_unix ||
  ------------------
  |  Branch (2494:17): [True: 0, False: 1.37k]
  ------------------
 2495|  1.37k|                cf->cft == &Curl_cft_tcp_accept);
  ------------------
  |  Branch (2495:17): [True: 0, False: 1.37k]
  ------------------
 2496|  3.36k|}

Curl_cf_def_adjust_pollset:
   69|  55.0k|{
   70|       |  /* NOP */
   71|  55.0k|  (void)cf;
   72|  55.0k|  (void)data;
   73|  55.0k|  (void)ps;
   74|  55.0k|  return CURLE_OK;
   75|  55.0k|}
Curl_cf_def_data_pending:
   79|  34.0k|{
   80|  34.0k|  return cf->next ?
  ------------------
  |  Branch (80:10): [True: 17.0k, False: 17.0k]
  ------------------
   81|  17.0k|    cf->next->cft->has_data_pending(cf->next, data) : FALSE;
  ------------------
  |  |  989|  34.0k|#define FALSE false
  ------------------
   82|  34.0k|}
Curl_cf_def_send:
   87|  35.0k|{
   88|  35.0k|  if(cf->next)
  ------------------
  |  Branch (88:6): [True: 35.0k, False: 0]
  ------------------
   89|  35.0k|    return cf->next->cft->do_send(cf->next, data, buf, len, eos, pnwritten);
   90|      0|  *pnwritten = 0;
   91|      0|  return CURLE_RECV_ERROR;
   92|  35.0k|}
Curl_cf_def_recv:
   96|  1.24M|{
   97|  1.24M|  if(cf->next)
  ------------------
  |  Branch (97:6): [True: 1.24M, False: 0]
  ------------------
   98|  1.24M|    return cf->next->cft->do_recv(cf->next, data, buf, len, pnread);
   99|      0|  *pnread = 0;
  100|      0|  return CURLE_SEND_ERROR;
  101|  1.24M|}
Curl_cf_def_query:
  123|   289k|{
  124|   289k|  return cf->next ?
  ------------------
  |  Branch (124:10): [True: 289k, False: 16]
  ------------------
  125|   289k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  126|   289k|    CURLE_UNKNOWN_OPTION;
  127|   289k|}
Curl_cfchain_trc:
  134|   308k|{
  135|   308k|  if(CURL_TRC_M_is_verbose(data) && chain) {
  ------------------
  |  |  135|   308k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  ------------------
  |  |  |  |  329|   616k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|   616k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 308k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 76.1k, False: 232k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   616k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 76.1k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  76.1k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|   616k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  76.1k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 36.7k, False: 39.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (135:37): [True: 36.7k, False: 0]
  ------------------
  136|  36.7k|    struct Curl_cfilter *cf = chain->cf;
  137|  36.7k|    if(cf) {
  ------------------
  |  Branch (137:8): [True: 36.7k, False: 0]
  ------------------
  138|  36.7k|      char msg[256], *buf;
  139|  36.7k|      int blen, n;
  140|       |
  141|  36.7k|      buf = msg;
  142|  36.7k|      blen = sizeof(msg) - 1;
  143|  36.7k|      n = curl_msnprintf(buf, blen, "%s [CHAIN%s]%s", info,
  144|  36.7k|                         chain->primary ? "" : "-1",
  ------------------
  |  Branch (144:26): [True: 36.7k, False: 0]
  ------------------
  145|  36.7k|                         chain->parent ? "..." : "");
  ------------------
  |  Branch (145:26): [True: 36.6k, False: 133]
  ------------------
  146|  36.7k|      buf += n;
  147|  36.7k|      blen -= n;
  148|   284k|      for(; cf && blen; cf = cf->next) {
  ------------------
  |  Branch (148:13): [True: 248k, False: 36.7k]
  |  Branch (148:19): [True: 248k, False: 0]
  ------------------
  149|   248k|        n = curl_msnprintf(buf, blen, "[%s%s]",
  150|   248k|                           cf->connected ? "" : "!", cf->cft->name);
  ------------------
  |  Branch (150:28): [True: 173k, False: 74.9k]
  ------------------
  151|   248k|        buf += n;
  152|   248k|        blen -= n;
  153|   248k|      }
  154|  36.7k|      if(chain->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  36.7k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (154:10): [True: 36.0k, False: 785]
  ------------------
  155|  36.0k|        n = curl_msnprintf(buf, blen, "<fd=%" FMT_SOCKET_T ">",
  156|  36.0k|                           chain->sock);
  157|  36.0k|        blen -= n;
  158|  36.0k|      }
  159|  36.7k|      if(cf_report)
  ------------------
  |  Branch (159:10): [True: 36.6k, False: 129]
  ------------------
  160|  36.6k|        CURL_TRC_CF(data, cf_report, "%s%s", msg, blen ? "" : "...");
  ------------------
  |  |  153|  36.6k|  do {                                          \
  |  |  154|  36.6k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  36.6k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  73.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 36.6k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 36.6k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  73.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 36.6k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  36.6k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  36.6k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  36.6k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 36.6k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 36.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  73.3k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 36.6k, False: 0]
  |  |  ------------------
  |  |  156|  36.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 36.6k]
  |  |  ------------------
  ------------------
  161|    129|      else
  162|    129|        CURL_TRC_M(data, "%s%s", msg, blen ? "" : "...");
  ------------------
  |  |  148|    129|  do {                                   \
  |  |  149|    129|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|    129|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|    129|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|    258|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 129, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 129, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|    258|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 129, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    129|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|    129|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    129|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 129, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    258|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 129, False: 0]
  |  |  ------------------
  |  |  151|    129|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 129]
  |  |  ------------------
  ------------------
  163|  36.7k|    }
  164|      0|    else {
  165|      0|      if(cf_report)
  ------------------
  |  Branch (165:10): [True: 0, False: 0]
  ------------------
  166|      0|        CURL_TRC_CF(data, cf_report, "%s [%d][-]",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  167|      0|                    info, chain->primary ? 0 : 1);
  168|      0|      else
  169|      0|        CURL_TRC_M(data, "%s [%d][-]", info, chain->primary ? 0 : 1);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  170|      0|    }
  171|  36.7k|  }
  172|   308k|}
Curl_conn_cf_discard_chain:
  177|  37.3k|{
  178|  37.3k|  struct Curl_cfilter *cfn, *cf = *pcf;
  179|       |
  180|  37.3k|  if(cf) {
  ------------------
  |  Branch (180:6): [True: 16.7k, False: 20.6k]
  ------------------
  181|  16.7k|    *pcf = NULL;
  182|  76.3k|    while(cf) {
  ------------------
  |  Branch (182:11): [True: 59.6k, False: 16.7k]
  ------------------
  183|  59.6k|      cfn = cf->next;
  184|       |      /* prevent destroying filter to mess with its sub-chain, since
  185|       |       * we have the reference now and will call destroy on it.
  186|       |       */
  187|  59.6k|      cf->next = NULL;
  188|  59.6k|      cf->cft->destroy(cf, data);
  189|  59.6k|      curlx_free(cf);
  ------------------
  |  | 1503|  59.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  190|  59.6k|      cf = cfn;
  191|  59.6k|    }
  192|  16.7k|  }
  193|  37.3k|}
Curl_cf_recv:
  197|  9.62k|{
  198|  9.62k|  struct Curl_cfilter *cf;
  199|       |
  200|  9.62k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (200:3): [True: 0, False: 9.62k]
  |  Branch (200:3): [True: 9.62k, False: 0]
  ------------------
  201|  9.62k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 9.62k]
  |  Branch (201:3): [True: 9.62k, False: 0]
  ------------------
  202|       |
  203|  9.62k|  cf = data->conn->chain.cf;
  204|  9.62k|  while(cf && !cf->connected)
  ------------------
  |  Branch (204:9): [True: 9.62k, False: 0]
  |  Branch (204:15): [True: 0, False: 9.62k]
  ------------------
  205|      0|    cf = cf->next;
  206|  9.62k|  if(cf)
  ------------------
  |  Branch (206:6): [True: 9.62k, False: 0]
  ------------------
  207|  9.62k|    return cf->cft->do_recv(cf, data, buf, len, pnread);
  208|      0|  failf(data, "recv: no filter connected");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  209|      0|  DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:3): [Folded, False: 0]
  |  Branch (209:3): [Folded, False: 0]
  ------------------
  210|      0|  *pnread = 0;
  211|      0|  return CURLE_FAILED_INIT;
  212|      0|}
Curl_cf_send:
  217|  2.23k|{
  218|  2.23k|  struct Curl_cfilter *cf;
  219|       |
  220|  2.23k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (220:3): [True: 0, False: 2.23k]
  |  Branch (220:3): [True: 2.23k, False: 0]
  ------------------
  221|  2.23k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (221:3): [True: 0, False: 2.23k]
  |  Branch (221:3): [True: 2.23k, False: 0]
  ------------------
  222|       |
  223|  2.23k|  cf = data->conn->chain.cf;
  224|  2.23k|  while(cf && !cf->connected)
  ------------------
  |  Branch (224:9): [True: 2.23k, False: 0]
  |  Branch (224:15): [True: 0, False: 2.23k]
  ------------------
  225|      0|    cf = cf->next;
  226|  2.23k|  if(cf) {
  ------------------
  |  Branch (226:6): [True: 2.23k, False: 0]
  ------------------
  227|  2.23k|    return cf->cft->do_send(cf, data, buf, len, eos, pnwritten);
  228|  2.23k|  }
  229|      0|  failf(data, "send: no filter connected");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  230|      0|  DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (230:3): [Folded, False: 0]
  |  Branch (230:3): [Folded, False: 0]
  ------------------
  231|      0|  *pnwritten = 0;
  232|      0|  return CURLE_FAILED_INIT;
  233|      0|}
Curl_cf_recv_bufq:
  253|   129k|{
  254|   129k|  struct cf_io_ctx io;
  255|       |
  256|   129k|  if(!cf || !data) {
  ------------------
  |  Branch (256:6): [True: 0, False: 129k]
  |  Branch (256:13): [True: 0, False: 129k]
  ------------------
  257|      0|    *pnread = 0;
  258|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  259|      0|  }
  260|   129k|  io.data = data;
  261|   129k|  io.cf = cf;
  262|   129k|  return Curl_bufq_sipn(bufq, maxlen, cf_bufq_reader, &io, pnread);
  263|   129k|}
Curl_cf_send_bufq:
  278|  8.43k|{
  279|  8.43k|  struct cf_io_ctx io;
  280|       |
  281|  8.43k|  if(!cf || !data) {
  ------------------
  |  Branch (281:6): [True: 0, False: 8.43k]
  |  Branch (281:13): [True: 0, False: 8.43k]
  ------------------
  282|      0|    *pnwritten = 0;
  283|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  284|      0|  }
  285|  8.43k|  io.data = data;
  286|  8.43k|  io.cf = cf;
  287|  8.43k|  if(buf && blen)
  ------------------
  |  Branch (287:6): [True: 0, False: 8.43k]
  |  Branch (287:13): [True: 0, False: 0]
  ------------------
  288|      0|    return Curl_bufq_write_pass(bufq, buf, blen, cf_bufq_writer, &io,
  289|      0|                                pnwritten);
  290|  8.43k|  else
  291|  8.43k|    return Curl_bufq_pass(bufq, cf_bufq_writer, &io, pnwritten);
  292|  8.43k|}
Curl_cf_create:
  297|  67.4k|{
  298|  67.4k|  struct Curl_cfilter *cf;
  299|  67.4k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  300|       |
  301|  67.4k|  DEBUGASSERT(cft);
  ------------------
  |  | 1016|  67.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (301:3): [True: 0, False: 67.4k]
  |  Branch (301:3): [True: 67.4k, False: 0]
  ------------------
  302|  67.4k|  cf = curlx_calloc(1, sizeof(*cf));
  ------------------
  |  | 1500|  67.4k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  303|  67.4k|  if(!cf)
  ------------------
  |  Branch (303:6): [True: 20, False: 67.4k]
  ------------------
  304|     20|    goto out;
  305|       |
  306|  67.4k|  cf->cft = cft;
  307|  67.4k|  cf->ctx = ctx;
  308|  67.4k|  result = CURLE_OK;
  309|  67.4k|out:
  310|  67.4k|  *pcf = cf;
  311|  67.4k|  return result;
  312|  67.4k|}
Curl_cfchain_init:
  317|  9.42k|{
  318|  9.42k|  chain->cf = NULL;
  319|  9.42k|  chain->parent = NULL;
  320|  9.42k|  chain->conn = conn;
  321|  9.42k|  chain->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  9.42k|#define CURL_SOCKET_BAD (-1)
  ------------------
  322|  9.42k|  chain->shutdown_start_ms = -1;
  323|  9.42k|  chain->primary = primary;
  324|       |  chain->ipv6 = FALSE;
  ------------------
  |  |  989|  9.42k|#define FALSE false
  ------------------
  325|  9.42k|}
Curl_cfchain_init_child:
  329|  18.5k|{
  330|  18.5k|  chain->cf = NULL;
  331|  18.5k|  chain->parent = parent;
  332|  18.5k|  chain->conn = parent->conn;
  333|  18.5k|  chain->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  18.5k|#define CURL_SOCKET_BAD (-1)
  ------------------
  334|  18.5k|  chain->shutdown_start_ms = parent->shutdown_start_ms;
  335|  18.5k|  chain->primary = parent->primary;
  336|       |  chain->ipv6 = FALSE;
  ------------------
  |  |  989|  18.5k|#define FALSE false
  ------------------
  337|  18.5k|}
Curl_cfchain_reset:
  341|  37.3k|{
  342|  37.3k|  Curl_conn_cf_discard_chain(&chain->cf, data);
  343|  37.3k|  chain->sock = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  37.3k|#define CURL_SOCKET_BAD (-1)
  ------------------
  344|  37.3k|  chain->shutdown_start_ms = -1;
  345|       |  chain->ipv6 = FALSE;
  ------------------
  |  |  989|  37.3k|#define FALSE false
  ------------------
  346|  37.3k|}
Curl_cfchain_cleanup:
  350|  27.9k|{
  351|  27.9k|  Curl_cfchain_reset(chain, data);
  352|  27.9k|  chain->conn = NULL;
  353|       |  chain->parent = NULL;
  354|  27.9k|}
Curl_cfchain_add:
  358|  32.0k|{
  359|  32.0k|  if(cf) {
  ------------------
  |  Branch (359:6): [True: 32.0k, False: 0]
  ------------------
  360|  32.0k|    DEBUGASSERT(!cf->next);
  ------------------
  |  | 1016|  32.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (360:5): [True: 0, False: 32.0k]
  |  Branch (360:5): [True: 32.0k, False: 0]
  ------------------
  361|  32.0k|    cf->next = chain->cf;
  362|  32.0k|    chain->cf = cf;
  363|  32.0k|    cf->chain = chain;
  364|  32.0k|  }
  365|  32.0k|}
Curl_cfchain_merge:
  369|  11.1k|{
  370|  11.1k|  struct Curl_cfilter **panchor = &dest->cf;
  371|  11.1k|  struct Curl_cfilter *cf = chain->cf;
  372|       |  /* get the `next` pointer of the last filter */
  373|  33.4k|  while(*panchor)
  ------------------
  |  Branch (373:9): [True: 22.2k, False: 11.1k]
  ------------------
  374|  22.2k|    panchor = &(*panchor)->next;
  375|       |  /* Append to last dest filter and set cf->chain to dest */
  376|  11.1k|  *panchor = cf;
  377|  30.1k|  for(; cf; cf = cf->next)
  ------------------
  |  Branch (377:9): [True: 18.9k, False: 11.1k]
  ------------------
  378|  18.9k|    cf->chain = dest;
  379|       |  /* filters have been moved, clear `chain` */
  380|  11.1k|  chain->cf = NULL;
  381|  11.1k|  if(chain->sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  11.1k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (381:6): [True: 11.1k, False: 0]
  ------------------
  382|  11.1k|    DEBUGASSERT(dest->sock == CURL_SOCKET_BAD);
  ------------------
  |  | 1016|  11.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (382:5): [True: 0, False: 11.1k]
  |  Branch (382:5): [True: 11.1k, False: 0]
  ------------------
  383|  11.1k|    dest->sock = chain->sock;
  384|  11.1k|    dest->ipv6 = chain->ipv6;
  385|  11.1k|  }
  386|  11.1k|}
Curl_conn_cf_insert_after:
  390|  28.1k|{
  391|  28.1k|  struct Curl_cfilter *tail, **pnext;
  392|       |
  393|  28.1k|  DEBUGASSERT(cf_at);
  ------------------
  |  | 1016|  28.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (393:3): [True: 0, False: 28.1k]
  |  Branch (393:3): [True: 28.1k, False: 0]
  ------------------
  394|  28.1k|  DEBUGASSERT(cf_new);
  ------------------
  |  | 1016|  28.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (394:3): [True: 0, False: 28.1k]
  |  Branch (394:3): [True: 28.1k, False: 0]
  ------------------
  395|  28.1k|  DEBUGASSERT(!cf_new->chain);
  ------------------
  |  | 1016|  28.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (395:3): [True: 0, False: 28.1k]
  |  Branch (395:3): [True: 28.1k, False: 0]
  ------------------
  396|       |
  397|  28.1k|  tail = cf_at->next;
  398|  28.1k|  cf_at->next = cf_new;
  399|  28.1k|  do {
  400|  28.1k|    cf_new->chain = cf_at->chain;
  401|  28.1k|    pnext = &cf_new->next;
  402|  28.1k|    cf_new = cf_new->next;
  403|  28.1k|  } while(cf_new);
  ------------------
  |  Branch (403:11): [True: 0, False: 28.1k]
  ------------------
  404|  28.1k|  *pnext = tail;
  405|  28.1k|}
Curl_conn_cf_connect:
  434|   435k|{
  435|   435k|  if(cf)
  ------------------
  |  Branch (435:6): [True: 435k, False: 0]
  ------------------
  436|   435k|    return cf->cft->do_connect(cf, data, done);
  437|      0|  return CURLE_FAILED_INIT;
  438|   435k|}
Curl_conn_cf_send:
  443|  11.1k|{
  444|  11.1k|  if(cf)
  ------------------
  |  Branch (444:6): [True: 11.1k, False: 0]
  ------------------
  445|  11.1k|    return cf->cft->do_send(cf, data, buf, len, eos, pnwritten);
  446|      0|  *pnwritten = 0;
  447|      0|  return CURLE_SEND_ERROR;
  448|  11.1k|}
Curl_conn_cf_recv:
  452|  1.11M|{
  453|  1.11M|  if(cf)
  ------------------
  |  Branch (453:6): [True: 1.11M, False: 0]
  ------------------
  454|  1.11M|    return cf->cft->do_recv(cf, data, buf, len, pnread);
  455|      0|  *pnread = 0;
  456|      0|  return CURLE_RECV_ERROR;
  457|  1.11M|}
Curl_conn_cf_is_ip_connected:
  470|  12.9k|{
  471|  12.9k|  if(cf) {
  ------------------
  |  Branch (471:6): [True: 12.9k, False: 12]
  ------------------
  472|  12.9k|    int value = 0;
  473|  12.9k|    if(!cf->cft->query(cf, data, CF_QUERY_REALLY_CONNECTED, &value, NULL))
  ------------------
  |  |  182|  12.9k|#define CF_QUERY_REALLY_CONNECTED  16  /* TRUE/FALSE - */
  ------------------
  |  Branch (473:8): [True: 12.7k, False: 182]
  ------------------
  474|  12.7k|      return !!value;
  475|  12.9k|  }
  476|    194|  return FALSE;
  ------------------
  |  |  989|    194|#define FALSE false
  ------------------
  477|  12.9k|}
Curl_conn_cntrl_update_info:
  481|  1.95k|{
  482|  1.95k|  cf_cntrl_all(conn, data, TRUE, CF_CTRL_CONN_INFO_UPDATE, 0, NULL);
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
                cf_cntrl_all(conn, data, TRUE, CF_CTRL_CONN_INFO_UPDATE, 0, NULL);
  ------------------
  |  |  121|  1.95k|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  483|  1.95k|}
Curl_cfchain_cntrl_report_stats:
  487|  8.48k|{
  488|  8.48k|  (void)Curl_conn_cf_cntrl(chain->cf, data, TRUE,
  ------------------
  |  |  986|  8.48k|#define TRUE true
  ------------------
  489|  8.48k|                           CF_CTRL_REPORT_STATS, 0, NULL);
  ------------------
  |  |  124|  8.48k|#define CF_CTRL_REPORT_STATS     (256 + 3) /* 0          NULL     ignored */
  ------------------
  490|  8.48k|}
Curl_cfchain_remove_setup_filters:
  494|  1.95k|{
  495|  1.95k|  struct Curl_cfilter **anchor = &chain->cf;
  496|  13.7k|  while(*anchor) {
  ------------------
  |  Branch (496:9): [True: 11.7k, False: 1.95k]
  ------------------
  497|  11.7k|    struct Curl_cfilter *cf = *anchor;
  498|  11.7k|    if(cf->connected && (cf->cft->flags & CF_TYPE_SETUP)) {
  ------------------
  |  |  215|  11.7k|#define CF_TYPE_SETUP       (1 << 5)
  ------------------
  |  Branch (498:8): [True: 11.7k, False: 0]
  |  Branch (498:25): [True: 7.83k, False: 3.91k]
  ------------------
  499|  7.83k|      *anchor = cf->next;
  500|  7.83k|      cf->next = NULL;
  501|  7.83k|      CURL_TRC_CF(data, cf, "removing connected setup filter");
  ------------------
  |  |  153|  7.83k|  do {                                          \
  |  |  154|  7.83k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  7.83k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  15.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.83k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 588, False: 7.24k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  15.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 588, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    588|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.83k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    588|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 588, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 16, False: 572]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.83k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.83k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.83k]
  |  |  ------------------
  ------------------
  502|  7.83k|      cf->cft->destroy(cf, data);
  503|  7.83k|      curlx_free(cf);
  ------------------
  |  | 1503|  7.83k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  504|  7.83k|    }
  505|  3.91k|    else
  506|  3.91k|      anchor = &cf->next;
  507|  11.7k|  }
  508|  1.95k|}
Curl_cfchain_is_connected:
  511|   149k|{
  512|   149k|  if(chain->cf)
  ------------------
  |  Branch (512:6): [True: 149k, False: 0]
  ------------------
  513|   149k|    return (bool)chain->cf->connected;
  514|      0|  else if(chain->conn->scheme->flags & PROTOPT_NONETWORK)
  ------------------
  |  |  221|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (514:11): [True: 0, False: 0]
  ------------------
  515|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  516|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  517|   149k|}
Curl_conn_is_connected:
  520|   149k|{
  521|   149k|  return Curl_cfchain_is_connected(&conn->chain);
  522|   149k|}
Curl_cfchain_is_ssl:
  573|  5.86k|{
  574|  5.86k|  return cf_is_ssl(chain->cf);
  575|  5.86k|}
Curl_conn_is_ssl:
  578|  3.90k|{
  579|  3.90k|  return conn ? Curl_cfchain_is_ssl(&conn->chain) : FALSE;
  ------------------
  |  |  989|  3.90k|#define FALSE false
  ------------------
  |  Branch (579:10): [True: 3.90k, False: 0]
  ------------------
  580|  3.90k|}
Curl_conn_is_multiplex:
  619|  12.3k|{
  620|  12.3k|  return cfchain_is_multiplex(&conn->chain);
  621|  12.3k|}
Curl_conn_has_safe_eos:
  634|  9.62k|{
  635|  9.62k|  struct Curl_cfilter *cf;
  636|       |
  637|  9.62k|  for(cf = conn->chain.cf; cf; cf = cf->next) {
  ------------------
  |  Branch (637:28): [True: 9.62k, False: 0]
  ------------------
  638|  9.62k|    if(cf->cft->flags & CF_TYPE_SAFE_EOS)
  ------------------
  |  |  218|  9.62k|#define CF_TYPE_SAFE_EOS    (1 << 8)
  ------------------
  |  Branch (638:8): [True: 9.62k, False: 0]
  ------------------
  639|  9.62k|      return TRUE;
  ------------------
  |  |  986|  9.62k|#define TRUE true
  ------------------
  640|      0|    if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  210|      0|#define CF_TYPE_IP_CONNECT  (1 << 0)
  ------------------
                  if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  211|      0|#define CF_TYPE_SSL         (1 << 1)
  ------------------
  |  Branch (640:8): [True: 0, False: 0]
  ------------------
  641|      0|      return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  642|      0|  }
  643|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  644|  9.62k|}
Curl_socktype_for_transport:
  654|  9.40k|{
  655|  9.40k|  switch(transport) {
  656|  7.40k|  case TRNSPRT_TCP:
  ------------------
  |  |  225|  7.40k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (656:3): [True: 7.40k, False: 1.99k]
  ------------------
  657|  7.40k|    return SOCK_STREAM;
  658|      0|  case TRNSPRT_UNIX:
  ------------------
  |  |  228|      0|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (658:3): [True: 0, False: 9.40k]
  ------------------
  659|      0|    return SOCK_STREAM;
  660|  1.99k|  default: /* UDP and QUIC */
  ------------------
  |  Branch (660:3): [True: 1.99k, False: 7.40k]
  ------------------
  661|       |    return SOCK_DGRAM;
  662|  9.40k|  }
  663|  9.40k|}
Curl_protocol_for_transport:
  666|  9.40k|{
  667|  9.40k|  switch(transport) {
  668|  7.40k|  case TRNSPRT_TCP:
  ------------------
  |  |  225|  7.40k|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (668:3): [True: 7.40k, False: 1.99k]
  ------------------
  669|  7.40k|    return IPPROTO_TCP;
  670|      0|  case TRNSPRT_UNIX:
  ------------------
  |  |  228|      0|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (670:3): [True: 0, False: 9.40k]
  ------------------
  671|      0|    return IPPROTO_IP;
  672|  1.99k|  default: /* UDP and QUIC */
  ------------------
  |  Branch (672:3): [True: 1.99k, False: 7.40k]
  ------------------
  673|       |    return IPPROTO_UDP;
  674|  9.40k|  }
  675|  9.40k|}
Curl_conn_cf_http_version:
  679|  1.94k|{
  680|  1.94k|  CURLcode result = CURLE_UNKNOWN_OPTION;
  681|  1.94k|  uint8_t v = 0;
  682|       |
  683|  1.94k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (683:9): [True: 1.94k, False: 0]
  ------------------
  684|  1.94k|    if(cf->cft->flags & CF_TYPE_HTTP) {
  ------------------
  |  |  214|  1.94k|#define CF_TYPE_HTTP        (1 << 4)
  ------------------
  |  Branch (684:8): [True: 1.94k, False: 0]
  ------------------
  685|  1.94k|      int value = 0;
  686|  1.94k|      result = cf->cft->query(cf, data, CF_QUERY_HTTP_VERSION, &value, NULL);
  ------------------
  |  |  173|  1.94k|#define CF_QUERY_HTTP_VERSION       9  /* number (10/11/20/30)   - */
  ------------------
  687|  1.94k|      if(!result && ((value < 0) || (value > 255)))
  ------------------
  |  Branch (687:10): [True: 1.94k, False: 0]
  |  Branch (687:22): [True: 0, False: 1.94k]
  |  Branch (687:37): [True: 0, False: 1.94k]
  ------------------
  688|      0|        result = CURLE_FAILED_INIT;
  689|  1.94k|      else
  690|  1.94k|        v = (uint8_t)value;
  691|  1.94k|      break;
  692|  1.94k|    }
  693|      0|    if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  210|      0|#define CF_TYPE_IP_CONNECT  (1 << 0)
  ------------------
                  if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  211|      0|#define CF_TYPE_SSL         (1 << 1)
  ------------------
  |  Branch (693:8): [True: 0, False: 0]
  ------------------
  694|      0|      break;
  695|      0|  }
  696|  1.94k|  return (uint8_t)(result ? 0 : v);
  ------------------
  |  Branch (696:20): [True: 0, False: 1.94k]
  ------------------
  697|  1.94k|}
Curl_conn_http_version:
  701|  1.94k|{
  702|  1.94k|  return Curl_conn_cf_http_version(data, conn->chain.cf);
  703|  1.94k|}
Curl_cfchain_data_pending:
  707|  17.0k|{
  708|  17.0k|  struct Curl_cfilter *cf = chain->cf;
  709|       |
  710|  17.0k|  while(cf && !cf->connected)
  ------------------
  |  Branch (710:9): [True: 17.0k, False: 0]
  |  Branch (710:15): [True: 0, False: 17.0k]
  ------------------
  711|      0|    cf = cf->next;
  712|  17.0k|  return cf ? cf->cft->has_data_pending(cf, data) : FALSE;
  ------------------
  |  |  989|  17.0k|#define FALSE false
  ------------------
  |  Branch (712:10): [True: 17.0k, False: 0]
  ------------------
  713|  17.0k|}
Curl_conn_data_pending:
  716|  17.0k|{
  717|  17.0k|  return data->conn ?
  ------------------
  |  Branch (717:10): [True: 17.0k, False: 0]
  ------------------
  718|  17.0k|         Curl_cfchain_data_pending(data, &data->conn->chain) :
  719|       |         FALSE;
  ------------------
  |  |  989|  17.0k|#define FALSE false
  ------------------
  720|  17.0k|}
Curl_cfchain_needs_flush:
  724|   264k|{
  725|   264k|  struct Curl_cfilter *cf = chain->cf;
  726|   264k|  int pending = 0;
  727|   264k|  CURLcode result = cf ? cf->cft->query(cf, data, CF_QUERY_NEED_FLUSH,
  ------------------
  |  |  171|   264k|#define CF_QUERY_NEED_FLUSH         7  /* TRUE/FALSE - */
  ------------------
  |  Branch (727:21): [True: 264k, False: 0]
  ------------------
  728|   264k|                                        &pending, NULL) : CURLE_UNKNOWN_OPTION;
  729|   264k|  return (result || !pending) ? FALSE : TRUE;
  ------------------
  |  |  989|   264k|#define FALSE false
  ------------------
                return (result || !pending) ? FALSE : TRUE;
  ------------------
  |  |  986|   264k|#define TRUE true
  ------------------
  |  Branch (729:11): [True: 252k, False: 11.5k]
  |  Branch (729:21): [True: 0, False: 11.5k]
  ------------------
  730|   264k|}
Curl_conn_cf_adjust_pollset:
  735|   130k|{
  736|   130k|  CURLcode result = CURLE_OK;
  737|       |  /* Go through all filters, top to bottom, and let them manage the pollset
  738|       |   * - connected filters can do so
  739|       |   * - CF_TYPE_DNS filters can
  740|       |   * - unconnected filters without next or connect next can
  741|       |   */
  742|   678k|  for(; cf && !result; cf = cf->next) {
  ------------------
  |  Branch (742:9): [True: 547k, False: 130k]
  |  Branch (742:15): [True: 547k, False: 0]
  ------------------
  743|   547k|    if(cf->shutdown)
  ------------------
  |  Branch (743:8): [True: 0, False: 547k]
  ------------------
  744|      0|      continue;
  745|   547k|    if(cf->connected || (cf->cft->flags & CF_TYPE_DNS) ||
  ------------------
  |  |  216|   251k|#define CF_TYPE_DNS         (1 << 6)
  ------------------
  |  Branch (745:8): [True: 296k, False: 251k]
  |  Branch (745:25): [True: 69.3k, False: 181k]
  ------------------
  746|   181k|       !cf->next || cf->next->connected)
  ------------------
  |  Branch (746:8): [True: 63.2k, False: 118k]
  |  Branch (746:21): [True: 59.1k, False: 59.3k]
  ------------------
  747|   488k|      result = cf->cft->adjust_pollset(cf, data, ps);
  748|   547k|  }
  749|   130k|  return result;
  750|   130k|}
Curl_cfchain_adjust_pollset:
  755|  69.9k|{
  756|       |  /* During connect time, connection filters may add sockets to the pollset
  757|       |   * even when the transfer neither wants to send nor receive. And those
  758|       |   * sockets, when having events, are served. The same applies to a
  759|       |   * filter chain whose shutdown has started.
  760|       |   * Once a filter chain is connected however and before its shutdown
  761|       |   * starts, a transfer that neither wants to send nor receive
  762|       |   * will never call the connection filters. Any sockets added by the filters
  763|       |   * will not change state and POLLIN/POLLOUT events will trigger forever,
  764|       |   * making us busy loop. See #21671.
  765|       |   * Gate each filter chain on its own state, so that one chain being in
  766|       |   * connect or shutdown does not add poll events for the other. Check
  767|       |   * against the transfer's own interest, before any chain added sockets
  768|       |   * of its own. */
  769|  69.9k|  if(chain->cf &&
  ------------------
  |  Branch (769:6): [True: 67.8k, False: 2.10k]
  ------------------
  770|  67.8k|     (!!ps->n || !chain->cf->connected || CURL_CFCHAIN_IN_SHUTDOWN(chain))) {
  ------------------
  |  |   60|      0|#define CURL_CFCHAIN_IN_SHUTDOWN(c)  ((c)->shutdown_start_ms >= 0)
  |  |  ------------------
  |  |  |  Branch (60:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (770:7): [True: 8.50k, False: 59.3k]
  |  Branch (770:18): [True: 59.3k, False: 0]
  ------------------
  771|  67.8k|    return Curl_conn_cf_adjust_pollset(chain->cf, data, ps);
  772|  67.8k|  }
  773|  2.10k|  return CURLE_OK;
  774|  69.9k|}
Curl_conn_adjust_pollset:
  779|  69.9k|{
  780|  69.9k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  69.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (780:3): [True: 0, False: 69.9k]
  |  Branch (780:3): [True: 69.9k, False: 0]
  ------------------
  781|  69.9k|  DEBUGASSERT(conn);
  ------------------
  |  | 1016|  69.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (781:3): [True: 0, False: 69.9k]
  |  Branch (781:3): [True: 69.9k, False: 0]
  ------------------
  782|  69.9k|  return Curl_cfchain_adjust_pollset(data, &conn->chain, ps);
  783|  69.9k|}
Curl_conn_cf_cntrl:
  865|  60.8k|{
  866|  60.8k|  CURLcode result = CURLE_OK;
  867|       |
  868|   230k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (868:9): [True: 175k, False: 55.1k]
  ------------------
  869|   175k|    if(cf->cft->cntrl == Curl_cf_def_cntrl)
  ------------------
  |  Branch (869:8): [True: 68.1k, False: 107k]
  ------------------
  870|  68.1k|      continue;
  871|   107k|    result = cf->cft->cntrl(cf, data, event, arg1, arg2);
  872|   107k|    if(!ignore_result && result)
  ------------------
  |  Branch (872:8): [True: 26.9k, False: 80.0k]
  |  Branch (872:26): [True: 5.72k, False: 21.2k]
  ------------------
  873|  5.72k|      break;
  874|   107k|  }
  875|  60.8k|  return result;
  876|  60.8k|}
Curl_conn_cf_get_alpn_negotiated:
  889|  9.17k|{
  890|  9.17k|  const char *alpn = NULL;
  891|  9.17k|  CURL_TRC_CF(data, cf, "query ALPN");
  ------------------
  |  |  153|  9.17k|  do {                                          \
  |  |  154|  9.17k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.17k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.17k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 864, False: 8.31k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 864, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    864|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.17k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    864|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 864, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 156, False: 708]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.17k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.17k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.17k]
  |  |  ------------------
  ------------------
  892|  9.17k|  if(cf && !cf->cft->query(cf, data, CF_QUERY_ALPN_NEGOTIATED, NULL,
  ------------------
  |  |  181|  9.17k|#define CF_QUERY_ALPN_NEGOTIATED   15  /* -          const char * */
  ------------------
  |  Branch (892:6): [True: 9.17k, False: 0]
  |  Branch (892:12): [True: 1.95k, False: 7.22k]
  ------------------
  893|  9.17k|                           CURL_UNCONST(&alpn)))
  ------------------
  |  |  793|  9.17k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  894|  1.95k|    return alpn;
  895|  7.22k|  return NULL;
  896|  9.17k|}
Curl_conn_cf_get_ip_info:
  912|    304|{
  913|    304|  CURLcode result = CURLE_UNKNOWN_OPTION;
  914|    304|  if(cf) {
  ------------------
  |  Branch (914:6): [True: 304, False: 0]
  ------------------
  915|    304|    int ipv6 = 0;
  916|    304|    result = cf->cft->query(cf, data, CF_QUERY_IP_INFO, &ipv6, ipquad);
  ------------------
  |  |  172|    304|#define CF_QUERY_IP_INFO            8  /* TRUE/FALSE struct ip_quadruple */
  ------------------
  917|    304|    *is_ipv6 = !!ipv6;
  918|    304|  }
  919|    304|  return result;
  920|    304|}
Curl_conn_ev_data_setup:
  944|  9.39k|{
  945|  9.39k|  return cf_cntrl_all(data->conn, data, FALSE, CF_CTRL_DATA_SETUP, 0, NULL);
  ------------------
  |  |  989|  9.39k|#define FALSE false
  ------------------
                return cf_cntrl_all(data->conn, data, FALSE, CF_CTRL_DATA_SETUP, 0, NULL);
  ------------------
  |  |  115|  9.39k|#define CF_CTRL_DATA_SETUP              4  /* 0          NULL     first fail */
  ------------------
  946|  9.39k|}
Curl_cfchain_flush:
  950|  5.75k|{
  951|  5.75k|  return Curl_conn_cf_cntrl(chain->cf, data, FALSE, CF_CTRL_FLUSH, 0, NULL);
  ------------------
  |  |  989|  5.75k|#define FALSE false
  ------------------
                return Curl_conn_cf_cntrl(chain->cf, data, FALSE, CF_CTRL_FLUSH, 0, NULL);
  ------------------
  |  |  123|  5.75k|#define CF_CTRL_FLUSH            (256 + 2) /* 0          NULL     first fail */
  ------------------
  952|  5.75k|}
Curl_conn_ev_data_done:
  965|  9.37k|{
  966|  9.37k|  cf_cntrl_all(data->conn, data, TRUE, CF_CTRL_DATA_DONE, premature, NULL);
  ------------------
  |  |  986|  9.37k|#define TRUE true
  ------------------
                cf_cntrl_all(data->conn, data, TRUE, CF_CTRL_DATA_DONE, premature, NULL);
  ------------------
  |  |  118|  9.37k|#define CF_CTRL_DATA_DONE               7  /* premature  NULL     ignored */
  ------------------
  967|  9.37k|}
Curl_conn_get_max_concurrent:
  993|  1.94k|{
  994|  1.94k|  struct Curl_cfilter *cf;
  995|  1.94k|  CURLcode result;
  996|  1.94k|  int n = -1;
  997|       |
  998|  1.94k|  cf = conn->chain.cf;
  999|  1.94k|  result = cf ? cf->cft->query(cf, data, CF_QUERY_MAX_CONCURRENT,
  ------------------
  |  |  167|  1.94k|#define CF_QUERY_MAX_CONCURRENT     1  /* number     -        */
  ------------------
  |  Branch (999:12): [True: 1.94k, False: 0]
  ------------------
 1000|  1.94k|                               &n, NULL) : CURLE_UNKNOWN_OPTION;
 1001|       |  /* If no filter answered the query, the default is a non-multiplexed
 1002|       |   * connection with limit 1. Otherwise, the query may return 0
 1003|       |   * for connections that are in shutdown, e.g. server HTTP/2 GOAWAY. */
 1004|  1.94k|  return (result || n < 0) ? 1 : (size_t)n;
  ------------------
  |  Branch (1004:11): [True: 0, False: 1.94k]
  |  Branch (1004:21): [True: 0, False: 1.94k]
  ------------------
 1005|  1.94k|}
Curl_conn_recv:
 1022|  9.62k|{
 1023|  9.62k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1023:3): [True: 0, False: 9.62k]
  |  Branch (1023:3): [True: 9.62k, False: 0]
  ------------------
 1024|  9.62k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1024:3): [True: 0, False: 9.62k]
  |  Branch (1024:3): [True: 9.62k, False: 0]
  ------------------
 1025|  9.62k|  if(data && data->conn && data->conn->do_recv)
  ------------------
  |  Branch (1025:6): [True: 9.62k, False: 0]
  |  Branch (1025:14): [True: 9.62k, False: 0]
  |  Branch (1025:28): [True: 9.62k, False: 0]
  ------------------
 1026|  9.62k|    return data->conn->do_recv(data, buf, len, pnread);
 1027|      0|  *pnread = 0;
 1028|      0|  return CURLE_FAILED_INIT;
 1029|  9.62k|}
Curl_conn_send:
 1034|  2.23k|{
 1035|  2.23k|  size_t write_len = len;
 1036|       |
 1037|  2.23k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1037:3): [True: 0, False: 2.23k]
  |  Branch (1037:3): [True: 2.23k, False: 0]
  ------------------
 1038|  2.23k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1038:3): [True: 0, False: 2.23k]
  |  Branch (1038:3): [True: 2.23k, False: 0]
  ------------------
 1039|  2.23k|#ifdef DEBUGBUILD
 1040|  2.23k|  if(write_len) {
  ------------------
  |  Branch (1040:6): [True: 2.18k, False: 52]
  ------------------
 1041|       |    /* Allow debug builds to override this logic to force short sends */
 1042|  2.18k|    const char *p = getenv("CURL_SMALLSENDS");
 1043|  2.18k|    if(p) {
  ------------------
  |  Branch (1043:8): [True: 0, False: 2.18k]
  ------------------
 1044|      0|      curl_off_t altsize;
 1045|      0|      if(!curlx_str_number(&p, &altsize, write_len)) {
  ------------------
  |  Branch (1045:10): [True: 0, False: 0]
  ------------------
 1046|      0|        write_len = (size_t)altsize;
 1047|      0|        if(write_len != len)
  ------------------
  |  Branch (1047:12): [True: 0, False: 0]
  ------------------
 1048|      0|          eos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1049|      0|      }
 1050|      0|    }
 1051|  2.18k|  }
 1052|  2.23k|#endif
 1053|  2.23k|  if(data && data->conn && data->conn->do_send) {
  ------------------
  |  Branch (1053:6): [True: 2.23k, False: 0]
  |  Branch (1053:14): [True: 2.23k, False: 0]
  |  Branch (1053:28): [True: 2.23k, False: 0]
  ------------------
 1054|  2.23k|    CURLcode result =
 1055|  2.23k|      data->conn->do_send(data, buf, write_len, eos, pnwritten);
 1056|  2.23k|    if(!result && (*pnwritten > write_len)) {
  ------------------
  |  Branch (1056:8): [True: 2.16k, False: 74]
  |  Branch (1056:19): [True: 0, False: 2.16k]
  ------------------
 1057|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1057:7): [Folded, False: 0]
  |  Branch (1057:7): [Folded, False: 0]
  ------------------
 1058|      0|      *pnwritten = 0;
 1059|      0|      return CURLE_SEND_ERROR;
 1060|      0|    }
 1061|  2.23k|    return result;
 1062|  2.23k|  }
 1063|      0|  *pnwritten = 0;
 1064|      0|  return CURLE_FAILED_INIT;
 1065|  2.23k|}
cfilters.c:cf_bufq_reader:
  243|   129k|{
  244|   129k|  struct cf_io_ctx *io = writer_ctx;
  245|   129k|  return Curl_conn_cf_recv(io->cf, io->data, (char *)buf, blen, pnread);
  246|   129k|}
cfilters.c:cf_bufq_writer:
  268|  8.44k|{
  269|  8.44k|  struct cf_io_ctx *io = writer_ctx;
  270|       |  return Curl_conn_cf_send(io->cf, io->data, buf, buflen, FALSE, pnwritten);
  ------------------
  |  |  989|  8.44k|#define FALSE false
  ------------------
  271|  8.44k|}
cfilters.c:cf_cntrl_all:
  463|  20.7k|{
  464|  20.7k|  return Curl_conn_cf_cntrl(conn->chain.cf, data, ignore_result,
  465|  20.7k|                            event, arg1, arg2);
  466|  20.7k|}
cfilters.c:cf_is_ssl:
  560|  5.86k|{
  561|  17.6k|  for(; cf; cf = cf->next) {
  ------------------
  |  Branch (561:9): [True: 17.6k, False: 0]
  ------------------
  562|       |    /* A tunneling proxy does not offer end2end encryption, even if
  563|       |     * it does SSL itself (e.g. QUIC H3 proxy) */
  564|  17.6k|    if((cf->cft->flags & CF_TYPE_SSL) && !(cf->cft->flags & CF_TYPE_PROXY))
  ------------------
  |  |  211|  17.6k|#define CF_TYPE_SSL         (1 << 1)
  ------------------
                  if((cf->cft->flags & CF_TYPE_SSL) && !(cf->cft->flags & CF_TYPE_PROXY))
  ------------------
  |  |  213|  5.86k|#define CF_TYPE_PROXY       (1 << 3)
  ------------------
  |  Branch (564:8): [True: 5.86k, False: 11.7k]
  |  Branch (564:42): [True: 5.86k, False: 0]
  ------------------
  565|  5.86k|      return TRUE;
  ------------------
  |  |  986|  5.86k|#define TRUE true
  ------------------
  566|  11.7k|    if(cf->cft->flags & CF_TYPE_IP_CONNECT)
  ------------------
  |  |  210|  11.7k|#define CF_TYPE_IP_CONNECT  (1 << 0)
  ------------------
  |  Branch (566:8): [True: 0, False: 11.7k]
  ------------------
  567|      0|      return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  568|  11.7k|  }
  569|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  570|  5.86k|}
cfilters.c:cfchain_is_multiplex:
  607|  12.3k|{
  608|  12.3k|  struct Curl_cfilter *cf;
  609|  29.2k|  for(cf = chain->cf; cf; cf = cf->next) {
  ------------------
  |  Branch (609:23): [True: 21.6k, False: 7.57k]
  ------------------
  610|  21.6k|    if(cf->cft->flags & CF_TYPE_MULTIPLEX)
  ------------------
  |  |  212|  21.6k|#define CF_TYPE_MULTIPLEX   (1 << 2)
  ------------------
  |  Branch (610:8): [True: 4.74k, False: 16.9k]
  ------------------
  611|  4.74k|      return TRUE;
  ------------------
  |  |  986|  4.74k|#define TRUE true
  ------------------
  612|  16.9k|    if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  210|  16.9k|#define CF_TYPE_IP_CONNECT  (1 << 0)
  ------------------
                  if(cf->cft->flags & (CF_TYPE_IP_CONNECT | CF_TYPE_SSL))
  ------------------
  |  |  211|  16.9k|#define CF_TYPE_SSL         (1 << 1)
  ------------------
  |  Branch (612:8): [True: 0, False: 16.9k]
  ------------------
  613|      0|      return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  614|  16.9k|  }
  615|  7.57k|  return FALSE;
  ------------------
  |  |  989|  7.57k|#define FALSE false
  ------------------
  616|  12.3k|}

Curl_cpool_init:
  249|  9.78k|{
  250|  9.78k|  Curl_uint32_tbl_init(&cpool->conns);
  251|  9.78k|  Curl_uint32_bset_init(&cpool->idles);
  252|  9.78k|  Curl_hash_init(&cpool->dest2bundle, size, CURL_HASH_TYPE_BYTES,
  253|  9.78k|                 cpool_bundle_hash_dtor);
  254|  9.78k|  cpool->share = share;
  255|  9.78k|  cpool->initialized = TRUE;
  ------------------
  |  |  986|  9.78k|#define TRUE true
  ------------------
  256|  9.78k|  cpool->in_shutdown = FALSE;
  ------------------
  |  |  989|  9.78k|#define FALSE false
  ------------------
  257|       |  cpool->locked = FALSE;
  ------------------
  |  |  989|  9.78k|#define FALSE false
  ------------------
  258|  9.78k|}
Curl_cpool_destroy:
  261|  9.82k|{
  262|  9.82k|  if(cpool && cpool->initialized && admin) {
  ------------------
  |  Branch (262:6): [True: 9.82k, False: 0]
  |  Branch (262:15): [True: 9.78k, False: 47]
  |  Branch (262:37): [True: 9.78k, False: 0]
  ------------------
  263|  9.78k|    void *entry;
  264|  9.78k|    uint32_t cpid;
  265|       |
  266|  9.78k|    CURL_TRC_M(admin, "%s[CPOOL] destroy, %u connections",
  ------------------
  |  |  148|  9.78k|  do {                                   \
  |  |  149|  9.78k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.78k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.78k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  19.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.78k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 9.78k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  19.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.78k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.78k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|  9.78k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.78k]
  |  |  ------------------
  ------------------
  267|  9.78k|               cpool->share ? "[SHARE] " : "",
  268|  9.78k|               Curl_uint32_tbl_count(&cpool->conns));
  269|       |    /* Move all connections to the shutdown list */
  270|  9.78k|    CPOOL_LOCK(cpool, admin);
  ------------------
  |  |   43|  9.78k|  do {                                                                  \
  |  |   44|  9.78k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 9.78k, False: 0]
  |  |  ------------------
  |  |   45|  9.78k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|  9.78k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 9.78k]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|  9.78k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   47|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   48|  9.78k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1016|  9.78k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   49|  9.78k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  986|  9.78k|#define TRUE true
  |  |  ------------------
  |  |   50|  9.78k|    }                                                                   \
  |  |   51|  9.78k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 9.78k]
  |  |  ------------------
  ------------------
  |  Branch (270:5): [True: 0, False: 9.78k]
  |  Branch (270:5): [True: 9.78k, False: 0]
  ------------------
  271|  9.78k|    if(Curl_uint32_tbl_first(&cpool->conns, &cpid, &entry)) {
  ------------------
  |  Branch (271:8): [True: 1.57k, False: 8.20k]
  ------------------
  272|  1.57k|      struct Curl_sigpipe_ctx pipe_ctx;
  273|       |
  274|  1.57k|      sigpipe_init(&pipe_ctx);
  275|  1.57k|      sigpipe_apply(admin, &pipe_ctx);
  276|  1.57k|      do {
  277|  1.57k|        struct connectdata *conn = entry;
  278|  1.57k|        cpool_remove_conn(cpool, conn);
  279|  1.57k|        cpool_discard_conn(cpool, admin, conn, FALSE);
  ------------------
  |  |  989|  1.57k|#define FALSE false
  ------------------
  280|  1.57k|      } while(Curl_uint32_tbl_next(&cpool->conns, cpid, &cpid, &entry));
  ------------------
  |  Branch (280:15): [True: 0, False: 1.57k]
  ------------------
  281|  1.57k|      sigpipe_restore(&pipe_ctx);
  282|  1.57k|    }
  283|  9.78k|    CPOOL_UNLOCK(cpool, admin);
  ------------------
  |  |   54|  9.78k|  do {                                                                  \
  |  |   55|  9.78k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (55:8): [True: 9.78k, False: 0]
  |  |  ------------------
  |  |   56|  9.78k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1016|  9.78k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   57|  9.78k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  |  989|  9.78k|#define FALSE false
  |  |  ------------------
  |  |   58|  9.78k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|  9.78k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 9.78k]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|  9.78k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   60|  9.78k|    }                                                                   \
  |  |   61|  9.78k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (61:11): [Folded, False: 9.78k]
  |  |  ------------------
  ------------------
  |  Branch (283:5): [True: 0, False: 9.78k]
  |  Branch (283:5): [True: 9.78k, False: 0]
  ------------------
  284|  9.78k|    Curl_hash_destroy(&cpool->dest2bundle);
  285|  9.78k|    Curl_uint32_bset_destroy(&cpool->idles);
  286|  9.78k|    Curl_uint32_tbl_destroy(&cpool->conns);
  287|  9.78k|  }
  288|  9.82k|}
Curl_cpool_xfer_init:
  304|  9.76k|{
  305|  9.76k|  struct cpool *cpool = cpool_get_instance(data);
  306|       |
  307|  9.76k|  if(cpool) {
  ------------------
  |  Branch (307:6): [True: 9.76k, False: 0]
  ------------------
  308|  9.76k|    CPOOL_LOCK(cpool, data);
  ------------------
  |  |   43|  9.76k|  do {                                                                  \
  |  |   44|  9.76k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 9.76k, False: 0]
  |  |  ------------------
  |  |   45|  9.76k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|  9.76k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 9.76k]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|  9.76k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   47|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   48|  9.76k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1016|  9.76k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   49|  9.76k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  986|  9.76k|#define TRUE true
  |  |  ------------------
  |  |   50|  9.76k|    }                                                                   \
  |  |   51|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
  |  Branch (308:5): [True: 0, False: 9.76k]
  |  Branch (308:5): [True: 9.76k, False: 0]
  ------------------
  309|       |    /* the identifier inside the connection cache */
  310|  9.76k|    data->id = cpool->next_easy_id++;
  311|  9.76k|    if(cpool->next_easy_id == CURL_OFF_T_MAX)
  ------------------
  |  |  539|  9.76k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (311:8): [True: 0, False: 9.76k]
  ------------------
  312|      0|      cpool->next_easy_id = 0;
  313|  9.76k|    data->state.last_conn_id = -1;
  314|  9.76k|    data->state.last_cpid = UINT32_MAX;
  315|       |
  316|  9.76k|    CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   54|  9.76k|  do {                                                                  \
  |  |   55|  9.76k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (55:8): [True: 9.76k, False: 0]
  |  |  ------------------
  |  |   56|  9.76k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1016|  9.76k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   57|  9.76k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  |  989|  9.76k|#define FALSE false
  |  |  ------------------
  |  |   58|  9.76k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|  9.76k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 9.76k]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|  9.76k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   60|  9.76k|    }                                                                   \
  |  |   61|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (61:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
  |  Branch (316:5): [True: 0, False: 9.76k]
  |  Branch (316:5): [True: 9.76k, False: 0]
  ------------------
  317|  9.76k|  }
  318|      0|  else {
  319|       |    /* We should not get here, but in a non-debug build, do something */
  320|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (320:5): [Folded, False: 0]
  |  Branch (320:5): [Folded, False: 0]
  ------------------
  321|      0|    data->id = 0;
  322|      0|    data->state.last_conn_id = -1;
  323|       |    data->state.last_cpid = UINT32_MAX;
  324|      0|  }
  325|  9.76k|}
Curl_conn_close:
  448|  7.82k|{
  449|  7.82k|  struct cpool *cpool = cpool_get_instance(data);
  450|  7.82k|  cpool_conn_close(cpool, data, conn, aborted);
  451|  7.82k|}
Curl_cpool_add:
  571|  9.40k|{
  572|  9.40k|  CURLcode result = CURLE_OK;
  573|  9.40k|  struct cpool_bundle *bundle = NULL;
  574|  9.40k|  struct cpool *cpool = cpool_get_instance(data);
  575|  9.40k|  uint32_t capacity, cpid;
  576|  9.40k|  DEBUGASSERT(conn);
  ------------------
  |  | 1016|  9.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (576:3): [True: 0, False: 9.40k]
  |  Branch (576:3): [True: 9.40k, False: 0]
  ------------------
  577|       |
  578|  9.40k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1016|  9.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (578:3): [True: 0, False: 9.40k]
  |  Branch (578:3): [True: 9.40k, False: 0]
  ------------------
  579|  9.40k|  if(!cpool)
  ------------------
  |  Branch (579:6): [True: 0, False: 9.40k]
  ------------------
  580|      0|    return CURLE_FAILED_INIT;
  581|       |
  582|  9.40k|  DEBUGASSERT(conn->cpid == UINT32_MAX);
  ------------------
  |  | 1016|  9.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (582:3): [True: 0, False: 9.40k]
  |  Branch (582:3): [True: 9.40k, False: 0]
  ------------------
  583|  9.40k|  conn->created = *pnow;
  584|  9.40k|  conn->connect_start_ms = -1;
  585|       |
  586|  9.40k|  CPOOL_LOCK(cpool, data);
  ------------------
  |  |   43|  9.40k|  do {                                                                  \
  |  |   44|  9.40k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 9.40k, False: 0]
  |  |  ------------------
  |  |   45|  9.40k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|  9.40k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 9.40k]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|  9.40k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   47|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   48|  9.40k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1016|  9.40k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   49|  9.40k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  986|  9.40k|#define TRUE true
  |  |  ------------------
  |  |   50|  9.40k|    }                                                                   \
  |  |   51|  9.40k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 9.40k]
  |  |  ------------------
  ------------------
  |  Branch (586:3): [True: 0, False: 9.40k]
  |  Branch (586:3): [True: 9.40k, False: 0]
  ------------------
  587|       |  /* Find the bundle, should it exist, and check the limits */
  588|  9.40k|  bundle = cpool_get_bundle(cpool, conn->destination);
  589|       |
  590|  9.40k|  switch(cpool_check_limits(data, max_total, conn, max_host, bundle, pnow)) {
  591|      0|  case CPOOL_LIMIT_DEST:
  ------------------
  |  |  470|      0|#define CPOOL_LIMIT_DEST   1
  ------------------
  |  Branch (591:3): [True: 0, False: 9.40k]
  ------------------
  592|      0|    infof(data, "No more connections allowed to host");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  593|      0|    result = CURLE_NO_CONNECTION_AVAILABLE;
  594|      0|    goto out;
  595|      0|  case CPOOL_LIMIT_TOTAL:
  ------------------
  |  |  471|      0|#define CPOOL_LIMIT_TOTAL  2
  ------------------
  |  Branch (595:3): [True: 0, False: 9.40k]
  ------------------
  596|      0|    infof(data, "No connections available, total of %u reached.",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  597|      0|          data->multi->max_total_connections);
  598|      0|    result = CURLE_NO_CONNECTION_AVAILABLE;
  599|      0|    goto out;
  600|  9.40k|  default:
  ------------------
  |  Branch (600:3): [True: 9.40k, False: 0]
  ------------------
  601|  9.40k|    break;
  602|  9.40k|  }
  603|       |
  604|       |  /* We add the connection */
  605|  9.40k|  capacity = Curl_uint32_tbl_capacity(&cpool->conns);
  606|  9.40k|  if(capacity == UINT32_MAX) {
  ------------------
  |  Branch (606:6): [True: 0, False: 9.40k]
  ------------------
  607|      0|    infof(data, "No connections available, pool at max capacity");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  608|      0|    result = CURLE_NO_CONNECTION_AVAILABLE;
  609|      0|    goto out;
  610|      0|  }
  611|  9.40k|  if(Curl_uint32_tbl_count(&cpool->conns) >= capacity) {
  ------------------
  |  Branch (611:6): [True: 9.40k, False: 0]
  ------------------
  612|  9.40k|    uint32_t growth, ncapacity;
  613|       |
  614|  9.40k|    growth = CURLMAX(capacity, 16);
  ------------------
  |  | 1314|  9.40k|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1314:24): [True: 0, False: 9.40k]
  |  |  ------------------
  ------------------
  615|  9.40k|    if((UINT32_MAX - growth) >= capacity)
  ------------------
  |  Branch (615:8): [True: 9.40k, False: 0]
  ------------------
  616|  9.40k|      ncapacity = capacity + growth;
  617|      0|    else
  618|      0|      ncapacity = UINT32_MAX;
  619|       |    /* Grow bitset first, so table resize failure does not leave a too
  620|       |     * short bitset should that one fail. */
  621|  9.40k|    if(Curl_uint32_bset_resize(&cpool->idles, ncapacity) ||
  ------------------
  |  Branch (621:8): [True: 4, False: 9.40k]
  ------------------
  622|  9.40k|       Curl_uint32_tbl_resize(&cpool->conns, ncapacity)) {
  ------------------
  |  Branch (622:8): [True: 2, False: 9.40k]
  ------------------
  623|      6|      result = CURLE_OUT_OF_MEMORY;
  624|      6|      goto out;
  625|      6|    }
  626|  9.40k|  }
  627|       |
  628|  9.40k|  if(!bundle) {
  ------------------
  |  Branch (628:6): [True: 9.40k, False: 0]
  ------------------
  629|  9.40k|    bundle = cpool_create_bundle();
  630|  9.40k|    if(!bundle) {
  ------------------
  |  Branch (630:8): [True: 3, False: 9.39k]
  ------------------
  631|      3|      result = CURLE_OUT_OF_MEMORY;
  632|      3|      goto out;
  633|      3|    }
  634|  9.40k|  }
  635|       |
  636|  9.39k|  if(!Curl_uint32_tbl_add(&cpool->conns, conn, &cpid)) {
  ------------------
  |  Branch (636:6): [True: 0, False: 9.39k]
  ------------------
  637|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (637:5): [Folded, False: 0]
  |  Branch (637:5): [Folded, False: 0]
  ------------------
  638|      0|    result = CURLE_OUT_OF_MEMORY;
  639|      0|    goto out;
  640|      0|  }
  641|  9.39k|  conn->cpid = cpid;
  642|       |
  643|  9.39k|  if(!cpool_bundle_add_id(cpool, bundle, conn->destination, cpid)) {
  ------------------
  |  Branch (643:6): [True: 2, False: 9.39k]
  ------------------
  644|      2|    Curl_uint32_tbl_remove(&cpool->conns, cpid);
  645|      2|    conn->cpid = UINT32_MAX;
  646|      2|    result = CURLE_OUT_OF_MEMORY;
  647|      2|    goto out;
  648|      2|  }
  649|       |
  650|  9.39k|  conn->connection_id = cpool->next_connection_id++;
  651|  9.39k|  CURL_TRC_M(data, "[CPOOL] added connection %" FMT_OFF_T ". "
  ------------------
  |  |  148|  9.39k|  do {                                   \
  |  |  149|  9.39k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.39k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.39k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  18.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.39k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 932, False: 8.46k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  18.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 932, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    932|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.39k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    932|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 186, False: 746]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.39k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.39k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.39k]
  |  |  ------------------
  ------------------
  652|  9.39k|             "The cache now contains %u members",
  653|  9.39k|             conn->connection_id, Curl_uint32_tbl_count(&cpool->conns));
  654|  9.40k|out:
  655|  9.40k|  cpool_bundle_unlink(&bundle);
  656|  9.40k|  CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   54|  9.40k|  do {                                                                  \
  |  |   55|  9.40k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (55:8): [True: 9.40k, False: 0]
  |  |  ------------------
  |  |   56|  9.40k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1016|  9.40k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   57|  9.40k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  |  989|  9.40k|#define FALSE false
  |  |  ------------------
  |  |   58|  9.40k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|  9.40k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 9.40k]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|  9.40k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   60|  9.40k|    }                                                                   \
  |  |   61|  9.40k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (61:11): [Folded, False: 9.40k]
  |  |  ------------------
  ------------------
  |  Branch (656:3): [True: 0, False: 9.40k]
  |  Branch (656:3): [True: 9.40k, False: 0]
  ------------------
  657|       |
  658|  9.40k|  return result;
  659|  9.40k|}
Curl_cpool_find:
  779|  9.36k|{
  780|  9.36k|  struct cpool *cpool = cpool_get_instance(data);
  781|  9.36k|  struct cpool_bundle *bundle = NULL;
  782|  9.36k|  bool found = FALSE;
  ------------------
  |  |  989|  9.36k|#define FALSE false
  ------------------
  783|       |
  784|  9.36k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1016|  9.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (784:3): [True: 0, False: 9.36k]
  |  Branch (784:3): [True: 9.36k, False: 0]
  ------------------
  785|  9.36k|  DEBUGASSERT(conn_cb);
  ------------------
  |  | 1016|  9.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (785:3): [True: 0, False: 9.36k]
  |  Branch (785:3): [True: 9.36k, False: 0]
  ------------------
  786|  9.36k|  if(!cpool)
  ------------------
  |  Branch (786:6): [True: 0, False: 9.36k]
  ------------------
  787|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  788|       |
  789|  9.36k|  CPOOL_LOCK(cpool, data);
  ------------------
  |  |   43|  9.36k|  do {                                                                  \
  |  |   44|  9.36k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 9.36k, False: 0]
  |  |  ------------------
  |  |   45|  9.36k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|  9.36k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 9.36k]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|  9.36k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   47|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   48|  9.36k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1016|  9.36k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   49|  9.36k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  986|  9.36k|#define TRUE true
  |  |  ------------------
  |  |   50|  9.36k|    }                                                                   \
  |  |   51|  9.36k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 9.36k]
  |  |  ------------------
  ------------------
  |  Branch (789:3): [True: 0, False: 9.36k]
  |  Branch (789:3): [True: 9.36k, False: 0]
  ------------------
  790|       |
  791|  9.36k|  if(prune_dead)
  ------------------
  |  Branch (791:6): [True: 9.36k, False: 0]
  ------------------
  792|  9.36k|    cpool_prune_dead(cpool, data, pnow);
  793|       |
  794|  9.36k|  if(data->state.last_cpid != UINT32_MAX) {
  ------------------
  |  Branch (794:6): [True: 0, False: 9.36k]
  ------------------
  795|      0|    struct connectdata *conn =
  796|      0|      Curl_uint32_tbl_get(&cpool->conns, data->state.last_cpid);
  797|      0|    if(conn && (data->state.last_conn_id == conn->connection_id)) {
  ------------------
  |  Branch (797:8): [True: 0, False: 0]
  |  Branch (797:16): [True: 0, False: 0]
  ------------------
  798|       |      /* Indeed the last connection used by `data` still exists.
  799|       |       * Check that first, so that connection use gets "sticky". */
  800|      0|      found = cpool_find_act(cpool, data, conn, conn_cb(conn, userdata));
  801|      0|      if(found)
  ------------------
  |  Branch (801:10): [True: 0, False: 0]
  ------------------
  802|      0|        goto out;
  803|      0|    }
  804|      0|    else {
  805|       |      /* No longer found here. */
  806|      0|      data->state.last_conn_id = -1;
  807|      0|      data->state.last_cpid = UINT32_MAX;
  808|      0|    }
  809|      0|  }
  810|       |
  811|  9.36k|  bundle = cpool_get_bundle(cpool, destination);
  812|  9.36k|  if(bundle) {
  ------------------
  |  Branch (812:6): [True: 0, False: 9.36k]
  ------------------
  813|      0|    uint32_t cpid;
  814|      0|    if(Curl_uint32_spbset_first(&bundle->ids, &cpid)) {
  ------------------
  |  Branch (814:8): [True: 0, False: 0]
  ------------------
  815|      0|      do {
  816|      0|        struct connectdata *conn = Curl_uint32_tbl_get(&cpool->conns, cpid);
  817|      0|        if(conn) {
  ------------------
  |  Branch (817:12): [True: 0, False: 0]
  ------------------
  818|      0|          if(data->state.last_conn_id != conn->connection_id) {
  ------------------
  |  Branch (818:14): [True: 0, False: 0]
  ------------------
  819|      0|            found = cpool_find_act(cpool, data, conn, conn_cb(conn, userdata));
  820|      0|            if(found)
  ------------------
  |  Branch (820:16): [True: 0, False: 0]
  ------------------
  821|      0|              goto out;
  822|      0|          }
  823|      0|        }
  824|      0|        else {
  825|      0|          DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (825:11): [Folded, False: 0]
  |  Branch (825:11): [Folded, False: 0]
  ------------------
  826|      0|          Curl_uint32_spbset_remove(&bundle->ids, cpid);
  827|      0|        }
  828|      0|      } while(Curl_uint32_spbset_next(&bundle->ids, cpid, &cpid));
  ------------------
  |  Branch (828:15): [True: 0, False: 0]
  ------------------
  829|      0|    }
  830|      0|  }
  831|       |
  832|  9.36k|out:
  833|  9.36k|  if(done_cb) {
  ------------------
  |  Branch (833:6): [True: 9.36k, False: 0]
  ------------------
  834|  9.36k|    found = done_cb(userdata);
  835|  9.36k|  }
  836|  9.36k|  cpool_bundle_unlink(&bundle);
  837|  9.36k|  CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   54|  9.36k|  do {                                                                  \
  |  |   55|  9.36k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (55:8): [True: 9.36k, False: 0]
  |  |  ------------------
  |  |   56|  9.36k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1016|  9.36k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   57|  9.36k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  |  989|  9.36k|#define FALSE false
  |  |  ------------------
  |  |   58|  9.36k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|  9.36k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 9.36k]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|  9.36k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   60|  9.36k|    }                                                                   \
  |  |   61|  9.36k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (61:11): [Folded, False: 9.36k]
  |  |  ------------------
  ------------------
  |  Branch (837:3): [True: 0, False: 9.36k]
  |  Branch (837:3): [True: 9.36k, False: 0]
  ------------------
  838|  9.36k|  return found;
  839|  9.36k|}
Curl_cpool_get_last_conn:
  925|  9.91k|{
  926|  9.91k|  struct cpool *cpool = cpool_get_instance(data);
  927|  9.91k|  if(cpool && (data->state.last_cpid != UINT32_MAX)) {
  ------------------
  |  Branch (927:6): [True: 0, False: 9.91k]
  |  Branch (927:15): [True: 0, False: 0]
  ------------------
  928|      0|    struct connectdata *conn;
  929|       |
  930|      0|    CPOOL_LOCK(cpool, data);
  ------------------
  |  |   43|      0|  do {                                                                  \
  |  |   44|      0|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|      0|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|      0|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   47|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   48|      0|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   49|      0|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |   50|      0|    }                                                                   \
  |  |   51|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (930:5): [True: 0, False: 0]
  |  Branch (930:5): [True: 0, False: 0]
  ------------------
  931|      0|    conn = Curl_uint32_tbl_get(&cpool->conns, data->state.last_cpid);
  932|      0|    CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   54|      0|  do {                                                                  \
  |  |   55|      0|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (55:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   56|      0|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   57|      0|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   58|      0|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|      0|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|      0|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   60|      0|    }                                                                   \
  |  |   61|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (61:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (932:5): [True: 0, False: 0]
  |  Branch (932:5): [True: 0, False: 0]
  ------------------
  933|      0|    if(conn && (data->state.last_conn_id == conn->connection_id))
  ------------------
  |  Branch (933:8): [True: 0, False: 0]
  |  Branch (933:16): [True: 0, False: 0]
  ------------------
  934|      0|      return conn;
  935|      0|    data->state.last_cpid = UINT32_MAX;
  936|      0|    data->state.last_conn_id = -1;
  937|      0|  }
  938|  9.91k|  return NULL;
  939|  9.91k|}
Curl_cpool_return:
  945|  9.37k|{
  946|  9.37k|  struct cpool *cpool = cpool_get_instance(data);
  947|       |
  948|  9.37k|  CPOOL_LOCK(cpool, data);
  ------------------
  |  |   43|  9.37k|  do {                                                                  \
  |  |   44|  9.37k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 9.37k, False: 0]
  |  |  ------------------
  |  |   45|  9.37k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|  9.37k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 9.37k]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|  9.37k|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   47|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   48|  9.37k|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1016|  9.37k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   49|  9.37k|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  986|  9.37k|#define TRUE true
  |  |  ------------------
  |  |   50|  9.37k|    }                                                                   \
  |  |   51|  9.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 9.37k]
  |  |  ------------------
  ------------------
  |  Branch (948:3): [True: 0, False: 9.37k]
  |  Branch (948:3): [True: 9.37k, False: 0]
  ------------------
  949|       |
  950|       |  /* remember times, connection had been used just before */
  951|  9.37k|  conn->lastchecked_ms = conn->lastupkeep_ms = conn->lastused_ms =
  952|  9.37k|    curlx_ptimediff_ms(pnow, &conn->created);
  953|       |
  954|  9.37k|  switch(cb(data, conn, cbdata, pnow)) {
  ------------------
  |  Branch (954:10): [True: 9.37k, False: 0]
  ------------------
  955|      0|  case CPOOL_DO_KEEP:
  ------------------
  |  Branch (955:3): [True: 0, False: 9.37k]
  ------------------
  956|      0|    break;
  957|  1.57k|  case CPOOL_DO_IDLE:
  ------------------
  |  Branch (957:3): [True: 1.57k, False: 7.79k]
  ------------------
  958|       |    /* the connection is no longer in use by any transfer */
  959|  1.57k|    if(cpool_conn_now_idle(cpool, data, conn, pnow)) {
  ------------------
  |  Branch (959:8): [True: 1.57k, False: 0]
  ------------------
  960|       |      /* connection kept in the cpool */
  961|  1.57k|      infof(data, "Connection #%" FMT_OFF_T " to host %s:%u left intact",
  ------------------
  |  |  143|  1.57k|  do {                               \
  |  |  144|  1.57k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  1.57k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.57k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 122, False: 1.45k]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.57k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 122, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    122|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.57k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.57k]
  |  |  ------------------
  ------------------
  962|  1.57k|            conn->connection_id, conn->origin->user_hostname,
  963|  1.57k|            conn->origin->port);
  964|  1.57k|    }
  965|      0|    else { /* connection was removed from the cpool and destroyed. */
  966|      0|      data->state.last_conn_id = -1;
  967|      0|      data->state.last_cpid = UINT32_MAX;
  968|      0|    }
  969|  1.57k|    break;
  970|      1|  case CPOOL_DO_CLOSE:
  ------------------
  |  Branch (970:3): [True: 1, False: 9.37k]
  ------------------
  971|      1|    Curl_conn_close(data, conn, FALSE);
  ------------------
  |  |  989|      1|#define FALSE false
  ------------------
  972|      1|    break;
  973|  7.79k|  case CPOOL_DO_TERMINATE:
  ------------------
  |  Branch (973:3): [True: 7.79k, False: 1.57k]
  ------------------
  974|  7.79k|    Curl_conn_close(data, conn, TRUE);
  ------------------
  |  |  986|  7.79k|#define TRUE true
  ------------------
  975|  7.79k|    break;
  976|  9.37k|  }
  977|       |
  978|  9.37k|  CPOOL_UNLOCK(cpool, data);
  ------------------
  |  |   54|  9.37k|  do {                                                                  \
  |  |   55|  9.37k|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (55:8): [True: 9.37k, False: 0]
  |  |  ------------------
  |  |   56|  9.37k|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1016|  9.37k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   57|  9.37k|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  |  989|  9.37k|#define FALSE false
  |  |  ------------------
  |  |   58|  9.37k|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|  9.37k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 9.37k]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|  9.37k|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   60|  9.37k|    }                                                                   \
  |  |   61|  9.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (61:11): [Folded, False: 9.37k]
  |  |  ------------------
  ------------------
  |  Branch (978:3): [True: 0, False: 9.37k]
  |  Branch (978:3): [True: 9.37k, False: 0]
  ------------------
  979|  9.37k|}
Curl_cpool_conn_was_used:
 1085|  1.95k|{
 1086|  1.95k|  (void)data;
 1087|  1.95k|  conn->lastupkeep_ms = curlx_ptimediff_ms(pnow, &conn->created);
 1088|  1.95k|}
conncache.c:cpool_bundle_hash_dtor:
  145|  9.39k|{
  146|  9.39k|  struct cpool_bundle *bundle = entry;
  147|  9.39k|  cpool_bundle_unlink(&bundle);
  148|  9.39k|}
conncache.c:cpool_remove_conn:
  161|  9.39k|{
  162|  9.39k|  uint32_t cpid = conn->cpid;
  163|       |
  164|  9.39k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (164:3): [True: 0, False: 9.39k]
  |  Branch (164:3): [True: 9.39k, False: 0]
  ------------------
  165|  9.39k|  if(cpid != UINT32_MAX) {
  ------------------
  |  Branch (165:6): [True: 9.39k, False: 0]
  ------------------
  166|  9.39k|    struct cpool_bundle *bundle;
  167|       |
  168|  9.39k|#ifdef DEBUGBUILD
  169|  9.39k|    {
  170|  9.39k|      struct connectdata *pooled_conn =
  171|  9.39k|        Curl_uint32_tbl_get(&cpool->conns, cpid);
  172|  9.39k|      DEBUGASSERT(conn == pooled_conn);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (172:7): [True: 0, False: 9.39k]
  |  Branch (172:7): [True: 9.39k, False: 0]
  ------------------
  173|  9.39k|    }
  174|  9.39k|#endif
  175|  9.39k|    Curl_uint32_tbl_remove(&cpool->conns, cpid);
  176|  9.39k|    Curl_uint32_bset_remove(&cpool->idles, cpid);
  177|  9.39k|    conn->cpid = UINT32_MAX;
  178|       |
  179|  9.39k|    bundle = cpool_get_bundle(cpool, conn->destination);
  180|  9.39k|    DEBUGASSERT(bundle);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (180:5): [True: 0, False: 9.39k]
  |  Branch (180:5): [True: 9.39k, False: 0]
  ------------------
  181|  9.39k|    if(bundle)
  ------------------
  |  Branch (181:8): [True: 9.39k, False: 0]
  ------------------
  182|  9.39k|      cpool_bundle_remove_id(cpool, bundle, conn->destination, cpid);
  183|  9.39k|    cpool_bundle_unlink(&bundle);
  184|  9.39k|  }
  185|  9.39k|}
conncache.c:cpool_bundle_remove_id:
  136|  9.39k|{
  137|  9.39k|  Curl_uint32_spbset_remove(&bundle->ids, pool_id);
  138|  9.39k|  if(!Curl_uint32_spbset_count(&bundle->ids)) {
  ------------------
  |  Branch (138:6): [True: 9.39k, False: 0]
  ------------------
  139|       |    /* Now empty, unregister bundle */
  140|  9.39k|    Curl_hash_delete(&cpool->dest2bundle, destination, strlen(destination));
  141|  9.39k|  }
  142|  9.39k|}
conncache.c:cpool_discard_conn:
  191|  9.39k|{
  192|  9.39k|  struct Curl_easy *admin;
  193|  9.39k|  bool done = FALSE;
  ------------------
  |  |  989|  9.39k|#define FALSE false
  ------------------
  194|       |
  195|  9.39k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (195:3): [True: 0, False: 9.39k]
  |  Branch (195:3): [True: 9.39k, False: 0]
  ------------------
  196|  9.39k|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (196:3): [True: 0, False: 9.39k]
  |  Branch (196:3): [True: 9.39k, False: 0]
  ------------------
  197|  9.39k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (197:3): [True: 0, False: 9.39k]
  |  Branch (197:3): [True: 9.39k, False: 0]
  ------------------
  198|  9.39k|  DEBUGASSERT(conn->cpid == UINT32_MAX);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (198:3): [True: 0, False: 9.39k]
  |  Branch (198:3): [True: 9.39k, False: 0]
  ------------------
  199|       |
  200|  9.39k|  admin = Curl_get_admin(data);
  201|       |  /* We MUST NOT discard a connection that is still in use and would
  202|       |   * trigger Use-After-Free. */
  203|  9.39k|  if(CONN_INUSE(conn)) {
  ------------------
  |  |  327|  9.39k|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (327:23): [True: 0, False: 9.39k]
  |  |  ------------------
  ------------------
  204|      0|    CURL_TRC_M(admin, "[CPOOL] not discarding #%" FMT_OFF_T
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  205|      0|               " still in use by %u transfers", conn->connection_id,
  206|      0|               conn->attached_xfers);
  207|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (207:5): [Folded, False: 0]
  |  Branch (207:5): [Folded, False: 0]
  ------------------
  208|      0|    return;
  209|      0|  }
  210|       |
  211|       |  /* treat the connection as aborted in CONNECT_ONLY situations, we do
  212|       |   * not know what the APP did with it. */
  213|  9.39k|  if(conn->bits.connect_only)
  ------------------
  |  Branch (213:6): [True: 0, False: 9.39k]
  ------------------
  214|      0|    aborted = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  215|  9.39k|  conn->bits.aborted = aborted;
  216|       |
  217|       |  /* We do not shutdown dead connections. The term 'dead' can be misleading
  218|       |   * here, as we also mark errored connections/transfers as 'dead'.
  219|       |   * If we do a shutdown for an aborted transfer, the server might think
  220|       |   * it was successful otherwise (for example an ftps: upload). This is
  221|       |   * not what we want. */
  222|  9.39k|  if(aborted)
  ------------------
  |  Branch (222:6): [True: 7.82k, False: 1.57k]
  ------------------
  223|  7.82k|    done = TRUE;
  ------------------
  |  |  986|  7.82k|#define TRUE true
  ------------------
  224|  9.39k|  if(!done) {
  ------------------
  |  Branch (224:6): [True: 1.57k, False: 7.82k]
  ------------------
  225|       |    /* Attempt to shutdown the connection right away. */
  226|  1.57k|    Curl_cshutdn_try_once(admin, conn, &done);
  227|  1.57k|  }
  228|       |
  229|  9.39k|  if(done || !data->multi)
  ------------------
  |  Branch (229:6): [True: 9.39k, False: 0]
  |  Branch (229:14): [True: 0, False: 0]
  ------------------
  230|  9.39k|    Curl_cshutdn_terminate(admin, conn, FALSE);
  ------------------
  |  |  989|  9.39k|#define FALSE false
  ------------------
  231|      0|  else {
  232|      0|    struct Curl_multi *multi = data->multi;
  233|      0|    size_t max_shutdowns = multi->max_total_connections;
  234|      0|    uint32_t num_conns = Curl_uint32_tbl_count(&cpool->conns);
  235|       |
  236|      0|    if(num_conns < max_shutdowns)
  ------------------
  |  Branch (236:8): [True: 0, False: 0]
  ------------------
  237|      0|      max_shutdowns -= num_conns;
  238|      0|    else if(max_shutdowns)
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|      0|      max_shutdowns = 1;
  240|      0|    else /* no connection limit set, let's restrict growth nevertheless */
  241|      0|      max_shutdowns = CURLMAX(num_conns / 4, 128);
  ------------------
  |  | 1314|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1314:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  242|      0|    Curl_cshutdn_add(&multi->cshutdn, multi, conn, max_shutdowns);
  243|      0|  }
  244|  9.39k|}
conncache.c:cpool_get_instance:
  291|  65.0k|{
  292|       |  /* admin handles do not necessarily find the correct pool */
  293|  65.0k|  DEBUGASSERT(data->mid);
  ------------------
  |  | 1016|  65.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (293:3): [True: 0, False: 65.0k]
  |  Branch (293:3): [True: 65.0k, False: 0]
  ------------------
  294|  65.0k|  if(CURL_SHARE_KEEP_CONNECT(data->share))
  ------------------
  |  |   42|  65.0k|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  ------------------
  |  |  |  Branch (42:4): [True: 0, False: 65.0k]
  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  295|      0|    return &data->share->cpool;
  296|  65.0k|  else if(data->multi_easy)
  ------------------
  |  Branch (296:11): [True: 0, False: 65.0k]
  ------------------
  297|      0|    return &data->multi_easy->cpool;
  298|  65.0k|  else if(data->multi)
  ------------------
  |  Branch (298:11): [True: 55.1k, False: 9.91k]
  ------------------
  299|  55.1k|    return &data->multi->cpool;
  300|  9.91k|  return NULL;
  301|  65.0k|}
conncache.c:cpool_conn_close:
  396|  7.82k|{
  397|  7.82k|  struct Curl_easy *admin;
  398|  7.82k|  bool do_lock;
  399|       |
  400|  7.82k|  DEBUGASSERT(cpool);
  ------------------
  |  | 1016|  7.82k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (400:3): [True: 0, False: 7.82k]
  |  Branch (400:3): [True: 7.82k, False: 0]
  ------------------
  401|  7.82k|  DEBUGASSERT(data && !data->conn);
  ------------------
  |  | 1016|  7.82k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (401:3): [True: 0, False: 7.82k]
  |  Branch (401:3): [True: 0, False: 0]
  |  Branch (401:3): [True: 7.82k, False: 0]
  |  Branch (401:3): [True: 7.82k, False: 0]
  ------------------
  402|  7.82k|  if(!cpool)
  ------------------
  |  Branch (402:6): [True: 0, False: 7.82k]
  ------------------
  403|      0|    return;
  404|       |
  405|       |  /* If this connection is still used by transfers, we cannot close it. */
  406|  7.82k|  if(CONN_INUSE(conn)) {
  ------------------
  |  |  327|  7.82k|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (327:23): [True: 0, False: 7.82k]
  |  |  ------------------
  ------------------
  407|      0|    DEBUGASSERT(0); /* we'd like to know when this happens */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (407:5): [Folded, False: 0]
  |  Branch (407:5): [Folded, False: 0]
  ------------------
  408|      0|    DEBUGF(infof(data, "conn terminate when inuse: %u", conn->attached_xfers));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  409|      0|    return;
  410|      0|  }
  411|       |
  412|       |  /* This method may be called while we are under lock, e.g. from a
  413|       |   * user callback in find. */
  414|  7.82k|  admin = Curl_get_admin(data);
  415|  7.82k|  do_lock = !CPOOL_IS_LOCKED(cpool);
  ------------------
  |  |   40|  7.82k|#define CPOOL_IS_LOCKED(c)    ((c) && (c)->locked)
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 7.82k, False: 0]
  |  |  |  Branch (40:39): [True: 7.79k, False: 26]
  |  |  ------------------
  ------------------
  416|  7.82k|  if(do_lock)
  ------------------
  |  Branch (416:6): [True: 26, False: 7.79k]
  ------------------
  417|     26|    CPOOL_LOCK(cpool, admin);
  ------------------
  |  |   43|     26|  do {                                                                  \
  |  |   44|     26|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 26, False: 0]
  |  |  ------------------
  |  |   45|     26|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|     26|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 26]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   46|     26|        Curl_share_lock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT,  \
  |  |   47|      0|                        CURL_LOCK_ACCESS_SINGLE);                       \
  |  |   48|     26|      DEBUGASSERT(!(c)->locked);                                        \
  |  |  ------------------
  |  |  |  | 1016|     26|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   49|     26|      (c)->locked = TRUE;                                               \
  |  |  ------------------
  |  |  |  |  986|     26|#define TRUE true
  |  |  ------------------
  |  |   50|     26|    }                                                                   \
  |  |   51|     26|  } while(0)
  |  |  ------------------
  |  |  |  Branch (51:11): [Folded, False: 26]
  |  |  ------------------
  ------------------
  |  Branch (417:5): [True: 0, False: 26]
  |  Branch (417:5): [True: 26, False: 0]
  ------------------
  418|       |
  419|  7.82k|  if(conn->cpid != UINT32_MAX) {
  ------------------
  |  Branch (419:6): [True: 7.82k, False: 0]
  ------------------
  420|  7.82k|    cpool_remove_conn(cpool, conn);
  421|  7.82k|    DEBUGASSERT(conn->cpid == UINT32_MAX);
  ------------------
  |  | 1016|  7.82k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (421:5): [True: 0, False: 7.82k]
  |  Branch (421:5): [True: 7.82k, False: 0]
  ------------------
  422|  7.82k|  }
  423|       |
  424|       |  /* treat the connection as aborted in CONNECT_ONLY situations,
  425|       |   * so no graceful shutdown is attempted. */
  426|  7.82k|  if(conn->bits.connect_only)
  ------------------
  |  Branch (426:6): [True: 0, False: 7.82k]
  ------------------
  427|      0|    aborted = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  428|       |
  429|  7.82k|  if(data->multi) {
  ------------------
  |  Branch (429:6): [True: 7.82k, False: 0]
  ------------------
  430|       |    /* Add it to the multi's cpool for shutdown handling */
  431|  7.82k|    infof(data, "%s connection #%" FMT_OFF_T,
  ------------------
  |  |  143|  7.82k|  do {                               \
  |  |  144|  7.82k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  7.82k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 7.82k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 810, False: 7.01k]
  |  |  |  |  ------------------
  |  |  |  |  323|  7.82k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 810, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    810|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  7.82k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 810, False: 0]
  |  |  ------------------
  |  |  146|  7.82k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 7.82k]
  |  |  ------------------
  ------------------
  432|  7.82k|          aborted ? "closing" : "shutting down", conn->connection_id);
  433|  7.82k|    cpool_discard_conn(&data->multi->cpool, data, conn, aborted);
  434|  7.82k|  }
  435|      0|  else {
  436|       |    /* No multi available, terminate */
  437|      0|    infof(data, "closing connection #%" FMT_OFF_T, conn->connection_id);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  438|      0|    Curl_cshutdn_terminate(admin, conn, !aborted);
  439|      0|  }
  440|       |
  441|  7.82k|  if(do_lock)
  ------------------
  |  Branch (441:6): [True: 26, False: 7.79k]
  ------------------
  442|       |    CPOOL_UNLOCK(cpool, admin);
  ------------------
  |  |   54|     26|  do {                                                                  \
  |  |   55|     26|    if(c) {                                                             \
  |  |  ------------------
  |  |  |  Branch (55:8): [True: 26, False: 0]
  |  |  ------------------
  |  |   56|     26|      DEBUGASSERT((c)->locked);                                         \
  |  |  ------------------
  |  |  |  | 1016|     26|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |   57|     26|      (c)->locked = FALSE;                                              \
  |  |  ------------------
  |  |  |  |  989|     26|#define FALSE false
  |  |  ------------------
  |  |   58|     26|      if(CURL_SHARE_KEEP_CONNECT((c)->share))                           \
  |  |  ------------------
  |  |  |  |   42|     26|  ((s) && ((s)->specifier & (1 << CURL_LOCK_DATA_CONNECT)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:4): [True: 0, False: 26]
  |  |  |  |  |  Branch (42:11): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   59|     26|        Curl_share_unlock_share((c)->share, (d), CURL_LOCK_DATA_CONNECT); \
  |  |   60|     26|    }                                                                   \
  |  |   61|     26|  } while(0)
  |  |  ------------------
  |  |  |  Branch (61:11): [Folded, False: 26]
  |  |  ------------------
  ------------------
  |  Branch (442:5): [True: 0, False: 26]
  |  Branch (442:5): [True: 26, False: 0]
  ------------------
  443|  7.82k|}
conncache.c:cpool_get_bundle:
  152|  28.1k|{
  153|       |  struct cpool_bundle *bundle = NULL;
  154|  28.1k|  cpool_bundle_link(&bundle, Curl_hash_pick(
  155|  28.1k|    &cpool->dest2bundle, destination, strlen(destination)));
  156|  28.1k|  return bundle;
  157|  28.1k|}
conncache.c:cpool_bundle_link:
   87|  37.5k|{
   88|  37.5k|  if(*pdest != src) {
  ------------------
  |  Branch (88:6): [True: 18.7k, False: 18.7k]
  ------------------
   89|  18.7k|    cpool_bundle_unlink(pdest);
   90|  18.7k|    *pdest = src;
   91|  18.7k|    if(src) {
  ------------------
  |  Branch (91:8): [True: 18.7k, False: 0]
  ------------------
   92|  18.7k|      DEBUGASSERT(src->refcount < UINT32_MAX);
  ------------------
  |  | 1016|  18.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (92:7): [True: 0, False: 18.7k]
  |  Branch (92:7): [True: 18.7k, False: 0]
  ------------------
   93|  18.7k|      src->refcount++;
   94|  18.7k|    }
   95|  18.7k|  }
   96|  37.5k|}
conncache.c:cpool_check_limits:
  479|  9.40k|{
  480|  9.40k|  struct cpool *cpool = cpool_get_instance(data);
  481|  9.40k|  struct cshutdn *cshutdn = data->multi ? &data->multi->cshutdn : NULL;
  ------------------
  |  Branch (481:29): [True: 9.40k, False: 0]
  ------------------
  482|  9.40k|  struct Curl_easy *admin = NULL;
  483|       |
  484|  9.40k|  if(!cpool)
  ------------------
  |  Branch (484:6): [True: 0, False: 9.40k]
  ------------------
  485|      0|    return CPOOL_LIMIT_OK;
  ------------------
  |  |  469|      0|#define CPOOL_LIMIT_OK     0
  ------------------
  486|       |
  487|  9.40k|  if(!max_total && !max_host)
  ------------------
  |  Branch (487:6): [True: 9.40k, False: 0]
  |  Branch (487:20): [True: 9.40k, False: 0]
  ------------------
  488|  9.40k|    return CPOOL_LIMIT_OK;
  ------------------
  |  |  469|  9.40k|#define CPOOL_LIMIT_OK     0
  ------------------
  489|       |
  490|      0|  if(max_host) {
  ------------------
  |  Branch (490:6): [True: 0, False: 0]
  ------------------
  491|      0|    size_t live = 0, shutdowns = 0;
  492|       |    /* if we are at or above `dest_limit`, try to get rid of connections
  493|       |     * in shutdown and, if that does not lower it, evict idle connections
  494|       |     * from the pool. */
  495|      0|    admin = Curl_get_admin(data);
  496|      0|    if(bundle) {
  ------------------
  |  Branch (496:8): [True: 0, False: 0]
  ------------------
  497|      0|      live = Curl_uint32_spbset_count(&bundle->ids);
  498|      0|      if(live >= max_host) {
  ------------------
  |  Branch (498:10): [True: 0, False: 0]
  ------------------
  499|      0|        size_t over = live - max_host + 1;
  500|      0|        for(; over; --over) {
  ------------------
  |  Branch (500:15): [True: 0, False: 0]
  ------------------
  501|      0|          struct connectdata *oldest_idle =
  502|      0|            cpool_bundle_get_oldest_idle(cpool, bundle, pnow);
  503|      0|          if(!oldest_idle)
  ------------------
  |  Branch (503:14): [True: 0, False: 0]
  ------------------
  504|      0|            break;
  505|       |          /* disconnect the old conn and continue */
  506|      0|          CURL_TRC_M(admin, "Shutting down connection #%" FMT_OFF_T
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  507|      0|                     " to '%s' due to destination limit of %u",
  508|      0|                     oldest_idle->connection_id, oldest_idle->destination,
  509|      0|                     max_host);
  510|      0|          cpool_evict_conn(cpool, admin, oldest_idle);
  511|      0|        }
  512|      0|        live = Curl_uint32_spbset_count(&bundle->ids);
  513|      0|      }
  514|      0|    }
  515|      0|    if(cshutdn) {
  ------------------
  |  Branch (515:8): [True: 0, False: 0]
  ------------------
  516|      0|      shutdowns = Curl_cshutdn_dest_count(cshutdn, to_add->destination);
  517|      0|      if(shutdowns && ((live + shutdowns) >= max_host)) {
  ------------------
  |  Branch (517:10): [True: 0, False: 0]
  |  Branch (517:23): [True: 0, False: 0]
  ------------------
  518|      0|        size_t over = live + shutdowns - max_host + 1;
  519|      0|        shutdowns -= Curl_cshutdn_close_oldest(cshutdn, admin,
  520|      0|                                               to_add->destination, over);
  521|      0|      }
  522|      0|    }
  523|       |    /* We may not have gotten rid of as many connections as we wanted to */
  524|      0|    if((live + shutdowns) >= max_host)
  ------------------
  |  Branch (524:8): [True: 0, False: 0]
  ------------------
  525|      0|      return CPOOL_LIMIT_DEST;
  ------------------
  |  |  470|      0|#define CPOOL_LIMIT_DEST   1
  ------------------
  526|      0|  }
  527|       |
  528|       |  /* Internal transfers are outside the total limit */
  529|      0|  if(max_total && !data->state.internal) {
  ------------------
  |  Branch (529:6): [True: 0, False: 0]
  |  Branch (529:19): [True: 0, False: 0]
  ------------------
  530|      0|    size_t shutdowns = 0;
  531|      0|    uint32_t num_conns = Curl_uint32_tbl_count(&cpool->conns);
  532|       |
  533|      0|    if(!admin)
  ------------------
  |  Branch (533:8): [True: 0, False: 0]
  ------------------
  534|      0|      admin = Curl_get_admin(data);
  535|      0|    if(num_conns >= max_total) {
  ------------------
  |  Branch (535:8): [True: 0, False: 0]
  ------------------
  536|      0|      size_t over = num_conns - max_total + 1;
  537|      0|      for(; over; --over) {
  ------------------
  |  Branch (537:13): [True: 0, False: 0]
  ------------------
  538|      0|        struct connectdata *oldest_idle =
  539|      0|          cpool_get_oldest_idle(cpool, pnow, 0);
  540|      0|        if(!oldest_idle)
  ------------------
  |  Branch (540:12): [True: 0, False: 0]
  ------------------
  541|      0|          break;
  542|       |        /* disconnect the old conn and continue */
  543|      0|        CURL_TRC_M(admin, "Shutting down idle connection #%"
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  544|      0|                   FMT_OFF_T " to '%s' due to total limit of %u",
  545|      0|                   oldest_idle->connection_id, oldest_idle->destination,
  546|      0|                   max_total);
  547|      0|        cpool_evict_conn(cpool, admin, oldest_idle);
  548|      0|      }
  549|      0|    }
  550|       |
  551|      0|    num_conns = Curl_uint32_tbl_count(&cpool->conns);
  552|      0|    if(cshutdn) {
  ------------------
  |  Branch (552:8): [True: 0, False: 0]
  ------------------
  553|      0|      shutdowns = Curl_cshutdn_count(cshutdn);
  554|      0|      if(shutdowns && (num_conns + shutdowns) >= max_total) {
  ------------------
  |  Branch (554:10): [True: 0, False: 0]
  |  Branch (554:23): [True: 0, False: 0]
  ------------------
  555|      0|        size_t over = num_conns + shutdowns - max_total + 1;
  556|      0|        shutdowns -= Curl_cshutdn_close_oldest(cshutdn, admin, NULL, over);
  557|      0|      }
  558|      0|    }
  559|      0|    if((num_conns + shutdowns) >= max_total)
  ------------------
  |  Branch (559:8): [True: 0, False: 0]
  ------------------
  560|      0|      return CPOOL_LIMIT_TOTAL;
  ------------------
  |  |  471|      0|#define CPOOL_LIMIT_TOTAL  2
  ------------------
  561|      0|  }
  562|       |
  563|      0|  return CPOOL_LIMIT_OK;
  ------------------
  |  |  469|      0|#define CPOOL_LIMIT_OK     0
  ------------------
  564|      0|}
conncache.c:cpool_create_bundle:
   99|  9.40k|{
  100|       |  /* created with refcount == 1 */
  101|  9.40k|  struct cpool_bundle *bundle = curlx_calloc(1, sizeof(*bundle));
  ------------------
  |  | 1500|  9.40k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  102|  9.40k|  if(!bundle)
  ------------------
  |  Branch (102:6): [True: 3, False: 9.39k]
  ------------------
  103|      3|    return NULL;
  104|       |
  105|  9.39k|  Curl_uint32_spbset_init(&bundle->ids);
  106|  9.39k|  bundle->refcount = 1;
  107|  9.39k|  return bundle;
  108|  9.40k|}
conncache.c:cpool_bundle_add_id:
  115|  9.39k|{
  116|  9.39k|  if(!Curl_uint32_spbset_add(&bundle->ids, pool_id))
  ------------------
  |  Branch (116:6): [True: 0, False: 9.39k]
  ------------------
  117|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  118|  9.39k|  if(Curl_uint32_spbset_count(&bundle->ids) == 1) {
  ------------------
  |  Branch (118:6): [True: 9.39k, False: 0]
  ------------------
  119|       |    /* first one added, register bundle */
  120|  9.39k|    struct cpool_bundle *new_ref = NULL;
  121|  9.39k|    cpool_bundle_link(&new_ref, bundle);
  122|  9.39k|    if(!Curl_hash_add(&cpool->dest2bundle,
  ------------------
  |  Branch (122:8): [True: 2, False: 9.39k]
  ------------------
  123|  9.39k|                      destination, strlen(destination), new_ref)) {
  124|      2|      cpool_bundle_unlink(&new_ref);
  125|      2|      return FALSE;
  ------------------
  |  |  989|      2|#define FALSE false
  ------------------
  126|      2|    }
  127|  9.39k|  }
  128|  9.39k|  return TRUE;
  ------------------
  |  |  986|  9.39k|#define TRUE true
  ------------------
  129|  9.39k|}
conncache.c:cpool_bundle_unlink:
   70|  56.3k|{
   71|  56.3k|  if(*pbundle) {
  ------------------
  |  Branch (71:6): [True: 28.1k, False: 28.1k]
  ------------------
   72|  28.1k|    struct cpool_bundle *bundle = *pbundle;
   73|       |
   74|  28.1k|    DEBUGASSERT(bundle->refcount);
  ------------------
  |  | 1016|  28.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (74:5): [True: 0, False: 28.1k]
  |  Branch (74:5): [True: 28.1k, False: 0]
  ------------------
   75|  28.1k|    *pbundle = NULL;
   76|  28.1k|    if(bundle->refcount)
  ------------------
  |  Branch (76:8): [True: 28.1k, False: 0]
  ------------------
   77|  28.1k|      bundle->refcount--;
   78|  28.1k|    if(!bundle->refcount) {
  ------------------
  |  Branch (78:8): [True: 9.39k, False: 18.7k]
  ------------------
   79|  9.39k|      Curl_uint32_spbset_destroy(&bundle->ids);
   80|  9.39k|      curlx_free(bundle);
  ------------------
  |  | 1503|  9.39k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   81|  9.39k|    }
   82|  28.1k|  }
   83|  56.3k|}
conncache.c:cpool_prune_dead:
  871|  9.36k|{
  872|  9.36k|  timediff_t elapsed_ms = curlx_ptimediff_ms(pnow, &cpool->last_cleanup);
  873|       |
  874|  9.36k|  if(elapsed_ms >= 1000L) {
  ------------------
  |  Branch (874:6): [True: 9.36k, False: 0]
  ------------------
  875|  9.36k|    struct Curl_easy *admin = Curl_get_admin(data);
  876|  9.36k|    struct cpool_reaper_ctx reaper;
  877|       |
  878|  9.36k|    memset(&reaper, 0, sizeof(reaper));
  879|  9.36k|    reaper.pnow = pnow;
  880|  9.36k|    cpool_foreach(admin, cpool, &reaper, cpool_reap_dead_cb);
  881|  9.36k|    cpool->last_cleanup = *pnow;
  882|  9.36k|  }
  883|  9.36k|}
conncache.c:cpool_foreach:
  679|  9.36k|{
  680|  9.36k|  void *entry;
  681|  9.36k|  uint32_t cpid;
  682|       |
  683|  9.36k|  if(!cpool)
  ------------------
  |  Branch (683:6): [True: 0, False: 9.36k]
  ------------------
  684|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  685|       |
  686|  9.36k|  if(Curl_uint32_tbl_first(&cpool->conns, &cpid, &entry)) {
  ------------------
  |  Branch (686:6): [True: 0, False: 9.36k]
  ------------------
  687|      0|    do {
  688|      0|      struct connectdata *conn = entry;
  689|      0|      if(conn && func(cpool, data, conn, param) == 1)
  ------------------
  |  Branch (689:10): [True: 0, False: 0]
  |  Branch (689:18): [True: 0, False: 0]
  ------------------
  690|      0|        return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  691|      0|    } while(Curl_uint32_tbl_next(&cpool->conns, cpid, &cpid, &entry));
  ------------------
  |  Branch (691:13): [True: 0, False: 0]
  ------------------
  692|      0|  }
  693|  9.36k|  return FALSE;
  ------------------
  |  |  989|  9.36k|#define FALSE false
  ------------------
  694|  9.36k|}
conncache.c:cpool_conn_now_idle:
  706|  1.57k|{
  707|  1.57k|  struct connectdata *oldest_idle = NULL;
  708|  1.57k|  struct Curl_easy *admin;
  709|  1.57k|  uint32_t maxconnects;
  710|  1.57k|  bool kept = TRUE;
  ------------------
  |  |  986|  1.57k|#define TRUE true
  ------------------
  711|  1.57k|  timediff_t min_age_ms = 0;
  712|       |
  713|  1.57k|  if(!data || !data->multi)
  ------------------
  |  Branch (713:6): [True: 0, False: 1.57k]
  |  Branch (713:15): [True: 0, False: 1.57k]
  ------------------
  714|      0|    return kept;
  715|       |
  716|  1.57k|  Curl_uint32_bset_add(&cpool->idles, conn->cpid);
  717|       |
  718|  1.57k|  if(!data->multi->maxconnects) {
  ------------------
  |  Branch (718:6): [True: 1.57k, False: 0]
  ------------------
  719|       |    /* Attached transfers is a weak indicator of business. */
  720|  1.57k|    uint32_t attached = Curl_multi_xfers_attached(data->multi);
  721|  1.57k|    maxconnects = (attached <= UINT32_MAX / 2) ? attached * 2 : UINT32_MAX;
  ------------------
  |  Branch (721:19): [True: 1.57k, False: 0]
  ------------------
  722|       |    /* We are guessing. So, only evict a "seemingly superfluous" connection
  723|       |     * when has not been used for this long, */
  724|  1.57k|    min_age_ms = 1000;
  725|  1.57k|  }
  726|      0|  else {
  727|      0|    maxconnects = data->multi->maxconnects;
  728|      0|  }
  729|       |
  730|  1.57k|  if(cpool && maxconnects && (maxconnects < UINT32_MAX)) {
  ------------------
  |  Branch (730:6): [True: 1.57k, False: 0]
  |  Branch (730:15): [True: 1.57k, False: 0]
  |  Branch (730:30): [True: 1.57k, False: 0]
  ------------------
  731|  1.57k|    uint32_t num_conns = Curl_uint32_tbl_count(&cpool->conns);
  732|  1.57k|    admin = Curl_get_admin(data);
  733|  1.57k|    if(num_conns > maxconnects) {
  ------------------
  |  Branch (733:8): [True: 0, False: 1.57k]
  ------------------
  734|      0|      infof(data, "Connection pool is full, closing the oldest of %u/%u",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  735|      0|            num_conns, maxconnects);
  736|      0|      oldest_idle = cpool_get_oldest_idle(cpool, pnow, min_age_ms);
  737|      0|      kept = (oldest_idle != conn);
  738|      0|      if(oldest_idle) {
  ------------------
  |  Branch (738:10): [True: 0, False: 0]
  ------------------
  739|      0|        cpool_evict_conn(cpool, admin, oldest_idle);
  740|      0|      }
  741|      0|    }
  742|  1.57k|  }
  743|       |
  744|  1.57k|  return kept;
  745|  1.57k|}

Curl_cf_get_destination:
   50|  15.8k|{
   51|  15.8k|  return cfchain_get_destination(cf->chain);
   52|  15.8k|}
Curl_cf_get_first_peer:
   69|  9.32k|{
   70|  9.32k|  return cfchain_get_first_peer(cf->chain);
   71|  9.32k|}
timeleft_now_ms:
  171|   188k|{
  172|       |  return timeleft_now_ms_int(data, pnow, TRUE);
  ------------------
  |  |  986|   188k|#define TRUE true
  ------------------
  173|   188k|}
Curl_timeleft_ms:
  176|  33.5k|{
  177|  33.5k|  return timeleft_now_ms(data, Curl_pgrs_now(data));
  178|  33.5k|}
Curl_timeleft_total_now_ms:
  184|   144k|{
  185|       |  return timeleft_now_ms_int(data, pnow, FALSE);
  ------------------
  |  |  989|   144k|#define FALSE false
  ------------------
  186|   144k|}
Curl_timeleft_now_ms:
  190|   155k|{
  191|   155k|  return timeleft_now_ms(data, pnow);
  192|   155k|}
Curl_getconnectinfo:
  202|  9.91k|{
  203|       |  /* this works for an easy handle:
  204|       |   * - that has been used for curl_easy_perform()
  205|       |   * - that is associated with a multi handle, and whose connection
  206|       |   *   was detached with CURLOPT_CONNECT_ONLY
  207|       |   */
  208|  9.91k|  struct connectdata *conn = Curl_cpool_get_last_conn(data);
  209|  9.91k|  if(connp)
  ------------------
  |  Branch (209:6): [True: 0, False: 9.91k]
  ------------------
  210|      0|    *connp = conn;
  211|  9.91k|  return conn ? conn->chain.sock : CURL_SOCKET_BAD;
  ------------------
  |  |  147|  9.91k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (211:10): [True: 0, False: 9.91k]
  ------------------
  212|  9.91k|}
Curl_conncontrol:
  215|  9.19k|{
  216|  9.19k|  if(!conn) {
  ------------------
  |  Branch (216:6): [True: 0, False: 9.19k]
  ------------------
  217|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (217:5): [Folded, False: 0]
  |  Branch (217:5): [Folded, False: 0]
  ------------------
  218|      0|    return;
  219|      0|  }
  220|  9.19k|  switch(ctrl) {
  221|      0|    case CONNCTRL_CONN_KEEP:
  ------------------
  |  |   65|      0|#define CONNCTRL_CONN_KEEP       0
  ------------------
  |  Branch (221:5): [True: 0, False: 9.19k]
  ------------------
  222|      0|      conn->bits.close = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  223|      0|      break;
  224|  7.79k|    case CONNCTRL_CONN_CLOSE:
  ------------------
  |  |   66|  7.79k|#define CONNCTRL_CONN_CLOSE      1
  ------------------
  |  Branch (224:5): [True: 7.79k, False: 1.39k]
  ------------------
  225|  7.79k|      conn->bits.close = TRUE;
  ------------------
  |  |  986|  7.79k|#define TRUE true
  ------------------
  226|  7.79k|      break;
  227|  1.39k|    case CONNCTRL_STREAM_CLOSE:
  ------------------
  |  |   67|  1.39k|#define CONNCTRL_STREAM_CLOSE    2
  ------------------
  |  Branch (227:5): [True: 1.39k, False: 7.79k]
  ------------------
  228|       |      /* stream close when multiplexing does not affect connection */
  229|  1.39k|      if(!Curl_conn_is_multiplex(conn))
  ------------------
  |  Branch (229:10): [True: 0, False: 1.39k]
  ------------------
  230|      0|        conn->bits.close = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  231|  1.39k|      break;
  232|      0|    default:
  ------------------
  |  Branch (232:5): [True: 0, False: 9.19k]
  ------------------
  233|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (233:7): [Folded, False: 0]
  |  Branch (233:7): [Folded, False: 0]
  ------------------
  234|      0|      break;
  235|  9.19k|  }
  236|  9.19k|}
Curl_conn_setup:
  242|  9.39k|{
  243|  9.39k|  struct Curl_peer *first_peer = cfchain_get_first_peer(chain);
  244|  9.39k|  CURLcode result = CURLE_OK;
  245|  9.39k|  uint8_t dns_queries;
  246|       |
  247|  9.39k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (247:3): [True: 0, False: 9.39k]
  |  Branch (247:3): [True: 9.39k, False: 0]
  ------------------
  248|  9.39k|  DEBUGASSERT(conn->scheme);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (248:3): [True: 0, False: 9.39k]
  |  Branch (248:3): [True: 9.39k, False: 0]
  ------------------
  249|  9.39k|  DEBUGASSERT(!chain->cf);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (249:3): [True: 0, False: 9.39k]
  |  Branch (249:3): [True: 9.39k, False: 0]
  ------------------
  250|       |
  251|  9.39k|  if(!first_peer)
  ------------------
  |  Branch (251:6): [True: 0, False: 9.39k]
  ------------------
  252|      0|    return CURLE_FAILED_INIT;
  253|       |
  254|  9.39k|#ifndef CURL_DISABLE_HTTP
  255|  9.39k|  if(!chain->cf &&
  ------------------
  |  Branch (255:6): [True: 9.39k, False: 0]
  ------------------
  256|  9.39k|     conn->scheme->protocol == CURLPROTO_HTTPS) {
  ------------------
  |  | 1089|  9.39k|#define CURLPROTO_HTTPS   (1L << 1)
  ------------------
  |  Branch (256:6): [True: 9.39k, False: 0]
  ------------------
  257|  9.39k|    DEBUGASSERT(ssl_mode != CURL_CF_SSL_DISABLE);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (257:5): [True: 0, False: 9.39k]
  |  Branch (257:5): [True: 9.39k, False: 0]
  ------------------
  258|  9.39k|    result = Curl_cf_https_setup(
  259|  9.39k|      data, cfchain_get_destination(chain), chain);
  260|  9.39k|    if(result)
  ------------------
  |  Branch (260:8): [True: 11, False: 9.38k]
  ------------------
  261|     11|      goto out;
  262|  9.39k|  }
  263|  9.38k|#endif /* !CURL_DISABLE_HTTP */
  264|       |
  265|       |  /* Still no cfilter set, apply default. */
  266|  9.38k|  if(!chain->cf) {
  ------------------
  |  Branch (266:6): [True: 0, False: 9.38k]
  ------------------
  267|      0|    result = Curl_cf_setup_add(chain, data, conn->transport_wanted, ssl_mode);
  268|      0|    if(result)
  ------------------
  |  Branch (268:8): [True: 0, False: 0]
  ------------------
  269|      0|      goto out;
  270|      0|  }
  271|       |
  272|  9.38k|  DEBUGASSERT(chain->cf);
  ------------------
  |  | 1016|  9.38k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (272:3): [True: 0, False: 9.38k]
  |  Branch (272:3): [True: 9.38k, False: 0]
  ------------------
  273|       |  /* Whatever the filter chain will be in the end, it will need the
  274|       |   * resolving of `first_peer`. Add that now so the resolve is started
  275|       |   * right away. */
  276|  9.38k|  dns_queries = Curl_resolv_dns_queries(data, conn->ip_version);
  277|  9.38k|  result = Curl_dns_cf_add_addr_resolve(data, chain->cf,
  278|  9.38k|                                        first_peer, dns_queries,
  279|  9.38k|                                        conn->transport_wanted);
  280|  9.38k|  if(result)
  ------------------
  |  Branch (280:6): [True: 4, False: 9.38k]
  ------------------
  281|      4|    goto out;
  282|       |
  283|  9.39k|out:
  284|  9.39k|  return result;
  285|  9.38k|}
Curl_cfchain_report_failed:
  323|  6.52k|{
  324|  6.52k|  if(!chain->primary)
  ------------------
  |  Branch (324:6): [True: 0, False: 6.52k]
  ------------------
  325|      0|    return;
  326|       |  /* Only filters connected at IP level have info to update. Filters
  327|       |   * still racing for a connection, like happy eyeballing, pass it on
  328|       |   * to a connected one only. */
  329|  6.52k|  (void)Curl_conn_cf_cntrl(chain->cf, data, TRUE,
  ------------------
  |  |  986|  6.52k|#define TRUE true
  ------------------
  330|  6.52k|                           CF_CTRL_CONN_INFO_UPDATE, 0, NULL);
  ------------------
  |  |  121|  6.52k|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  331|  6.52k|  conn_report_stats(data, chain);
  332|  6.52k|}
Curl_cfchain_connect:
  338|   128k|{
  339|   128k|#define CF_CONN_NUM_POLLS_ON_STACK 5
  340|   128k|  struct pollfd a_few_on_stack[CF_CONN_NUM_POLLS_ON_STACK];
  341|   128k|  struct easy_pollset ps;
  342|   128k|  struct curl_pollfds cpfds;
  343|   128k|  struct Curl_cfilter *cf;
  344|   128k|  CURLcode result = CURLE_OK;
  345|       |
  346|   128k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|   128k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (346:3): [True: 0, False: 128k]
  |  Branch (346:3): [True: 128k, False: 0]
  ------------------
  347|   128k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|   128k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (347:3): [True: 0, False: 128k]
  |  Branch (347:3): [True: 128k, False: 0]
  ------------------
  348|       |
  349|   128k|  if(data->conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  221|   128k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (349:6): [True: 0, False: 128k]
  ------------------
  350|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  351|      0|    return CURLE_OK;
  352|      0|  }
  353|       |
  354|   128k|  cf = chain->cf;
  355|   128k|  if(!cf) {
  ------------------
  |  Branch (355:6): [True: 0, False: 128k]
  ------------------
  356|      0|    *done = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  357|      0|    return CURLE_FAILED_INIT;
  358|      0|  }
  359|       |
  360|   128k|  *done = (bool)cf->connected;
  361|   128k|  if(*done)
  ------------------
  |  Branch (361:6): [True: 0, False: 128k]
  ------------------
  362|      0|    return CURLE_OK;
  363|       |
  364|   128k|  if(data->conn->connect_start_ms < 0) {
  ------------------
  |  Branch (364:6): [True: 9.37k, False: 118k]
  ------------------
  365|  9.37k|    data->conn->connect_start_ms =
  366|  9.37k|      curlx_ptimediff_ms(Curl_pgrs_now(data), &data->conn->created);
  367|  9.37k|  }
  368|       |
  369|   128k|  Curl_pollset_init(&ps);
  370|   128k|  Curl_pollfds_init(&cpfds, a_few_on_stack, CF_CONN_NUM_POLLS_ON_STACK);
  ------------------
  |  |  339|   128k|#define CF_CONN_NUM_POLLS_ON_STACK 5
  ------------------
  371|   128k|  while(!*done) {
  ------------------
  |  Branch (371:9): [True: 128k, False: 0]
  ------------------
  372|   128k|    if(Curl_cfchain_needs_flush(data, chain)) {
  ------------------
  |  Branch (372:8): [True: 5.75k, False: 122k]
  ------------------
  373|  5.75k|      DEBUGF(infof(data, "Curl_conn_connect(%s), flush",
  ------------------
  |  | 1002|  54.5k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 5.75k, False: 0]
  |  |  |  Branch (1002:19): [True: 2.84k, False: 2.91k]
  |  |  |  Branch (1002:19): [True: 2.84k, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 2.84k, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 5.75k]
  |  |  ------------------
  ------------------
  374|  5.75k|             chain->primary ? "" : "2nd"));
  375|  5.75k|      result = Curl_cfchain_flush(data, chain);
  376|  5.75k|      if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (376:10): [True: 0, False: 5.75k]
  |  Branch (376:20): [True: 0, False: 0]
  ------------------
  377|      0|        goto out;
  378|  5.75k|    }
  379|       |
  380|   128k|    result = cf->cft->do_connect(cf, data, done);
  381|   128k|    CURL_TRC_CF(data, cf, "Curl_conn_connect(block=%d) -> %d, done=%d",
  ------------------
  |  |  153|   128k|  do {                                          \
  |  |  154|   128k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|   128k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|   256k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 128k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 35.7k, False: 92.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   256k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 35.7k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  35.7k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|   128k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  35.7k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 35.7k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 18.0k, False: 17.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   128k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|   128k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 128k]
  |  |  ------------------
  ------------------
  382|   128k|                blocking, (int)result, *done);
  383|   128k|    if(!result && *done) {
  ------------------
  |  Branch (383:8): [True: 121k, False: 6.52k]
  |  Branch (383:19): [True: 1.95k, False: 119k]
  ------------------
  384|       |      /* A final sanity check on connection security */
  385|  1.95k|      if((data->state.origin->scheme->flags & PROTOPT_SSL) &&
  ------------------
  |  |  214|  1.95k|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  |  Branch (385:10): [True: 1.95k, False: 0]
  ------------------
  386|  1.95k|         chain->primary && !Curl_conn_is_ssl(data->conn)) {
  ------------------
  |  Branch (386:10): [True: 1.95k, False: 0]
  |  Branch (386:28): [True: 0, False: 1.95k]
  ------------------
  387|      0|        DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (387:9): [Folded, False: 0]
  |  Branch (387:9): [Folded, False: 0]
  ------------------
  388|      0|        failf(data, "transfer requires SSL, but not connected via SSL");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  389|      0|        result = CURLE_FAILED_INIT;
  390|      0|        goto out;
  391|      0|      }
  392|       |      /* Now that the complete filter chain is connected, let all filters
  393|       |       * persist information at the connection. E.g. cf-socket sets the
  394|       |       * socket and ip related information. */
  395|  1.95k|      Curl_conn_cntrl_update_info(data, data->conn);
  396|  1.95k|      conn_report_stats(data, chain);
  397|  1.95k|      Curl_cpool_conn_was_used(data, data->conn, Curl_pgrs_now(data));
  398|  1.95k|      VERBOSE(result = conn_connect_trace(data, cf));
  ------------------
  |  | 1637|  1.95k|#define VERBOSE(x) x
  ------------------
  399|  1.95k|      VERBOSE(Curl_cfchain_trc(data, NULL, chain, "connected"));
  ------------------
  |  | 1637|  1.95k|#define VERBOSE(x) x
  ------------------
  400|  1.95k|      Curl_cfchain_remove_setup_filters(data, chain);
  401|  1.95k|      VERBOSE(Curl_cfchain_trc(data, NULL, chain, "reduced to"));
  ------------------
  |  | 1637|  1.95k|#define VERBOSE(x) x
  ------------------
  402|  1.95k|      data->conn->connect_start_ms = -1;
  403|  1.95k|      goto out;
  404|  1.95k|    }
  405|   126k|    else if(result) {
  ------------------
  |  Branch (405:13): [True: 6.52k, False: 119k]
  ------------------
  406|  6.52k|      CURL_TRC_CF(data, cf, "Curl_conn_connect(), filter returned %d",
  ------------------
  |  |  153|  6.52k|  do {                                          \
  |  |  154|  6.52k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  6.52k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  13.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 6.52k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 645, False: 5.88k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  13.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 645, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    645|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  6.52k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    645|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 645, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 121, False: 524]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  6.52k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  6.52k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 6.52k]
  |  |  ------------------
  ------------------
  407|  6.52k|                  (int)result);
  408|  6.52k|      VERBOSE(Curl_cfchain_trc(data, NULL, chain, "failed to connect"));
  ------------------
  |  | 1637|  6.52k|#define VERBOSE(x) x
  ------------------
  409|  6.52k|      Curl_cfchain_report_failed(data, chain);
  410|  6.52k|      goto out;
  411|  6.52k|    }
  412|       |
  413|   119k|    if(!blocking)
  ------------------
  |  Branch (413:8): [True: 119k, False: 0]
  ------------------
  414|   119k|      goto out;
  415|      0|    else {
  416|       |      /* check allowed time left */
  417|      0|      const struct curltime *pnow = Curl_pgrs_now(data);
  418|      0|      timediff_t timeout_ms = Curl_timeleft_now_ms(data, pnow);
  419|      0|      curl_socket_t sockfd = cf->chain->sock;
  420|      0|      int rc;
  421|       |
  422|      0|      if(timeout_ms < 0) {
  ------------------
  |  Branch (422:10): [True: 0, False: 0]
  ------------------
  423|       |        /* no need to continue if time already is up */
  424|      0|        failf(data, "connect timeout");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  425|      0|        result = CURLE_OPERATION_TIMEDOUT;
  426|      0|        goto out;
  427|      0|      }
  428|       |
  429|      0|      CURL_TRC_CF(data, cf, "Curl_conn_connect(block=1), do poll");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  430|      0|      Curl_pollset_reset(&ps);
  431|      0|      Curl_pollfds_reset(&cpfds);
  432|       |      /* In general, we want to send after connect, wait on that. */
  433|      0|      if(sockfd != CURL_SOCKET_BAD)
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (433:10): [True: 0, False: 0]
  ------------------
  434|      0|        result = Curl_pollset_set_out_only(data, &ps, sockfd);
  ------------------
  |  |  164|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  |  |                 Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
  435|      0|      if(!result)
  ------------------
  |  Branch (435:10): [True: 0, False: 0]
  ------------------
  436|      0|        result = Curl_conn_adjust_pollset(data, data->conn, &ps);
  437|      0|      if(result)
  ------------------
  |  Branch (437:10): [True: 0, False: 0]
  ------------------
  438|      0|        goto out;
  439|      0|      result = Curl_pollfds_add_ps(&cpfds, &ps);
  440|      0|      if(result)
  ------------------
  |  Branch (440:10): [True: 0, False: 0]
  ------------------
  441|      0|        goto out;
  442|       |
  443|      0|      rc = Curl_poll(cpfds.pfds, cpfds.n,
  444|      0|                     CURLMIN(timeout_ms ? timeout_ms : 1000,
  ------------------
  |  | 1315|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 0, False: 0]
  |  |  |  Branch (1315:25): [True: 0, False: 0]
  |  |  |  Branch (1315:31): [True: 0, False: 0]
  |  |  |  Branch (1315:37): [True: 0, False: 0]
  |  |  |  Branch (1315:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  445|      0|                             (cpfds.n ? 1000 : 10)));
  446|      0|      CURL_TRC_CF(data, cf, "Curl_conn_connect(block=1), Curl_poll() -> %d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  447|      0|                  rc);
  448|      0|      if(rc < 0) {
  ------------------
  |  Branch (448:10): [True: 0, False: 0]
  ------------------
  449|      0|        result = CURLE_COULDNT_CONNECT;
  450|      0|        goto out;
  451|      0|      }
  452|       |      /* continue iterating */
  453|      0|    }
  454|   119k|  }
  455|       |
  456|   128k|out:
  457|   128k|  Curl_pollset_cleanup(&ps);
  458|   128k|  Curl_pollfds_cleanup(&cpfds);
  459|   128k|  return result;
  460|   128k|}
Curl_conn_connect:
  465|   128k|{
  466|   128k|  return Curl_cfchain_connect(data, &data->conn->chain,
  467|   128k|                              blocking, done);
  468|   128k|}
Curl_conn_set_multiplex:
  471|  1.95k|{
  472|  1.95k|  if(chain->primary) {
  ------------------
  |  Branch (472:6): [True: 1.95k, False: 0]
  ------------------
  473|  1.95k|    chain->conn->httpversion_seen = http_version;
  474|  1.95k|    if(!chain->conn->bits.multiplex) {
  ------------------
  |  Branch (474:8): [True: 1.95k, False: 0]
  ------------------
  475|  1.95k|      chain->conn->bits.multiplex = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
  476|  1.95k|      if(chain->conn->attached_multi) {
  ------------------
  |  Branch (476:10): [True: 1.95k, False: 0]
  ------------------
  477|  1.95k|        Curl_multi_connchanged(chain->conn->attached_multi);
  478|  1.95k|      }
  479|  1.95k|    }
  480|  1.95k|  }
  481|  1.95k|}
Curl_conn_get_destination:
  489|  9.41k|{
  490|  9.41k|  return conn->via_peer ? conn->via_peer : conn->origin;
  ------------------
  |  Branch (490:10): [True: 2.00k, False: 7.41k]
  ------------------
  491|  9.41k|}
Curl_conn_get_first_peer:
  494|  37.5k|{
  495|  37.5k|#ifndef CURL_DISABLE_PROXY
  496|  37.5k|  if(conn->socks_proxy.peer)
  ------------------
  |  Branch (496:6): [True: 0, False: 37.5k]
  ------------------
  497|      0|    return conn->socks_proxy.peer;
  498|  37.5k|  if(conn->http_proxy.peer)
  ------------------
  |  Branch (498:6): [True: 29.0k, False: 8.43k]
  ------------------
  499|  29.0k|    return conn->http_proxy.peer;
  500|  8.43k|#endif
  501|  8.43k|  return conn->via_peer ? conn->via_peer : conn->origin;
  ------------------
  |  Branch (501:10): [True: 7.98k, False: 449]
  ------------------
  502|  37.5k|}
Curl_cf_get_origin:
  505|  1.38k|{
  506|  1.38k|  struct connectdata *conn = CF_CONN(cf);
  ------------------
  |  |  260|  1.38k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  507|  1.38k|  return CF_IS_PRIMARY(cf) ? conn->origin : conn->origin2;
  ------------------
  |  |  261|  1.38k|#define CF_IS_PRIMARY(cf)       (bool)(cf)->chain->primary
  |  |  ------------------
  |  |  |  Branch (261:33): [True: 1.38k, False: 0]
  |  |  ------------------
  ------------------
  508|  1.38k|}
connect.c:cfchain_get_destination:
   42|  25.2k|{
   43|  25.2k|  struct connectdata *conn = chain->conn;
   44|  25.2k|  return chain->primary ?
  ------------------
  |  Branch (44:10): [True: 25.2k, False: 0]
  ------------------
   45|  25.2k|    (conn->via_peer ? conn->via_peer : conn->origin) :
  ------------------
  |  Branch (45:6): [True: 1.99k, False: 23.2k]
  ------------------
   46|  25.2k|    (conn->via_peer2 ? conn->via_peer2 : conn->origin2);
  ------------------
  |  Branch (46:6): [True: 0, False: 0]
  ------------------
   47|  25.2k|}
connect.c:cfchain_get_first_peer:
   55|  18.7k|{
   56|  18.7k|  struct connectdata *conn = chain->conn;
   57|  18.7k|#ifndef CURL_DISABLE_PROXY
   58|  18.7k|  if(conn->socks_proxy.peer)
  ------------------
  |  Branch (58:6): [True: 0, False: 18.7k]
  ------------------
   59|      0|    return conn->socks_proxy.peer;
   60|  18.7k|  if(conn->http_proxy.peer)
  ------------------
  |  Branch (60:6): [True: 14.5k, False: 4.20k]
  ------------------
   61|  14.5k|    return conn->http_proxy.peer;
   62|  4.20k|#endif
   63|  4.20k|  return !chain->primary ?
  ------------------
  |  Branch (63:10): [True: 0, False: 4.20k]
  ------------------
   64|      0|    (conn->via_peer2 ? conn->via_peer2 : conn->origin2) :
  ------------------
  |  Branch (64:6): [True: 0, False: 0]
  ------------------
   65|  4.20k|    (conn->via_peer ? conn->via_peer : conn->origin);
  ------------------
  |  Branch (65:6): [True: 4.01k, False: 198]
  ------------------
   66|  18.7k|}
connect.c:timeleft_now_ms_int:
  117|   333k|{
  118|   333k|  struct Curl_cfchain *chain = data->conn ?
  ------------------
  |  Branch (118:32): [True: 323k, False: 9.93k]
  ------------------
  119|   333k|                               &data->conn->chain : NULL;
  120|   333k|  timediff_t timeleft_ms = 0;
  121|   333k|  timediff_t ctimeleft_ms = 0;
  122|       |
  123|   333k|  if(chain && CURL_CFCHAIN_IN_SHUTDOWN(chain))
  ------------------
  |  |   60|   323k|#define CURL_CFCHAIN_IN_SHUTDOWN(c)  ((c)->shutdown_start_ms >= 0)
  |  |  ------------------
  |  |  |  Branch (60:38): [True: 0, False: 323k]
  |  |  ------------------
  ------------------
  |  Branch (123:6): [True: 323k, False: 9.93k]
  ------------------
  124|      0|    return Curl_cshutdn_timeleft_ms(data, chain);
  125|   333k|  else if(with_connect && Curl_is_connecting(data)) {
  ------------------
  |  Branch (125:11): [True: 188k, False: 144k]
  |  Branch (125:27): [True: 180k, False: 8.50k]
  ------------------
  126|       |    /* transfer has not reached DO phase yet */
  127|   180k|    timediff_t ctimeout_ms = (data->set.connecttimeout > 0) ?
  ------------------
  |  Branch (127:30): [True: 180k, False: 0]
  ------------------
  128|   180k|      data->set.connecttimeout : DEFAULT_CONNECT_TIMEOUT;
  ------------------
  |  |   45|      0|#define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */
  ------------------
  129|   180k|    ctimeleft_ms = ctimeout_ms -
  130|   180k|      Curl_pgrs_since_ms(data, pnow, TIMER_STARTSINGLE);
  131|   180k|    if(!ctimeleft_ms)
  ------------------
  |  Branch (131:8): [True: 0, False: 180k]
  ------------------
  132|      0|      ctimeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */
  133|   180k|  }
  134|   152k|  else if(with_connect && data->conn && data->conn->connect_start_ms >= 0) {
  ------------------
  |  Branch (134:11): [True: 8.50k, False: 144k]
  |  Branch (134:27): [True: 8.50k, False: 0]
  |  Branch (134:41): [True: 0, False: 8.50k]
  ------------------
  135|       |    /* ongoing connect of filters, pbly FTP second socket */
  136|      0|    ctimeleft_ms = connect_left_ms(data, pnow);
  137|      0|  }
  138|   152k|  else if(!data->set.timeout ||
  ------------------
  |  Branch (138:11): [True: 0, False: 152k]
  ------------------
  139|   152k|          (data->set.connect_only && !Curl_is_connecting(data))) {
  ------------------
  |  Branch (139:12): [True: 0, False: 152k]
  |  Branch (139:38): [True: 0, False: 0]
  ------------------
  140|       |    /* no timeout in place, or a CONNECT_ONLY transfer that is done
  141|       |       connecting: return "no limit" */
  142|      0|    return 0;
  143|      0|  }
  144|       |
  145|   333k|  if(data->set.timeout) {
  ------------------
  |  Branch (145:6): [True: 333k, False: 0]
  ------------------
  146|   333k|    timeleft_ms = data->set.timeout -
  147|   333k|                  Curl_pgrs_since_ms(data, pnow, TIMER_STARTOP);
  148|   333k|    if(!timeleft_ms)
  ------------------
  |  Branch (148:8): [True: 0, False: 333k]
  ------------------
  149|      0|      timeleft_ms = -1; /* 0 is "no limit", fake 1 ms expiry */
  150|   333k|  }
  151|       |
  152|   333k|  if(!ctimeleft_ms)
  ------------------
  |  Branch (152:6): [True: 152k, False: 180k]
  ------------------
  153|   152k|    return timeleft_ms;
  154|   180k|  else if(!timeleft_ms)
  ------------------
  |  Branch (154:11): [True: 0, False: 180k]
  ------------------
  155|      0|    return ctimeleft_ms;
  156|   180k|  return CURLMIN(ctimeleft_ms, timeleft_ms);
  ------------------
  |  | 1315|   180k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 0, False: 180k]
  |  |  ------------------
  ------------------
  157|   333k|}
connect.c:conn_report_stats:
  315|  8.48k|{
  316|       |  /* We only gather stats for the primary chain */
  317|  8.48k|  if(chain->primary)
  ------------------
  |  Branch (317:6): [True: 8.48k, False: 0]
  ------------------
  318|  8.48k|    Curl_cfchain_cntrl_report_stats(data, chain);
  319|  8.48k|}
connect.c:conn_connect_trace:
  290|  1.95k|{
  291|  1.95k|  if(Curl_trc_is_verbose(data)) {
  ------------------
  |  |  322|  1.95k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  ------------------
  |  |  323|  1.95k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  ------------------
  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  292|    147|    struct ip_quadruple ipquad;
  293|    147|    bool is_ipv6;
  294|    147|    CURLcode result;
  295|       |
  296|    147|    result = Curl_conn_cf_get_ip_info(cf, data, &is_ipv6, &ipquad);
  297|    147|    if(result)
  ------------------
  |  Branch (297:8): [True: 0, False: 147]
  ------------------
  298|      0|      return result;
  299|       |
  300|    147|    infof(data, "Established %sconnection to %s (%s port %u) from %s port %u ",
  ------------------
  |  |  143|    147|  do {                               \
  |  |  144|    147|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    147|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    147|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.17k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 147]
  |  |  |  Branch (145:24): [True: 147, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 147]
  |  |  |  Branch (145:24): [True: 0, False: 147]
  |  |  ------------------
  |  |  146|    147|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 147]
  |  |  ------------------
  ------------------
  301|    147|          !CF_IS_PRIMARY(cf) ? "2nd " : "",
  302|    147|          CURL_CONN_HOST_DISPNAME(data->conn),
  303|    147|          ipquad.remote_ip, ipquad.remote_port,
  304|    147|          ipquad.local_ip, ipquad.local_port);
  305|    147|  }
  306|  1.95k|  return CURLE_OK;
  307|  1.95k|}

Curl_get_content_encodings:
  725|    757|{
  726|    757|  struct dynbuf enc;
  727|    757|  const struct Curl_cwtype * const *cep;
  728|    757|  CURLcode result = CURLE_OK;
  729|    757|  curlx_dyn_init(&enc, 255);
  730|       |
  731|  4.52k|  for(cep = general_unencoders; *cep && !result; cep++) {
  ------------------
  |  Branch (731:33): [True: 3.77k, False: 750]
  |  Branch (731:41): [True: 3.76k, False: 7]
  ------------------
  732|  3.76k|    const struct Curl_cwtype *ce = *cep;
  733|  3.76k|    if(!curl_strequal(ce->name, CONTENT_ENCODING_DEFAULT)) {
  ------------------
  |  |   54|  3.76k|#define CONTENT_ENCODING_DEFAULT  "identity"
  ------------------
  |  Branch (733:8): [True: 3.00k, False: 757]
  ------------------
  734|  3.00k|      if(curlx_dyn_len(&enc))
  ------------------
  |  Branch (734:10): [True: 2.25k, False: 757]
  ------------------
  735|  2.25k|        result = curlx_dyn_addn(&enc, ", ", 2);
  736|  3.00k|      if(!result)
  ------------------
  |  Branch (736:10): [True: 3.00k, False: 0]
  ------------------
  737|  3.00k|        result = curlx_dyn_add(&enc, ce->name);
  738|  3.00k|    }
  739|  3.76k|  }
  740|    757|  if(!result && !curlx_dyn_len(&enc))
  ------------------
  |  Branch (740:6): [True: 750, False: 7]
  |  Branch (740:17): [True: 0, False: 750]
  ------------------
  741|      0|    result = curlx_dyn_add(&enc, CONTENT_ENCODING_DEFAULT);
  ------------------
  |  |   54|      0|#define CONTENT_ENCODING_DEFAULT  "identity"
  ------------------
  742|       |
  743|    757|  if(!result)
  ------------------
  |  Branch (743:6): [True: 750, False: 7]
  ------------------
  744|    750|    return curlx_dyn_ptr(&enc);
  745|      7|  return NULL;
  746|    757|}

Curl_cookie_add:
 1097|  19.4k|{
 1098|  19.4k|  struct tempcookie cookie;
 1099|  19.4k|  struct Cookie *real;
 1100|  19.4k|  struct Cookie *replace = NULL;
 1101|  19.4k|  size_t myhash;
 1102|  19.4k|  CURLcode result;
 1103|  19.4k|  unsigned int replacetime = 0;
 1104|  19.4k|  bool okay;
 1105|  19.4k|  bool iponly;
 1106|       |
 1107|  19.4k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  19.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1107:3): [True: 0, False: 19.4k]
  |  Branch (1107:3): [True: 19.4k, False: 0]
  ------------------
 1108|  19.4k|  DEBUGASSERT(MAX_SET_COOKIE_AMOUNT <= 255); /* counter is an unsigned char */
  ------------------
  |  | 1016|  19.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1108:3): [True: 0, Folded]
  |  Branch (1108:3): [True: 19.4k, Folded]
  ------------------
 1109|  19.4k|  if(data->req.setcookies >= MAX_SET_COOKIE_AMOUNT)
  ------------------
  |  |   91|  19.4k|#define MAX_SET_COOKIE_AMOUNT 50
  ------------------
  |  Branch (1109:6): [True: 0, False: 19.4k]
  ------------------
 1110|      0|    return CURLE_OK; /* silently ignore */
 1111|       |
 1112|  19.4k|  memset(&cookie, 0, sizeof(cookie));
 1113|       |
 1114|  19.4k|  if(flags & COOKIE_HTTPHEADER)
  ------------------
  |  |  116|  19.4k|#define COOKIE_HTTPHEADER (1<<0) /* if HTTP header-style line */
  ------------------
  |  Branch (1114:6): [True: 0, False: 19.4k]
  ------------------
 1115|      0|    result = parse_cookie_header(data, &cookie, &okay,
 1116|      0|                                 lineptr, domain, path,
 1117|      0|                                 flags & COOKIE_SECURE);
  ------------------
  |  |  118|      0|#define COOKIE_SECURE     (1<<2) /* connection is over secure origin */
  ------------------
 1118|  19.4k|  else
 1119|  19.4k|    result = parse_netscape(&cookie, ci, &okay, lineptr,
 1120|  19.4k|                            flags & COOKIE_SECURE);
  ------------------
  |  |  118|  19.4k|#define COOKIE_SECURE     (1<<2) /* connection is over secure origin */
  ------------------
 1121|       |
 1122|  19.4k|  if(result || !okay)
  ------------------
  |  Branch (1122:6): [True: 0, False: 19.4k]
  |  Branch (1122:16): [True: 13.7k, False: 5.74k]
  ------------------
 1123|  13.7k|    return result;
 1124|       |
 1125|  5.74k|  if(cookie.prefix_secure && !cookie.secure)
  ------------------
  |  Branch (1125:6): [True: 124, False: 5.62k]
  |  Branch (1125:30): [True: 34, False: 90]
  ------------------
 1126|       |    /* The __Secure- prefix only requires that the cookie be set secure */
 1127|     34|    return result;
 1128|       |
 1129|  5.71k|  iponly = curlx_strlen(&cookie.domain) ? host_is_ipnum(&cookie.domain) :
  ------------------
  |  |   50|  5.71k|#define curlx_strlen(x) ((x)->len)
  |  |  ------------------
  |  |  |  Branch (50:25): [True: 5.71k, False: 0]
  |  |  ------------------
  ------------------
 1130|  5.71k|    FALSE;
  ------------------
  |  |  989|  5.71k|#define FALSE false
  ------------------
 1131|       |
 1132|  5.71k|  if(!iponly && !(flags & COOKIE_NOPSL) &&
  ------------------
  |  |  119|  5.28k|#define COOKIE_NOPSL      (1<<3) /* skip PSL check */
  ------------------
  |  Branch (1132:6): [True: 5.28k, False: 427]
  |  Branch (1132:17): [True: 0, False: 5.28k]
  ------------------
 1133|      0|     is_public_suffix(data, &cookie, domain))
  ------------------
  |  Branch (1133:6): [True: 0, False: 0]
  ------------------
 1134|      0|    return result;
 1135|       |
 1136|  5.71k|  if(cookie.prefix_host) {
  ------------------
  |  Branch (1136:6): [True: 137, False: 5.57k]
  ------------------
 1137|       |    /*
 1138|       |     * The __Host- prefix requires the cookie to be secure, have a "/" path
 1139|       |     * and not have a domain set.
 1140|       |     */
 1141|    137|    if(cookie.secure && curlx_strlen(&cookie.path) &&
  ------------------
  |  |   50|    240|#define curlx_strlen(x) ((x)->len)
  |  |  ------------------
  |  |  |  Branch (50:25): [True: 103, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1141:8): [True: 103, False: 34]
  ------------------
 1142|    103|       curlx_str_cmp(&cookie.path, "/") && !cookie.tailmatch)
  ------------------
  |  Branch (1142:8): [True: 93, False: 10]
  |  Branch (1142:44): [True: 83, False: 10]
  ------------------
 1143|     83|      ;
 1144|     54|    else
 1145|     54|      return result;
 1146|    137|  }
 1147|       |
 1148|  5.65k|  if(!ci->running &&                /* read from a file */
  ------------------
  |  Branch (1148:6): [True: 5.65k, False: 0]
  ------------------
 1149|  5.65k|     (flags & COOKIE_NOSESSION) &&  /* clean session cookies */
  ------------------
  |  |  120|  5.65k|#define COOKIE_NOSESSION  (1<<6) /* drop session cookies */
  ------------------
  |  Branch (1149:6): [True: 0, False: 5.65k]
  ------------------
 1150|      0|     !cookie.expires)               /* this is a session cookie */
  ------------------
  |  Branch (1150:6): [True: 0, False: 0]
  ------------------
 1151|      0|    return result;
 1152|       |
 1153|       |  /*
 1154|       |   * Now we have parsed the incoming line, we must now check if this supersedes
 1155|       |   * an already existing cookie, which it may if the previous have the same
 1156|       |   * domain and path as this.
 1157|       |   */
 1158|  5.65k|  if(ci->running)
  ------------------
  |  Branch (1158:6): [True: 0, False: 5.65k]
  ------------------
 1159|      0|    remove_expired(ci);
 1160|       |
 1161|  5.65k|  myhash = iponly ? 0 : cookiehash(&cookie.domain);
  ------------------
  |  Branch (1161:12): [True: 427, False: 5.22k]
  ------------------
 1162|  5.65k|  if(!cookie_accept(data, &cookie, ci, myhash, flags |
  ------------------
  |  Branch (1162:6): [True: 0, False: 5.65k]
  ------------------
 1163|  5.65k|                    (ci->running ? COOKIE_LIVE : 0), &replace))
  ------------------
  |  |  117|      0|#define COOKIE_LIVE       (1<<1) /* from a server or API */
  ------------------
  |  Branch (1163:22): [True: 0, False: 5.65k]
  ------------------
 1164|      0|    return result;
 1165|       |
 1166|       |  /* clone the temp cookie into a real one */
 1167|  5.65k|  real = cookiedup(&cookie);
 1168|  5.65k|  if(!real)
  ------------------
  |  Branch (1168:6): [True: 3, False: 5.65k]
  ------------------
 1169|      3|    return CURLE_OUT_OF_MEMORY;
 1170|       |
 1171|  5.65k|  if(replace) {
  ------------------
  |  Branch (1171:6): [True: 3.29k, False: 2.35k]
  ------------------
 1172|  3.29k|    replacetime = replace->creationtime;
 1173|  3.29k|    Curl_node_remove(&replace->node);
 1174|  3.29k|    curlx_free(replace);
  ------------------
  |  | 1503|  3.29k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1175|  3.29k|  }
 1176|       |
 1177|  5.65k|  real->livecookie = ci->running || (flags & COOKIE_LIVE);
  ------------------
  |  |  117|  5.65k|#define COOKIE_LIVE       (1<<1) /* from a server or API */
  ------------------
  |  Branch (1177:22): [True: 0, False: 5.65k]
  |  Branch (1177:37): [True: 5.65k, False: 0]
  ------------------
 1178|       |
 1179|       |  /* use the time from the cookie this replaces, or get a new one */
 1180|  5.65k|  real->creationtime = replacetime ? replacetime : ++ci->lastct;
  ------------------
  |  Branch (1180:24): [True: 3.29k, False: 2.35k]
  ------------------
 1181|       |
 1182|       |  /* add this cookie to the list */
 1183|  5.65k|  Curl_llist_append(&ci->cookielist[myhash], real, &real->node);
 1184|       |
 1185|  5.65k|  if(ci->running)
  ------------------
  |  Branch (1185:6): [True: 0, False: 5.65k]
  ------------------
 1186|       |    /* Only show this when NOT reading the cookies from a file */
 1187|      0|    infof(data, "%s cookie %s=\"%s\" for domain %s, path %s, "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1188|  5.65k|          "expire %" FMT_OFF_T,
 1189|  5.65k|          replacetime ? "Replaced" : "Added", real->name, real->value,
 1190|  5.65k|          real->domain, real->path, real->expires);
 1191|       |
 1192|  5.65k|  if(!replacetime)
  ------------------
  |  Branch (1192:6): [True: 2.35k, False: 3.29k]
  ------------------
 1193|  2.35k|    ci->numcookies++; /* one more cookie in the jar */
 1194|       |
 1195|       |  /*
 1196|       |   * Now that we have added a new cookie to the jar, update the expiration
 1197|       |   * tracker in case it is the next one to expire.
 1198|       |   */
 1199|  5.65k|  if(cookie.expires && (cookie.expires < ci->next_expiration))
  ------------------
  |  Branch (1199:6): [True: 4.18k, False: 1.46k]
  |  Branch (1199:24): [True: 872, False: 3.31k]
  ------------------
 1200|    872|    ci->next_expiration = cookie.expires;
 1201|       |
 1202|  5.65k|  if(flags & COOKIE_HTTPHEADER)
  ------------------
  |  |  116|  5.65k|#define COOKIE_HTTPHEADER (1<<0) /* if HTTP header-style line */
  ------------------
  |  Branch (1202:6): [True: 0, False: 5.65k]
  ------------------
 1203|      0|    data->req.setcookies++;
 1204|       |
 1205|  5.65k|  return result;
 1206|  5.65k|}
Curl_cookie_init:
 1221|  9.91k|{
 1222|  9.91k|  int i;
 1223|  9.91k|  struct CookieInfo *ci = curlx_calloc(1, sizeof(struct CookieInfo));
  ------------------
  |  | 1500|  9.91k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1224|  9.91k|  if(!ci)
  ------------------
  |  Branch (1224:6): [True: 16, False: 9.90k]
  ------------------
 1225|     16|    return NULL;
 1226|       |
 1227|       |  /* This does not use the destructor callback since we want to add
 1228|       |     and remove to lists while keeping the cookie struct intact */
 1229|   633k|  for(i = 0; i < COOKIE_HASH_SIZE; i++)
  ------------------
  |  |   56|   633k|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (1229:14): [True: 623k, False: 9.90k]
  ------------------
 1230|   623k|    Curl_llist_init(&ci->cookielist[i], NULL);
 1231|       |  /*
 1232|       |   * Initialize the next_expiration time to signal that we do not have enough
 1233|       |   * information yet.
 1234|       |   */
 1235|  9.90k|  ci->next_expiration = CURL_OFF_T_MAX;
  ------------------
  |  |  539|  9.90k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
 1236|       |
 1237|  9.90k|  return ci;
 1238|  9.91k|}
Curl_cookie_loadfiles:
 1333|  9.67k|{
 1334|  9.67k|  CURLcode result = CURLE_OK;
 1335|  9.67k|  struct curl_slist *list = data->state.cookielist;
 1336|  9.67k|  if(list) {
  ------------------
  |  Branch (1336:6): [True: 9.65k, False: 26]
  ------------------
 1337|  9.65k|    Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1338|  9.65k|    if(!data->cookies)
  ------------------
  |  Branch (1338:8): [True: 28, False: 9.62k]
  ------------------
 1339|     28|      data->cookies = Curl_cookie_init();
 1340|  9.65k|    if(!data->cookies)
  ------------------
  |  Branch (1340:8): [True: 0, False: 9.65k]
  ------------------
 1341|      0|      result = CURLE_OUT_OF_MEMORY;
 1342|  9.65k|    else {
 1343|  9.65k|      data->state.cookie_engine = TRUE;
  ------------------
  |  |  986|  9.65k|#define TRUE true
  ------------------
 1344|  19.3k|      while(list) {
  ------------------
  |  Branch (1344:13): [True: 9.65k, False: 9.64k]
  ------------------
 1345|  9.65k|        result = cookie_load(data, list->data, data->cookies, flags);
 1346|  9.65k|        if(result)
  ------------------
  |  Branch (1346:12): [True: 5, False: 9.64k]
  ------------------
 1347|      5|          break;
 1348|  9.64k|        list = list->next;
 1349|  9.64k|      }
 1350|  9.65k|    }
 1351|  9.65k|    Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1352|  9.65k|  }
 1353|  9.67k|  return result;
 1354|  9.67k|}
Curl_secure_context:
 1410|  1.94k|{
 1411|  1.94k|  return Curl_xfer_is_secure(data) ||
  ------------------
  |  Branch (1411:10): [True: 1.94k, False: 0]
  ------------------
 1412|      0|    (!data->info.used_proxy &&
  ------------------
  |  Branch (1412:6): [True: 0, False: 0]
  ------------------
 1413|      0|     (((hlen == 9) && curl_strnequal("localhost", host, 9)) ||
  ------------------
  |  Branch (1413:8): [True: 0, False: 0]
  |  Branch (1413:23): [True: 0, False: 0]
  ------------------
 1414|      0|      ((hlen == 9) && !memcmp(host, "127.0.0.1", 9)) ||
  ------------------
  |  Branch (1414:8): [True: 0, False: 0]
  |  Branch (1414:23): [True: 0, False: 0]
  ------------------
 1415|      0|      ((hlen == 3) && !memcmp(host, "::1", 3))));
  ------------------
  |  Branch (1415:8): [True: 0, False: 0]
  |  Branch (1415:23): [True: 0, False: 0]
  ------------------
 1416|  1.94k|}
Curl_cookie_getlist:
 1436|  1.94k|{
 1437|  1.94k|  size_t matches = 0;
 1438|  1.94k|  bool is_ip = FALSE;
  ------------------
  |  |  989|  1.94k|#define FALSE false
  ------------------
 1439|  1.94k|  size_t myhash = 0;
 1440|  1.94k|  struct Curl_llist_node *n;
 1441|  1.94k|  bool secure;
 1442|  1.94k|  const struct CookieInfo *ci = data->cookies;
 1443|  1.94k|  const char *path = data->state.up.path;
 1444|  1.94k|  CURLcode result = CURLE_OK;
 1445|  1.94k|  struct Curl_str host;
 1446|  1.94k|  curl_off_t now;
 1447|  1.94k|  *okay = FALSE;
  ------------------
  |  |  989|  1.94k|#define FALSE false
  ------------------
 1448|       |
 1449|  1.94k|  Curl_llist_init(list, NULL);
 1450|       |
 1451|  1.94k|  curlx_str_assign(&host, hostp, strlen(hostp));
 1452|  1.94k|  secure = Curl_secure_context(data, hostp, curlx_strlen(&host));
  ------------------
  |  |   50|  1.94k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1453|  1.94k|  if(!host_is_ipnum(&host))
  ------------------
  |  Branch (1453:6): [True: 1.94k, False: 0]
  ------------------
 1454|  1.94k|    myhash = cookiehash(&host);
 1455|      0|  else
 1456|      0|    is_ip = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1457|       |
 1458|  1.94k|  if(!ci || !Curl_llist_count(&ci->cookielist[myhash]))
  ------------------
  |  Branch (1458:6): [True: 0, False: 1.94k]
  |  Branch (1458:13): [True: 1.94k, False: 1]
  ------------------
 1459|  1.94k|    return CURLE_OK; /* no cookie struct or no cookies in the struct */
 1460|       |
 1461|      1|  now = (curl_off_t)time(NULL);
 1462|       |
 1463|      2|  for(n = Curl_llist_head(&ci->cookielist[myhash]); n; n = Curl_node_next(n)) {
  ------------------
  |  Branch (1463:53): [True: 1, False: 1]
  ------------------
 1464|      1|    struct Cookie *co = Curl_node_elem(n);
 1465|       |
 1466|      1|    if(co->expires && (co->expires < now))
  ------------------
  |  Branch (1466:8): [True: 0, False: 1]
  |  Branch (1466:23): [True: 0, False: 0]
  ------------------
 1467|      0|      continue;
 1468|       |
 1469|       |    /* if the cookie requires we are secure we must only continue if we are! */
 1470|      1|    if(co->secure ? secure : TRUE) {
  ------------------
  |  |  986|      1|#define TRUE true
  ------------------
  |  Branch (1470:8): [True: 1, False: 0]
  |  Branch (1470:8): [True: 1, False: 0]
  ------------------
 1471|       |
 1472|       |      /* now check if the domain is correct */
 1473|      1|      if(!co->domain[0] ||
  ------------------
  |  Branch (1473:10): [True: 0, False: 1]
  ------------------
 1474|      1|         (co->tailmatch && !is_ip &&
  ------------------
  |  Branch (1474:11): [True: 1, False: 0]
  |  Branch (1474:28): [True: 1, False: 0]
  ------------------
 1475|      1|          cookie_tailmatch(co->domain, strlen(co->domain),
  ------------------
  |  Branch (1475:11): [True: 0, False: 1]
  ------------------
 1476|      1|                           curlx_str(&host), curlx_strlen(&host))) ||
  ------------------
  |  |   49|      1|#define curlx_str(x)    ((x)->str)
  ------------------
                                         curlx_str(&host), curlx_strlen(&host))) ||
  ------------------
  |  |   50|      1|#define curlx_strlen(x) ((x)->len)
  ------------------
 1477|      1|         ((!co->tailmatch || is_ip) && curl_strequal(hostp, co->domain))) {
  ------------------
  |  Branch (1477:12): [True: 0, False: 1]
  |  Branch (1477:30): [True: 0, False: 1]
  |  Branch (1477:40): [True: 0, False: 0]
  ------------------
 1478|       |        /*
 1479|       |         * the right part of the host matches the domain stuff in the
 1480|       |         * cookie data
 1481|       |         */
 1482|       |
 1483|       |        /*
 1484|       |         * now check the left part of the path with the cookies path
 1485|       |         * requirement
 1486|       |         */
 1487|      0|        if(!co->path || pathmatch(co->path, path)) {
  ------------------
  |  Branch (1487:12): [True: 0, False: 0]
  |  Branch (1487:25): [True: 0, False: 0]
  ------------------
 1488|       |
 1489|       |          /*
 1490|       |           * This is a match and we add it to the return-linked-list
 1491|       |           */
 1492|      0|          Curl_llist_append(list, co, &co->getnode);
 1493|      0|          matches++;
 1494|      0|          if(matches >= MAX_COOKIE_SEND_AMOUNT) {
  ------------------
  |  |  103|      0|#define MAX_COOKIE_SEND_AMOUNT 150
  ------------------
  |  Branch (1494:14): [True: 0, False: 0]
  ------------------
 1495|      0|            infof(data, "Included max number of cookies (%zu) in request!",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1496|      0|                  matches);
 1497|      0|            break;
 1498|      0|          }
 1499|      0|        }
 1500|      0|      }
 1501|      1|    }
 1502|      1|  }
 1503|       |
 1504|      1|  if(matches > 1) {
  ------------------
  |  Branch (1504:6): [True: 0, False: 1]
  ------------------
 1505|      0|#define NUM_ON_STACK 16
 1506|       |
 1507|       |    /*
 1508|       |     * Now we need to make sure that if there is a name appearing more than
 1509|       |     * once, the longest specified path version comes first. To make this the
 1510|       |     * swiftest way, we sort them all based on path length.
 1511|       |     */
 1512|      0|    struct Cookie **array;
 1513|      0|    struct Cookie *arrbuf[NUM_ON_STACK];
 1514|      0|    size_t i;
 1515|       |
 1516|      0|    if(matches > NUM_ON_STACK) {
  ------------------
  |  | 1505|      0|#define NUM_ON_STACK 16
  ------------------
  |  Branch (1516:8): [True: 0, False: 0]
  ------------------
 1517|       |      /* alloc an array and store all cookie pointers */
 1518|      0|      array = curlx_malloc(sizeof(struct Cookie *) * matches);
  ------------------
  |  | 1498|      0|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 1519|      0|      if(!array) {
  ------------------
  |  Branch (1519:10): [True: 0, False: 0]
  ------------------
 1520|      0|        result = CURLE_OUT_OF_MEMORY;
 1521|      0|        goto fail;
 1522|      0|      }
 1523|      0|    }
 1524|      0|    else
 1525|      0|      array = arrbuf;
 1526|       |
 1527|      0|    n = Curl_llist_head(list);
 1528|       |
 1529|      0|    for(i = 0; n; n = Curl_node_next(n))
  ------------------
  |  Branch (1529:16): [True: 0, False: 0]
  ------------------
 1530|      0|      array[i++] = Curl_node_elem(n);
 1531|       |
 1532|       |    /* now sort the cookie pointers in path length order */
 1533|      0|    qsort(array, matches, sizeof(struct Cookie *), cookie_sort);
 1534|       |
 1535|       |    /* remake the linked list order according to the new order */
 1536|      0|    Curl_llist_destroy(list, NULL);
 1537|       |
 1538|      0|    for(i = 0; i < matches; i++)
  ------------------
  |  Branch (1538:16): [True: 0, False: 0]
  ------------------
 1539|      0|      Curl_llist_append(list, array[i], &array[i]->getnode);
 1540|       |
 1541|      0|    if(array != arrbuf)
  ------------------
  |  Branch (1541:8): [True: 0, False: 0]
  ------------------
 1542|      0|      curlx_free(array); /* remove the temporary data again */
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1543|      0|  }
 1544|       |
 1545|      1|  *okay = TRUE;
  ------------------
  |  |  986|      1|#define TRUE true
  ------------------
 1546|      1|  return CURLE_OK; /* success */
 1547|       |
 1548|      0|fail:
 1549|       |  /* failure, clear up the allocated chain and return NULL */
 1550|       |  Curl_llist_destroy(list, NULL);
 1551|      0|  return result; /* error */
 1552|      1|}
Curl_cookie_clearall:
 1560|  10.5k|{
 1561|  10.5k|  if(ci) {
  ------------------
  |  Branch (1561:6): [True: 10.4k, False: 66]
  ------------------
 1562|  10.4k|    unsigned int i;
 1563|   668k|    for(i = 0; i < COOKIE_HASH_SIZE; i++) {
  ------------------
  |  |   56|   668k|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (1563:16): [True: 657k, False: 10.4k]
  ------------------
 1564|   657k|      struct Curl_llist_node *n;
 1565|   659k|      for(n = Curl_llist_head(&ci->cookielist[i]); n;) {
  ------------------
  |  Branch (1565:52): [True: 1.22k, False: 657k]
  ------------------
 1566|  1.22k|        struct Cookie *c = Curl_node_elem(n);
 1567|  1.22k|        struct Curl_llist_node *e = Curl_node_next(n);
 1568|  1.22k|        Curl_node_remove(n);
 1569|  1.22k|        curlx_free(c);
  ------------------
  |  | 1503|  1.22k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1570|  1.22k|        n = e;
 1571|  1.22k|      }
 1572|   657k|    }
 1573|  10.4k|    ci->numcookies = 0;
 1574|  10.4k|  }
 1575|  10.5k|}
Curl_cookie_cleanup:
 1611|  9.90k|{
 1612|  9.90k|  if(ci) {
  ------------------
  |  Branch (1612:6): [True: 9.90k, False: 0]
  ------------------
 1613|  9.90k|    Curl_cookie_clearall(ci);
 1614|  9.90k|    curlx_free(ci); /* free the base struct as well */
  ------------------
  |  | 1503|  9.90k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1615|  9.90k|  }
 1616|  9.90k|}
Curl_flush_cookies:
 1826|  19.7k|{
 1827|  19.7k|  Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1828|       |  /* only save the cookie file if a transfer was started (cookies->running is
 1829|       |     set), as otherwise the cookies were not completely initialized and there
 1830|       |     might be cookie files that were not loaded so saving the file is the
 1831|       |     wrong thing. */
 1832|  19.7k|  if(data->cookies) {
  ------------------
  |  Branch (1832:6): [True: 9.90k, False: 9.84k]
  ------------------
 1833|  9.90k|    const char *cookiejar = CURL_EASY_STR(data, STRING_COOKIEJAR);
  ------------------
  |  | 1206|  9.90k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1834|  9.90k|    if(cookiejar && data->cookies->running) {
  ------------------
  |  Branch (1834:8): [True: 9.87k, False: 23]
  |  Branch (1834:21): [True: 9.65k, False: 222]
  ------------------
 1835|       |      /* if we have a destination file for all the cookies to get dumped to */
 1836|  9.65k|      CURLcode result = cookie_output(data, data->cookies, cookiejar);
 1837|  9.65k|      if(result)
  ------------------
  |  Branch (1837:10): [True: 2, False: 9.65k]
  ------------------
 1838|      2|        infof(data, "WARNING: failed to save cookies in %s: %s",
  ------------------
  |  |  143|      2|  do {                               \
  |  |  144|      2|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  323|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      2|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1839|  9.65k|              cookiejar, curl_easy_strerror(result));
 1840|  9.65k|    }
 1841|       |
 1842|  9.90k|    if(cleanup && (!data->share || (data->cookies != data->share->cookies))) {
  ------------------
  |  Branch (1842:8): [True: 9.90k, False: 0]
  |  Branch (1842:20): [True: 9.90k, False: 0]
  |  Branch (1842:36): [True: 0, False: 0]
  ------------------
 1843|  9.90k|      Curl_cookie_cleanup(data->cookies);
 1844|       |      data->cookies = NULL;
 1845|  9.90k|    }
 1846|  9.90k|  }
 1847|  19.7k|  Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1848|  19.7k|}
Curl_cookie_run:
 1851|  9.67k|{
 1852|  9.67k|  Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1853|  9.67k|  if(data->cookies)
  ------------------
  |  Branch (1853:6): [True: 9.67k, False: 1]
  ------------------
 1854|  9.67k|    data->cookies->running = TRUE;
  ------------------
  |  |  986|  9.67k|#define TRUE true
  ------------------
 1855|  9.67k|  Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1856|  9.67k|}
cookie.c:strstore:
  262|  25.3k|{
  263|  25.3k|  DEBUGASSERT(dest);
  ------------------
  |  | 1016|  25.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (263:3): [True: 0, False: 25.3k]
  |  Branch (263:3): [True: 25.3k, False: 0]
  ------------------
  264|  25.3k|  curlx_str_assign(dest, str, len);
  265|  25.3k|}
cookie.c:sanitize_cookie_path:
  233|    919|{
  234|       |  /* some sites send path attribute within '"'. */
  235|    919|  if(len && (cookie_path[0] == '\"')) {
  ------------------
  |  Branch (235:6): [True: 919, False: 0]
  |  Branch (235:13): [True: 216, False: 703]
  ------------------
  236|    216|    cookie_path++;
  237|    216|    len--;
  238|       |
  239|    216|    if(len && (cookie_path[len - 1] == '\"'))
  ------------------
  |  Branch (239:8): [True: 141, False: 75]
  |  Branch (239:15): [True: 73, False: 68]
  ------------------
  240|     73|      len--;
  241|    216|  }
  242|       |
  243|       |  /* RFC6265 5.2.4 The Path Attribute */
  244|    919|  if(!len || (cookie_path[0] != '/'))
  ------------------
  |  Branch (244:6): [True: 142, False: 777]
  |  Branch (244:14): [True: 372, False: 405]
  ------------------
  245|       |    /* Let cookie-path be the default-path. */
  246|    514|    curlx_str_assign(dest, "/", 1);
  247|    405|  else {
  248|       |    /* remove trailing slash when path is non-empty */
  249|    405|    if(len > 1 && cookie_path[len - 1] == '/')
  ------------------
  |  Branch (249:8): [True: 264, False: 141]
  |  Branch (249:19): [True: 42, False: 222]
  ------------------
  250|     42|      len--;
  251|       |
  252|    405|    curlx_str_assign(dest, cookie_path, len);
  253|    405|  }
  254|    919|}
cookie.c:parse_netscape:
  705|  19.4k|{
  706|       |  /*
  707|       |   * This line is NOT an HTTP header style line, we do offer support for
  708|       |   * reading the odd netscape cookies-file format here
  709|       |   */
  710|  19.4k|  const char *ptr, *next;
  711|  19.4k|  int fields;
  712|  19.4k|  size_t len;
  713|  19.4k|  *okay = FALSE;
  ------------------
  |  |  989|  19.4k|#define FALSE false
  ------------------
  714|       |
  715|       |  /*
  716|       |   * In 2008, Internet Explorer introduced HTTP-only cookies to prevent XSS
  717|       |   * attacks. Cookies marked httpOnly are not accessible to JavaScript. In
  718|       |   * Firefox's cookie files, they are prefixed #HttpOnly_ and the rest
  719|       |   * remains as usual, so we skip 10 characters of the line.
  720|       |   */
  721|  19.4k|  if(!strncmp(lineptr, "#HttpOnly_", 10)) {
  ------------------
  |  Branch (721:6): [True: 163, False: 19.2k]
  ------------------
  722|    163|    lineptr += 10;
  723|    163|    co->httponly = TRUE;
  ------------------
  |  |  986|    163|#define TRUE true
  ------------------
  724|    163|  }
  725|       |
  726|  19.4k|  if(lineptr[0] == '#')
  ------------------
  |  Branch (726:6): [True: 126, False: 19.3k]
  ------------------
  727|       |    /* do not even try the comments */
  728|    126|    return CURLE_OK;
  729|       |
  730|       |  /*
  731|       |   * Now loop through the fields and init the struct we already have
  732|       |   * allocated
  733|       |   */
  734|  19.3k|  fields = 0;
  735|  54.5k|  for(next = lineptr; next; fields++) {
  ------------------
  |  Branch (735:23): [True: 47.7k, False: 6.86k]
  ------------------
  736|  47.7k|    ptr = next;
  737|  47.7k|    len = strcspn(ptr, "\t\r\n");
  738|  47.7k|    next = (ptr[len] == '\t' ? &ptr[len + 1] : NULL);
  ------------------
  |  Branch (738:13): [True: 28.8k, False: 18.9k]
  ------------------
  739|  47.7k|    switch(fields) {
  ------------------
  |  Branch (739:12): [True: 47.3k, False: 347]
  ------------------
  740|  19.3k|    case 0:
  ------------------
  |  Branch (740:5): [True: 19.3k, False: 28.4k]
  ------------------
  741|  19.3k|      if(ptr[0] == '.') { /* skip preceding dots */
  ------------------
  |  Branch (741:10): [True: 304, False: 19.0k]
  ------------------
  742|    304|        ptr++;
  743|    304|        len--;
  744|    304|      }
  745|  19.3k|      if(!len)
  ------------------
  |  Branch (745:10): [True: 11.9k, False: 7.34k]
  ------------------
  746|  11.9k|        return CURLE_OK;
  747|  7.34k|      strstore(&co->domain, ptr, len);
  748|  7.34k|      break;
  749|  7.16k|    case 1:
  ------------------
  |  Branch (749:5): [True: 7.16k, False: 40.5k]
  ------------------
  750|       |      /*
  751|       |       * flag: A TRUE/FALSE value indicating if all machines within a given
  752|       |       * domain can access the variable. Set TRUE when the cookie says
  753|       |       * .example.com and to false when the domain is complete www.example.com
  754|       |       */
  755|  7.16k|      co->tailmatch = !!curl_strnequal(ptr, "TRUE", len);
  756|  7.16k|      break;
  757|  7.13k|    case 2:
  ------------------
  |  Branch (757:5): [True: 7.13k, False: 40.5k]
  ------------------
  758|       |      /* The file format allows the path field to remain not filled in */
  759|  7.13k|      if(strncmp("TRUE", ptr, len) && strncmp("FALSE", ptr, len)) {
  ------------------
  |  Branch (759:10): [True: 1.06k, False: 6.07k]
  |  Branch (759:39): [True: 919, False: 146]
  ------------------
  760|       |        /* only if the path does not look like a boolean option! */
  761|    919|        sanitize_cookie_path(&co->path, ptr, len);
  762|    919|        break;
  763|    919|      }
  764|  6.22k|      else {
  765|       |        /* this does not look like a path, make one up! */
  766|  6.22k|        strstore(&co->path, "/", 1);
  767|  6.22k|      }
  768|  6.22k|      fields++; /* add a field and fall down to secure */
  769|  6.22k|      FALLTHROUGH();
  ------------------
  |  |  752|  6.22k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  770|  6.80k|    case 3:
  ------------------
  |  Branch (770:5): [True: 585, False: 47.1k]
  ------------------
  771|  6.80k|      co->secure = FALSE;
  ------------------
  |  |  989|  6.80k|#define FALSE false
  ------------------
  772|  6.80k|      if(curl_strnequal(ptr, "TRUE", len)) {
  ------------------
  |  Branch (772:10): [True: 6.42k, False: 382]
  ------------------
  773|  6.42k|        if(secure_origin || ci->running)
  ------------------
  |  Branch (773:12): [True: 6.42k, False: 0]
  |  Branch (773:29): [True: 0, False: 0]
  ------------------
  774|  6.42k|          co->secure = TRUE;
  ------------------
  |  |  986|  6.42k|#define TRUE true
  ------------------
  775|      0|        else
  776|      0|          return CURLE_OK;
  777|  6.42k|      }
  778|  6.80k|      break;
  779|  6.80k|    case 4:
  ------------------
  |  Branch (779:5): [True: 6.50k, False: 41.2k]
  ------------------
  780|  6.50k|      if(curlx_str_number(&ptr, &co->expires, CURL_OFF_T_MAX))
  ------------------
  |  |  539|  6.50k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (780:10): [True: 262, False: 6.24k]
  ------------------
  781|    262|        return CURLE_OK;
  782|  6.24k|      break;
  783|  6.24k|    case 5:
  ------------------
  |  Branch (783:5): [True: 6.11k, False: 41.6k]
  ------------------
  784|  6.11k|      if(!len)
  ------------------
  |  Branch (784:10): [True: 213, False: 5.90k]
  ------------------
  785|       |        /* reject blank names */
  786|    213|        return CURLE_OK;
  787|  5.90k|      strstore(&co->name, ptr, len);
  788|       |
  789|       |      /* For Netscape file format cookies we check prefix on the name. These
  790|       |         prefixes are matched case sensitively, same as on the header path and
  791|       |         as the 6265bis document specifies. */
  792|  5.90k|      if(len >= 9 && !memcmp("__Secure-", ptr, 9))
  ------------------
  |  Branch (792:10): [True: 264, False: 5.64k]
  |  Branch (792:22): [True: 124, False: 140]
  ------------------
  793|    124|        co->prefix_secure = TRUE;
  ------------------
  |  |  986|    124|#define TRUE true
  ------------------
  794|  5.78k|      else if(len >= 7 && !memcmp("__Host-", ptr, 7))
  ------------------
  |  Branch (794:15): [True: 333, False: 5.44k]
  |  Branch (794:27): [True: 137, False: 196]
  ------------------
  795|    137|        co->prefix_host = TRUE;
  ------------------
  |  |  986|    137|#define TRUE true
  ------------------
  796|       |
  797|  5.90k|      break;
  798|    536|    case 6:
  ------------------
  |  Branch (798:5): [True: 536, False: 47.1k]
  ------------------
  799|    536|      strstore(&co->value, ptr, len);
  800|    536|      break;
  801|  47.7k|    }
  802|  47.7k|  }
  803|  6.86k|  if(fields == 6) {
  ------------------
  |  Branch (803:6): [True: 5.37k, False: 1.49k]
  ------------------
  804|       |    /* we got a cookie with blank contents, fix it */
  805|  5.37k|    strstore(&co->value, "", 0);
  806|  5.37k|    fields++;
  807|  5.37k|  }
  808|       |
  809|  6.86k|  if(fields != 7)
  ------------------
  |  Branch (809:6): [True: 976, False: 5.88k]
  ------------------
  810|       |    /* we did not find the sufficient number of fields */
  811|    976|    return CURLE_OK;
  812|       |
  813|       |  /* Reject control octets in the name or value, matching the filtering done
  814|       |     for cookies set over HTTP. A cookie loaded from a file is later sent in
  815|       |     request headers, so the same bytes that make a server reject a request
  816|       |     must not slip in through the file. */
  817|  5.88k|  if(invalid_octets(curlx_str(&co->name), curlx_strlen(&co->name)) ||
  ------------------
  |  |   49|  5.88k|#define curlx_str(x)    ((x)->str)
  ------------------
                if(invalid_octets(curlx_str(&co->name), curlx_strlen(&co->name)) ||
  ------------------
  |  |   50|  5.88k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (817:6): [True: 78, False: 5.81k]
  ------------------
  818|  5.81k|     invalid_octets(curlx_str(&co->value), curlx_strlen(&co->value)))
  ------------------
  |  |   49|  5.81k|#define curlx_str(x)    ((x)->str)
  ------------------
                   invalid_octets(curlx_str(&co->value), curlx_strlen(&co->value)))
  ------------------
  |  |   50|  5.81k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (818:6): [True: 67, False: 5.74k]
  ------------------
  819|    145|    return CURLE_OK;
  820|       |
  821|  5.74k|  *okay = TRUE;
  ------------------
  |  |  986|  5.74k|#define TRUE true
  ------------------
  822|  5.74k|  return CURLE_OK;
  823|  5.88k|}
cookie.c:invalid_octets:
  353|  11.7k|{
  354|  11.7k|  const unsigned char *p = (const unsigned char *)ptr;
  355|       |  /* Reject all bytes \x01 - \x1f + \x7f */
  356|  49.7k|  while(len--) {
  ------------------
  |  Branch (356:9): [True: 38.1k, False: 11.5k]
  ------------------
  357|  38.1k|    if((*p < 0x20) || (*p == 0x7f))
  ------------------
  |  Branch (357:8): [True: 48, False: 38.1k]
  |  Branch (357:23): [True: 97, False: 38.0k]
  ------------------
  358|    145|      return TRUE;
  ------------------
  |  |  986|    145|#define TRUE true
  ------------------
  359|  38.0k|    p++;
  360|  38.0k|  }
  361|  11.5k|  return FALSE;
  ------------------
  |  |  989|  11.5k|#define FALSE false
  ------------------
  362|  11.7k|}
cookie.c:host_is_ipnum:
  827|  7.65k|{
  828|  7.65k|  const char *hp = curlx_str(host);
  ------------------
  |  |   49|  7.65k|#define curlx_str(x)    ((x)->str)
  ------------------
  829|  7.65k|  size_t len = curlx_strlen(host);
  ------------------
  |  |   50|  7.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
  830|  7.65k|  char temp[MAX_IPADR_LEN]; /* the define includes the null terminator */
  831|  7.65k|  if((!ISXDIGIT(hp[0]) && (hp[0] != ':')) ||
  ------------------
  |  |   37|  15.3k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  15.3k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 5.27k, False: 2.38k]
  |  |  |  |  |  Branch (42:38): [True: 2.04k, False: 3.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  13.2k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 2.29k, False: 3.31k]
  |  |  |  |  |  Branch (27:43): [True: 288, False: 2.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  5.32k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 2.39k, False: 2.92k]
  |  |  |  |  |  Branch (28:43): [True: 344, False: 2.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (831:27): [True: 4.43k, False: 539]
  ------------------
  832|  3.21k|     (!ISXDIGIT(hp[len - 1]) && (hp[len - 1] != ':')) ||
  ------------------
  |  |   37|  6.43k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  6.43k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 3.09k, False: 126]
  |  |  |  |  |  Branch (42:38): [True: 1.41k, False: 1.67k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  5.02k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 677, False: 1.12k]
  |  |  |  |  |  Branch (27:43): [True: 648, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  1.15k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 660, False: 495]
  |  |  |  |  |  Branch (28:43): [True: 538, False: 122]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (832:33): [True: 250, False: 367]
  ------------------
  833|  2.96k|     (!ISDIGIT(hp[0]) && !memchr(hp, ':', len)) ||
  ------------------
  |  |   42|  5.93k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 2.96k, False: 0]
  |  |  |  Branch (42:38): [True: 1.91k, False: 1.05k]
  |  |  ------------------
  ------------------
  |  Branch (833:26): [True: 209, False: 848]
  ------------------
  834|  2.75k|     (len >= MAX_IPADR_LEN))
  ------------------
  |  |   41|  2.75k|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  |  Branch (834:6): [True: 35, False: 2.72k]
  ------------------
  835|  4.93k|    return FALSE;
  ------------------
  |  |  989|  4.93k|#define FALSE false
  ------------------
  836|  2.72k|  curl_msnprintf(temp, sizeof(temp), "%.*s", (int)len, hp);
  837|  2.72k|  return Curl_host_is_ipnum(temp);
  838|  7.65k|}
cookie.c:remove_expired:
  277|  19.3k|{
  278|  19.3k|  struct Cookie *co;
  279|  19.3k|  curl_off_t now;
  280|  19.3k|  unsigned int i;
  281|       |
  282|  19.3k|  if(!ci->numcookies)
  ------------------
  |  Branch (282:6): [True: 17.9k, False: 1.34k]
  ------------------
  283|  17.9k|    return;
  284|       |
  285|  1.34k|  now = (curl_off_t)time(NULL);
  286|       |  /*
  287|       |   * If the earliest expiration timestamp in the jar is in the future we can
  288|       |   * skip scanning the whole jar and instead exit early as there will not be
  289|       |   * any cookies to evict. If we need to evict, reset the next_expiration
  290|       |   * counter in order to track the next one. In case the recorded first
  291|       |   * expiration is the max offset, then perform the safe fallback of checking
  292|       |   * all cookies.
  293|       |   */
  294|  1.34k|  if(now < ci->next_expiration &&
  ------------------
  |  Branch (294:6): [True: 659, False: 686]
  ------------------
  295|    659|     ci->next_expiration != CURL_OFF_T_MAX)
  ------------------
  |  |  539|    659|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (295:6): [True: 287, False: 372]
  ------------------
  296|    287|    return;
  297|  1.05k|  else
  298|  1.05k|    ci->next_expiration = CURL_OFF_T_MAX;
  ------------------
  |  |  539|  1.05k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  299|       |
  300|  67.7k|  for(i = 0; i < COOKIE_HASH_SIZE; i++) {
  ------------------
  |  |   56|  67.7k|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (300:14): [True: 66.6k, False: 1.05k]
  ------------------
  301|  66.6k|    struct Curl_llist_node *n;
  302|  66.6k|    struct Curl_llist_node *e = NULL;
  303|       |
  304|  69.6k|    for(n = Curl_llist_head(&ci->cookielist[i]); n; n = e) {
  ------------------
  |  Branch (304:50): [True: 2.95k, False: 66.6k]
  ------------------
  305|  2.95k|      co = Curl_node_elem(n);
  306|  2.95k|      e = Curl_node_next(n);
  307|  2.95k|      if(co->expires) {
  ------------------
  |  Branch (307:10): [True: 1.32k, False: 1.62k]
  ------------------
  308|  1.32k|        if(co->expires < now) {
  ------------------
  |  Branch (308:12): [True: 1.13k, False: 195]
  ------------------
  309|  1.13k|          Curl_node_remove(n);
  310|  1.13k|          curlx_free(co);
  ------------------
  |  | 1503|  1.13k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  311|  1.13k|          ci->numcookies--;
  312|  1.13k|        }
  313|    195|        else if(co->expires < ci->next_expiration)
  ------------------
  |  Branch (313:17): [True: 134, False: 61]
  ------------------
  314|       |          /*
  315|       |           * If this cookie has an expiration timestamp earlier than what we
  316|       |           * have seen so far then record it for the next round of expirations.
  317|       |           */
  318|    134|          ci->next_expiration = co->expires;
  319|  1.32k|      }
  320|  2.95k|    }
  321|  66.6k|  }
  322|  1.05k|}
cookie.c:cookiehash:
  217|  7.17k|{
  218|  7.17k|  const char *top;
  219|  7.17k|  size_t len;
  220|       |
  221|  7.17k|  if(!curlx_strlen(domain))
  ------------------
  |  |   50|  7.17k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (221:6): [True: 0, False: 7.17k]
  ------------------
  222|      0|    return 0;
  223|       |
  224|  7.17k|  top = get_top_domain(domain, &len);
  225|  7.17k|  return cookie_hash_domain(top, len);
  226|  7.17k|}
cookie.c:get_top_domain:
  167|  7.17k|{
  168|  7.17k|  size_t len = curlx_strlen(domain);
  ------------------
  |  |   50|  7.17k|#define curlx_strlen(x) ((x)->len)
  ------------------
  169|  7.17k|  const char *first = NULL, *last;
  170|  7.17k|  const char *domainp = curlx_str(domain);
  ------------------
  |  |   49|  7.17k|#define curlx_str(x)    ((x)->str)
  ------------------
  171|       |
  172|  7.17k|  if(len) {
  ------------------
  |  Branch (172:6): [True: 7.17k, False: 0]
  ------------------
  173|  7.17k|    last = memrchr(domainp, '.', len);
  174|  7.17k|    if(last) {
  ------------------
  |  Branch (174:8): [True: 3.25k, False: 3.91k]
  ------------------
  175|  3.25k|      first = memrchr(domainp, '.', (last - domainp));
  176|  3.25k|      if(first)
  ------------------
  |  Branch (176:10): [True: 699, False: 2.55k]
  ------------------
  177|    699|        len -= (++first - domainp);
  178|  3.25k|    }
  179|  7.17k|  }
  180|       |
  181|  7.17k|  if(outlen)
  ------------------
  |  Branch (181:6): [True: 7.17k, False: 0]
  ------------------
  182|  7.17k|    *outlen = len;
  183|       |
  184|  7.17k|  return first ? first : domainp;
  ------------------
  |  Branch (184:10): [True: 699, False: 6.47k]
  ------------------
  185|  7.17k|}
cookie.c:cookie_hash_domain:
  196|  7.17k|{
  197|  7.17k|  const char *end = domain + len;
  198|  7.17k|  size_t h = 5381;
  199|       |
  200|  49.9k|  while(domain < end) {
  ------------------
  |  Branch (200:9): [True: 42.7k, False: 7.17k]
  ------------------
  201|  42.7k|    size_t j = (size_t)Curl_raw_toupper(*domain++);
  202|  42.7k|    h += h << 5;
  203|  42.7k|    h ^= j;
  204|  42.7k|  }
  205|       |
  206|  7.17k|  return (h % COOKIE_HASH_SIZE);
  ------------------
  |  |   56|  7.17k|#define COOKIE_HASH_SIZE 63
  ------------------
  207|  7.17k|}
cookie.c:cookie_accept:
  933|  5.65k|{
  934|  5.65k|  bool replace_old = FALSE;
  ------------------
  |  |  989|  5.65k|#define FALSE false
  ------------------
  935|  5.65k|  struct Curl_llist_node *replace_n = NULL;
  936|  5.65k|  struct Curl_llist_node *n;
  937|  5.65k|  const char *name = curlx_str(&co->name);
  ------------------
  |  |   49|  5.65k|#define curlx_str(x)    ((x)->str)
  ------------------
  938|  5.65k|  const size_t nlen = curlx_strlen(&co->name);
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
  939|  5.65k|  const char *domain = curlx_str(&co->domain);
  ------------------
  |  |   49|  5.65k|#define curlx_str(x)    ((x)->str)
  ------------------
  940|  5.65k|  const size_t dlen = curlx_strlen(&co->domain);
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
  941|  13.5k|  for(n = Curl_llist_head(&ci->cookielist[myhash]); n; n = Curl_node_next(n)) {
  ------------------
  |  Branch (941:53): [True: 7.90k, False: 5.65k]
  ------------------
  942|  7.90k|    struct Cookie *clist = Curl_node_elem(n);
  943|  7.90k|    if((clist->name[0] == name[0]) && (nlen == strlen(clist->name)) &&
  ------------------
  |  Branch (943:8): [True: 6.91k, False: 987]
  |  Branch (943:39): [True: 6.40k, False: 512]
  ------------------
  944|  6.40k|       !memcmp(clist->name, name, nlen)) {
  ------------------
  |  Branch (944:8): [True: 5.79k, False: 606]
  ------------------
  945|       |      /* the names are identical */
  946|  5.79k|      if(clist->secure && !co->secure && !(flags & COOKIE_SECURE) &&
  ------------------
  |  |  118|     66|#define COOKIE_SECURE     (1<<2) /* connection is over secure origin */
  ------------------
  |  Branch (946:10): [True: 5.52k, False: 273]
  |  Branch (946:27): [True: 66, False: 5.45k]
  |  Branch (946:42): [True: 0, False: 66]
  ------------------
  947|      0|         clist->path && curlx_strlen(&co->path)) {
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  |  |  ------------------
  |  |  |  Branch (50:25): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (947:10): [True: 0, False: 0]
  ------------------
  948|      0|        bool matching_domains = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  949|       |
  950|      0|        if(clist->domain && dlen) {
  ------------------
  |  Branch (950:12): [True: 0, False: 0]
  |  Branch (950:29): [True: 0, False: 0]
  ------------------
  951|      0|          if(cookie_tailmatch(clist->domain, strlen(clist->domain),
  ------------------
  |  Branch (951:14): [True: 0, False: 0]
  ------------------
  952|      0|                              domain, dlen) ||
  953|      0|             cookie_tailmatch(domain, dlen,
  ------------------
  |  Branch (953:14): [True: 0, False: 0]
  ------------------
  954|      0|                              clist->domain, strlen(clist->domain)))
  955|       |            /* The existing one is a tail of the new or vice versa */
  956|      0|            matching_domains = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  957|      0|        }
  958|      0|        else if(!clist->domain && !dlen)
  ------------------
  |  Branch (958:17): [True: 0, False: 0]
  |  Branch (958:35): [True: 0, False: 0]
  ------------------
  959|      0|          matching_domains = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  960|       |
  961|      0|        if(matching_domains) {
  ------------------
  |  Branch (961:12): [True: 0, False: 0]
  ------------------
  962|      0|          size_t cllen;
  963|      0|          const char *sep = NULL;
  964|       |
  965|       |          /*
  966|       |           * A non-secure cookie may not overlay an existing secure cookie.
  967|       |           * For an existing cookie "a" with path "/login", refuse a new
  968|       |           * cookie "a" with for example path "/login/en", while the path
  969|       |           * "/loginhelper" is ok.
  970|       |           */
  971|       |
  972|      0|          DEBUGASSERT(clist->path[0]);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (972:11): [True: 0, False: 0]
  |  Branch (972:11): [True: 0, False: 0]
  ------------------
  973|      0|          if(clist->path[0])
  ------------------
  |  Branch (973:14): [True: 0, False: 0]
  ------------------
  974|      0|            sep = strchr(clist->path + 1, '/');
  975|      0|          if(sep)
  ------------------
  |  Branch (975:14): [True: 0, False: 0]
  ------------------
  976|      0|            cllen = sep - clist->path;
  977|      0|          else
  978|      0|            cllen = strlen(clist->path);
  979|       |
  980|      0|          if((cllen <= curlx_strlen(&co->path)) &&
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (980:14): [True: 0, False: 0]
  ------------------
  981|      0|             !strncmp(clist->path, curlx_str(&co->path), cllen)) {
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
  |  Branch (981:14): [True: 0, False: 0]
  ------------------
  982|      0|            infof(data, "cookie '%s' for domain '%.*s' dropped, would "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  983|      0|                  "overlay an existing cookie", clist->name,
  984|      0|                  (int)dlen, domain);
  985|      0|            return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  986|      0|          }
  987|      0|        }
  988|      0|      }
  989|       |
  990|  5.79k|      if(!replace_n) {
  ------------------
  |  Branch (990:10): [True: 5.51k, False: 280]
  ------------------
  991|  5.51k|        if(clist->domain && (dlen == strlen(clist->domain))) {
  ------------------
  |  Branch (991:12): [True: 5.51k, False: 0]
  |  Branch (991:29): [True: 4.83k, False: 685]
  ------------------
  992|  4.83k|          if((!dlen || curl_strnequal(clist->domain, domain, dlen)) &&
  ------------------
  |  Branch (992:15): [True: 0, False: 4.83k]
  |  Branch (992:24): [True: 4.54k, False: 292]
  ------------------
  993|  4.54k|             (clist->tailmatch == co->tailmatch))
  ------------------
  |  Branch (993:14): [True: 4.24k, False: 294]
  ------------------
  994|       |            /* The domains are identical */
  995|  4.24k|            replace_old = TRUE;
  ------------------
  |  |  986|  4.24k|#define TRUE true
  ------------------
  996|  4.83k|        }
  997|    685|        else if(!clist->domain && !dlen)
  ------------------
  |  Branch (997:17): [True: 0, False: 685]
  |  Branch (997:35): [True: 0, False: 0]
  ------------------
  998|      0|          replace_old = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  999|       |
 1000|  5.51k|        if(replace_old) {
  ------------------
  |  Branch (1000:12): [True: 4.24k, False: 1.27k]
  ------------------
 1001|       |          /* the domains were identical */
 1002|  4.24k|          const char *path = curlx_str(&co->path);
  ------------------
  |  |   49|  4.24k|#define curlx_str(x)    ((x)->str)
  ------------------
 1003|  4.24k|          const size_t plen = curlx_strlen(&co->path);
  ------------------
  |  |   50|  4.24k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1004|       |
 1005|  4.24k|          if(clist->path && plen &&
  ------------------
  |  Branch (1005:14): [True: 4.24k, False: 0]
  |  Branch (1005:29): [True: 4.24k, False: 0]
  ------------------
 1006|  4.24k|             ((strlen(clist->path) != plen) ||
  ------------------
  |  Branch (1006:15): [True: 808, False: 3.43k]
  ------------------
 1007|  3.43k|              memcmp(clist->path, path, plen)))
  ------------------
  |  Branch (1007:15): [True: 143, False: 3.29k]
  ------------------
 1008|    951|            replace_old = FALSE;
  ------------------
  |  |  989|    951|#define FALSE false
  ------------------
 1009|  3.29k|          else if(!clist->path || !plen)
  ------------------
  |  Branch (1009:19): [True: 0, False: 3.29k]
  |  Branch (1009:35): [True: 0, False: 3.29k]
  ------------------
 1010|      0|            replace_old = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1011|  3.29k|          else if(!(flags & COOKIE_LIVE) && clist->livecookie) {
  ------------------
  |  |  117|  3.29k|#define COOKIE_LIVE       (1<<1) /* from a server or API */
  ------------------
  |  Branch (1011:19): [True: 0, False: 3.29k]
  |  Branch (1011:45): [True: 0, False: 0]
  ------------------
 1012|       |            /*
 1013|       |             * The already present cookie is "live", which means it was set
 1014|       |             * from a header, while the new one was read from a file and thus
 1015|       |             * is not "live". "live" cookies are preferred so the new cookie
 1016|       |             * is freed.
 1017|       |             */
 1018|      0|            return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1019|      0|          }
 1020|  3.29k|          else
 1021|  3.29k|            replace_n = n;
 1022|  4.24k|        }
 1023|  5.51k|      }
 1024|  5.79k|    }
 1025|  7.90k|  }
 1026|  5.65k|  *replacep = replace_n ? Curl_node_elem(replace_n) : NULL;
  ------------------
  |  Branch (1026:15): [True: 3.29k, False: 2.36k]
  ------------------
 1027|       |  return TRUE;
  ------------------
  |  |  986|  5.65k|#define TRUE true
  ------------------
 1028|  5.65k|}
cookie.c:cookiedup:
 1031|  5.65k|{
 1032|  5.65k|  struct Cookie *c;
 1033|  5.65k|  size_t len = curlx_strlen(&co->name) +
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1034|  5.65k|    curlx_strlen(&co->value) +
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1035|  5.65k|    curlx_strlen(&co->domain) +
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1036|  5.65k|    curlx_strlen(&co->path) + 4; /* one null terminator each */
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1037|  5.65k|  char *area;
 1038|  5.65k|  const char *p;
 1039|       |
 1040|  5.65k|  c = curlx_calloc(1, sizeof(struct Cookie) + len);
  ------------------
  |  | 1500|  5.65k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1041|  5.65k|  if(!c)
  ------------------
  |  Branch (1041:6): [True: 3, False: 5.65k]
  ------------------
 1042|      3|    return NULL;
 1043|  5.65k|  c->expires = co->expires;
 1044|  5.65k|  c->tailmatch = co->tailmatch;
 1045|  5.65k|  c->secure = co->secure;
 1046|  5.65k|  c->httponly = co->httponly;
 1047|  5.65k|  c->prefix_secure = co->prefix_secure;
 1048|  5.65k|  c->prefix_host = co->prefix_host;
 1049|       |
 1050|  5.65k|  area = c->buf;
 1051|       |
 1052|       |  /* copy the name */
 1053|  5.65k|  memcpy(area, curlx_str(&co->name), curlx_strlen(&co->name));
  ------------------
  |  |   49|  5.65k|#define curlx_str(x)    ((x)->str)
  ------------------
                memcpy(area, curlx_str(&co->name), curlx_strlen(&co->name));
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1054|  5.65k|  area[curlx_strlen(&co->name)] = 0;
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1055|  5.65k|  c->name = area;
 1056|       |
 1057|       |  /* copy the value */
 1058|  5.65k|  area += curlx_strlen(&co->name) + 1;
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1059|  5.65k|  memcpy(area, curlx_str(&co->value), curlx_strlen(&co->value));
  ------------------
  |  |   49|  5.65k|#define curlx_str(x)    ((x)->str)
  ------------------
                memcpy(area, curlx_str(&co->value), curlx_strlen(&co->value));
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1060|  5.65k|  area[curlx_strlen(&co->value)] = 0;
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1061|  5.65k|  c->value = area;
 1062|       |
 1063|       |  /* copy the domain */
 1064|  5.65k|  area += curlx_strlen(&co->value) + 1;
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1065|  5.65k|  p = curlx_str(&co->domain);
  ------------------
  |  |   49|  5.65k|#define curlx_str(x)    ((x)->str)
  ------------------
 1066|  5.65k|  memcpy(area, p ? p : "", curlx_strlen(&co->domain));
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (1066:16): [True: 5.65k, False: 0]
  ------------------
 1067|  5.65k|  area[curlx_strlen(&co->domain)] = 0;
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1068|  5.65k|  c->domain = area;
 1069|       |
 1070|       |  /* copy the path */
 1071|  5.65k|  area += curlx_strlen(&co->domain) + 1;
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1072|  5.65k|  p = curlx_str(&co->path);
  ------------------
  |  |   49|  5.65k|#define curlx_str(x)    ((x)->str)
  ------------------
 1073|  5.65k|  memcpy(area, p ? p : "", curlx_strlen(&co->path));
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (1073:16): [True: 5.65k, False: 0]
  ------------------
 1074|  5.65k|  area[curlx_strlen(&co->path)] = 0;
  ------------------
  |  |   50|  5.65k|#define curlx_strlen(x) ((x)->len)
  ------------------
 1075|  5.65k|  c->path = area;
 1076|       |
 1077|  5.65k|  return c;
 1078|  5.65k|}
cookie.c:cookie_load:
 1251|  9.65k|{
 1252|  9.65k|  FILE *handle = NULL;
 1253|  9.65k|  CURLcode result = CURLE_OK;
 1254|  9.65k|  FILE *fp = NULL;
 1255|  9.65k|  DEBUGASSERT(ci);
  ------------------
  |  | 1016|  9.65k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1255:3): [True: 0, False: 9.65k]
  |  Branch (1255:3): [True: 9.65k, False: 0]
  ------------------
 1256|  9.65k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.65k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1256:3): [True: 0, False: 9.65k]
  |  Branch (1256:3): [True: 9.65k, False: 0]
  ------------------
 1257|  9.65k|  DEBUGASSERT(file);
  ------------------
  |  | 1016|  9.65k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1257:3): [True: 0, False: 9.65k]
  |  Branch (1257:3): [True: 9.65k, False: 0]
  ------------------
 1258|       |
 1259|  9.65k|  ci->running = FALSE; /* this is not running, this is init */
  ------------------
  |  |  989|  9.65k|#define FALSE false
  ------------------
 1260|       |
 1261|  9.65k|  if(file && *file) {
  ------------------
  |  Branch (1261:6): [True: 9.65k, False: 0]
  |  Branch (1261:14): [True: 9.65k, False: 0]
  ------------------
 1262|  9.65k|    if(!strcmp(file, "-"))
  ------------------
  |  Branch (1262:8): [True: 0, False: 9.65k]
  ------------------
 1263|      0|      fp = stdin;
 1264|  9.65k|    else {
 1265|  9.65k|      fp = curlx_fopen(file, "rb");
  ------------------
  |  |   83|  9.65k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
 1266|  9.65k|      if(!fp)
  ------------------
  |  Branch (1266:10): [True: 0, False: 9.65k]
  ------------------
 1267|      0|        infof(data, "WARNING: failed to open cookie file \"%s\"", file);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1268|  9.65k|      else {
 1269|  9.65k|        curlx_struct_stat stat;
  ------------------
  |  |   67|  9.65k|#define curlx_struct_stat       struct stat
  ------------------
 1270|  9.65k|        if((curlx_fstat(fileno(fp), &stat) != -1) && S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   66|  9.65k|#define curlx_fstat             fstat
  ------------------
  |  Branch (1270:12): [True: 9.65k, False: 0]
  |  Branch (1270:54): [True: 0, False: 9.65k]
  ------------------
 1271|      0|          curlx_fclose(fp);
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1272|      0|          fp = NULL;
 1273|      0|          infof(data, "WARNING: cookie filename points to a directory: \"%s\"",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1274|      0|                file);
 1275|      0|        }
 1276|  9.65k|        else
 1277|  9.65k|          handle = fp;
 1278|  9.65k|      }
 1279|  9.65k|    }
 1280|  9.65k|  }
 1281|       |
 1282|  9.65k|  if(fp) {
  ------------------
  |  Branch (1282:6): [True: 9.65k, False: 0]
  ------------------
 1283|  9.65k|    struct dynbuf buf;
 1284|  9.65k|    bool eof = FALSE;
  ------------------
  |  |  989|  9.65k|#define FALSE false
  ------------------
 1285|       |    /* get_netscape_format() uses curl_maprintf(), which returns at most
 1286|       |       DYN_APRINTF - 1 bytes. cookie_output() adds a newline (CRLF on Windows),
 1287|       |       and this dynbuf needs one more byte for its null-terminator. This is a
 1288|       |       cap, not an allocation. */
 1289|  9.65k|    curlx_dyn_init(&buf, DYN_APRINTF + 2);
  ------------------
  |  |   70|  9.65k|#define DYN_APRINTF         8000000
  ------------------
 1290|  9.65k|    do {
 1291|  9.65k|      result = Curl_get_line(&buf, fp, &eof);
 1292|  9.65k|      if(!result) {
  ------------------
  |  Branch (1292:10): [True: 9.64k, False: 5]
  ------------------
 1293|  9.64k|        const char *lineptr = curlx_dyn_ptr(&buf);
 1294|  9.64k|        bool headerline = FALSE;
  ------------------
  |  |  989|  9.64k|#define FALSE false
  ------------------
 1295|  9.64k|        if(checkprefix("Set-Cookie:", lineptr)) {
  ------------------
  |  |   49|  9.64k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1324|  9.64k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1319|  9.64k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (49:27): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 1296|       |          /* This is a cookie line, get it! */
 1297|      0|          lineptr += 11;
 1298|      0|          headerline = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1299|      0|          curlx_str_passblanks(&lineptr);
 1300|      0|        }
 1301|       |
 1302|  9.64k|        result = Curl_cookie_add(data, ci, lineptr, NULL, NULL,
 1303|  9.64k|                                 (headerline ? COOKIE_HTTPHEADER : 0) |
  ------------------
  |  |  116|      0|#define COOKIE_HTTPHEADER (1<<0) /* if HTTP header-style line */
  ------------------
  |  Branch (1303:35): [True: 0, False: 9.64k]
  ------------------
 1304|  9.64k|                                 COOKIE_SECURE |
  ------------------
  |  |  118|  9.64k|#define COOKIE_SECURE     (1<<2) /* connection is over secure origin */
  ------------------
 1305|  9.64k|                                 (flags & (COOKIE_NOPSL | COOKIE_NOSESSION)));
  ------------------
  |  |  119|  9.64k|#define COOKIE_NOPSL      (1<<3) /* skip PSL check */
  ------------------
                                               (flags & (COOKIE_NOPSL | COOKIE_NOSESSION)));
  ------------------
  |  |  120|  9.64k|#define COOKIE_NOSESSION  (1<<6) /* drop session cookies */
  ------------------
 1306|       |        /* Ignore individual cookie problems unless we ran out of memory */
 1307|  9.64k|        if(result != CURLE_OUT_OF_MEMORY)
  ------------------
  |  Branch (1307:12): [True: 9.64k, False: 0]
  ------------------
 1308|  9.64k|          result = CURLE_OK;
 1309|  9.64k|      }
 1310|  9.65k|    } while(!result && !eof);
  ------------------
  |  Branch (1310:13): [True: 9.64k, False: 5]
  |  Branch (1310:24): [True: 0, False: 9.64k]
  ------------------
 1311|  9.65k|    curlx_dyn_free(&buf); /* free the line buffer */
 1312|       |
 1313|       |    /*
 1314|       |     * Remove expired cookies from the hash. We must make sure to run this
 1315|       |     * after reading the file, and not on every cookie.
 1316|       |     */
 1317|  9.65k|    remove_expired(ci);
 1318|       |
 1319|  9.65k|    if(handle)
  ------------------
  |  Branch (1319:8): [True: 9.65k, False: 0]
  ------------------
 1320|  9.65k|      curlx_fclose(handle);
  ------------------
  |  |   88|  9.65k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1321|  9.65k|  }
 1322|  9.65k|  data->state.cookie_engine = TRUE;
  ------------------
  |  |  986|  9.65k|#define TRUE true
  ------------------
 1323|  9.65k|  ci->running = TRUE; /* now, we are running */
  ------------------
  |  |  986|  9.65k|#define TRUE true
  ------------------
 1324|       |
 1325|  9.65k|  return result;
 1326|  9.65k|}
cookie.c:cookie_tailmatch:
   82|      1|{
   83|      1|  if(hostname_len < cookie_domain_len)
  ------------------
  |  Branch (83:6): [True: 0, False: 1]
  ------------------
   84|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
   85|       |
   86|      1|  if(!curl_strnequal(cookie_domain,
  ------------------
  |  Branch (86:6): [True: 1, False: 0]
  ------------------
   87|      1|                     hostname + hostname_len - cookie_domain_len,
   88|      1|                     cookie_domain_len))
   89|      1|    return FALSE;
  ------------------
  |  |  989|      1|#define FALSE false
  ------------------
   90|       |
   91|       |  /*
   92|       |   * A lead char of cookie_domain is not '.'.
   93|       |   * RFC6265 4.1.2.3. The Domain Attribute says:
   94|       |   * For example, if the value of the Domain attribute is
   95|       |   * "example.com", the user agent will include the cookie in the Cookie
   96|       |   * header when making HTTP requests to example.com, www.example.com, and
   97|       |   * www.corp.example.com.
   98|       |   */
   99|      0|  if(hostname_len == cookie_domain_len)
  ------------------
  |  Branch (99:6): [True: 0, False: 0]
  ------------------
  100|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  101|      0|  if('.' == *(hostname + hostname_len - cookie_domain_len - 1))
  ------------------
  |  Branch (101:6): [True: 0, False: 0]
  ------------------
  102|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  103|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  104|      0|}
cookie.c:get_netscape_format:
 1626|  1.08k|{
 1627|  1.08k|  return curl_maprintf(
 1628|  1.08k|    "%s"               /* httponly preamble */
 1629|  1.08k|    "%s%s\t"           /* domain */
 1630|  1.08k|    "%s\t"             /* tailmatch */
 1631|  1.08k|    "%s\t"             /* path */
 1632|  1.08k|    "%s\t"             /* secure */
 1633|  1.08k|    "%" FMT_OFF_T "\t" /* expires */
 1634|  1.08k|    "%s\t"             /* name */
 1635|  1.08k|    "%s",              /* value */
 1636|  1.08k|    co->httponly ? "#HttpOnly_" : "",
  ------------------
  |  Branch (1636:5): [True: 12, False: 1.07k]
  ------------------
 1637|       |    /*
 1638|       |     * Make sure all domains are prefixed with a dot if they allow
 1639|       |     * tailmatching. This is Mozilla-style.
 1640|       |     */
 1641|  1.08k|    (co->tailmatch && co->domain && co->domain[0] != '.') ? "." : "",
  ------------------
  |  Branch (1641:6): [True: 975, False: 111]
  |  Branch (1641:23): [True: 975, False: 0]
  |  Branch (1641:37): [True: 909, False: 66]
  ------------------
 1642|  1.08k|    co->domain ? co->domain : "unknown",
  ------------------
  |  Branch (1642:5): [True: 1.08k, False: 0]
  ------------------
 1643|  1.08k|    co->tailmatch ? "TRUE" : "FALSE",
  ------------------
  |  Branch (1643:5): [True: 975, False: 111]
  ------------------
 1644|  1.08k|    co->path ? co->path : "/",
  ------------------
  |  Branch (1644:5): [True: 1.08k, False: 0]
  ------------------
 1645|  1.08k|    co->secure ? "TRUE" : "FALSE",
  ------------------
  |  Branch (1645:5): [True: 1.06k, False: 19]
  ------------------
 1646|  1.08k|    co->expires,
 1647|  1.08k|    co->name,
 1648|  1.08k|    co->value ? co->value : "");
  ------------------
  |  Branch (1648:5): [True: 1.08k, False: 0]
  ------------------
 1649|  1.08k|}
cookie.c:cookie_output:
 1662|  9.65k|{
 1663|  9.65k|  FILE *out = NULL;
 1664|  9.65k|  bool use_stdout = FALSE;
  ------------------
  |  |  989|  9.65k|#define FALSE false
  ------------------
 1665|  9.65k|  char *tempstore = NULL;
 1666|  9.65k|  CURLcode result = CURLE_OK;
 1667|       |
 1668|  9.65k|  if(!ci)
  ------------------
  |  Branch (1668:6): [True: 0, False: 9.65k]
  ------------------
 1669|       |    /* no cookie engine alive */
 1670|      0|    return CURLE_OK;
 1671|       |
 1672|       |  /* at first, remove expired cookies */
 1673|  9.65k|  remove_expired(ci);
 1674|       |
 1675|  9.65k|  if(!strcmp("-", filename)) {
  ------------------
  |  Branch (1675:6): [True: 0, False: 9.65k]
  ------------------
 1676|       |    /* use stdout */
 1677|      0|    out = stdout;
 1678|      0|    use_stdout = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1679|      0|  }
 1680|  9.65k|  else {
 1681|  9.65k|    result = Curl_fopen(data, filename, &out, &tempstore);
 1682|  9.65k|    if(result)
  ------------------
  |  Branch (1682:8): [True: 0, False: 9.65k]
  ------------------
 1683|      0|      goto error;
 1684|  9.65k|  }
 1685|       |
 1686|  9.65k|  if(fputs("# Netscape HTTP Cookie File\n"
  ------------------
  |  Branch (1686:6): [True: 0, False: 9.65k]
  ------------------
 1687|  9.65k|           "# https://curl.se/docs/http-cookies.html\n"
 1688|  9.65k|           "# This file was generated by libcurl! Edit at your own risk.\n\n",
 1689|  9.65k|           out) == EOF) {
 1690|      0|    result = CURLE_WRITE_ERROR;
 1691|      0|    goto error;
 1692|      0|  }
 1693|       |
 1694|  9.65k|  if(ci->numcookies) {
  ------------------
  |  Branch (1694:6): [True: 410, False: 9.24k]
  ------------------
 1695|    410|    unsigned int i;
 1696|    410|    size_t nvalid = 0;
 1697|    410|    struct Cookie **array;
 1698|    410|    struct Curl_llist_node *n;
 1699|       |
 1700|    410|    array = curlx_calloc(1, sizeof(struct Cookie *) * ci->numcookies);
  ------------------
  |  | 1500|    410|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1701|    410|    if(!array) {
  ------------------
  |  Branch (1701:8): [True: 1, False: 409]
  ------------------
 1702|      1|      result = CURLE_OUT_OF_MEMORY;
 1703|      1|      goto error;
 1704|      1|    }
 1705|       |
 1706|       |    /* only sort the cookies with a domain property */
 1707|  26.1k|    for(i = 0; i < COOKIE_HASH_SIZE; i++) {
  ------------------
  |  |   56|  26.1k|#define COOKIE_HASH_SIZE 63
  ------------------
  |  Branch (1707:16): [True: 25.7k, False: 409]
  ------------------
 1708|  26.8k|      for(n = Curl_llist_head(&ci->cookielist[i]); n; n = Curl_node_next(n)) {
  ------------------
  |  Branch (1708:52): [True: 1.08k, False: 25.7k]
  ------------------
 1709|  1.08k|        struct Cookie *co = Curl_node_elem(n);
 1710|  1.08k|        if(!co->domain || !co->domain[0])
  ------------------
  |  Branch (1710:12): [True: 0, False: 1.08k]
  |  Branch (1710:27): [True: 0, False: 1.08k]
  ------------------
 1711|      0|          continue;
 1712|  1.08k|        array[nvalid++] = co;
 1713|  1.08k|      }
 1714|  25.7k|    }
 1715|       |
 1716|    409|    qsort(array, nvalid, sizeof(struct Cookie *), cookie_sort_ct);
 1717|       |
 1718|  1.49k|    for(i = 0; i < nvalid; i++) {
  ------------------
  |  Branch (1718:16): [True: 1.08k, False: 408]
  ------------------
 1719|  1.08k|      char *format_ptr = get_netscape_format(array[i]);
 1720|  1.08k|      if(!format_ptr) {
  ------------------
  |  Branch (1720:10): [True: 1, False: 1.08k]
  ------------------
 1721|      1|        curlx_free(array);
  ------------------
  |  | 1503|      1|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1722|      1|        result = CURLE_OUT_OF_MEMORY;
 1723|      1|        goto error;
 1724|      1|      }
 1725|  1.08k|      if(curl_mfprintf(out, "%s\n", format_ptr) < 0) {
  ------------------
  |  Branch (1725:10): [True: 0, False: 1.08k]
  ------------------
 1726|      0|        curlx_free(format_ptr);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1727|      0|        curlx_free(array);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1728|      0|        result = CURLE_WRITE_ERROR;
 1729|      0|        goto error;
 1730|      0|      }
 1731|  1.08k|      curlx_free(format_ptr);
  ------------------
  |  | 1503|  1.08k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1732|  1.08k|    }
 1733|       |
 1734|    408|    curlx_free(array);
  ------------------
  |  | 1503|    408|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1735|    408|  }
 1736|       |
 1737|       |  /* Catch buffered and earlier write errors before publishing the jar. */
 1738|  9.65k|  if(fflush(out) || ferror(out)) {
  ------------------
  |  Branch (1738:6): [True: 0, False: 9.65k]
  |  Branch (1738:21): [True: 0, False: 9.65k]
  ------------------
 1739|      0|    result = CURLE_WRITE_ERROR;
 1740|      0|    goto error;
 1741|      0|  }
 1742|       |
 1743|  9.65k|  if(!use_stdout) {
  ------------------
  |  Branch (1743:6): [True: 9.65k, False: 0]
  ------------------
 1744|  9.65k|    int close_result = curlx_fclose(out);
  ------------------
  |  |   88|  9.65k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1745|  9.65k|    out = NULL;
 1746|  9.65k|    if(close_result) {
  ------------------
  |  Branch (1746:8): [True: 0, False: 9.65k]
  ------------------
 1747|      0|      result = CURLE_WRITE_ERROR;
 1748|      0|      goto error;
 1749|      0|    }
 1750|  9.65k|    if(tempstore && curlx_rename(tempstore, filename)) {
  ------------------
  |  |   74|      0|#define curlx_rename            rename
  ------------------
  |  Branch (1750:8): [True: 0, False: 9.65k]
  |  Branch (1750:21): [True: 0, False: 0]
  ------------------
 1751|      0|      result = CURLE_WRITE_ERROR;
 1752|      0|      goto error;
 1753|      0|    }
 1754|  9.65k|  }
 1755|       |
 1756|       |  /*
 1757|       |   * If we reach here we have successfully written a cookie file so there is
 1758|       |   * no need to inspect the error, any error case should have jumped into the
 1759|       |   * error block below.
 1760|       |   */
 1761|  9.65k|  curlx_free(tempstore);
  ------------------
  |  | 1503|  9.65k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1762|  9.65k|  return CURLE_OK;
 1763|       |
 1764|      2|error:
 1765|      2|  if(out && !use_stdout)
  ------------------
  |  Branch (1765:6): [True: 2, False: 0]
  |  Branch (1765:13): [True: 2, False: 0]
  ------------------
 1766|      2|    curlx_fclose(out);
  ------------------
  |  |   88|      2|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
 1767|      2|  if(tempstore) {
  ------------------
  |  Branch (1767:6): [True: 0, False: 2]
  ------------------
 1768|      0|    unlink(tempstore);
 1769|      0|    curlx_free(tempstore);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1770|      0|  }
 1771|      2|  return result;
 1772|  9.65k|}
cookie.c:cookie_sort_ct:
 1401|  1.79k|{
 1402|  1.79k|  const struct Cookie *c1 = *(const struct Cookie * const *)p1;
 1403|  1.79k|  const struct Cookie *c2 = *(const struct Cookie * const *)p2;
 1404|       |
 1405|  1.79k|  return (c2->creationtime > c1->creationtime) ? 1 : -1;
  ------------------
  |  Branch (1405:10): [True: 1.04k, False: 750]
  ------------------
 1406|  1.79k|}

Curl_creds_create:
   41|  9.97k|{
   42|  9.97k|  struct Curl_creds *creds = NULL;
   43|  9.97k|  size_t ulen = user ? strlen(user) : 0;
  ------------------
  |  Branch (43:17): [True: 683, False: 9.29k]
  ------------------
   44|  9.97k|  size_t plen = passwd ? strlen(passwd) : 0;
  ------------------
  |  Branch (44:17): [True: 349, False: 9.62k]
  ------------------
   45|  9.97k|  size_t olen = oauth_bearer ? strlen(oauth_bearer) : 0;
  ------------------
  |  Branch (45:17): [True: 238, False: 9.73k]
  ------------------
   46|  9.97k|  size_t salen = sasl_authzid ? strlen(sasl_authzid) : 0;
  ------------------
  |  Branch (46:18): [True: 180, False: 9.79k]
  ------------------
   47|  9.97k|  size_t sslen = sasl_service ? strlen(sasl_service) : 0;
  ------------------
  |  Branch (47:18): [True: 180, False: 9.79k]
  ------------------
   48|  9.97k|  char *s, *buf;
   49|  9.97k|  size_t bufsize;
   50|  9.97k|  CURLcode result = CURLE_OK;
   51|       |
   52|  9.97k|  Curl_creds_unlink(pcreds);
   53|       |
   54|       |  /* Everything empty/NULL, this is the NULL credential */
   55|  9.97k|  if(!user && !passwd && !olen && !salen && !sslen)
  ------------------
  |  Branch (55:6): [True: 9.29k, False: 683]
  |  Branch (55:15): [True: 9.24k, False: 52]
  |  Branch (55:26): [True: 9.21k, False: 31]
  |  Branch (55:35): [True: 9.21k, False: 0]
  |  Branch (55:45): [True: 9.21k, False: 0]
  ------------------
   56|  9.21k|    goto out;
   57|       |
   58|    766|  if((ulen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|    766|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (58:6): [True: 0, False: 766]
  ------------------
   59|    766|     (plen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|    766|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (59:6): [True: 0, False: 766]
  ------------------
   60|    766|     (olen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|    766|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (60:6): [True: 0, False: 766]
  ------------------
   61|    766|     (salen > CURL_MAX_INPUT_LENGTH) ||
  ------------------
  |  |   45|    766|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (61:6): [True: 0, False: 766]
  ------------------
   62|    766|     (sslen > CURL_MAX_INPUT_LENGTH)) {
  ------------------
  |  |   45|    766|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (62:6): [True: 0, False: 766]
  ------------------
   63|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
   64|      0|    goto out;
   65|      0|  }
   66|       |
   67|       |  /* null-terminator for user already part of struct */
   68|    766|  bufsize = ulen + plen + 1 + olen + 1 + salen + 1 + sslen + 1;
   69|    766|  creds = curlx_calloc(1, sizeof(*creds) + bufsize);
  ------------------
  |  | 1500|    766|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   70|    766|  if(!creds) {
  ------------------
  |  Branch (70:6): [True: 1, False: 765]
  ------------------
   71|      1|    result = CURLE_OUT_OF_MEMORY;
   72|      1|    goto out;
   73|      1|  }
   74|       |
   75|    765|  creds->bufsize = bufsize;
   76|    765|  Curl_refcount_init(&creds->refcount, 1);
  ------------------
  |  |   53|    765|#define Curl_refcount_init(c, v) atomic_init(c, v)
  ------------------
   77|    765|  creds->source = source;
   78|       |  /* Some compilers try to be too smart about our dynamic struct size */
   79|    765|  buf = ((char *)creds) + offsetof(struct Curl_creds, buf);
   80|    765|  creds->user = s = buf;
   81|    765|  if(ulen)
  ------------------
  |  Branch (81:6): [True: 300, False: 465]
  ------------------
   82|    300|    memcpy(s, user, ulen + 1);
   83|    765|  creds->passwd = s = buf + ulen + 1;
   84|    765|  if(plen)
  ------------------
  |  Branch (84:6): [True: 94, False: 671]
  ------------------
   85|     94|    memcpy(s, passwd, plen + 1);
   86|    765|  creds->oauth_bearer = s = buf + ulen + 1 + plen + 1;
   87|    765|  if(olen)
  ------------------
  |  Branch (87:6): [True: 70, False: 695]
  ------------------
   88|     70|    memcpy(s, oauth_bearer, olen + 1);
   89|    765|  creds->sasl_authzid = s = buf + ulen + 1 + plen + 1 + olen + 1;
   90|    765|  if(salen)
  ------------------
  |  Branch (90:6): [True: 0, False: 765]
  ------------------
   91|      0|    memcpy(s, sasl_authzid, salen + 1);
   92|    765|  creds->sasl_service = s = buf + ulen + 1 + plen + 1 + olen + 1 + salen + 1;
   93|    765|  if(sslen)
  ------------------
  |  Branch (93:6): [True: 0, False: 765]
  ------------------
   94|      0|    memcpy(s, sasl_service, sslen + 1);
   95|       |
   96|  9.97k|out:
   97|  9.97k|  if(!result)
  ------------------
  |  Branch (97:6): [True: 9.97k, False: 1]
  ------------------
   98|  9.97k|    *pcreds = creds;
   99|      1|  else
  100|      1|    Curl_creds_unlink(&creds);
  101|  9.97k|  return result;
  102|    765|}
Curl_creds_merge:
  109|  9.38k|{
  110|  9.38k|  struct Curl_creds *creds_out = NULL;
  111|  9.38k|  CURLcode result;
  112|       |
  113|  9.38k|  if(!creds_in) {
  ------------------
  |  Branch (113:6): [True: 9.20k, False: 180]
  ------------------
  114|  9.20k|    result = Curl_creds_create(user, passwd, NULL, NULL, NULL,
  115|  9.20k|                               source, &creds_out);
  116|  9.20k|  }
  117|    180|  else {
  118|    180|    result = Curl_creds_create(user ? user : Curl_creds_user(creds_in),
  ------------------
  |  |   82|    180|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (82:43): [True: 180, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (118:32): [True: 0, False: 180]
  ------------------
  119|    180|                               passwd ? passwd : Curl_creds_passwd(creds_in),
  ------------------
  |  |   83|    180|#define Curl_creds_passwd(c)             ((c) ? (c)->passwd : "")
  |  |  ------------------
  |  |  |  Branch (83:43): [True: 180, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (119:32): [True: 0, False: 180]
  ------------------
  120|    180|                               Curl_creds_oauth_bearer(creds_in),
  ------------------
  |  |   84|    180|#define Curl_creds_oauth_bearer(c)       ((c) ? (c)->oauth_bearer : "")
  |  |  ------------------
  |  |  |  Branch (84:43): [True: 180, False: 0]
  |  |  ------------------
  ------------------
  121|    180|                               Curl_creds_sasl_authzid(creds_in),
  ------------------
  |  |   85|    180|#define Curl_creds_sasl_authzid(c)       ((c) ? (c)->sasl_authzid : "")
  |  |  ------------------
  |  |  |  Branch (85:43): [True: 180, False: 0]
  |  |  ------------------
  ------------------
  122|    180|                               Curl_creds_sasl_service(creds_in),
  ------------------
  |  |   86|    180|#define Curl_creds_sasl_service(c)       ((c) ? (c)->sasl_service : "")
  |  |  ------------------
  |  |  |  Branch (86:43): [True: 180, False: 0]
  |  |  ------------------
  ------------------
  123|    180|                               source, &creds_out);
  124|    180|  }
  125|  9.38k|  Curl_creds_link(pcreds_out, creds_out);
  126|  9.38k|  Curl_creds_unlink(&creds_out);
  127|  9.38k|  return result;
  128|  9.38k|}
Curl_creds_link:
  131|  9.61k|{
  132|  9.61k|  if(*pdest != src) {
  ------------------
  |  Branch (132:6): [True: 412, False: 9.20k]
  ------------------
  133|    412|    Curl_creds_unlink(pdest);
  134|    412|    *pdest = src;
  135|    412|    if(src) {
  ------------------
  |  Branch (135:8): [True: 411, False: 1]
  ------------------
  136|    411|      uint32_t newcount = Curl_refcount_incr(&src->refcount);
  ------------------
  |  |   56|    411|  (atomic_fetch_add_explicit(c, 1U, memory_order_relaxed) + 1U)
  ------------------
  137|    411|      (void)newcount;
  138|       |      DEBUGASSERT(newcount < UINT32_MAX);
  ------------------
  |  | 1016|    411|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (138:7): [True: 0, False: 411]
  |  Branch (138:7): [True: 411, False: 0]
  ------------------
  139|    411|    }
  140|    412|  }
  141|  9.61k|}
Curl_creds_unlink:
  144|   157k|{
  145|   157k|  if(*pcreds) {
  ------------------
  |  Branch (145:6): [True: 1.17k, False: 156k]
  ------------------
  146|  1.17k|    struct Curl_creds *creds = *pcreds;
  147|  1.17k|    uint32_t newcount;
  148|       |
  149|  1.17k|    *pcreds = NULL;
  150|       |
  151|  1.17k|    newcount = Curl_refcount_decr(&creds->refcount);
  ------------------
  |  |   58|  1.17k|  (atomic_fetch_sub_explicit(c, 1U, memory_order_acq_rel) - 1U)
  ------------------
  152|  1.17k|    DEBUGASSERT(newcount < UINT32_MAX); /* wraparound check */
  ------------------
  |  | 1016|  1.17k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (152:5): [True: 0, False: 1.17k]
  |  Branch (152:5): [True: 1.17k, False: 0]
  ------------------
  153|       |
  154|  1.17k|    if(!newcount) {
  ------------------
  |  Branch (154:8): [True: 765, False: 411]
  ------------------
  155|    765|      curlx_memzero(creds, sizeof(*creds) + creds->bufsize);
  156|    765|      curlx_free(creds);
  ------------------
  |  | 1503|    765|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  157|    765|    }
  158|  1.17k|  }
  159|   157k|}
Curl_creds_same:
  162|  9.43k|{
  163|  9.43k|  return (c1 == c2) ||
  ------------------
  |  Branch (163:10): [True: 9.20k, False: 229]
  ------------------
  164|    229|         (c1 && c2 &&
  ------------------
  |  Branch (164:11): [True: 0, False: 229]
  |  Branch (164:17): [True: 0, False: 0]
  ------------------
  165|      0|          !Curl_timestrcmp(c1->user, c2->user) &&
  ------------------
  |  Branch (165:11): [True: 0, False: 0]
  ------------------
  166|      0|          !Curl_timestrcmp(c1->passwd, c2->passwd) &&
  ------------------
  |  Branch (166:11): [True: 0, False: 0]
  ------------------
  167|      0|          !Curl_timestrcmp(c1->oauth_bearer, c2->oauth_bearer) &&
  ------------------
  |  Branch (167:11): [True: 0, False: 0]
  ------------------
  168|      0|          !Curl_timestrcmp(c1->sasl_authzid, c2->sasl_authzid) &&
  ------------------
  |  Branch (168:11): [True: 0, False: 0]
  ------------------
  169|      0|          !Curl_timestrcmp(c1->sasl_service, c2->sasl_service));
  ------------------
  |  Branch (169:11): [True: 0, False: 0]
  ------------------
  170|  9.43k|}
Curl_creds_equal:
  173|  9.43k|{
  174|  9.43k|  return Curl_creds_same(c1, c2) &&
  ------------------
  |  Branch (174:10): [True: 9.20k, False: 229]
  ------------------
  175|  9.20k|         ((c1 == c2) || (c1 && c2 && (c1->source == c2->source)));
  ------------------
  |  Branch (175:11): [True: 9.20k, False: 0]
  |  Branch (175:26): [True: 0, False: 0]
  |  Branch (175:32): [True: 0, False: 0]
  |  Branch (175:38): [True: 0, False: 0]
  ------------------
  176|  9.43k|}
Curl_creds_trace:
  181|  9.43k|{
  182|  9.43k|  if(creds) {
  ------------------
  |  Branch (182:6): [True: 0, False: 9.43k]
  ------------------
  183|      0|    CURL_TRC_M(data, "%s: user=%s, passwd=%s, "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  184|      0|               "sasl_authzid=%s, oauth_bearer=%s, source=%d",
  185|      0|               msg,
  186|      0|               Curl_creds_user(creds),
  187|      0|               Curl_creds_has_passwd(creds) ? "***" : "",
  188|      0|               Curl_creds_sasl_authzid(creds),
  189|      0|               Curl_creds_has_oauth_bearer(creds) ? "***" : "",
  190|      0|               creds->source);
  191|      0|  }
  192|  9.43k|  else
  193|  9.43k|    CURL_TRC_M(data, "%s: -", msg);
  ------------------
  |  |  148|  9.43k|  do {                                   \
  |  |  149|  9.43k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.43k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.43k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  18.8k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.43k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 933, False: 8.49k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  18.8k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 933, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    933|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.43k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    933|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 186, False: 747]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.43k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.43k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.43k]
  |  |  ------------------
  ------------------
  194|  9.43k|}

Curl_cshutdn_start_timer:
   46|  1.57k|{
   47|  1.57k|  const struct curltime *pnow = Curl_pgrs_now(data);
   48|       |
   49|  1.57k|  chain->shutdown_start_ms = curlx_ptimediff_ms(pnow, &chain->conn->created);
   50|  1.57k|  chain->shutdown_timeout_ms = (timeout_ms > 0) ?
  ------------------
  |  Branch (50:32): [True: 0, False: 1.57k]
  ------------------
   51|      0|    (timediff_t)timeout_ms :
   52|  1.57k|    ((data->set.shutdowntimeout > 0) ?
  ------------------
  |  Branch (52:6): [True: 0, False: 1.57k]
  ------------------
   53|  1.57k|     data->set.shutdowntimeout : DEFAULT_SHUTDOWN_TIMEOUT_MS);
  ------------------
  |  |   41|  1.57k|#define DEFAULT_SHUTDOWN_TIMEOUT_MS   (2 * 1000)
  ------------------
   54|  1.57k|  CURL_TRC_M(data, "shutdown start on%s connection",
  ------------------
  |  |  148|  1.57k|  do {                                   \
  |  |  149|  1.57k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  1.57k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  1.57k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  3.14k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 1.57k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 1.57k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  3.14k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  1.57k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  1.57k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|  1.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 1.57k]
  |  |  ------------------
  ------------------
   55|  1.57k|             !chain->primary ? " secondary" : "");
   56|  1.57k|}
Curl_cshutdn_timeleft_ms:
   60|  1.57k|{
   61|  1.57k|  timediff_t left_ms;
   62|       |
   63|  1.57k|  if(chain->shutdown_start_ms < 0)
  ------------------
  |  Branch (63:6): [True: 0, False: 1.57k]
  ------------------
   64|      0|    return 0; /* not started or no limits */
   65|       |
   66|  1.57k|  left_ms = chain->shutdown_timeout_ms -
   67|  1.57k|            (curlx_ptimediff_ms(Curl_pgrs_now(data), &chain->conn->created) -
   68|  1.57k|             chain->shutdown_start_ms);
   69|  1.57k|  return left_ms ? left_ms : -1;
  ------------------
  |  Branch (69:10): [True: 1.57k, False: 0]
  ------------------
   70|  1.57k|}
Curl_cshutdn_try_once:
  211|  1.57k|{
  212|  1.57k|  DEBUGASSERT(!admin->conn);
  ------------------
  |  | 1016|  1.57k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (212:3): [True: 0, False: 1.57k]
  |  Branch (212:3): [True: 1.57k, False: 0]
  ------------------
  213|  1.57k|  DEBUGASSERT(!admin->mid);
  ------------------
  |  | 1016|  1.57k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (213:3): [True: 0, False: 1.57k]
  |  Branch (213:3): [True: 1.57k, False: 0]
  ------------------
  214|  1.57k|  Curl_attach_connection(admin, conn, FALSE);
  ------------------
  |  |  989|  1.57k|#define FALSE false
  ------------------
  215|  1.57k|  cshutdn_run_once(admin, conn, done);
  216|  1.57k|  CURL_TRC_M(admin, "[SHUTDOWN] shutdown, done=%d", *done);
  ------------------
  |  |  148|  1.57k|  do {                                   \
  |  |  149|  1.57k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  1.57k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  1.57k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  3.14k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 1.57k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 1.57k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  3.14k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  1.57k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  1.57k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  1.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 1.57k]
  |  |  ------------------
  ------------------
  217|  1.57k|  Curl_detach_connection(admin);
  218|  1.57k|}
Curl_cshutdn_terminate:
  223|  9.39k|{
  224|  9.39k|  bool done;
  225|       |
  226|       |  /* there must be a connection to close */
  227|  9.39k|  DEBUGASSERT(conn);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (227:3): [True: 0, False: 9.39k]
  |  Branch (227:3): [True: 9.39k, False: 0]
  ------------------
  228|       |  /* it must be removed from the connection pool */
  229|  9.39k|  DEBUGASSERT(conn->cpid == UINT32_MAX);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (229:3): [True: 0, False: 9.39k]
  |  Branch (229:3): [True: 9.39k, False: 0]
  ------------------
  230|       |  /* the transfer must be detached from the connection */
  231|  9.39k|  DEBUGASSERT(admin && !admin->conn);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (231:3): [True: 0, False: 9.39k]
  |  Branch (231:3): [True: 0, False: 0]
  |  Branch (231:3): [True: 9.39k, False: 0]
  |  Branch (231:3): [True: 9.39k, False: 0]
  ------------------
  232|  9.39k|  DEBUGASSERT(!admin->mid);
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (232:3): [True: 0, False: 9.39k]
  |  Branch (232:3): [True: 9.39k, False: 0]
  ------------------
  233|       |
  234|  9.39k|  Curl_attach_connection(admin, conn, FALSE);
  ------------------
  |  |  989|  9.39k|#define FALSE false
  ------------------
  235|       |
  236|  9.39k|  cshutdn_run_conn_handler(admin, conn);
  237|  9.39k|  if(do_shutdown) {
  ------------------
  |  Branch (237:6): [True: 0, False: 9.39k]
  ------------------
  238|       |    /* Make a last attempt to shutdown handlers and filters, if
  239|       |     * not done so already. */
  240|      0|    cshutdn_run_once(admin, conn, &done);
  241|      0|  }
  242|  9.39k|  CURL_TRC_M(admin, "[SHUTDOWN] %sclosing connection #%" FMT_OFF_T,
  ------------------
  |  |  148|  9.39k|  do {                                   \
  |  |  149|  9.39k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.39k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.39k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  18.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.39k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 9.39k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  18.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.39k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.39k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|  9.39k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.39k]
  |  |  ------------------
  ------------------
  243|  9.39k|             conn->bits.shutdown_filters ? "" : "force ",
  244|  9.39k|             conn->connection_id);
  245|  9.39k|  Curl_cfchain_reset(&conn->chain, admin);
  246|  9.39k|  Curl_detach_connection(admin);
  247|       |
  248|  9.39k|  if(admin->multi)
  ------------------
  |  Branch (248:6): [True: 9.39k, False: 0]
  ------------------
  249|  9.39k|    Curl_multi_ev_conn_done(admin->multi, admin, conn);
  250|  9.39k|  Curl_conn_free(admin, conn);
  251|       |
  252|  9.39k|  if(admin->multi) {
  ------------------
  |  Branch (252:6): [True: 9.39k, False: 0]
  ------------------
  253|  9.39k|    CURL_TRC_M(admin, "[SHUTDOWN] trigger multi connchanged");
  ------------------
  |  |  148|  9.39k|  do {                                   \
  |  |  149|  9.39k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.39k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.39k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  18.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.39k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 9.39k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  18.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.39k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.39k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.39k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.39k]
  |  |  ------------------
  ------------------
  254|  9.39k|    Curl_multi_connchanged(admin->multi);
  255|  9.39k|  }
  256|  9.39k|}
Curl_cshutdn_init:
  400|  9.82k|{
  401|  9.82k|  Curl_ptrarray_init(&cshutdn->conns);
  402|  9.82k|}
Curl_cshutdn_destroy:
  406|  9.82k|{
  407|  9.82k|  if(admin) {
  ------------------
  |  Branch (407:6): [True: 9.82k, False: 0]
  ------------------
  408|  9.82k|    int timeout_ms = 0;
  409|       |    /* for testing, run graceful shutdown */
  410|  9.82k|#ifdef DEBUGBUILD
  411|  9.82k|    {
  412|  9.82k|      const char *p = getenv("CURL_GRACEFUL_SHUTDOWN");
  413|  9.82k|      if(p) {
  ------------------
  |  Branch (413:10): [True: 0, False: 9.82k]
  ------------------
  414|      0|        curl_off_t l;
  415|      0|        if(!curlx_str_number(&p, &l, INT_MAX))
  ------------------
  |  Branch (415:12): [True: 0, False: 0]
  ------------------
  416|      0|          timeout_ms = (int)l;
  417|      0|      }
  418|  9.82k|    }
  419|  9.82k|#endif
  420|  9.82k|    if(CURL_PTRARRAY_COUNT(&cshutdn->conns)) {
  ------------------
  |  |   41|  9.82k|#define CURL_PTRARRAY_COUNT(a)    ((a)->n)
  |  |  ------------------
  |  |  |  Branch (41:35): [True: 0, False: 9.82k]
  |  |  ------------------
  ------------------
  421|      0|      CURL_TRC_M(admin, "[SHUTDOWN] destroy, %u connections, timeout=%dms",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  422|      0|                 CURL_PTRARRAY_COUNT(&cshutdn->conns), timeout_ms);
  423|      0|      cshutdn_terminate_all(cshutdn, admin, timeout_ms);
  424|      0|    }
  425|  9.82k|  }
  426|  9.82k|}
Curl_cshutdn_perform:
  499|   122k|{
  500|   122k|  cshutdn_perform(cshutdn, admin, sigpipe_ctx);
  501|   122k|}
Curl_cshutdn_setfds:
  508|  54.8k|{
  509|  54.8k|  if(CURL_PTRARRAY_COUNT(&cshutdn->conns)) {
  ------------------
  |  |   41|  54.8k|#define CURL_PTRARRAY_COUNT(a)    ((a)->n)
  |  |  ------------------
  |  |  |  Branch (41:35): [True: 0, False: 54.8k]
  |  |  ------------------
  ------------------
  510|      0|    struct easy_pollset ps;
  511|      0|    uint32_t i;
  512|       |
  513|      0|    Curl_pollset_init(&ps);
  514|      0|    for(i = 0; i < CURL_PTRARRAY_COUNT(&cshutdn->conns); ++i) {
  ------------------
  |  |   41|      0|#define CURL_PTRARRAY_COUNT(a)    ((a)->n)
  ------------------
  |  Branch (514:16): [True: 0, False: 0]
  ------------------
  515|      0|      unsigned int j;
  516|      0|      struct connectdata *conn = CURL_PTRARRAY_GET(&cshutdn->conns, i);
  ------------------
  |  |   42|      0|#define CURL_PTRARRAY_GET(a, i)   (((i) < ((a)->n)) ? (a)->data[(i)] : NULL)
  |  |  ------------------
  |  |  |  Branch (42:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  517|      0|      CURLcode result;
  518|       |
  519|      0|      Curl_pollset_reset(&ps);
  520|      0|      Curl_attach_connection(admin, conn, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  521|      0|      result = Curl_conn_adjust_pollset(admin, conn, &ps);
  522|      0|      Curl_detach_connection(admin);
  523|       |
  524|      0|      if(result)
  ------------------
  |  Branch (524:10): [True: 0, False: 0]
  ------------------
  525|      0|        continue;
  526|       |
  527|      0|      for(j = 0; j < ps.n; j++) {
  ------------------
  |  Branch (527:18): [True: 0, False: 0]
  ------------------
  528|      0|        curl_socket_t sock = ps.sockets[j];
  529|      0|        if(!FDSET_SOCK(sock))
  ------------------
  |  |   91|      0|#define FDSET_SOCK(s) ((s) < FD_SETSIZE)
  ------------------
  |  Branch (529:12): [True: 0, False: 0]
  ------------------
  530|      0|          continue;
  531|      0|        if(ps.actions[j] & CURL_POLL_IN)
  ------------------
  |  |  283|      0|#define CURL_POLL_IN     1
  ------------------
  |  Branch (531:12): [True: 0, False: 0]
  ------------------
  532|      0|          FD_SET(sock, read_fd_set);
  533|      0|        if(ps.actions[j] & CURL_POLL_OUT)
  ------------------
  |  |  284|      0|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (533:12): [True: 0, False: 0]
  ------------------
  534|      0|          FD_SET(sock, write_fd_set);
  535|      0|        if((ps.actions[j] & (CURL_POLL_OUT | CURL_POLL_IN)) &&
  ------------------
  |  |  284|      0|#define CURL_POLL_OUT    2
  ------------------
                      if((ps.actions[j] & (CURL_POLL_OUT | CURL_POLL_IN)) &&
  ------------------
  |  |  283|      0|#define CURL_POLL_IN     1
  ------------------
  |  Branch (535:12): [True: 0, False: 0]
  ------------------
  536|      0|           ((int)sock > *maxfd))
  ------------------
  |  Branch (536:12): [True: 0, False: 0]
  ------------------
  537|      0|          *maxfd = (int)sock;
  538|      0|      }
  539|      0|    }
  540|      0|    Curl_pollset_cleanup(&ps);
  541|      0|  }
  542|  54.8k|}
Curl_cshutdn_add_pollfds:
  576|    395|{
  577|    395|  CURLcode result = CURLE_OK;
  578|       |
  579|    395|  if(CURL_PTRARRAY_COUNT(&cshutdn->conns)) {
  ------------------
  |  |   41|    395|#define CURL_PTRARRAY_COUNT(a)    ((a)->n)
  |  |  ------------------
  |  |  |  Branch (41:35): [True: 0, False: 395]
  |  |  ------------------
  ------------------
  580|      0|    struct easy_pollset ps;
  581|      0|    struct connectdata *conn;
  582|      0|    uint32_t i;
  583|       |
  584|      0|    Curl_pollset_init(&ps);
  585|      0|    for(i = 0; i < CURL_PTRARRAY_COUNT(&cshutdn->conns); ++i) {
  ------------------
  |  |   41|      0|#define CURL_PTRARRAY_COUNT(a)    ((a)->n)
  ------------------
  |  Branch (585:16): [True: 0, False: 0]
  ------------------
  586|      0|      conn = CURL_PTRARRAY_GET(&cshutdn->conns, i);
  ------------------
  |  |   42|      0|#define CURL_PTRARRAY_GET(a, i)   (((i) < ((a)->n)) ? (a)->data[(i)] : NULL)
  |  |  ------------------
  |  |  |  Branch (42:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  587|      0|      Curl_pollset_reset(&ps);
  588|      0|      Curl_attach_connection(admin, conn, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  589|      0|      result = Curl_conn_adjust_pollset(admin, conn, &ps);
  590|      0|      Curl_detach_connection(admin);
  591|       |
  592|      0|      if(!result)
  ------------------
  |  Branch (592:10): [True: 0, False: 0]
  ------------------
  593|      0|        result = Curl_pollfds_add_ps(cpfds, &ps);
  594|      0|      if(result) {
  ------------------
  |  Branch (594:10): [True: 0, False: 0]
  ------------------
  595|      0|        Curl_pollset_cleanup(&ps);
  596|      0|        Curl_pollfds_cleanup(cpfds);
  597|      0|        goto out;
  598|      0|      }
  599|      0|    }
  600|      0|    Curl_pollset_cleanup(&ps);
  601|      0|  }
  602|    395|out:
  603|    395|  return result;
  604|    395|}
cshutdn.c:cshutdn_cfchain_try_once:
  117|  1.57k|{
  118|  1.57k|  struct Curl_cfilter *cf = chain->cf;
  119|  1.57k|  CURLcode result = CURLE_OK;
  120|  1.57k|  timediff_t timeout_ms;
  121|       |
  122|       |  /* Get the first connected filter that is not shut down already. */
  123|  1.57k|  while(cf && (!cf->connected || cf->shutdown))
  ------------------
  |  Branch (123:9): [True: 1.57k, False: 0]
  |  Branch (123:16): [True: 0, False: 1.57k]
  |  Branch (123:34): [True: 0, False: 1.57k]
  ------------------
  124|      0|    cf = cf->next;
  125|       |
  126|  1.57k|  if(!cf) {
  ------------------
  |  Branch (126:6): [True: 0, False: 1.57k]
  ------------------
  127|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  128|      0|    return CURLE_OK;
  129|      0|  }
  130|       |
  131|  1.57k|  *done = FALSE;
  ------------------
  |  |  989|  1.57k|#define FALSE false
  ------------------
  132|  1.57k|  if(!CURL_CFCHAIN_IN_SHUTDOWN(chain)) {
  ------------------
  |  |   60|  1.57k|#define CURL_CFCHAIN_IN_SHUTDOWN(c)  ((c)->shutdown_start_ms >= 0)
  ------------------
  |  Branch (132:6): [True: 0, False: 1.57k]
  ------------------
  133|      0|    Curl_cshutdn_start_timer(data, chain, 0);
  134|      0|  }
  135|  1.57k|  else {
  136|  1.57k|    timeout_ms = Curl_cshutdn_timeleft_ms(data, chain);
  137|  1.57k|    if(timeout_ms < 0) {
  ------------------
  |  Branch (137:8): [True: 0, False: 1.57k]
  ------------------
  138|       |      /* info message, since this might be regarded as acceptable */
  139|      0|      infof(data, "shutdown timeout");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  140|      0|      return CURLE_OPERATION_TIMEDOUT;
  141|      0|    }
  142|  1.57k|  }
  143|       |
  144|  4.72k|  while(cf) {
  ------------------
  |  Branch (144:9): [True: 3.14k, False: 1.57k]
  ------------------
  145|  3.14k|    if(!cf->shutdown) {
  ------------------
  |  Branch (145:8): [True: 3.14k, False: 0]
  ------------------
  146|  3.14k|      bool cfdone = FALSE;
  ------------------
  |  |  989|  3.14k|#define FALSE false
  ------------------
  147|  3.14k|      result = cf->cft->do_shutdown(cf, data, &cfdone);
  148|  3.14k|      if(result) {
  ------------------
  |  Branch (148:10): [True: 0, False: 3.14k]
  ------------------
  149|      0|        CURL_TRC_CF(data, cf, "shut down failed with %d", (int)result);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  150|      0|        return result;
  151|      0|      }
  152|  3.14k|      else if(!cfdone) {
  ------------------
  |  Branch (152:15): [True: 0, False: 3.14k]
  ------------------
  153|      0|        CURL_TRC_CF(data, cf, "shut down not done yet");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  154|      0|        return CURLE_OK;
  155|      0|      }
  156|  3.14k|      CURL_TRC_CF(data, cf, "shut down successfully");
  ------------------
  |  |  153|  3.14k|  do {                                          \
  |  |  154|  3.14k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.14k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.29k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.14k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 3.14k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.29k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  3.14k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.14k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.14k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.14k]
  |  |  ------------------
  ------------------
  157|  3.14k|      cf->shutdown = TRUE;
  ------------------
  |  |  986|  3.14k|#define TRUE true
  ------------------
  158|  3.14k|    }
  159|  3.14k|    cf = cf->next;
  160|  3.14k|  }
  161|  1.57k|  *done = (!result);
  162|  1.57k|  return result;
  163|  1.57k|}
cshutdn.c:cshutdn_run_once:
  182|  1.57k|{
  183|       |  /* We expect to be attached when called */
  184|  1.57k|  DEBUGASSERT(data->conn == conn);
  ------------------
  |  | 1016|  1.57k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (184:3): [True: 0, False: 1.57k]
  |  Branch (184:3): [True: 1.57k, False: 0]
  ------------------
  185|       |
  186|  1.57k|  *done = FALSE;
  ------------------
  |  |  989|  1.57k|#define FALSE false
  ------------------
  187|  1.57k|  if(!CURL_CFCHAIN_IN_SHUTDOWN(&conn->chain))
  ------------------
  |  |   60|  1.57k|#define CURL_CFCHAIN_IN_SHUTDOWN(c)  ((c)->shutdown_start_ms >= 0)
  ------------------
  |  Branch (187:6): [True: 1.57k, False: 0]
  ------------------
  188|  1.57k|    Curl_cshutdn_start_timer(data, &conn->chain, 0);
  189|       |
  190|  1.57k|  cshutdn_run_conn_handler(data, conn);
  191|       |
  192|  1.57k|  if(conn->bits.shutdown_filters) {
  ------------------
  |  Branch (192:6): [True: 0, False: 1.57k]
  ------------------
  193|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  194|      0|    return;
  195|      0|  }
  196|       |
  197|  1.57k|  if(!conn->bits.connect_only && Curl_conn_is_connected(conn)) {
  ------------------
  |  Branch (197:6): [True: 1.57k, False: 0]
  |  Branch (197:34): [True: 1.57k, False: 0]
  ------------------
  198|  1.57k|    if(cshutdn_cfchain_try_once(data, &conn->chain, done))
  ------------------
  |  Branch (198:8): [True: 0, False: 1.57k]
  ------------------
  199|      0|      *done = TRUE;  /* we are done on errors encountered */
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  200|  1.57k|  }
  201|      0|  else
  202|      0|    *done = TRUE; /* connection is not clean, just close it */
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  203|       |
  204|  1.57k|  if(*done)
  ------------------
  |  Branch (204:6): [True: 1.57k, False: 0]
  ------------------
  205|  1.57k|    conn->bits.shutdown_filters = TRUE;
  ------------------
  |  |  986|  1.57k|#define TRUE true
  ------------------
  206|  1.57k|}
cshutdn.c:cshutdn_run_conn_handler:
   88|  10.9k|{
   89|  10.9k|  if(!conn->bits.shutdown_handler) {
  ------------------
  |  Branch (89:6): [True: 9.39k, False: 1.57k]
  ------------------
   90|       |
   91|  9.39k|    if(conn->scheme && conn->scheme->run->disconnect) {
  ------------------
  |  Branch (91:8): [True: 9.39k, False: 0]
  |  Branch (91:24): [True: 0, False: 9.39k]
  ------------------
   92|       |      /* Some disconnect handlers do a blocking wait on server responses.
   93|       |       * FTP/IMAP/SMTP and SFTP are among them. When using the internal
   94|       |       * handle, set an overall short timeout so we do not hang for the
   95|       |       * default 120 seconds. */
   96|      0|      if(data->state.internal) {
  ------------------
  |  Branch (96:10): [True: 0, False: 0]
  ------------------
   97|      0|        data->set.timeout = DEFAULT_SHUTDOWN_TIMEOUT_MS;
  ------------------
  |  |   41|      0|#define DEFAULT_SHUTDOWN_TIMEOUT_MS   (2 * 1000)
  ------------------
   98|      0|        Curl_pgrsTime(data, TIMER_STARTOP);
   99|      0|      }
  100|       |
  101|       |      /* This is set if protocol-specific cleanups should be made */
  102|      0|      DEBUGF(infof(data, "connection #%" FMT_OFF_T
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  103|      0|                   ", shutdown protocol handler (aborted=%d)",
  104|      0|                   conn->connection_id, conn->bits.aborted));
  105|       |      /* There are protocol handlers that block on retrieving
  106|       |       * server responses here (FTP). Set a short timeout. */
  107|      0|      conn->scheme->run->disconnect(data, conn, (bool)conn->bits.aborted);
  108|      0|    }
  109|       |
  110|       |    conn->bits.shutdown_handler = TRUE;
  ------------------
  |  |  986|  9.39k|#define TRUE true
  ------------------
  111|  9.39k|  }
  112|  10.9k|}
cshutdn.c:cshutdn_perform:
  320|   122k|{
  321|   122k|  struct connectdata *conn;
  322|   122k|  timediff_t next_expire_ms = 0, ms;
  323|   122k|  uint32_t i = 0;
  324|   122k|  bool done;
  325|       |
  326|   122k|  if(!CURL_PTRARRAY_COUNT(&cshutdn->conns))
  ------------------
  |  |   41|   122k|#define CURL_PTRARRAY_COUNT(a)    ((a)->n)
  ------------------
  |  Branch (326:6): [True: 122k, False: 0]
  ------------------
  327|   122k|    return;
  328|       |
  329|      0|  CURL_TRC_M(admin, "[SHUTDOWN] perform on %u connections",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  330|      0|             CURL_PTRARRAY_COUNT(&cshutdn->conns));
  331|      0|  sigpipe_apply(admin, sigpipe_ctx);
  332|      0|  while(i < CURL_PTRARRAY_COUNT(&cshutdn->conns)) {
  ------------------
  |  |   41|      0|#define CURL_PTRARRAY_COUNT(a)    ((a)->n)
  ------------------
  |  Branch (332:9): [True: 0, False: 0]
  ------------------
  333|      0|    conn = CURL_PTRARRAY_GET(&cshutdn->conns, i);
  ------------------
  |  |   42|      0|#define CURL_PTRARRAY_GET(a, i)   (((i) < ((a)->n)) ? (a)->data[(i)] : NULL)
  |  |  ------------------
  |  |  |  Branch (42:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  334|      0|    Curl_cshutdn_try_once(admin, conn, &done);
  335|      0|    if(done) {
  ------------------
  |  Branch (335:8): [True: 0, False: 0]
  ------------------
  336|      0|      Curl_ptrarray_remove(&cshutdn->conns, i);
  337|      0|      Curl_cshutdn_terminate(admin, conn, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  338|      0|    }
  339|      0|    else {
  340|      0|      ++i;
  341|       |      /* idata has one timer list, but maybe more than one connection.
  342|       |       * Set EXPIRE_SHUTDOWN to the smallest time left for all. */
  343|      0|      ms = cshutdn_conn_timeleft(admin, conn);
  344|      0|      if(ms && (!next_expire_ms || (ms < next_expire_ms)))
  ------------------
  |  Branch (344:10): [True: 0, False: 0]
  |  Branch (344:17): [True: 0, False: 0]
  |  Branch (344:36): [True: 0, False: 0]
  ------------------
  345|      0|        next_expire_ms = ms;
  346|      0|    }
  347|      0|  }
  348|       |
  349|      0|  if(next_expire_ms)
  ------------------
  |  Branch (349:6): [True: 0, False: 0]
  ------------------
  350|      0|    Curl_expire(admin, next_expire_ms, EXPIRE_SHUTDOWN);
  351|      0|}

Curl_freeaddrinfo:
   72|  9.30k|{
   73|  9.30k|  struct Curl_addrinfo *vqualifier canext;
   74|  9.30k|  struct Curl_addrinfo *ca;
   75|       |
   76|  18.5k|  for(ca = cahead; ca; ca = canext) {
  ------------------
  |  Branch (76:20): [True: 9.24k, False: 9.30k]
  ------------------
   77|  9.24k|    canext = ca->ai_next;
   78|  9.24k|    curlx_free(ca);
  ------------------
  |  | 1503|  9.24k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   79|  9.24k|  }
   80|  9.30k|}
Curl_addrinfo_get:
   85|  34.3k|{
   86|  34.3k|  unsigned int i;
   87|  59.0k|  for(i = 0; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (87:14): [True: 33.9k, False: 25.1k]
  ------------------
   88|  33.9k|    if(ai->ai_family == ai_family) {
  ------------------
  |  Branch (88:8): [True: 16.9k, False: 16.9k]
  ------------------
   89|  16.9k|      if(i == n)
  ------------------
  |  Branch (89:10): [True: 9.22k, False: 7.77k]
  ------------------
   90|  9.22k|        return ai;
   91|  7.77k|      ++i;
   92|  7.77k|    }
   93|  33.9k|  }
   94|  25.1k|  return NULL;
   95|  34.3k|}
Curl_getaddrinfo_ex:
  115|    179|{
  116|    179|  const struct addrinfo *ai;
  117|    179|  struct addrinfo *aihead;
  118|    179|  struct Curl_addrinfo *cafirst = NULL;
  119|    179|  struct Curl_addrinfo *calast = NULL;
  120|    179|  struct Curl_addrinfo *ca;
  121|    179|  size_t ss_size;
  122|    179|  int error;
  123|       |
  124|    179|  *result = NULL; /* assume failure */
  125|       |
  126|    179|  error = CURL_GETADDRINFO(nodename, servname, hints, &aihead);
  ------------------
  |  | 1452|    179|  curl_dbg_getaddrinfo(host, serv, hint, res, __LINE__, __FILE__)
  ------------------
  127|    179|  if(error)
  ------------------
  |  Branch (127:6): [True: 179, False: 0]
  ------------------
  128|    179|    return error;
  129|       |
  130|       |  /* traverse the addrinfo list */
  131|       |
  132|      0|  for(ai = aihead; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (132:20): [True: 0, False: 0]
  ------------------
  133|      0|    size_t namelen = ai->ai_canonname ? strlen(ai->ai_canonname) + 1 : 0;
  ------------------
  |  Branch (133:22): [True: 0, False: 0]
  ------------------
  134|       |    /* ignore elements with unsupported address family,
  135|       |       settle family-specific sockaddr structure size. */
  136|      0|    if(ai->ai_family == AF_INET)
  ------------------
  |  Branch (136:8): [True: 0, False: 0]
  ------------------
  137|      0|      ss_size = sizeof(struct sockaddr_in);
  138|      0|#ifdef USE_IPV6
  139|      0|    else if(ai->ai_family == AF_INET6)
  ------------------
  |  Branch (139:13): [True: 0, False: 0]
  ------------------
  140|      0|      ss_size = sizeof(struct sockaddr_in6);
  141|      0|#endif
  142|      0|    else
  143|      0|      continue;
  144|       |
  145|       |    /* ignore elements without required address info */
  146|      0|    if(!ai->ai_addr || !(ai->ai_addrlen > 0))
  ------------------
  |  Branch (146:8): [True: 0, False: 0]
  |  Branch (146:24): [True: 0, False: 0]
  ------------------
  147|      0|      continue;
  148|       |
  149|       |    /* ignore elements with bogus address size */
  150|      0|    if((size_t)ai->ai_addrlen < ss_size)
  ------------------
  |  Branch (150:8): [True: 0, False: 0]
  ------------------
  151|      0|      continue;
  152|       |
  153|      0|    ca = curlx_malloc(sizeof(struct Curl_addrinfo) + ss_size + namelen);
  ------------------
  |  | 1498|      0|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  154|      0|    if(!ca) {
  ------------------
  |  Branch (154:8): [True: 0, False: 0]
  ------------------
  155|      0|      error = EAI_MEMORY;
  156|      0|      break;
  157|      0|    }
  158|       |
  159|       |    /* copy each structure member individually, member ordering,
  160|       |       size, or padding might be different for each platform. */
  161|       |
  162|      0|    ca->ai_flags     = ai->ai_flags;
  163|      0|    ca->ai_family    = ai->ai_family;
  164|      0|    ca->ai_socktype  = ai->ai_socktype;
  165|      0|    ca->ai_protocol  = ai->ai_protocol;
  166|      0|    ca->ai_addrlen   = (curl_socklen_t)ss_size;
  167|      0|    ca->ai_addr      = NULL;
  168|      0|    ca->ai_canonname = NULL;
  169|      0|    ca->ai_next      = NULL;
  170|       |
  171|      0|    ca->ai_addr = (void *)((char *)ca + sizeof(struct Curl_addrinfo));
  172|      0|    memcpy(ca->ai_addr, ai->ai_addr, ss_size);
  173|       |
  174|      0|    if(namelen) {
  ------------------
  |  Branch (174:8): [True: 0, False: 0]
  ------------------
  175|      0|      ca->ai_canonname = (void *)((char *)ca->ai_addr + ss_size);
  176|      0|      memcpy(ca->ai_canonname, ai->ai_canonname, namelen);
  177|      0|    }
  178|       |
  179|       |    /* if the return list is empty, this becomes the first element */
  180|      0|    if(!cafirst)
  ------------------
  |  Branch (180:8): [True: 0, False: 0]
  ------------------
  181|      0|      cafirst = ca;
  182|       |
  183|       |    /* add this element last in the return list */
  184|      0|    if(calast)
  ------------------
  |  Branch (184:8): [True: 0, False: 0]
  ------------------
  185|      0|      calast->ai_next = ca;
  186|      0|    calast = ca;
  187|      0|  }
  188|       |
  189|       |  /* destroy the addrinfo list */
  190|      0|  if(aihead)
  ------------------
  |  Branch (190:6): [True: 0, False: 0]
  ------------------
  191|      0|    CURL_FREEADDRINFO(aihead);
  ------------------
  |  | 1454|      0|  curl_dbg_freeaddrinfo(data, __LINE__, __FILE__)
  ------------------
  192|       |
  193|       |  /* if we failed, also destroy the Curl_addrinfo list */
  194|      0|  if(error) {
  ------------------
  |  Branch (194:6): [True: 0, False: 0]
  ------------------
  195|      0|    Curl_freeaddrinfo(cafirst);
  196|      0|    cafirst = NULL;
  197|      0|  }
  198|      0|  else if(!cafirst) {
  ------------------
  |  Branch (198:11): [True: 0, False: 0]
  ------------------
  199|      0|#ifdef EAI_NONAME
  200|       |    /* rfc3493 conformant */
  201|      0|    error = EAI_NONAME;
  202|       |#else
  203|       |    /* rfc3493 obsoleted */
  204|       |    error = EAI_NODATA;
  205|       |#endif
  206|       |#ifdef USE_WINSOCK
  207|       |    SET_SOCKERRNO(error);
  208|       |#endif
  209|      0|  }
  210|       |
  211|      0|  *result = cafirst;
  212|       |
  213|       |  /* This is not a CURLcode */
  214|      0|  return error;
  215|    179|}
Curl_str2addr:
  425|  9.25k|{
  426|  9.25k|  struct in_addr in;
  427|  9.25k|  if(curlx_inet_pton(AF_INET, dotted, &in) > 0)
  ------------------
  |  Branch (427:6): [True: 9.24k, False: 7]
  ------------------
  428|       |    /* This is a dotted IP address 123.123.123.123-style */
  429|  9.24k|    return ip2addr(addrp, AF_INET, &in, dotted, port);
  430|      7|#ifdef USE_IPV6
  431|      7|  {
  432|      7|    struct in6_addr in6;
  433|      7|    if(curlx_inet_pton(AF_INET6, dotted, &in6) > 0)
  ------------------
  |  Branch (433:8): [True: 7, False: 0]
  ------------------
  434|       |      /* This is a dotted IPv6 address ::1-style */
  435|      7|      return ip2addr(addrp, AF_INET6, &in6, dotted, port);
  436|      7|  }
  437|      0|#endif
  438|      0|  return CURLE_BAD_FUNCTION_ARGUMENT; /* bad input format */
  439|      7|}
Curl_is_ipv4addr:
  442|  31.7k|{
  443|  31.7k|  struct in_addr in;
  444|       |  return (curlx_inet_pton(AF_INET, address, &in) > 0);
  445|  31.7k|}
Curl_is_ipaddr:
  448|  22.4k|{
  449|  22.4k|  if(Curl_is_ipv4addr(address))
  ------------------
  |  Branch (449:6): [True: 11.2k, False: 11.1k]
  ------------------
  450|  11.2k|    return TRUE;
  ------------------
  |  |  986|  11.2k|#define TRUE true
  ------------------
  451|  11.1k|#ifdef USE_IPV6
  452|  11.1k|  {
  453|  11.1k|    struct in6_addr in6;
  454|  11.1k|    if(curlx_inet_pton(AF_INET6, address, &in6) > 0)
  ------------------
  |  Branch (454:8): [True: 5.67k, False: 5.50k]
  ------------------
  455|       |      /* This is a dotted IPv6 address ::1-style */
  456|  5.67k|      return TRUE;
  ------------------
  |  |  986|  5.67k|#define TRUE true
  ------------------
  457|  11.1k|  }
  458|  5.50k|#endif
  459|  5.50k|  return FALSE;
  ------------------
  |  |  989|  5.50k|#define FALSE false
  ------------------
  460|  11.1k|}
Curl_looks_like_ipv6:
  464|  5.70k|{
  465|  5.70k|  const char *zonep = NULL;
  466|  5.70k|  size_t i = 0, hlen = 0, zlen = 0;
  467|       |
  468|  5.70k|  if(host)
  ------------------
  |  Branch (468:6): [True: 5.70k, False: 0]
  ------------------
  469|  5.70k|    memset(host, 0, sizeof(*host));
  470|  5.70k|  if(zone)
  ------------------
  |  Branch (470:6): [True: 5.70k, False: 0]
  ------------------
  471|  5.70k|    memset(zone, 0, sizeof(*zone));
  472|       |
  473|  22.8k|  for(i = 0; i < len; ++i, ++hlen) {
  ------------------
  |  Branch (473:14): [True: 17.1k, False: 5.70k]
  ------------------
  474|  17.1k|    if(!s[i] || !(ISXDIGIT(s[i]) || (s[i] == ':') || (s[i] == '.')))
  ------------------
  |  |   37|  34.2k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  34.2k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 17.1k, False: 0]
  |  |  |  |  |  Branch (42:38): [True: 5.70k, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  28.5k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 0, False: 11.4k]
  |  |  |  |  |  Branch (27:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  11.4k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 0, False: 11.4k]
  |  |  |  |  |  Branch (28:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:8): [True: 0, False: 17.1k]
  |  Branch (474:37): [True: 11.4k, False: 0]
  |  Branch (474:54): [True: 0, False: 0]
  ------------------
  475|      0|      break;
  476|  17.1k|  }
  477|       |
  478|  5.70k|  if((i < len) && (s[i] == '%')) { /* address followed by a zone? */
  ------------------
  |  Branch (478:6): [True: 0, False: 5.70k]
  |  Branch (478:19): [True: 0, False: 0]
  ------------------
  479|      0|    i += 1;
  480|      0|    if(maybe_url_encoded && !strncmp("25", s + i, 2))
  ------------------
  |  Branch (480:8): [True: 0, False: 0]
  |  Branch (480:29): [True: 0, False: 0]
  ------------------
  481|      0|      i += 2;
  482|      0|    zonep = s + i;
  483|      0|    for(; i < len; ++i, ++zlen) {
  ------------------
  |  Branch (483:11): [True: 0, False: 0]
  ------------------
  484|       |      /* Allow unreserved characters as defined in RFC 3986 */
  485|      0|      if(!s[i] || !(ISALPHA(s[i]) || ISXDIGIT(s[i]) || (s[i] == '-') ||
  ------------------
  |  |   36|      0|#define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   41|      0|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (41:38): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   40|      0|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (40:38): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                    if(!s[i] || !(ISALPHA(s[i]) || ISXDIGIT(s[i]) || (s[i] == '-') ||
  ------------------
  |  |   37|      0|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|      0|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 0, False: 0]
  |  |  |  |  |  Branch (42:38): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|      0|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 0, False: 0]
  |  |  |  |  |  Branch (27:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|      0|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 0, False: 0]
  |  |  |  |  |  Branch (28:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (485:10): [True: 0, False: 0]
  |  Branch (485:56): [True: 0, False: 0]
  ------------------
  486|      0|                    (s[i] == '.') || (s[i] == '_') || (s[i] == '~')))
  ------------------
  |  Branch (486:21): [True: 0, False: 0]
  |  Branch (486:38): [True: 0, False: 0]
  |  Branch (486:55): [True: 0, False: 0]
  ------------------
  487|      0|        break;
  488|      0|    }
  489|      0|  }
  490|       |
  491|  5.70k|  if(i != len)
  ------------------
  |  Branch (491:6): [True: 0, False: 5.70k]
  ------------------
  492|      0|    return FALSE; /* invalid chars in zone */
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  493|  5.70k|  if(host && hlen) {
  ------------------
  |  Branch (493:6): [True: 5.70k, False: 0]
  |  Branch (493:14): [True: 5.70k, False: 0]
  ------------------
  494|  5.70k|    host->str = s;
  495|  5.70k|    host->len = hlen;
  496|  5.70k|  }
  497|  5.70k|  if(zone && zlen) {
  ------------------
  |  Branch (497:6): [True: 5.70k, False: 0]
  |  Branch (497:14): [True: 0, False: 5.70k]
  ------------------
  498|      0|    zone->str = zonep;
  499|      0|    zone->len = zlen;
  500|      0|  }
  501|       |  return TRUE;
  ------------------
  |  |  986|  5.70k|#define TRUE true
  ------------------
  502|  5.70k|}
curl_dbg_getaddrinfo:
  594|    179|{
  595|       |#ifdef USE_LWIPSOCK
  596|       |  int res = lwip_getaddrinfo(hostname, service, hints, result);
  597|       |#elif defined(USE_FAKE_GETADDRINFO)
  598|       |  int res;
  599|       |  const char *env = getenv("CURL_DNS_SERVER");
  600|       |  if(env)
  601|       |    res = r_getaddrinfo(hostname, service, hints, result);
  602|       |  else
  603|       |    /* !checksrc! disable BANNEDFUNC 1 */
  604|       |    res = getaddrinfo(hostname, service, hints, result);
  605|       |#else
  606|       |  /* !checksrc! disable BANNEDFUNC 1 */
  607|    179|  int res = getaddrinfo(hostname, service, hints, result);
  608|    179|#endif
  609|    179|  if(res == 0)
  ------------------
  |  Branch (609:6): [True: 0, False: 179]
  ------------------
  610|       |    /* success */
  611|      0|    curl_dbg_log("ADDR %s:%d getaddrinfo() = %p\n", source, line,
  612|      0|                 (void *)*result);
  613|    179|  else
  614|    179|    curl_dbg_log("ADDR %s:%d getaddrinfo() failed\n", source, line);
  615|    179|  return res;
  616|    179|}
curl_addrinfo.c:ip2addr:
  359|  9.25k|{
  360|  9.25k|  struct Curl_addrinfo *ai;
  361|  9.25k|  size_t addrsize;
  362|  9.25k|  size_t namelen;
  363|  9.25k|  struct sockaddr_in *addr;
  364|  9.25k|#ifdef USE_IPV6
  365|  9.25k|  struct sockaddr_in6 *addr6;
  366|  9.25k|#endif
  367|       |
  368|  9.25k|  DEBUGASSERT(inaddr && hostname);
  ------------------
  |  | 1016|  9.25k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (368:3): [True: 0, False: 9.25k]
  |  Branch (368:3): [True: 0, False: 0]
  |  Branch (368:3): [True: 9.25k, False: 0]
  |  Branch (368:3): [True: 9.25k, False: 0]
  ------------------
  369|       |
  370|  9.25k|  namelen = strlen(hostname) + 1;
  371|  9.25k|  *addrp = NULL;
  372|       |
  373|  9.25k|  if(af == AF_INET)
  ------------------
  |  Branch (373:6): [True: 9.24k, False: 7]
  ------------------
  374|  9.24k|    addrsize = sizeof(struct sockaddr_in);
  375|      7|#ifdef USE_IPV6
  376|      7|  else if(af == AF_INET6)
  ------------------
  |  Branch (376:11): [True: 7, False: 0]
  ------------------
  377|      7|    addrsize = sizeof(struct sockaddr_in6);
  378|      0|#endif
  379|      0|  else
  380|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  381|       |
  382|       |  /* allocate memory to hold the struct, the address and the name */
  383|  9.25k|  ai = curlx_calloc(1, sizeof(struct Curl_addrinfo) + addrsize + namelen);
  ------------------
  |  | 1500|  9.25k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  384|  9.25k|  if(!ai)
  ------------------
  |  Branch (384:6): [True: 7, False: 9.24k]
  ------------------
  385|      7|    return CURLE_OUT_OF_MEMORY;
  386|       |  /* put the address after the struct */
  387|  9.24k|  ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo));
  388|       |  /* then put the name after the address */
  389|  9.24k|  ai->ai_canonname = (char *)ai->ai_addr + addrsize;
  390|  9.24k|  memcpy(ai->ai_canonname, hostname, namelen);
  391|  9.24k|  ai->ai_family = af;
  392|  9.24k|  ai->ai_socktype = SOCK_STREAM;
  393|  9.24k|  ai->ai_addrlen = (curl_socklen_t)addrsize;
  394|       |  /* leave the rest of the struct filled with zero */
  395|       |
  396|  9.24k|  switch(af) {
  ------------------
  |  Branch (396:10): [True: 9.24k, False: 0]
  ------------------
  397|  9.23k|  case AF_INET:
  ------------------
  |  Branch (397:3): [True: 9.23k, False: 6]
  ------------------
  398|  9.23k|    addr = (void *)ai->ai_addr; /* storage area for this info */
  399|       |
  400|  9.23k|    memcpy(&addr->sin_addr, inaddr, sizeof(struct in_addr));
  401|  9.23k|    addr->sin_family = (CURL_SA_FAMILY_T)af;
  402|  9.23k|    addr->sin_port = htons((unsigned short)port);
  403|  9.23k|    break;
  404|       |
  405|      0|#ifdef USE_IPV6
  406|      6|  case AF_INET6:
  ------------------
  |  Branch (406:3): [True: 6, False: 9.23k]
  ------------------
  407|      6|    addr6 = (void *)ai->ai_addr; /* storage area for this info */
  408|       |
  409|      6|    memcpy(&addr6->sin6_addr, inaddr, sizeof(struct in6_addr));
  410|      6|    addr6->sin6_family = (CURL_SA_FAMILY_T)af;
  411|      6|    addr6->sin6_port = htons((unsigned short)port);
  412|      6|    break;
  413|  9.24k|#endif
  414|  9.24k|  }
  415|  9.24k|  *addrp = ai;
  416|  9.24k|  return CURLE_OK;
  417|  9.24k|}

Curl_fopen:
   83|  29.2k|{
   84|  29.2k|  CURLcode result = CURLE_WRITE_ERROR;
   85|  29.2k|  unsigned char randbuf[41];
   86|  29.2k|  char *tempstore = NULL;
   87|  29.2k|#ifndef _WIN32
   88|  29.2k|  curlx_struct_stat sb;
  ------------------
  |  |   67|  29.2k|#define curlx_struct_stat       struct stat
  ------------------
   89|  29.2k|#endif
   90|  29.2k|  int fd = -1;
   91|  29.2k|  char *dir = NULL;
   92|  29.2k|  *tempname = NULL;
   93|       |
   94|  29.2k|#ifndef _WIN32
   95|       |  /* Preserve existing contents until the temporary file replaces them. */
   96|  29.2k|  *fh = curlx_fopen(filename, FOPEN_APPENDTEXT);
  ------------------
  |  |   83|  29.2k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
   97|  29.2k|  if(!*fh)
  ------------------
  |  Branch (97:6): [True: 0, False: 29.2k]
  ------------------
   98|      0|    goto fail;
   99|  29.2k|  if(curlx_fstat(fileno(*fh), &sb) == -1 || !S_ISREG(sb.st_mode)) {
  ------------------
  |  |   66|  29.2k|#define curlx_fstat             fstat
  ------------------
  |  Branch (99:6): [True: 0, False: 29.2k]
  |  Branch (99:45): [True: 29.2k, False: 0]
  ------------------
  100|  29.2k|    return CURLE_OK;
  101|  29.2k|  }
  102|      0|  curlx_fclose(*fh);
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  103|      0|#endif /* !_WIN32 */
  104|      0|  *fh = NULL;
  105|       |
  106|      0|  result = Curl_rand_alnum(data, randbuf, sizeof(randbuf));
  107|      0|  if(result)
  ------------------
  |  Branch (107:6): [True: 0, False: 0]
  ------------------
  108|      0|    goto fail;
  109|       |
  110|      0|  dir = dirslash(filename);
  111|      0|  if(dir) {
  ------------------
  |  Branch (111:6): [True: 0, False: 0]
  ------------------
  112|       |    /* The temp filename should not end up too long for the target file
  113|       |       system */
  114|      0|    tempstore = curl_maprintf("%s%s.tmp", dir, randbuf);
  115|      0|    curlx_free(dir);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  116|      0|  }
  117|       |
  118|      0|  if(!tempstore) {
  ------------------
  |  Branch (118:6): [True: 0, False: 0]
  ------------------
  119|      0|    result = CURLE_OUT_OF_MEMORY;
  120|      0|    goto fail;
  121|      0|  }
  122|       |
  123|      0|  result = CURLE_WRITE_ERROR;
  124|       |#ifdef _WIN32
  125|       |  fd = curlx_open(tempstore, _O_WRONLY | _O_CREAT | _O_EXCL,
  126|       |                  _S_IREAD | _S_IWRITE);
  127|       |#else
  128|      0|  fd = curlx_open(tempstore, O_WRONLY | O_CREAT | O_EXCL,
  ------------------
  |  |   72|      0|#define curlx_open              open
  ------------------
  129|      0|                  (mode_t)(S_IRUSR | S_IWUSR | 0600));
  130|      0|#endif
  131|      0|  if(fd == -1)
  ------------------
  |  Branch (131:6): [True: 0, False: 0]
  ------------------
  132|      0|    goto fail;
  133|       |
  134|      0|#ifdef HAVE_FCHMOD
  135|      0|  {
  136|      0|    curlx_struct_stat nsb;
  ------------------
  |  |   67|      0|#define curlx_struct_stat       struct stat
  ------------------
  137|      0|    if((curlx_fstat(fd, &nsb) != -1) &&
  ------------------
  |  |   66|      0|#define curlx_fstat             fstat
  ------------------
  |  Branch (137:8): [True: 0, False: 0]
  ------------------
  138|      0|       (nsb.st_uid == sb.st_uid) && (nsb.st_gid == sb.st_gid)) {
  ------------------
  |  Branch (138:8): [True: 0, False: 0]
  |  Branch (138:37): [True: 0, False: 0]
  ------------------
  139|       |      /* if the user and group are the same, clone the original mode. Failure
  140|       |         is ignored as it then just leaves it at the default 0600 */
  141|      0|      (void)fchmod(fd, (mode_t)sb.st_mode);
  142|      0|    }
  143|      0|  }
  144|      0|#endif
  145|       |
  146|      0|  *fh = curlx_fdopen(fd, FOPEN_WRITETEXT);
  ------------------
  |  |   87|      0|  curl_dbg_fdopen(file, mode, __LINE__, __FILE__)
  ------------------
  147|      0|  if(!*fh)
  ------------------
  |  Branch (147:6): [True: 0, False: 0]
  ------------------
  148|      0|    goto fail;
  149|       |
  150|      0|  *tempname = tempstore;
  151|      0|  return CURLE_OK;
  152|       |
  153|      0|fail:
  154|      0|  if(fd != -1) {
  ------------------
  |  Branch (154:6): [True: 0, False: 0]
  ------------------
  155|      0|    curlx_close(fd);
  ------------------
  |  |   73|      0|#define curlx_close             close
  ------------------
  156|      0|    unlink(tempstore);
  157|      0|  }
  158|       |
  159|      0|  curlx_free(tempstore);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  160|      0|  return result;
  161|      0|}

Curl_get_line:
   36|  29.0k|{
   37|  29.0k|  CURLcode result;
   38|  29.0k|  char buffer[128];
   39|  29.0k|  curlx_dyn_reset(buf);
   40|  29.0k|  while(1) {
  ------------------
  |  Branch (40:9): [True: 29.0k, Folded]
  ------------------
   41|  29.0k|    size_t rlen;
   42|  29.0k|    const char *b = fgets(buffer, sizeof(buffer), input);
   43|  29.0k|    if(!b && ferror(input))
  ------------------
  |  Branch (43:8): [True: 29.0k, False: 0]
  |  Branch (43:14): [True: 0, False: 29.0k]
  ------------------
   44|      0|      return CURLE_READ_ERROR;
   45|       |
   46|  29.0k|    *eof = feof(input);
   47|       |
   48|  29.0k|    rlen = b ? strlen(b) : 0;
  ------------------
  |  Branch (48:12): [True: 0, False: 29.0k]
  ------------------
   49|  29.0k|    if(rlen) {
  ------------------
  |  Branch (49:8): [True: 0, False: 29.0k]
  ------------------
   50|      0|      result = curlx_dyn_addn(buf, b, rlen);
   51|      0|      if(result)
  ------------------
  |  Branch (51:10): [True: 0, False: 0]
  ------------------
   52|       |        /* too long line or out of memory */
   53|      0|        return result;
   54|      0|    }
   55|       |    /* now check the full line */
   56|  29.0k|    rlen = curlx_dyn_len(buf);
   57|  29.0k|    b = curlx_dyn_ptr(buf);
   58|  29.0k|    if(rlen && (b[rlen - 1] == '\n'))
  ------------------
  |  Branch (58:8): [True: 0, False: 29.0k]
  |  Branch (58:16): [True: 0, False: 0]
  ------------------
   59|       |      /* LF at end of the line */
   60|      0|      return CURLE_OK; /* all good */
   61|  29.0k|    if(*eof)
  ------------------
  |  Branch (61:8): [True: 29.0k, False: 0]
  ------------------
   62|       |      /* append a newline */
   63|  29.0k|      return curlx_dyn_addn(buf, "\n", 1);
   64|       |    /* otherwise get next line to append */
   65|  29.0k|  }
   66|       |  /* UNREACHABLE */
   67|  29.0k|}

Curl_share_lock_share:
  345|  61.0k|{
  346|  61.0k|  if(!GOOD_SHARE_HANDLE(share))
  ------------------
  |  |   39|  61.0k|#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
  |  |  ------------------
  |  |  |  |   38|      0|#define CURL_GOOD_SHARE 0x7e117a1e
  |  |  ------------------
  |  |  |  Branch (39:31): [True: 0, False: 61.0k]
  |  |  |  Branch (39:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  347|  61.0k|    return CURLSHE_INVALID;
  348|       |
  349|      0|  if(share->specifier & (unsigned int)(1 << type) &&
  ------------------
  |  Branch (349:6): [True: 0, False: 0]
  ------------------
  350|      0|     share->lockfunc) /* only call this if set! */
  ------------------
  |  Branch (350:6): [True: 0, False: 0]
  ------------------
  351|      0|    share->lockfunc(data, type, accesstype, share->clientdata);
  352|       |  /* else if we do not share this, pretend successful lock */
  353|       |
  354|      0|  return CURLSHE_OK;
  355|  61.0k|}
Curl_share_lock:
  359|  61.0k|{
  360|  61.0k|  return Curl_share_lock_share(data->share, data, type, accesstype);
  361|  61.0k|}
Curl_share_unlock_share:
  366|  61.0k|{
  367|  61.0k|  if(!GOOD_SHARE_HANDLE(share))
  ------------------
  |  |   39|  61.0k|#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
  |  |  ------------------
  |  |  |  |   38|      0|#define CURL_GOOD_SHARE 0x7e117a1e
  |  |  ------------------
  |  |  |  Branch (39:31): [True: 0, False: 61.0k]
  |  |  |  Branch (39:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  368|  61.0k|    return CURLSHE_INVALID;
  369|       |
  370|      0|  if(share->specifier & (unsigned int)(1 << type) &&
  ------------------
  |  Branch (370:6): [True: 0, False: 0]
  ------------------
  371|      0|     share->unlockfunc) /* only call this if set! */
  ------------------
  |  Branch (371:6): [True: 0, False: 0]
  ------------------
  372|      0|    share->unlockfunc(data, type, share->clientdata);
  373|       |
  374|      0|  return CURLSHE_OK;
  375|  61.0k|}
Curl_share_unlock:
  378|  61.0k|{
  379|  61.0k|  return Curl_share_unlock_share(data->share, data, type);
  380|  61.0k|}
Curl_share_easy_unlink:
  383|  19.7k|{
  384|  19.7k|  struct Curl_share *share = data->share;
  385|       |
  386|  19.7k|  if(share) {
  ------------------
  |  Branch (386:6): [True: 0, False: 19.7k]
  ------------------
  387|      0|    bool locked;
  388|       |
  389|      0|    if(!GOOD_SHARE_HANDLE(share))
  ------------------
  |  |   39|      0|#define GOOD_SHARE_HANDLE(x) ((x) && (x)->magic == CURL_GOOD_SHARE)
  |  |  ------------------
  |  |  |  |   38|      0|#define CURL_GOOD_SHARE 0x7e117a1e
  |  |  ------------------
  |  |  |  Branch (39:31): [True: 0, False: 0]
  |  |  |  Branch (39:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  390|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  391|       |
  392|      0|    locked = share_lock_acquire(share, data);
  393|       |    /* If share caches connections, detach any existing connection and
  394|       |     * forget its identifier. */
  395|      0|    if((share->specifier & (1 << CURL_LOCK_DATA_CONNECT))) {
  ------------------
  |  Branch (395:8): [True: 0, False: 0]
  ------------------
  396|      0|      if(data->conn)
  ------------------
  |  Branch (396:10): [True: 0, False: 0]
  ------------------
  397|      0|        Curl_detach_connection(data);
  398|      0|      data->state.last_conn_id = -1;
  399|      0|      data->state.last_cpid = UINT32_MAX;
  400|      0|    }
  401|       |
  402|      0|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
  403|      0|    if(share->cookies == data->cookies)
  ------------------
  |  Branch (403:8): [True: 0, False: 0]
  ------------------
  404|      0|      data->cookies = NULL;
  405|      0|#endif
  406|       |
  407|      0|#ifndef CURL_DISABLE_HSTS
  408|      0|    if(share->hsts == data->hsts)
  ------------------
  |  Branch (408:8): [True: 0, False: 0]
  ------------------
  409|      0|      data->hsts = NULL;
  410|      0|#endif
  411|       |#ifdef USE_LIBPSL
  412|       |    if(&share->psl == data->psl)
  413|       |      data->psl = data->multi ? &data->multi->psl : NULL;
  414|       |#endif
  415|       |
  416|      0|    share_lock_release(data->share, data, locked);
  417|      0|    share_unlink(&data->share);
  418|      0|  }
  419|  19.7k|  return CURLE_OK;
  420|  19.7k|}

Curl_thread_create:
   86|    231|{
   87|    231|  curl_thread_t t = curlx_malloc(sizeof(pthread_t));
  ------------------
  |  |   47|    231|#  define curl_thread_t          pthread_t *
  ------------------
                curl_thread_t t = curlx_malloc(sizeof(pthread_t));
  ------------------
  |  | 1498|    231|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   88|    231|  struct Curl_actual_call *ac = NULL;
   89|    231|  int rc;
   90|       |
   91|    231|  if(t)
  ------------------
  |  Branch (91:6): [True: 225, False: 6]
  ------------------
   92|    225|    ac = curlx_malloc(sizeof(struct Curl_actual_call));
  ------------------
  |  | 1498|    225|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   93|    231|  if(!(ac && t))
  ------------------
  |  Branch (93:8): [True: 210, False: 21]
  |  Branch (93:14): [True: 210, False: 0]
  ------------------
   94|     21|    goto err;
   95|       |
   96|    210|  ac->func = func;
   97|    210|  ac->arg = arg;
   98|       |
   99|    210|  rc = pthread_create(t, NULL, curl_thread_create_thunk, ac);
  100|    210|  if(rc) {
  ------------------
  |  Branch (100:6): [True: 0, False: 210]
  ------------------
  101|      0|    errno = rc;
  102|      0|    goto err;
  103|      0|  }
  104|       |
  105|    210|  return t;
  106|       |
  107|     21|err:
  108|     21|  curlx_free(t);
  ------------------
  |  | 1503|     21|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  109|     21|  curlx_free(ac);
  ------------------
  |  | 1503|     21|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  110|     21|  return curl_thread_t_null;
  ------------------
  |  |   49|     21|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  111|    210|}
Curl_thread_join:
  123|    210|{
  124|    210|  int ret = (pthread_join(**hnd, NULL) == 0);
  125|       |
  126|    210|  curlx_free(*hnd);
  ------------------
  |  | 1503|    210|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  127|    210|  *hnd = curl_thread_t_null;
  ------------------
  |  |   49|    210|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  128|       |
  129|    210|  return ret;
  130|    210|}
Curl_cond_signal:
  175|    619|{
  176|       |  /* return code defined as always 0 */
  177|    619|  (void)pthread_cond_signal(c);
  178|    619|}
Curl_cond_wait:
  181|    153|{
  182|       |  /* return code defined as always 0 */
  183|    153|  (void)pthread_cond_wait(c, m);
  184|    153|}
Curl_cond_timedwait:
  188|    152|{
  189|    152|  struct curltime now;
  190|    152|  struct timespec ts;
  191|    152|  timediff_t usec;
  192|    152|  int rc;
  193|       |
  194|       |  /* POSIX expects an "absolute" time until the condition wait ends.
  195|       |   * We cannot use `curlx_now()` here that may run on some monotonic clock
  196|       |   * that will be most likely in the past, as far as POSIX abstime is
  197|       |   * concerned. */
  198|    152|#ifdef HAVE_GETTIMEOFDAY
  199|    152|  struct timeval tv;
  200|    152|  (void)gettimeofday(&tv, NULL);
  201|    152|  now.tv_sec = tv.tv_sec;
  202|    152|  now.tv_usec = (int)tv.tv_usec;
  203|       |#else
  204|       |  now.tv_sec = time(NULL);
  205|       |  now.tv_usec = 0;
  206|       |#endif
  207|       |
  208|    152|  ts.tv_sec = now.tv_sec + (timeout_ms / 1000);
  209|    152|  usec = now.tv_usec + ((timeout_ms % 1000) * 1000);
  210|    152|  if(usec >= 1000000) {
  ------------------
  |  Branch (210:6): [True: 0, False: 152]
  ------------------
  211|      0|    ++ts.tv_sec;
  212|      0|    usec %= 1000000;
  213|      0|  }
  214|    152|  ts.tv_nsec = (long)usec * 1000;
  215|       |
  216|    152|  rc = pthread_cond_timedwait(c, m, &ts);
  217|    152|  if(rc == SOCKETIMEDOUT)
  ------------------
  |  | 1145|    152|#define SOCKETIMEDOUT     ETIMEDOUT
  ------------------
  |  Branch (217:6): [True: 0, False: 152]
  ------------------
  218|      0|    return CURLE_OPERATION_TIMEDOUT;
  219|    152|  return rc ? CURLE_UNRECOVERABLE_POLL : CURLE_OK;
  ------------------
  |  Branch (219:10): [True: 0, False: 152]
  ------------------
  220|    152|}
Curl_thread_get_current_id:
  223|  5.23k|{
  224|  5.23k|  return pthread_self();
  225|  5.23k|}
curl_threads.c:curl_thread_create_thunk:
   72|    210|{
   73|    210|  struct Curl_actual_call *ac = arg;
   74|    210|  unsigned int (*func)(void *) = ac->func;
   75|    210|  void *real_arg = ac->arg;
   76|       |
   77|    210|  curlx_free(ac);
  ------------------
  |  | 1503|    210|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   78|       |
   79|    210|  (*func)(real_arg);
   80|       |
   81|    210|  return 0;
   82|    210|}

Curl_debug:
  129|  45.8k|{
  130|  45.8k|  if(data->set.verbose) {
  ------------------
  |  Branch (130:6): [True: 17.1k, False: 28.7k]
  ------------------
  131|  17.1k|    static const char s_infotype[CURLINFO_END][3] = {
  132|  17.1k|      "* ", "< ", "> ", "{ ", "} ", "{ ", "} " };
  133|  17.1k|    char buf[TRC_LINE_MAX];
  134|  17.1k|    size_t len;
  135|  17.1k|    if(data->set.fdebug) {
  ------------------
  |  Branch (135:8): [True: 17.1k, False: 0]
  ------------------
  136|  17.1k|      struct Curl_mapi_guard guard;
  137|  17.1k|      if(CURL_TRC_IDS(data) && (size < TRC_LINE_MAX)) {
  ------------------
  |  |   91|  34.3k|  (Curl_trc_is_verbose(data) && \
  |  |  ------------------
  |  |  |  |  322|  34.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 17.1k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 17.1k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  34.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 17.1k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  17.1k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   92|  34.3k|  Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|  17.1k|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (92:3): [True: 16.3k, False: 860]
  |  |  ------------------
  ------------------
                    if(CURL_TRC_IDS(data) && (size < TRC_LINE_MAX)) {
  ------------------
  |  |   79|  16.3k|#define TRC_LINE_MAX 2048
  ------------------
  |  Branch (137:32): [True: 16.2k, False: 58]
  ------------------
  138|  16.2k|        len = trc_print_ids(data, buf, TRC_LINE_MAX);
  ------------------
  |  |   79|  16.2k|#define TRC_LINE_MAX 2048
  ------------------
  139|  16.2k|        len += curl_msnprintf(buf + len, TRC_LINE_MAX - len, "%.*s",
  ------------------
  |  |   79|  16.2k|#define TRC_LINE_MAX 2048
  ------------------
  140|  16.2k|                              (int)size, ptr);
  141|  16.2k|        len = trc_end_buf(buf, len, TRC_LINE_MAX, FALSE);
  ------------------
  |  |   79|  16.2k|#define TRC_LINE_MAX 2048
  ------------------
                      len = trc_end_buf(buf, len, TRC_LINE_MAX, FALSE);
  ------------------
  |  |  989|  16.2k|#define FALSE false
  ------------------
  142|  16.2k|        CURL_CBAPI_START(&guard, data, easy_fdebug);
  ------------------
  |  |  201|  16.2k|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
  143|  16.2k|        (void)(*data->set.fdebug)(data, type, buf, len, data->set.debugdata);
  144|  16.2k|        CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|  16.2k|  Curl_cbapi_leave(g)
  ------------------
  145|  16.2k|      }
  146|    918|      else {
  147|    918|        CURL_CBAPI_START(&guard, data, easy_fdebug);
  ------------------
  |  |  201|    918|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
  148|    918|        (void)(*data->set.fdebug)(data, type, CURL_UNCONST(ptr),
  ------------------
  |  |  793|    918|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  149|    918|                                  size, data->set.debugdata);
  150|    918|        CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|    918|  Curl_cbapi_leave(g)
  ------------------
  151|    918|      }
  152|  17.1k|    }
  153|      0|    else {
  154|      0|      switch(type) {
  155|      0|      case CURLINFO_TEXT:
  ------------------
  |  Branch (155:7): [True: 0, False: 0]
  ------------------
  156|      0|      case CURLINFO_HEADER_OUT:
  ------------------
  |  Branch (156:7): [True: 0, False: 0]
  ------------------
  157|      0|      case CURLINFO_HEADER_IN:
  ------------------
  |  Branch (157:7): [True: 0, False: 0]
  ------------------
  158|      0|#ifndef CURL_DISABLE_VERBOSE_STRINGS
  159|      0|        if(CURL_TRC_IDS(data)) {
  ------------------
  |  |   91|      0|  (Curl_trc_is_verbose(data) && \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   92|      0|  Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (92:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  160|      0|          len = trc_print_ids(data, buf, TRC_LINE_MAX);
  ------------------
  |  |   79|      0|#define TRC_LINE_MAX 2048
  ------------------
  161|      0|          fwrite(buf, len, 1, data->set.err);
  162|      0|        }
  163|      0|#endif
  164|      0|        fwrite(s_infotype[type], 2, 1, data->set.err);
  165|      0|        fwrite(ptr, size, 1, data->set.err);
  166|      0|        break;
  167|      0|      default: /* nada */
  ------------------
  |  Branch (167:7): [True: 0, False: 0]
  ------------------
  168|      0|        break;
  169|      0|      }
  170|      0|    }
  171|  17.1k|  }
  172|  45.8k|}
Curl_failf:
  178|  9.39k|{
  179|  9.39k|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1016|  9.39k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 0, False: 9.39k]
  |  Branch (179:3): [True: 9.39k, False: 0]
  ------------------
  180|  9.39k|  if(data->set.verbose || data->set.errorbuffer) {
  ------------------
  |  Branch (180:6): [True: 872, False: 8.52k]
  |  Branch (180:27): [True: 0, False: 8.52k]
  ------------------
  181|    872|    va_list ap;
  182|    872|    size_t len;
  183|    872|    char error[CURL_ERROR_SIZE + 2];
  184|    872|    va_start(ap, fmt);
  185|    872|    len = curl_mvsnprintf(error, CURL_ERROR_SIZE, fmt, ap);
  ------------------
  |  |  877|    872|#define CURL_ERROR_SIZE 256
  ------------------
  186|       |
  187|    872|    if(data->set.errorbuffer && !data->state.errorbuf) {
  ------------------
  |  Branch (187:8): [True: 0, False: 872]
  |  Branch (187:33): [True: 0, False: 0]
  ------------------
  188|      0|      curlx_strcopy(data->set.errorbuffer, CURL_ERROR_SIZE, error, len);
  ------------------
  |  |  877|      0|#define CURL_ERROR_SIZE 256
  ------------------
  189|      0|      data->state.errorbuf = TRUE; /* wrote error string */
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  190|      0|    }
  191|    872|    error[len++] = '\n';
  192|    872|    error[len] = '\0';
  193|    872|    trc_write(data, CURLINFO_TEXT, error, len);
  194|       |    va_end(ap);
  195|    872|  }
  196|  9.39k|}
Curl_reset_fail:
  199|  20.4k|{
  200|  20.4k|  if(data->set.errorbuffer)
  ------------------
  |  Branch (200:6): [True: 0, False: 20.4k]
  ------------------
  201|      0|    data->set.errorbuffer[0] = 0;
  202|       |  data->state.errorbuf = FALSE;
  ------------------
  |  |  989|  20.4k|#define FALSE false
  ------------------
  203|  20.4k|}
Curl_infof:
  272|  13.9k|{
  273|  13.9k|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1016|  13.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 13.9k]
  |  Branch (273:3): [True: 13.9k, False: 0]
  ------------------
  274|  13.9k|  if(Curl_trc_is_verbose(data)) {
  ------------------
  |  |  322|  13.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 13.9k, False: 0]
  |  |  |  Branch (322:14): [True: 13.9k, False: 0]
  |  |  ------------------
  |  |  323|  13.9k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 13.9k, False: 0]
  |  |  ------------------
  |  |  324|  13.9k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  275|  13.9k|    va_list ap;
  276|  13.9k|    va_start(ap, fmt);
  277|  13.9k|    trc_infof(data, data->state.feat, NULL, 0, fmt, ap);
  278|       |    va_end(ap);
  279|  13.9k|  }
  280|  13.9k|}
Curl_trc_cf_infof:
  284|   385k|{
  285|   385k|  DEBUGASSERT(cf);
  ------------------
  |  | 1016|   385k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (285:3): [True: 0, False: 385k]
  |  Branch (285:3): [True: 385k, False: 0]
  ------------------
  286|   385k|  if(Curl_trc_cf_is_verbose(cf, data)) {
  ------------------
  |  |  326|   385k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  ------------------
  |  |  |  |  322|   771k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 385k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 385k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|   771k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 385k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|   385k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  327|   385k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|   385k|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (327:4): [True: 385k, False: 0]
  |  |  |  Branch (327:12): [True: 385k, False: 0]
  |  |  ------------------
  ------------------
  287|   385k|    va_list ap;
  288|   385k|    va_start(ap, fmt);
  289|   385k|    trc_infof(data, data->state.feat, cf->cft->name,
  290|   385k|              (cf->chain && !CF_IS_PRIMARY(cf)) ? 1 : 0, fmt, ap);
  ------------------
  |  |  261|   385k|#define CF_IS_PRIMARY(cf)       (bool)(cf)->chain->primary
  ------------------
  |  Branch (290:16): [True: 385k, False: 0]
  |  Branch (290:29): [True: 0, False: 385k]
  ------------------
  291|       |    va_end(ap);
  292|   385k|  }
  293|   385k|}
Curl_trc_feat_infof:
  298|    291|{
  299|    291|  DEBUGASSERT(feat);
  ------------------
  |  | 1016|    291|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (299:3): [True: 0, False: 291]
  |  Branch (299:3): [True: 291, False: 0]
  ------------------
  300|    291|  if(Curl_trc_ft_is_verbose(data, feat)) {
  ------------------
  |  |  329|    291|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  322|    582|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 291, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 291, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    582|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 291, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    291|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  330|    291|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|    291|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (330:4): [True: 291, False: 0]
  |  |  ------------------
  ------------------
  301|    291|    va_list ap;
  302|    291|    va_start(ap, fmt);
  303|    291|    trc_infof(data, feat, NULL, 0, fmt, ap);
  304|       |    va_end(ap);
  305|    291|  }
  306|    291|}
Curl_trc_timer:
  332|  23.8k|{
  333|  23.8k|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1016|  23.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (333:3): [True: 0, False: 23.8k]
  |  Branch (333:3): [True: 23.8k, False: 0]
  ------------------
  334|  23.8k|  if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)) {
  ------------------
  |  |  329|  23.8k|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  322|  47.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 23.8k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 23.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  47.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 23.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  23.8k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  330|  23.8k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|  23.8k|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (330:4): [True: 23.8k, False: 0]
  |  |  ------------------
  ------------------
  335|  23.8k|    const char *tname = trc_timer_name(tid);
  336|  23.8k|    va_list ap;
  337|  23.8k|    va_start(ap, fmt);
  338|  23.8k|    trc_infof(data, &Curl_trc_feat_timer, tname, 0, fmt, ap);
  339|       |    va_end(ap);
  340|  23.8k|  }
  341|  23.8k|}
Curl_trc_easy_timers:
  344|  7.62k|{
  345|  7.62k|  if(CURL_TRC_TIMER_is_verbose(data) && data->multi) {
  ------------------
  |  |  139|  7.62k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  ------------------
  |  |  |  |  329|  15.2k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  15.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.62k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 7.62k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  15.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 7.62k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  7.62k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  15.2k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  7.62k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 7.62k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (345:41): [True: 7.62k, False: 0]
  ------------------
  346|  7.62k|    if(data->state.timeouts.first < EXPIRE_LAST) {
  ------------------
  |  Branch (346:8): [True: 7.58k, False: 38]
  ------------------
  347|  7.58k|      struct expire_timers *timeouts = &data->state.timeouts;
  348|  7.58k|      timediff_t base_us =
  349|  7.58k|        Curl_timeouts_offset_us(&data->multi->timeouts, Curl_pgrs_now(data));
  350|  7.58k|      uint8_t id = data->state.timeouts.first;
  351|  30.3k|      for(; id < EXPIRE_LAST; id = timeouts->next[id]) {
  ------------------
  |  Branch (351:13): [True: 22.7k, False: 7.58k]
  ------------------
  352|  22.7k|        CURL_TRC_TIMER(data, id, "expires in %" FMT_TIMEDIFF_T "us",
  ------------------
  |  |  173|  22.7k|  do {                                        \
  |  |  174|  22.7k|    if(CURL_TRC_TIMER_is_verbose(data))       \
  |  |  ------------------
  |  |  |  |  139|  22.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  22.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  45.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 22.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 22.7k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  45.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 22.7k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  22.7k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  22.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  22.7k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 22.7k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  22.7k|      Curl_trc_timer(data, tid, __VA_ARGS__); \
  |  |  176|  22.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (176:11): [Folded, False: 22.7k]
  |  |  ------------------
  ------------------
  353|  22.7k|                       timeouts->offset_us[id] - base_us);
  354|  22.7k|      }
  355|  7.58k|    }
  356|  7.62k|  }
  357|  7.62k|}
Curl_trc_mstate_name:
  379|  12.2k|{
  380|  12.2k|  if((state >= 0) && ((size_t)state < CURL_ARRAYSIZE(Curl_trc_mstate_names)))
  ------------------
  |  | 1326|  12.2k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (380:6): [True: 12.2k, False: 0]
  |  Branch (380:22): [True: 12.2k, False: 0]
  ------------------
  381|  12.2k|    return Curl_trc_mstate_names[(size_t)state];
  382|      0|  return "?";
  383|  12.2k|}
Curl_trc_multi:
  386|  11.4k|{
  387|  11.4k|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1016|  11.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (387:3): [True: 0, False: 11.4k]
  |  Branch (387:3): [True: 11.4k, False: 0]
  ------------------
  388|  11.4k|  if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)) {
  ------------------
  |  |  329|  11.4k|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  322|  22.8k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 11.4k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 11.4k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  22.8k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 11.4k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  11.4k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  330|  11.4k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|  11.4k|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (330:4): [True: 11.4k, False: 0]
  |  |  ------------------
  ------------------
  389|  11.4k|    const char *sname = (data->id >= 0) ?
  ------------------
  |  Branch (389:25): [True: 11.4k, False: 0]
  ------------------
  390|  11.4k|                        Curl_trc_mstate_name(data->mstate) : NULL;
  391|  11.4k|    va_list ap;
  392|  11.4k|    va_start(ap, fmt);
  393|  11.4k|    trc_infof(data, &Curl_trc_feat_multi, sname, 0, fmt, ap);
  394|       |    va_end(ap);
  395|  11.4k|  }
  396|  11.4k|}
Curl_trc_read:
  399|    519|{
  400|    519|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1016|    519|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (400:3): [True: 0, False: 519]
  |  Branch (400:3): [True: 519, False: 0]
  ------------------
  401|    519|  if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) {
  ------------------
  |  |  329|    519|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  322|  1.03k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 519, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 519, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.03k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 519, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    519|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  330|    519|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|    519|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (330:4): [True: 519, False: 0]
  |  |  ------------------
  ------------------
  402|    519|    va_list ap;
  403|    519|    va_start(ap, fmt);
  404|    519|    trc_infof(data, &Curl_trc_feat_read, NULL, 0, fmt, ap);
  405|       |    va_end(ap);
  406|    519|  }
  407|    519|}
Curl_trc_write:
  410|  56.3k|{
  411|  56.3k|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1016|  56.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (411:3): [True: 0, False: 56.3k]
  |  Branch (411:3): [True: 56.3k, False: 0]
  ------------------
  412|  56.3k|  if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) {
  ------------------
  |  |  329|  56.3k|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  322|   112k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 56.3k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 56.3k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|   112k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 56.3k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  56.3k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  330|  56.3k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|  56.3k|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (330:4): [True: 56.3k, False: 0]
  |  |  ------------------
  ------------------
  413|  56.3k|    va_list ap;
  414|  56.3k|    va_start(ap, fmt);
  415|  56.3k|    trc_infof(data, &Curl_trc_feat_write, NULL, 0, fmt, ap);
  416|       |    va_end(ap);
  417|  56.3k|  }
  418|  56.3k|}
Curl_trc_dns:
  421|  1.48k|{
  422|  1.48k|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1016|  1.48k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (422:3): [True: 0, False: 1.48k]
  |  Branch (422:3): [True: 1.48k, False: 0]
  ------------------
  423|  1.48k|  if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)) {
  ------------------
  |  |  329|  1.48k|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  322|  2.96k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.48k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 1.48k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|  2.96k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 1.48k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|  1.48k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  330|  1.48k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|  1.48k|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (330:4): [True: 1.48k, False: 0]
  |  |  ------------------
  ------------------
  424|  1.48k|    va_list ap;
  425|  1.48k|    va_start(ap, fmt);
  426|  1.48k|    trc_infof(data, &Curl_trc_feat_dns, NULL, 0, fmt, ap);
  427|       |    va_end(ap);
  428|  1.48k|  }
  429|  1.48k|}
Curl_trc_ssls:
  474|    222|{
  475|    222|  DEBUGASSERT(!strchr(fmt, '\n'));
  ------------------
  |  | 1016|    222|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (475:3): [True: 0, False: 222]
  |  Branch (475:3): [True: 222, False: 0]
  ------------------
  476|    222|  if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) {
  ------------------
  |  |  329|    222|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  322|    444|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 222, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 222, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    444|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 222, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    222|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  330|    222|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|    222|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (330:4): [True: 222, False: 0]
  |  |  ------------------
  ------------------
  477|    222|    va_list ap;
  478|    222|    va_start(ap, fmt);
  479|    222|    trc_infof(data, &Curl_trc_feat_ssls, NULL, 0, fmt, ap);
  480|       |    va_end(ap);
  481|    222|  }
  482|    222|}
Curl_trc_opt:
  676|  20.9k|{
  677|  20.9k|  CURLcode result = config ? trc_opt(config) : CURLE_OK;
  ------------------
  |  Branch (677:21): [True: 20.9k, False: 2]
  ------------------
  678|  20.9k|#ifdef DEBUGBUILD
  679|       |  /* CURL_DEBUG can override anything */
  680|  20.9k|  if(!result) {
  ------------------
  |  Branch (680:6): [True: 20.9k, False: 0]
  ------------------
  681|  20.9k|    const char *dbg_config = getenv("CURL_DEBUG");
  682|  20.9k|    if(dbg_config)
  ------------------
  |  Branch (682:8): [True: 0, False: 20.9k]
  ------------------
  683|      0|      result = trc_opt(dbg_config);
  684|  20.9k|  }
  685|  20.9k|#endif /* DEBUGBUILD */
  686|  20.9k|  return result;
  687|  20.9k|}
Curl_trc_init:
  690|      2|{
  691|      2|#ifdef DEBUGBUILD
  692|      2|  return Curl_trc_opt(NULL);
  693|       |#else
  694|       |  return CURLE_OK;
  695|       |#endif
  696|      2|}
curl_trc.c:trc_print_ids:
   95|   500k|{
   96|   500k|  curl_off_t cid = data->state.last_conn_id;
   97|   500k|  if(data->id >= 0) {
  ------------------
  |  Branch (97:6): [True: 500k, False: 0]
  ------------------
   98|   500k|    if(cid >= 0)
  ------------------
  |  Branch (98:8): [True: 495k, False: 4.54k]
  ------------------
   99|   495k|      return curl_msnprintf(buf, maxlen, CURL_TRC_FMT_IDSDC, data->id, cid);
  ------------------
  |  |   83|   495k|#define CURL_TRC_FMT_IDSDC  "[%" CURL_FORMAT_CURL_OFF_T "-%" \
  |  |   84|   495k|                            CURL_FORMAT_CURL_OFF_T "] "
  ------------------
  100|  4.54k|    else
  101|  4.54k|      return curl_msnprintf(buf, maxlen, CURL_TRC_FMT_IDSD, data->id);
  ------------------
  |  |   82|  4.54k|#define CURL_TRC_FMT_IDSD   "[%" CURL_FORMAT_CURL_OFF_T "-x] "
  ------------------
  102|   500k|  }
  103|      0|  else if(cid >= 0)
  ------------------
  |  Branch (103:11): [True: 0, False: 0]
  ------------------
  104|      0|    return curl_msnprintf(buf, maxlen, CURL_TRC_FMT_IDSC, cid);
  ------------------
  |  |   81|      0|#define CURL_TRC_FMT_IDSC   "[x-%" CURL_FORMAT_CURL_OFF_T "] "
  ------------------
  105|      0|  else {
  106|      0|    return curl_msnprintf(buf, maxlen, "[x-x] ");
  107|      0|  }
  108|   500k|}
curl_trc.c:trc_end_buf:
  111|   510k|{
  112|       |  /* make sure we end the trace line in `buf` properly. It needs
  113|       |   * to end with a null-terminator '\0' or '\n\0' */
  114|   510k|  if(len >= (maxlen - (addnl ? 2 : 1))) {
  ------------------
  |  Branch (114:6): [True: 43, False: 510k]
  |  Branch (114:24): [True: 493k, False: 16.2k]
  ------------------
  115|     43|    len = maxlen - 5;
  116|     43|    buf[len++] = '.';
  117|     43|    buf[len++] = '.';
  118|     43|    buf[len++] = '.';
  119|     43|    buf[len++] = '\n';
  120|     43|  }
  121|   510k|  else if(addnl)
  ------------------
  |  Branch (121:11): [True: 493k, False: 16.2k]
  ------------------
  122|   493k|    buf[len++] = '\n';
  123|   510k|  buf[len] = '\0';
  124|   510k|  return len;
  125|   510k|}
curl_trc.c:trc_write:
   52|   494k|{
   53|   494k|  if(data->set.verbose) {
  ------------------
  |  Branch (53:6): [True: 494k, False: 0]
  ------------------
   54|   494k|    if(data->set.fdebug) {
  ------------------
  |  Branch (54:8): [True: 494k, False: 0]
  ------------------
   55|   494k|      struct Curl_mapi_guard guard;
   56|   494k|      CURL_CBAPI_START(&guard, data, easy_fdebug);
  ------------------
  |  |  201|   494k|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
   57|   494k|      (void)(*data->set.fdebug)(data, type, CURL_UNCONST(ptr), size,
  ------------------
  |  |  793|   494k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   58|   494k|                                data->set.debugdata);
   59|   494k|      CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|   494k|  Curl_cbapi_leave(g)
  ------------------
   60|   494k|    }
   61|      0|    else {
   62|      0|      static const char s_infotype[CURLINFO_END][3] = {
   63|      0|        "* ", "< ", "> ", "{ ", "} ", "{ ", "} " };
   64|      0|      switch(type) {
   65|      0|      case CURLINFO_TEXT:
  ------------------
  |  Branch (65:7): [True: 0, False: 0]
  ------------------
   66|      0|      case CURLINFO_HEADER_OUT:
  ------------------
  |  Branch (66:7): [True: 0, False: 0]
  ------------------
   67|      0|      case CURLINFO_HEADER_IN:
  ------------------
  |  Branch (67:7): [True: 0, False: 0]
  ------------------
   68|      0|        fwrite(s_infotype[type], 2, 1, data->set.err);
   69|      0|        fwrite(ptr, size, 1, data->set.err);
   70|      0|        break;
   71|      0|      default: /* nada */
  ------------------
  |  Branch (71:7): [True: 0, False: 0]
  ------------------
   72|      0|        break;
   73|      0|      }
   74|      0|    }
   75|   494k|  }
   76|   494k|}
curl_trc.c:trc_infof:
  251|   493k|{
  252|   493k|  size_t len = 0;
  253|   493k|  char buf[TRC_LINE_MAX];
  254|       |
  255|   493k|  if(CURL_TRC_IDS(data))
  ------------------
  |  |   91|   493k|  (Curl_trc_is_verbose(data) && \
  |  |  ------------------
  |  |  |  |  322|   987k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 493k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 493k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|   987k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 493k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|   493k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   92|   493k|  Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|   493k|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (92:3): [True: 484k, False: 9.78k]
  |  |  ------------------
  ------------------
  256|   484k|    len += trc_print_ids(data, buf + len, TRC_LINE_MAX - len);
  ------------------
  |  |   79|   484k|#define TRC_LINE_MAX 2048
  ------------------
  257|   493k|  if(feat)
  ------------------
  |  Branch (257:6): [True: 94.1k, False: 399k]
  ------------------
  258|  94.1k|    len += curl_msnprintf(buf + len, TRC_LINE_MAX - len, "[%s] ", feat->name);
  ------------------
  |  |   79|  94.1k|#define TRC_LINE_MAX 2048
  ------------------
  259|   493k|  if(opt_id) {
  ------------------
  |  Branch (259:6): [True: 421k, False: 72.8k]
  ------------------
  260|   421k|    if(opt_id_idx > 0)
  ------------------
  |  Branch (260:8): [True: 0, False: 421k]
  ------------------
  261|      0|      len += curl_msnprintf(buf + len, TRC_LINE_MAX - len, "[%s-%d] ",
  ------------------
  |  |   79|      0|#define TRC_LINE_MAX 2048
  ------------------
  262|      0|                            opt_id, opt_id_idx);
  263|   421k|    else
  264|   421k|      len += curl_msnprintf(buf + len, TRC_LINE_MAX - len, "[%s] ", opt_id);
  ------------------
  |  |   79|   421k|#define TRC_LINE_MAX 2048
  ------------------
  265|   421k|  }
  266|   493k|  len += curl_mvsnprintf(buf + len, TRC_LINE_MAX - len, fmt, ap);
  ------------------
  |  |   79|   493k|#define TRC_LINE_MAX 2048
  ------------------
  267|   493k|  len = trc_end_buf(buf, len, TRC_LINE_MAX, TRUE);
  ------------------
  |  |   79|   493k|#define TRC_LINE_MAX 2048
  ------------------
                len = trc_end_buf(buf, len, TRC_LINE_MAX, TRUE);
  ------------------
  |  |  986|   493k|#define TRUE true
  ------------------
  268|   493k|  trc_write(data, CURLINFO_TEXT, buf, len);
  269|   493k|}
curl_trc.c:trc_timer_name:
  325|  23.8k|{
  326|  23.8k|  if((tid >= 0) && ((size_t)tid < CURL_ARRAYSIZE(Curl_trc_timer_names)))
  ------------------
  |  | 1326|  23.8k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (326:6): [True: 23.8k, False: 0]
  |  Branch (326:20): [True: 23.8k, False: 0]
  ------------------
  327|  23.8k|    return Curl_trc_timer_names[(size_t)tid];
  328|      0|  return "TIMER-???";
  329|  23.8k|}
curl_trc.c:trc_opt:
  645|  20.9k|{
  646|  20.9k|  struct Curl_str out;
  647|  23.4k|  while(!curlx_str_until(&config, &out, 32, ',')) {
  ------------------
  |  Branch (647:9): [True: 23.4k, False: 45]
  ------------------
  648|  23.4k|    int lvl = CURL_LOG_LVL_INFO;
  ------------------
  |  |   70|  23.4k|#define CURL_LOG_LVL_INFO  1
  ------------------
  649|  23.4k|    const char *token = curlx_str(&out);
  ------------------
  |  |   49|  23.4k|#define curlx_str(x)    ((x)->str)
  ------------------
  650|       |
  651|  23.4k|    if(*token == '-') {
  ------------------
  |  Branch (651:8): [True: 20.0k, False: 3.41k]
  ------------------
  652|  20.0k|      lvl = CURL_LOG_LVL_NONE;
  ------------------
  |  |   69|  20.0k|#define CURL_LOG_LVL_NONE  0
  ------------------
  653|  20.0k|      curlx_str_nudge(&out, 1);
  654|  20.0k|    }
  655|  3.41k|    else if(*token == '+')
  ------------------
  |  Branch (655:13): [True: 442, False: 2.97k]
  ------------------
  656|    442|      curlx_str_nudge(&out, 1);
  657|       |
  658|  23.4k|    if(curlx_str_casecompare2(&out, STRCONST("all")))
  ------------------
  |  | 1324|  23.4k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  23.4k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (658:8): [True: 20.1k, False: 3.31k]
  ------------------
  659|  20.1k|      trc_apply_level_by_category(TRC_CT_NONE, lvl);
  ------------------
  |  |  521|  20.1k|#define TRC_CT_NONE        0
  ------------------
  660|  3.31k|    else if(curlx_str_casecompare2(&out, STRCONST("protocol")))
  ------------------
  |  | 1324|  3.31k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  3.31k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (660:13): [True: 6, False: 3.31k]
  ------------------
  661|      6|      trc_apply_level_by_category(TRC_CT_PROTOCOL, lvl);
  ------------------
  |  |  522|      6|#define TRC_CT_PROTOCOL    (1 << 0)
  ------------------
  662|  3.31k|    else if(curlx_str_casecompare2(&out, STRCONST("network")))
  ------------------
  |  | 1324|  3.31k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  3.31k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (662:13): [True: 0, False: 3.31k]
  ------------------
  663|      0|      trc_apply_level_by_category(TRC_CT_NETWORK, lvl);
  ------------------
  |  |  523|      0|#define TRC_CT_NETWORK     (1 << 1)
  ------------------
  664|  3.31k|    else if(curlx_str_casecompare2(&out, STRCONST("proxy")))
  ------------------
  |  | 1324|  3.31k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  3.31k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (664:13): [True: 0, False: 3.31k]
  ------------------
  665|      0|      trc_apply_level_by_category(TRC_CT_PROXY, lvl);
  ------------------
  |  |  524|      0|#define TRC_CT_PROXY       (1 << 2)
  ------------------
  666|  3.31k|    else
  667|  3.31k|      trc_apply_level_by_name(&out, lvl);
  668|       |
  669|  23.4k|    if(curlx_str_single(&config, ','))
  ------------------
  |  Branch (669:8): [True: 20.9k, False: 2.49k]
  ------------------
  670|  20.9k|      break;
  671|  23.4k|  }
  672|  20.9k|  return CURLE_OK;
  673|  20.9k|}
curl_trc.c:trc_apply_level_by_category:
  631|  20.1k|{
  632|  20.1k|  size_t i;
  633|       |
  634|   402k|  for(i = 0; i < CURL_ARRAYSIZE(trc_cfts); ++i) {
  ------------------
  |  | 1326|   402k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (634:14): [True: 382k, False: 20.1k]
  ------------------
  635|   382k|    if(!category || (trc_cfts[i].category & category))
  ------------------
  |  Branch (635:8): [True: 382k, False: 114]
  |  Branch (635:21): [True: 36, False: 78]
  ------------------
  636|   382k|      trc_cfts[i].cft->log_level = lvl;
  637|   382k|  }
  638|   261k|  for(i = 0; i < CURL_ARRAYSIZE(trc_feats); ++i) {
  ------------------
  |  | 1326|   261k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (638:14): [True: 241k, False: 20.1k]
  ------------------
  639|   241k|    if(!category || (trc_feats[i].category & category))
  ------------------
  |  Branch (639:8): [True: 241k, False: 72]
  |  Branch (639:21): [True: 18, False: 54]
  ------------------
  640|   241k|      trc_feats[i].feat->log_level = lvl;
  641|   241k|  }
  642|  20.1k|}
curl_trc.c:trc_apply_level_by_name:
  613|  3.31k|{
  614|  3.31k|  size_t i;
  615|       |
  616|  64.5k|  for(i = 0; i < CURL_ARRAYSIZE(trc_cfts); ++i) {
  ------------------
  |  | 1326|  64.5k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (616:14): [True: 62.2k, False: 2.29k]
  ------------------
  617|  62.2k|    if(curlx_str_casecompare(token, trc_cfts[i].cft->name)) {
  ------------------
  |  Branch (617:8): [True: 1.02k, False: 61.2k]
  ------------------
  618|  1.02k|      trc_cfts[i].cft->log_level = lvl;
  619|  1.02k|      break;
  620|  1.02k|    }
  621|  62.2k|  }
  622|  33.8k|  for(i = 0; i < CURL_ARRAYSIZE(trc_feats); ++i) {
  ------------------
  |  | 1326|  33.8k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (622:14): [True: 31.9k, False: 1.89k]
  ------------------
  623|  31.9k|    if(curlx_str_casecompare(token, trc_feats[i].feat->name)) {
  ------------------
  |  Branch (623:8): [True: 1.42k, False: 30.5k]
  ------------------
  624|  1.42k|      trc_feats[i].feat->log_level = lvl;
  625|  1.42k|      break;
  626|  1.42k|    }
  627|  31.9k|  }
  628|  3.31k|}

curlx_base64_encode:
  268|    263|{
  269|    263|  return base64_encode(curlx_base64encdec, '=',
  270|    263|                       inputbuff, insize, outptr, outlen);
  271|    263|}
base64.c:base64_encode:
  189|    263|{
  190|    263|  char *output;
  191|    263|  char *base64data;
  192|    263|  const unsigned char *in = (const unsigned char *)inputbuff;
  193|       |
  194|    263|  *outptr = NULL;
  195|    263|  *outlen = 0;
  196|       |
  197|    263|  if(!insize)
  ------------------
  |  Branch (197:6): [True: 0, False: 263]
  ------------------
  198|      0|    return CURLE_OK;
  199|       |
  200|       |  /* safety precaution */
  201|    263|  DEBUGASSERT(insize <= CURL_MAX_BASE64_INPUT);
  ------------------
  |  | 1016|    263|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 263]
  |  Branch (201:3): [True: 263, False: 0]
  ------------------
  202|    263|  if(insize > CURL_MAX_BASE64_INPUT)
  ------------------
  |  |   38|    263|#define CURL_MAX_BASE64_INPUT 16000000
  ------------------
  |  Branch (202:6): [True: 0, False: 263]
  ------------------
  203|      0|    return CURLE_TOO_LARGE;
  204|       |
  205|    263|  base64data = output = curlx_malloc(((insize + 2) / 3 * 4) + 1);
  ------------------
  |  | 1498|    263|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  206|    263|  if(!output)
  ------------------
  |  Branch (206:6): [True: 1, False: 262]
  ------------------
  207|      1|    return CURLE_OUT_OF_MEMORY;
  208|       |
  209|  94.1k|  while(insize >= 3) {
  ------------------
  |  Branch (209:9): [True: 93.8k, False: 262]
  ------------------
  210|       |    /* Load all three input bytes before storing output, avoiding reloads when
  211|       |       the compiler cannot rule out aliasing. Extract four 6-bit indices from
  212|       |       the packed value; byte-wise loads avoid alignment and endian issues. */
  213|  93.8k|    uint32_t bits = ((uint32_t)in[0] << 16) |
  214|  93.8k|      ((uint32_t)in[1] << 8) | in[2];
  215|  93.8k|    *output++ = table64[bits >> 18];
  216|  93.8k|    *output++ = table64[(bits >> 12) & 0x3F];
  217|  93.8k|    *output++ = table64[(bits >> 6) & 0x3F];
  218|  93.8k|    *output++ = table64[bits & 0x3F];
  219|  93.8k|    insize -= 3;
  220|  93.8k|    in += 3;
  221|  93.8k|  }
  222|    262|  if(insize) {
  ------------------
  |  Branch (222:6): [True: 204, False: 58]
  ------------------
  223|       |    /* this is only one or two bytes now */
  224|    204|    *output++ = table64[in[0] >> 2];
  225|    204|    if(insize == 1) {
  ------------------
  |  Branch (225:8): [True: 95, False: 109]
  ------------------
  226|     95|      *output++ = table64[((in[0] & 0x03) << 4)];
  227|     95|      if(padbyte) {
  ------------------
  |  Branch (227:10): [True: 95, False: 0]
  ------------------
  228|     95|        *output++ = padbyte;
  229|     95|        *output++ = padbyte;
  230|     95|      }
  231|     95|    }
  232|    109|    else {
  233|       |      /* insize == 2 */
  234|    109|      *output++ = table64[((in[0] & 0x03) << 4) | ((in[1] & 0xF0) >> 4)];
  235|    109|      *output++ = table64[((in[1] & 0x0F) << 2)];
  236|    109|      if(padbyte)
  ------------------
  |  Branch (236:10): [True: 109, False: 0]
  ------------------
  237|    109|        *output++ = padbyte;
  238|    109|    }
  239|    204|  }
  240|       |
  241|       |  /* null-terminate */
  242|    262|  *output = '\0';
  243|       |
  244|       |  /* Return the pointer to the new data (allocated memory) */
  245|    262|  *outptr = base64data;
  246|       |
  247|       |  /* Return the length of the new data */
  248|    262|  *outlen = (size_t)(output - base64data);
  249|       |
  250|    262|  return CURLE_OK;
  251|    263|}

curlx_dyn_init:
   39|   191k|{
   40|   191k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   191k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (40:3): [True: 0, False: 191k]
  |  Branch (40:3): [True: 191k, False: 0]
  ------------------
   41|   191k|  DEBUGASSERT(toobig);
  ------------------
  |  | 1016|   191k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (41:3): [True: 0, False: 191k]
  |  Branch (41:3): [True: 191k, False: 0]
  ------------------
   42|   191k|  DEBUGASSERT(toobig <= MAX_DYNBUF_SIZE); /* catch crazy mistakes */
  ------------------
  |  | 1016|   191k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (42:3): [True: 0, False: 191k]
  |  Branch (42:3): [True: 191k, False: 0]
  ------------------
   43|   191k|  s->bufr = NULL;
   44|   191k|  s->leng = 0;
   45|   191k|  s->allc = 0;
   46|   191k|  s->toobig = toobig;
   47|   191k|#ifdef DEBUGBUILD
   48|   191k|  s->init = DYNINIT;
  ------------------
  |  |   32|   191k|#define DYNINIT 0xbee51da /* random pattern */
  ------------------
   49|   191k|#endif
   50|   191k|}
curlx_dyn_free:
   57|   116k|{
   58|   116k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   116k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (58:3): [True: 0, False: 116k]
  |  Branch (58:3): [True: 116k, False: 0]
  ------------------
   59|   116k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   116k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (59:3): [True: 0, False: 116k]
  |  Branch (59:3): [True: 116k, False: 0]
  ------------------
   60|   116k|  curlx_safefree(s->bufr);
  ------------------
  |  | 1359|   116k|  do {                      \
  |  | 1360|   116k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|   116k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|   116k|    (ptr) = NULL;           \
  |  | 1362|   116k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 116k]
  |  |  ------------------
  ------------------
   61|   116k|  s->leng = s->allc = 0;
   62|   116k|}
curlx_dyn_reset:
  126|   126k|{
  127|   126k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   126k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (127:3): [True: 0, False: 126k]
  |  Branch (127:3): [True: 126k, False: 0]
  ------------------
  128|   126k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   126k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (128:3): [True: 0, False: 126k]
  |  Branch (128:3): [True: 126k, False: 0]
  ------------------
  129|   126k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|   126k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (129:3): [True: 126k, False: 0]
  |  Branch (129:3): [True: 0, False: 0]
  |  Branch (129:3): [True: 65.9k, False: 60.8k]
  |  Branch (129:3): [True: 60.8k, False: 0]
  ------------------
  130|   126k|  if(s->leng)
  ------------------
  |  Branch (130:6): [True: 60.8k, False: 65.9k]
  ------------------
  131|  60.8k|    s->bufr[0] = 0;
  132|   126k|  s->leng = 0;
  133|   126k|}
curlx_dyn_addn:
  163|  1.81M|{
  164|  1.81M|  DEBUGASSERT(s);
  ------------------
  |  | 1016|  1.81M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (164:3): [True: 0, False: 1.81M]
  |  Branch (164:3): [True: 1.81M, False: 0]
  ------------------
  165|  1.81M|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|  1.81M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (165:3): [True: 0, False: 1.81M]
  |  Branch (165:3): [True: 1.81M, False: 0]
  ------------------
  166|  1.81M|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|  1.81M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (166:3): [True: 1.81M, False: 0]
  |  Branch (166:3): [True: 0, False: 0]
  |  Branch (166:3): [True: 188k, False: 1.62M]
  |  Branch (166:3): [True: 1.62M, False: 0]
  ------------------
  167|  1.81M|  return dyn_nappend(s, mem, len);
  168|  1.81M|}
curlx_dyn_add:
  174|  14.8k|{
  175|  14.8k|  size_t n;
  176|  14.8k|  DEBUGASSERT(str);
  ------------------
  |  | 1016|  14.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (176:3): [True: 0, False: 14.8k]
  |  Branch (176:3): [True: 14.8k, False: 0]
  ------------------
  177|  14.8k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|  14.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (177:3): [True: 0, False: 14.8k]
  |  Branch (177:3): [True: 14.8k, False: 0]
  ------------------
  178|  14.8k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|  14.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 0, False: 14.8k]
  |  Branch (178:3): [True: 14.8k, False: 0]
  ------------------
  179|  14.8k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|  14.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 14.8k, False: 0]
  |  Branch (179:3): [True: 0, False: 0]
  |  Branch (179:3): [True: 765, False: 14.0k]
  |  Branch (179:3): [True: 14.0k, False: 0]
  ------------------
  180|  14.8k|  n = strlen(str);
  181|  14.8k|  return dyn_nappend(s, (const unsigned char *)str, n);
  182|  14.8k|}
curlx_dyn_vaddf:
  188|   142k|{
  189|   142k|#ifdef BUILDING_LIBCURL
  190|   142k|  int rc;
  191|   142k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   142k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (191:3): [True: 0, False: 142k]
  |  Branch (191:3): [True: 142k, False: 0]
  ------------------
  192|   142k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   142k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (192:3): [True: 0, False: 142k]
  |  Branch (192:3): [True: 142k, False: 0]
  ------------------
  193|   142k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|   142k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (193:3): [True: 142k, False: 0]
  |  Branch (193:3): [True: 0, False: 0]
  |  Branch (193:3): [True: 19.8k, False: 123k]
  |  Branch (193:3): [True: 123k, False: 0]
  ------------------
  194|   142k|  DEBUGASSERT(fmt);
  ------------------
  |  | 1016|   142k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (194:3): [True: 0, False: 142k]
  |  Branch (194:3): [True: 142k, False: 0]
  ------------------
  195|   142k|  rc = curlx_dyn_vprintf(s, fmt, ap);
  196|       |
  197|   142k|  if(!rc)
  ------------------
  |  Branch (197:6): [True: 142k, False: 14]
  ------------------
  198|   142k|    return CURLE_OK;
  199|     14|  else if(rc == MERR_TOO_LARGE)
  ------------------
  |  |   29|     14|#define MERR_TOO_LARGE 2
  ------------------
  |  Branch (199:11): [True: 0, False: 14]
  ------------------
  200|      0|    return CURLE_TOO_LARGE;
  201|     14|  return CURLE_OUT_OF_MEMORY;
  202|       |#else
  203|       |  char *str;
  204|       |  str = curl_mvaprintf(fmt, ap); /* this allocs a new string to append */
  205|       |
  206|       |  if(str) {
  207|       |    CURLcode result = dyn_nappend(s, (const unsigned char *)str, strlen(str));
  208|       |    curl_free(str);
  209|       |    return result;
  210|       |  }
  211|       |  /* If we failed, we cleanup the whole buffer and return error */
  212|       |  curlx_dyn_free(s);
  213|       |  return CURLE_OUT_OF_MEMORY;
  214|       |#endif
  215|   142k|}
curlx_dyn_addf:
  221|   142k|{
  222|   142k|  CURLcode result;
  223|   142k|  va_list ap;
  224|   142k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   142k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (224:3): [True: 0, False: 142k]
  |  Branch (224:3): [True: 142k, False: 0]
  ------------------
  225|   142k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   142k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (225:3): [True: 0, False: 142k]
  |  Branch (225:3): [True: 142k, False: 0]
  ------------------
  226|   142k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|   142k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (226:3): [True: 142k, False: 0]
  |  Branch (226:3): [True: 0, False: 0]
  |  Branch (226:3): [True: 19.8k, False: 123k]
  |  Branch (226:3): [True: 123k, False: 0]
  ------------------
  227|   142k|  DEBUGASSERT(strcmp(fmt, "%s")); /* use curlx_dyn_add instead */
  ------------------
  |  | 1016|   142k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (227:3): [True: 0, False: 142k]
  |  Branch (227:3): [True: 142k, False: 0]
  ------------------
  228|   142k|  va_start(ap, fmt);
  229|   142k|  result = curlx_dyn_vaddf(s, fmt, ap);
  230|       |  va_end(ap);
  231|   142k|  return result;
  232|   142k|}
curlx_dyn_ptr:
  238|   310k|{
  239|   310k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   310k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (239:3): [True: 0, False: 310k]
  |  Branch (239:3): [True: 310k, False: 0]
  ------------------
  240|   310k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   310k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (240:3): [True: 0, False: 310k]
  |  Branch (240:3): [True: 310k, False: 0]
  ------------------
  241|   310k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|   310k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (241:3): [True: 310k, False: 0]
  |  Branch (241:3): [True: 0, False: 0]
  |  Branch (241:3): [True: 29.1k, False: 281k]
  |  Branch (241:3): [True: 281k, False: 0]
  ------------------
  242|   310k|  return s->bufr;
  243|   310k|}
curlx_dyn_take:
  246|  5.31k|{
  247|  5.31k|  char *ptr = s->bufr;
  248|  5.31k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|  5.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (248:3): [True: 0, False: 5.31k]
  |  Branch (248:3): [True: 5.31k, False: 0]
  ------------------
  249|  5.31k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|  5.31k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (249:3): [True: 0, False: 5.31k]
  |  Branch (249:3): [True: 5.31k, False: 0]
  ------------------
  250|  5.31k|  *plen = s->leng;
  251|       |  s->bufr = NULL;
  252|  5.31k|  s->leng = 0;
  253|  5.31k|  s->allc = 0;
  254|  5.31k|  return ptr;
  255|  5.31k|}
curlx_dyn_uptr:
  261|  9.77k|{
  262|  9.77k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|  9.77k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (262:3): [True: 0, False: 9.77k]
  |  Branch (262:3): [True: 9.77k, False: 0]
  ------------------
  263|  9.77k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|  9.77k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (263:3): [True: 0, False: 9.77k]
  |  Branch (263:3): [True: 9.77k, False: 0]
  ------------------
  264|  9.77k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|  9.77k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (264:3): [True: 9.77k, False: 0]
  |  Branch (264:3): [True: 0, False: 0]
  |  Branch (264:3): [True: 0, False: 9.77k]
  |  Branch (264:3): [True: 9.77k, False: 0]
  ------------------
  265|  9.77k|  return (unsigned char *)s->bufr;
  266|  9.77k|}
curlx_dyn_len:
  272|   295k|{
  273|   295k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|   295k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 295k]
  |  Branch (273:3): [True: 295k, False: 0]
  ------------------
  274|   295k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|   295k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (274:3): [True: 0, False: 295k]
  |  Branch (274:3): [True: 295k, False: 0]
  ------------------
  275|   295k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|   295k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (275:3): [True: 295k, False: 0]
  |  Branch (275:3): [True: 0, False: 0]
  |  Branch (275:3): [True: 44.1k, False: 251k]
  |  Branch (275:3): [True: 251k, False: 0]
  ------------------
  276|   295k|  return s->leng;
  277|   295k|}
curlx_dyn_setlen:
  283|  12.9k|{
  284|  12.9k|  DEBUGASSERT(s);
  ------------------
  |  | 1016|  12.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (284:3): [True: 0, False: 12.9k]
  |  Branch (284:3): [True: 12.9k, False: 0]
  ------------------
  285|  12.9k|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|  12.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (285:3): [True: 0, False: 12.9k]
  |  Branch (285:3): [True: 12.9k, False: 0]
  ------------------
  286|  12.9k|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|  12.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (286:3): [True: 12.9k, False: 0]
  |  Branch (286:3): [True: 0, False: 0]
  |  Branch (286:3): [True: 0, False: 12.9k]
  |  Branch (286:3): [True: 12.9k, False: 0]
  ------------------
  287|  12.9k|  if(set > s->leng)
  ------------------
  |  Branch (287:6): [True: 0, False: 12.9k]
  ------------------
  288|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  289|  12.9k|  s->leng = set;
  290|  12.9k|  s->bufr[s->leng] = 0;
  291|  12.9k|  return CURLE_OK;
  292|  12.9k|}
dynbuf.c:dyn_nappend:
   69|  1.82M|{
   70|  1.82M|  size_t idx = s->leng;
   71|  1.82M|  size_t a = s->allc;
   72|  1.82M|  size_t fit = len + idx + 1; /* new string + old string + zero byte */
   73|       |
   74|       |  /* try to detect if there is rubbish in the struct */
   75|  1.82M|  DEBUGASSERT(s->init == DYNINIT);
  ------------------
  |  | 1016|  1.82M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (75:3): [True: 0, False: 1.82M]
  |  Branch (75:3): [True: 1.82M, False: 0]
  ------------------
   76|  1.82M|  DEBUGASSERT(s->toobig);
  ------------------
  |  | 1016|  1.82M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (76:3): [True: 0, False: 1.82M]
  |  Branch (76:3): [True: 1.82M, False: 0]
  ------------------
   77|  1.82M|  DEBUGASSERT(idx < s->toobig);
  ------------------
  |  | 1016|  1.82M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:3): [True: 0, False: 1.82M]
  |  Branch (77:3): [True: 1.82M, False: 0]
  ------------------
   78|  1.82M|  DEBUGASSERT(!s->leng || s->bufr);
  ------------------
  |  | 1016|  1.82M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (78:3): [True: 1.82M, False: 0]
  |  Branch (78:3): [True: 0, False: 0]
  |  Branch (78:3): [True: 189k, False: 1.63M]
  |  Branch (78:3): [True: 1.63M, False: 0]
  ------------------
   79|  1.82M|  DEBUGASSERT(a <= s->toobig);
  ------------------
  |  | 1016|  1.82M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (79:3): [True: 0, False: 1.82M]
  |  Branch (79:3): [True: 1.82M, False: 0]
  ------------------
   80|  1.82M|  DEBUGASSERT(!len || mem);
  ------------------
  |  | 1016|  1.82M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (80:3): [True: 1.82M, False: 0]
  |  Branch (80:3): [True: 0, False: 0]
  |  Branch (80:3): [True: 1.58k, False: 1.82M]
  |  Branch (80:3): [True: 1.82M, False: 0]
  ------------------
   81|       |
   82|  1.82M|  if(fit > s->toobig) {
  ------------------
  |  Branch (82:6): [True: 2, False: 1.82M]
  ------------------
   83|      2|    curlx_dyn_free(s);
   84|      2|    return CURLE_TOO_LARGE;
   85|      2|  }
   86|  1.82M|  else if(!a) {
  ------------------
  |  Branch (86:11): [True: 135k, False: 1.69M]
  ------------------
   87|   135k|    DEBUGASSERT(!idx);
  ------------------
  |  | 1016|   135k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:5): [True: 0, False: 135k]
  |  Branch (87:5): [True: 135k, False: 0]
  ------------------
   88|       |    /* first invoke */
   89|   135k|    if(MIN_FIRST_ALLOC > s->toobig)
  ------------------
  |  |   29|   135k|#define MIN_FIRST_ALLOC 32
  ------------------
  |  Branch (89:8): [True: 1.35k, False: 134k]
  ------------------
   90|  1.35k|      a = s->toobig;
   91|   134k|    else if(fit < MIN_FIRST_ALLOC)
  ------------------
  |  |   29|   134k|#define MIN_FIRST_ALLOC 32
  ------------------
  |  Branch (91:13): [True: 115k, False: 18.3k]
  ------------------
   92|   115k|      a = MIN_FIRST_ALLOC;
  ------------------
  |  |   29|   115k|#define MIN_FIRST_ALLOC 32
  ------------------
   93|  18.3k|    else
   94|  18.3k|      a = fit;
   95|   135k|  }
   96|  1.69M|  else {
   97|  1.72M|    while(a < fit)
  ------------------
  |  Branch (97:11): [True: 33.1k, False: 1.69M]
  ------------------
   98|  33.1k|      a *= 2;
   99|  1.69M|    if(a > s->toobig)
  ------------------
  |  Branch (99:8): [True: 237, False: 1.69M]
  ------------------
  100|       |      /* no point in allocating a larger buffer than this is allowed to use */
  101|    237|      a = s->toobig;
  102|  1.69M|  }
  103|       |
  104|  1.82M|  if(a != s->allc) {
  ------------------
  |  Branch (104:6): [True: 167k, False: 1.65M]
  ------------------
  105|   167k|    void *p = curlx_realloc(s->bufr, a);
  ------------------
  |  | 1502|   167k|  curl_dbg_realloc(ptr, size, __LINE__, __FILE__)
  ------------------
  106|   167k|    if(!p) {
  ------------------
  |  Branch (106:8): [True: 122, False: 167k]
  ------------------
  107|    122|      curlx_dyn_free(s);
  108|    122|      return CURLE_OUT_OF_MEMORY;
  109|    122|    }
  110|   167k|    s->bufr = p;
  111|   167k|    s->allc = a;
  112|   167k|  }
  113|       |
  114|  1.82M|  if(len)
  ------------------
  |  Branch (114:6): [True: 1.82M, False: 1.58k]
  ------------------
  115|  1.82M|    memcpy(&s->bufr[idx], mem, len);
  116|  1.82M|  s->leng = idx + len;
  117|  1.82M|  s->bufr[s->leng] = 0;
  118|  1.82M|  return CURLE_OK;
  119|  1.82M|}

curlx_inet_ntop:
  190|  22.7k|{
  191|  22.7k|  switch(af) {
  192|  11.1k|  case AF_INET:
  ------------------
  |  Branch (192:3): [True: 11.1k, False: 11.6k]
  ------------------
  193|  11.1k|    return inet_ntop4((const unsigned char *)src, buf, size);
  194|  11.6k|  case AF_INET6:
  ------------------
  |  Branch (194:3): [True: 11.6k, False: 11.1k]
  ------------------
  195|  11.6k|    return inet_ntop6((const unsigned char *)src, buf, size);
  196|      0|  default:
  ------------------
  |  Branch (196:3): [True: 0, False: 22.7k]
  ------------------
  197|      0|    return CURLE_UNSUPPORTED_PROTOCOL;
  198|  22.7k|  }
  199|  22.7k|}
inet_ntop.c:inet_ntop4:
   57|  11.1k|{
   58|  11.1k|  char tmp[sizeof("255.255.255.255")];
   59|  11.1k|  size_t len;
   60|       |
   61|  11.1k|  DEBUGASSERT(size >= 16);
  ------------------
  |  | 1016|  11.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (61:3): [True: 0, False: 11.1k]
  |  Branch (61:3): [True: 11.1k, False: 0]
  ------------------
   62|       |
   63|       |  /* this snprintf() does not overflow the buffer. */
   64|  11.1k|  SNPRINTF(tmp, sizeof(tmp), "%d.%d.%d.%d",
  ------------------
  |  |   43|  11.1k|#define SNPRINTF curl_msnprintf
  ------------------
   65|  11.1k|           ((int)((unsigned char)src[0])) & 0xff,
   66|  11.1k|           ((int)((unsigned char)src[1])) & 0xff,
   67|  11.1k|           ((int)((unsigned char)src[2])) & 0xff,
   68|  11.1k|           ((int)((unsigned char)src[3])) & 0xff);
   69|       |
   70|  11.1k|  len = strlen(tmp);
   71|  11.1k|  if(len == 0 || len >= size)
  ------------------
  |  Branch (71:6): [True: 0, False: 11.1k]
  |  Branch (71:18): [True: 0, False: 11.1k]
  ------------------
   72|      0|    return CURLE_TOO_LARGE;
   73|  11.1k|  curlx_strcopy(dst, size, tmp, len);
   74|  11.1k|  return CURLE_OK;
   75|  11.1k|}
inet_ntop.c:inet_ntop6:
   81|  11.6k|{
   82|       |  /*
   83|       |   * Note that int32_t and int16_t need only be "at least" large enough
   84|       |   * to contain a value of the specified size. On some systems, like
   85|       |   * Crays, there is no such thing as an integer variable with 16 bits.
   86|       |   * Keep this in mind if you think this function should have been coded
   87|       |   * to use pointer overlays. All the world's not a VAX.
   88|       |   */
   89|  11.6k|  char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
   90|  11.6k|  char *tp;
   91|  11.6k|  struct {
   92|  11.6k|    int base;
   93|  11.6k|    int len;
   94|  11.6k|  } best, cur;
   95|  11.6k|  unsigned int words[IN6ADDRSZ / INT16SZ];
   96|  11.6k|  int i;
   97|       |
   98|       |  /* Preprocess:
   99|       |   *  Copy the input (bytewise) array into a wordwise array.
  100|       |   *  Find the longest run of 0x00's in src[] for :: shorthanding.
  101|       |   */
  102|  11.6k|  memset(words, '\0', sizeof(words));
  103|   197k|  for(i = 0; i < IN6ADDRSZ; i++)
  ------------------
  |  |   35|   197k|#define IN6ADDRSZ       16
  ------------------
  |  Branch (103:14): [True: 185k, False: 11.6k]
  ------------------
  104|   185k|    words[i / 2] |= ((unsigned int)src[i] << ((1 - (i % 2)) << 3));
  105|       |
  106|  11.6k|  best.base = -1;
  107|  11.6k|  cur.base = -1;
  108|  11.6k|  best.len = 0;
  109|  11.6k|  cur.len = 0;
  110|       |
  111|   104k|  for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
  ------------------
  |  |   35|   104k|#define IN6ADDRSZ       16
  ------------------
                for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
  ------------------
  |  |   37|   104k|#define INT16SZ          2
  ------------------
  |  Branch (111:14): [True: 92.9k, False: 11.6k]
  ------------------
  112|  92.9k|    if(words[i] == 0) {
  ------------------
  |  Branch (112:8): [True: 81.3k, False: 11.6k]
  ------------------
  113|  81.3k|      if(cur.base == -1) {
  ------------------
  |  Branch (113:10): [True: 11.6k, False: 69.7k]
  ------------------
  114|  11.6k|        cur.base = i;
  115|  11.6k|        cur.len = 1;
  116|  11.6k|      }
  117|  69.7k|      else
  118|  69.7k|        cur.len++;
  119|  81.3k|    }
  120|  11.6k|    else if(cur.base != -1) {
  ------------------
  |  Branch (120:13): [True: 11.6k, False: 0]
  ------------------
  121|  11.6k|      if(best.base == -1 || cur.len > best.len)
  ------------------
  |  Branch (121:10): [True: 11.6k, False: 0]
  |  Branch (121:29): [True: 0, False: 0]
  ------------------
  122|  11.6k|        best = cur;
  123|  11.6k|      cur.base = -1;
  124|  11.6k|    }
  125|  92.9k|  }
  126|  11.6k|  if((cur.base != -1) && (best.base == -1 || cur.len > best.len))
  ------------------
  |  Branch (126:6): [True: 0, False: 11.6k]
  |  Branch (126:27): [True: 0, False: 0]
  |  Branch (126:46): [True: 0, False: 0]
  ------------------
  127|      0|    best = cur;
  128|  11.6k|  if(best.base != -1 && best.len < 2)
  ------------------
  |  Branch (128:6): [True: 11.6k, False: 0]
  |  Branch (128:25): [True: 0, False: 11.6k]
  ------------------
  129|      0|    best.base = -1;
  130|       |  /* Format the result. */
  131|  11.6k|  tp = tmp;
  132|   104k|  for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
  ------------------
  |  |   35|   104k|#define IN6ADDRSZ       16
  ------------------
                for(i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
  ------------------
  |  |   37|   104k|#define INT16SZ          2
  ------------------
  |  Branch (132:14): [True: 92.9k, False: 11.6k]
  ------------------
  133|       |    /* Are we inside the best run of 0x00's? */
  134|  92.9k|    if(best.base != -1 && i >= best.base && i < (best.base + best.len)) {
  ------------------
  |  Branch (134:8): [True: 92.9k, False: 0]
  |  Branch (134:27): [True: 92.9k, False: 0]
  |  Branch (134:45): [True: 81.3k, False: 11.6k]
  ------------------
  135|  81.3k|      if(i == best.base)
  ------------------
  |  Branch (135:10): [True: 11.6k, False: 69.7k]
  ------------------
  136|  11.6k|        *tp++ = ':';
  137|  81.3k|      continue;
  138|  81.3k|    }
  139|       |
  140|       |    /* Are we following an initial run of 0x00s or any real hex?
  141|       |     */
  142|  11.6k|    if(i)
  ------------------
  |  Branch (142:8): [True: 11.6k, False: 0]
  ------------------
  143|  11.6k|      *tp++ = ':';
  144|       |
  145|       |    /* Is this address an encapsulated IPv4?
  146|       |     */
  147|  11.6k|    if(i == 6 && best.base == 0 &&
  ------------------
  |  Branch (147:8): [True: 0, False: 11.6k]
  |  Branch (147:18): [True: 0, False: 0]
  ------------------
  148|      0|       (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
  ------------------
  |  Branch (148:9): [True: 0, False: 0]
  |  Branch (148:27): [True: 0, False: 0]
  |  Branch (148:44): [True: 0, False: 0]
  ------------------
  149|      0|      CURLcode result = inet_ntop4(src + 12, tp, sizeof(tmp) - (tp - tmp));
  150|      0|      if(result)
  ------------------
  |  Branch (150:10): [True: 0, False: 0]
  ------------------
  151|      0|        return result;
  152|      0|      tp += strlen(tp);
  153|      0|      break;
  154|      0|    }
  155|  11.6k|    else {
  156|       |      /* Lower-case digits. Cannot use the set from mprintf.c since this
  157|       |         needs to work as a curlx function */
  158|  11.6k|      static const unsigned char ldigits[] = "0123456789abcdef";
  159|       |
  160|  11.6k|      unsigned int w = words[i];
  161|       |      /* output lowercase 16-bit hex number but ignore leading zeroes */
  162|  11.6k|      if(w & 0xf000)
  ------------------
  |  Branch (162:10): [True: 0, False: 11.6k]
  ------------------
  163|      0|        *tp++ = ldigits[(w & 0xf000) >> 12];
  164|  11.6k|      if(w & 0xff00)
  ------------------
  |  Branch (164:10): [True: 0, False: 11.6k]
  ------------------
  165|      0|        *tp++ = ldigits[(w & 0x0f00) >> 8];
  166|  11.6k|      if(w & 0xfff0)
  ------------------
  |  Branch (166:10): [True: 0, False: 11.6k]
  ------------------
  167|      0|        *tp++ = ldigits[(w & 0x00f0) >> 4];
  168|  11.6k|      *tp++ = ldigits[(w & 0x000f)];
  169|  11.6k|    }
  170|  11.6k|  }
  171|       |
  172|       |  /* Was it a trailing run of 0x00's?
  173|       |   */
  174|  11.6k|  if(best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
  ------------------
  |  |   35|  11.6k|#define IN6ADDRSZ       16
  ------------------
                if(best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
  ------------------
  |  |   37|  11.6k|#define INT16SZ          2
  ------------------
  |  Branch (174:6): [True: 11.6k, False: 0]
  |  Branch (174:25): [True: 0, False: 11.6k]
  ------------------
  175|      0|    *tp++ = ':';
  176|       |
  177|       |  /* Check for overflow, copy, and we are done. */
  178|  11.6k|  if((size_t)(tp - tmp) >= size)
  ------------------
  |  Branch (178:6): [True: 0, False: 11.6k]
  ------------------
  179|      0|    return CURLE_TOO_LARGE;
  180|  11.6k|  curlx_strcopy(dst, size, tmp, tp - tmp);
  181|  11.6k|  return CURLE_OK;
  182|  11.6k|}

curlx_inet_pton:
  204|  76.8k|{
  205|  76.8k|  switch(af) {
  206|  48.0k|  case AF_INET:
  ------------------
  |  Branch (206:3): [True: 48.0k, False: 28.8k]
  ------------------
  207|  48.0k|    return inet_pton4(src, (unsigned char *)dst);
  208|  28.8k|  case AF_INET6:
  ------------------
  |  Branch (208:3): [True: 28.8k, False: 48.0k]
  ------------------
  209|  28.8k|    return inet_pton6(src, (unsigned char *)dst);
  210|      0|  default:
  ------------------
  |  Branch (210:3): [True: 0, False: 76.8k]
  ------------------
  211|      0|    return -1;
  212|  76.8k|  }
  213|       |  /* NOTREACHED */
  214|  76.8k|}
inet_pton.c:inet_pton4:
   63|  48.9k|{
   64|  48.9k|  int saw_digit, octets, ch;
   65|  48.9k|  unsigned char tmp[INADDRSZ], *tp;
   66|       |
   67|  48.9k|  saw_digit = 0;
   68|  48.9k|  octets = 0;
   69|  48.9k|  tp = tmp;
   70|  48.9k|  *tp = 0;
   71|   351k|  while((ch = (unsigned char)*src++) != '\0') {
  ------------------
  |  Branch (71:9): [True: 319k, False: 31.5k]
  ------------------
   72|   319k|    if(ISDIGIT(ch)) {
  ------------------
  |  |   42|   319k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 224k, False: 95.0k]
  |  |  |  Branch (42:38): [True: 208k, False: 16.2k]
  |  |  ------------------
  ------------------
   73|   208k|      unsigned int val = (*tp * 10) + (ch - '0');
   74|       |
   75|   208k|      if(saw_digit && *tp == 0)
  ------------------
  |  Branch (75:10): [True: 81.2k, False: 127k]
  |  Branch (75:23): [True: 170, False: 81.0k]
  ------------------
   76|    170|        return 0;
   77|   208k|      if(val > 255)
  ------------------
  |  Branch (77:10): [True: 220, False: 208k]
  ------------------
   78|    220|        return 0;
   79|   208k|      *tp = (unsigned char)val;
   80|   208k|      if(!saw_digit) {
  ------------------
  |  Branch (80:10): [True: 127k, False: 80.8k]
  ------------------
   81|   127k|        if(++octets > 4)
  ------------------
  |  Branch (81:12): [True: 0, False: 127k]
  ------------------
   82|      0|          return 0;
   83|   127k|        saw_digit = 1;
   84|   127k|      }
   85|   208k|    }
   86|   111k|    else if(ch == '.' && saw_digit) {
  ------------------
  |  Branch (86:13): [True: 94.6k, False: 16.6k]
  |  Branch (86:26): [True: 94.6k, False: 94]
  ------------------
   87|  94.6k|      if(octets == 4)
  ------------------
  |  Branch (87:10): [True: 175, False: 94.4k]
  ------------------
   88|    175|        return 0;
   89|  94.4k|      *++tp = 0;
   90|  94.4k|      saw_digit = 0;
   91|  94.4k|    }
   92|  16.7k|    else
   93|  16.7k|      return 0;
   94|   319k|  }
   95|  31.5k|  if(octets < 4)
  ------------------
  |  Branch (95:6): [True: 771, False: 30.8k]
  ------------------
   96|    771|    return 0;
   97|  30.8k|  memcpy(dst, tmp, INADDRSZ);
  ------------------
  |  |   36|  30.8k|#define INADDRSZ         4
  ------------------
   98|  30.8k|  return 1;
   99|  31.5k|}
inet_pton.c:inet_pton6:
  114|  28.8k|{
  115|  28.8k|  unsigned char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
  116|  28.8k|  const char *curtok;
  117|  28.8k|  int ch, saw_xdigit;
  118|  28.8k|  size_t val;
  119|       |
  120|  28.8k|  memset((tp = tmp), 0, IN6ADDRSZ);
  ------------------
  |  |   35|  28.8k|#define IN6ADDRSZ       16
  ------------------
  121|  28.8k|  endp = tp + IN6ADDRSZ;
  ------------------
  |  |   35|  28.8k|#define IN6ADDRSZ       16
  ------------------
  122|  28.8k|  colonp = NULL;
  123|       |  /* Leading :: requires some special handling. */
  124|  28.8k|  if(*src == ':' && *++src != ':')
  ------------------
  |  Branch (124:6): [True: 18.8k, False: 9.92k]
  |  Branch (124:21): [True: 165, False: 18.7k]
  ------------------
  125|    165|    return 0;
  126|  28.6k|  curtok = src;
  127|  28.6k|  saw_xdigit = 0;
  128|  28.6k|  val = 0;
  129|  78.1k|  while((ch = (unsigned char)*src++) != '\0') {
  ------------------
  |  Branch (129:9): [True: 58.7k, False: 19.3k]
  ------------------
  130|  58.7k|    if(ISXDIGIT(ch)) {
  ------------------
  |  |   37|  58.7k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|   117k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 57.6k, False: 1.05k]
  |  |  |  |  |  Branch (42:38): [True: 23.4k, False: 34.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  94.0k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 10.1k, False: 25.1k]
  |  |  |  |  |  Branch (27:43): [True: 2.25k, False: 7.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  33.0k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 9.68k, False: 23.3k]
  |  |  |  |  |  Branch (28:43): [True: 1.79k, False: 7.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|  27.4k|      val <<= 4;
  132|  27.4k|      val |= curlx_hexval(ch);
  ------------------
  |  |  113|  27.4k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  133|  27.4k|      if(++saw_xdigit > 4)
  ------------------
  |  Branch (133:10): [True: 101, False: 27.3k]
  ------------------
  134|    101|        return 0;
  135|  27.3k|      continue;
  136|  27.4k|    }
  137|  31.2k|    if(ch == ':') {
  ------------------
  |  Branch (137:8): [True: 22.3k, False: 8.94k]
  ------------------
  138|  22.3k|      curtok = src;
  139|  22.3k|      if(!saw_xdigit) {
  ------------------
  |  Branch (139:10): [True: 19.0k, False: 3.24k]
  ------------------
  140|  19.0k|        if(colonp)
  ------------------
  |  Branch (140:12): [True: 66, False: 18.9k]
  ------------------
  141|     66|          return 0;
  142|  18.9k|        colonp = tp;
  143|  18.9k|        continue;
  144|  19.0k|      }
  145|  3.24k|      if(!*src)
  ------------------
  |  Branch (145:10): [True: 100, False: 3.14k]
  ------------------
  146|    100|        return 0;
  147|  3.14k|      if(tp + INT16SZ > endp)
  ------------------
  |  |   37|  3.14k|#define INT16SZ          2
  ------------------
  |  Branch (147:10): [True: 66, False: 3.08k]
  ------------------
  148|     66|        return 0;
  149|  3.08k|      *tp++ = (unsigned char)((val >> 8) & 0xff);
  150|  3.08k|      *tp++ = (unsigned char)(val & 0xff);
  151|  3.08k|      saw_xdigit = 0;
  152|  3.08k|      val = 0;
  153|  3.08k|      continue;
  154|  3.14k|    }
  155|  8.94k|    if(ch == '.' && ((tp + INADDRSZ) <= endp) &&
  ------------------
  |  |   36|    979|#define INADDRSZ         4
  ------------------
  |  Branch (155:8): [True: 979, False: 7.96k]
  |  Branch (155:21): [True: 896, False: 83]
  ------------------
  156|    896|       inet_pton4(curtok, tp) > 0) {
  ------------------
  |  Branch (156:8): [True: 136, False: 760]
  ------------------
  157|    136|      tp += INADDRSZ;
  ------------------
  |  |   36|    136|#define INADDRSZ         4
  ------------------
  158|    136|      saw_xdigit = 0;
  159|    136|      break;    /* '\0' was seen by inet_pton4(). */
  160|    136|    }
  161|  8.81k|    return 0;
  162|  8.94k|  }
  163|  19.5k|  if(saw_xdigit) {
  ------------------
  |  Branch (163:6): [True: 19.2k, False: 250]
  ------------------
  164|  19.2k|    if(tp + INT16SZ > endp)
  ------------------
  |  |   37|  19.2k|#define INT16SZ          2
  ------------------
  |  Branch (164:8): [True: 92, False: 19.1k]
  ------------------
  165|     92|      return 0;
  166|  19.1k|    *tp++ = (unsigned char)((val >> 8) & 0xff);
  167|  19.1k|    *tp++ = (unsigned char)(val & 0xff);
  168|  19.1k|  }
  169|  19.4k|  if(colonp) {
  ------------------
  |  Branch (169:6): [True: 18.8k, False: 606]
  ------------------
  170|       |    /*
  171|       |     * Since some memmove()'s erroneously fail to handle
  172|       |     * overlapping regions, we do the shift by hand.
  173|       |     */
  174|  18.8k|    const ssize_t n = tp - colonp;
  175|  18.8k|    ssize_t i;
  176|       |
  177|  18.8k|    if(tp == endp)
  ------------------
  |  Branch (177:8): [True: 78, False: 18.7k]
  ------------------
  178|     78|      return 0;
  179|  56.1k|    for(i = 1; i <= n; i++) {
  ------------------
  |  Branch (179:16): [True: 37.4k, False: 18.7k]
  ------------------
  180|  37.4k|      *(endp - i) = *(colonp + n - i);
  181|  37.4k|      *(colonp + n - i) = 0;
  182|  37.4k|    }
  183|  18.7k|    tp = endp;
  184|  18.7k|  }
  185|  19.3k|  if(tp != endp)
  ------------------
  |  Branch (185:6): [True: 605, False: 18.7k]
  ------------------
  186|    605|    return 0;
  187|  18.7k|  memcpy(dst, tmp, IN6ADDRSZ);
  ------------------
  |  |   35|  18.7k|#define IN6ADDRSZ       16
  ------------------
  188|  18.7k|  return 1;
  189|  19.3k|}

curlx_nonblock:
   47|  9.20k|{
   48|  9.20k|#ifdef HAVE_FCNTL_O_NONBLOCK
   49|       |  /* most recent Unix versions */
   50|  9.20k|  int flags;
   51|  9.20k|  flags = sfcntl(sockfd, F_GETFL, 0);
  ------------------
  |  |  935|  9.20k|#  define sfcntl  fcntl
  ------------------
   52|  9.20k|  if(flags < 0)
  ------------------
  |  Branch (52:6): [True: 0, False: 9.20k]
  ------------------
   53|      0|    return -1;
   54|       |  /* Check if the current file status flags have already satisfied
   55|       |   * the request, if so, it is no need to call fcntl() to replicate it.
   56|       |   */
   57|  9.20k|  if(!!(flags & O_NONBLOCK) == !!nonblock)
  ------------------
  |  Branch (57:6): [True: 1.97k, False: 7.23k]
  ------------------
   58|  1.97k|    return 0;
   59|  7.23k|  if(nonblock)
  ------------------
  |  Branch (59:6): [True: 7.23k, False: 0]
  ------------------
   60|  7.23k|    flags |= O_NONBLOCK;
   61|      0|  else
   62|      0|    flags &= ~O_NONBLOCK;
   63|  7.23k|  return sfcntl(sockfd, F_SETFL, flags);
  ------------------
  |  |  935|  7.23k|#  define sfcntl  fcntl
  ------------------
   64|       |
   65|       |#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
   66|       |
   67|       |  /* Amiga */
   68|       |  long flags = nonblock ? 1L : 0L;
   69|       |  return IoctlSocket(sockfd, FIONBIO, (char *)&flags);
   70|       |
   71|       |#elif defined(HAVE_IOCTL_FIONBIO)
   72|       |
   73|       |  /* older Unix versions */
   74|       |  int flags = nonblock ? 1 : 0;
   75|       |  return ioctl(sockfd, FIONBIO, &flags);
   76|       |
   77|       |#elif defined(HAVE_IOCTLSOCKET_FIONBIO)
   78|       |
   79|       |  /* Windows */
   80|       |  unsigned long flags = nonblock ? 1UL : 0UL;
   81|       |  return ioctlsocket(sockfd, (long)FIONBIO, &flags);
   82|       |
   83|       |#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
   84|       |
   85|       |  /* Orbis OS */
   86|       |  long b = nonblock ? 1L : 0L;
   87|       |  return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
   88|       |
   89|       |#else
   90|       |#error "no non-blocking method was found/used/set"
   91|       |#endif
   92|  9.20k|}

curlx_strcopy:
   42|  37.8k|{
   43|  37.8k|  DEBUGASSERT(slen < dsize);
  ------------------
  |  | 1016|  37.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (43:3): [True: 0, False: 37.8k]
  |  Branch (43:3): [True: 37.8k, False: 0]
  ------------------
   44|  37.8k|  if(slen < dsize) {
  ------------------
  |  Branch (44:6): [True: 37.8k, False: 0]
  ------------------
   45|  37.8k|    memcpy(dest, src, slen);
   46|  37.8k|    dest[slen] = 0;
   47|  37.8k|  }
   48|      0|  else if(dsize)
  ------------------
  |  Branch (48:11): [True: 0, False: 0]
  ------------------
   49|      0|    dest[0] = 0;
   50|  37.8k|}

curlx_memdup0:
   86|   169k|{
   87|   169k|  char *buf = (length < SIZE_MAX) ? curlx_malloc(length + 1) : NULL;
  ------------------
  |  | 1498|   169k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  |  Branch (87:15): [True: 169k, False: 0]
  ------------------
   88|   169k|  if(!buf)
  ------------------
  |  Branch (88:6): [True: 281, False: 169k]
  ------------------
   89|    281|    return NULL;
   90|   169k|  if(length) {
  ------------------
  |  Branch (90:6): [True: 143k, False: 25.4k]
  ------------------
   91|   143k|    DEBUGASSERT(src); /* must never be NULL */
  ------------------
  |  | 1016|   143k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (91:5): [True: 0, False: 143k]
  |  Branch (91:5): [True: 143k, False: 0]
  ------------------
   92|   143k|    memcpy(buf, src, length);
   93|   143k|  }
   94|   169k|  buf[length] = 0;
   95|   169k|  return buf;
   96|   169k|}
curlx_memzero:
  113|  30.2k|{
  114|  30.2k|  if(buf)
  ------------------
  |  Branch (114:6): [True: 30.2k, False: 0]
  ------------------
  115|  30.2k|    curlx_memzero_low(buf, size);
  ------------------
  |  | 1667|  30.2k|#define curlx_memzero_low(buf, size)  explicit_bzero(buf, size)
  ------------------
  116|  30.2k|}
curlx_strzero:
  120|  68.6k|{
  121|  68.6k|  if(buf)
  ------------------
  |  Branch (121:6): [True: 1.48k, False: 67.1k]
  ------------------
  122|  1.48k|    curlx_memzero_low(buf, strlen(buf));
  ------------------
  |  | 1667|  1.48k|#define curlx_memzero_low(buf, size)  explicit_bzero(buf, size)
  ------------------
  123|  68.6k|}

curlx_strerror:
  249|    188|{
  250|       |#ifdef _WIN32
  251|       |  DWORD old_win_err = GetLastError();
  252|       |#endif
  253|    188|  int old_errno = errno;
  254|    188|  char *p;
  255|       |
  256|    188|  if(!buflen)
  ------------------
  |  Branch (256:6): [True: 0, False: 188]
  ------------------
  257|      0|    return NULL;
  258|       |
  259|    188|#ifndef _WIN32
  260|    188|  DEBUGASSERT(err >= 0);
  ------------------
  |  | 1016|    188|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (260:3): [True: 0, False: 188]
  |  Branch (260:3): [True: 188, False: 0]
  ------------------
  261|    188|#endif
  262|       |
  263|    188|  *buf = '\0';
  264|       |
  265|       |#ifdef _WIN32
  266|       |  if((strerror_s(buf, buflen, err) || !strcmp(buf, "Unknown error")) &&
  267|       |#ifdef USE_WINSOCK
  268|       |     !get_winsock_error(err, buf, buflen) &&
  269|       |#endif
  270|       |     !curlx_get_winapi_error((DWORD)err, buf, buflen))
  271|       |    SNPRINTF(buf, buflen, "Unknown error %d (%#x)", err, (unsigned int)err);
  272|       |#else /* !_WIN32 */
  273|       |
  274|       |#if defined(HAVE_STRERROR_R) && defined(HAVE_POSIX_STRERROR_R)
  275|       |  /*
  276|       |   * The POSIX-style strerror_r() may set errno to ERANGE if insufficient
  277|       |   * storage is supplied via 'strerrbuf' and 'buflen' to hold the generated
  278|       |   * message string, or EINVAL if 'errnum' is not a valid error number.
  279|       |   */
  280|       |  if(strerror_r(err, buf, buflen) &&
  281|       |     buflen > sizeof("Unknown error ") + 20) {
  282|       |    if(buf[0] == '\0')
  283|       |      SNPRINTF(buf, buflen, "Unknown error %d", err);
  284|       |  }
  285|       |#elif defined(HAVE_STRERROR_R) && defined(HAVE_GLIBC_STRERROR_R)
  286|       |  /*
  287|       |   * The glibc-style strerror_r() only *might* use the buffer we pass to
  288|       |   * the function, but it always returns the error message as a pointer,
  289|       |   * so we must copy that string unconditionally (if non-NULL).
  290|       |   */
  291|    188|  {
  292|    188|    char buffer[256];
  293|    188|    const char *msg = strerror_r(err, buffer, sizeof(buffer));
  294|    188|    if(msg && buflen > 1)
  ------------------
  |  Branch (294:8): [True: 188, False: 0]
  |  Branch (294:15): [True: 188, False: 0]
  ------------------
  295|    188|      SNPRINTF(buf, buflen, "%s", msg);
  ------------------
  |  |   43|    188|#define SNPRINTF curl_msnprintf
  ------------------
  296|      0|    else if(buflen > sizeof("Unknown error ") + 20)
  ------------------
  |  Branch (296:13): [True: 0, False: 0]
  ------------------
  297|      0|      SNPRINTF(buf, buflen, "Unknown error %d", err);
  ------------------
  |  |   43|      0|#define SNPRINTF curl_msnprintf
  ------------------
  298|    188|  }
  299|       |#else
  300|       |  {
  301|       |    /* !checksrc! disable BANNEDFUNC 1 */
  302|       |    const char *msg = strerror(err);
  303|       |    if(msg && buflen > 1)
  304|       |      SNPRINTF(buf, buflen, "%s", msg);
  305|       |    else if(buflen > sizeof("Unknown error ") + 20)
  306|       |      SNPRINTF(buf, buflen, "Unknown error %d", err);
  307|       |  }
  308|       |#endif
  309|       |
  310|    188|#endif /* _WIN32 */
  311|       |
  312|       |  /* strip trailing '\r\n' or '\n'. */
  313|    188|  p = strrchr(buf, '\n');
  314|    188|  if(p && (p - buf) >= 2)
  ------------------
  |  Branch (314:6): [True: 0, False: 188]
  |  Branch (314:11): [True: 0, False: 0]
  ------------------
  315|      0|    *p = '\0';
  316|    188|  p = strrchr(buf, '\r');
  317|    188|  if(p && (p - buf) >= 1)
  ------------------
  |  Branch (317:6): [True: 0, False: 188]
  |  Branch (317:11): [True: 0, False: 0]
  ------------------
  318|      0|    *p = '\0';
  319|       |
  320|    188|  if(errno != old_errno)
  ------------------
  |  Branch (320:6): [True: 0, False: 188]
  ------------------
  321|    188|    errno = old_errno;
  322|       |
  323|       |#ifdef _WIN32
  324|       |  if(old_win_err != GetLastError())
  325|       |    SetLastError(old_win_err);
  326|       |#endif
  327|       |
  328|    188|  return buf;
  329|    188|}

curlx_str_init:
   27|  43.3k|{
   28|       |  out->str = NULL;
   29|  43.3k|  out->len = 0;
   30|  43.3k|}
curlx_str_assign:
   33|  59.9k|{
   34|  59.9k|  out->str = str;
   35|  59.9k|  out->len = len;
   36|  59.9k|}
curlx_str_until:
   51|  43.2k|{
   52|  43.2k|  const char *s;
   53|  43.2k|  size_t len = 0;
   54|  43.2k|  DEBUGASSERT(linep);
  ------------------
  |  | 1016|  43.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (54:3): [True: 0, False: 43.2k]
  |  Branch (54:3): [True: 43.2k, False: 0]
  ------------------
   55|  43.2k|  DEBUGASSERT(*linep);
  ------------------
  |  | 1016|  43.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (55:3): [True: 0, False: 43.2k]
  |  Branch (55:3): [True: 43.2k, False: 0]
  ------------------
   56|  43.2k|  DEBUGASSERT(out);
  ------------------
  |  | 1016|  43.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (56:3): [True: 0, False: 43.2k]
  |  Branch (56:3): [True: 43.2k, False: 0]
  ------------------
   57|  43.2k|  DEBUGASSERT(delim);
  ------------------
  |  | 1016|  43.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (57:3): [True: 0, False: 43.2k]
  |  Branch (57:3): [True: 43.2k, False: 0]
  ------------------
   58|  43.2k|  s = *linep;
   59|       |
   60|  43.2k|  curlx_str_init(out);
   61|   347k|  while(*s && (*s != delim)) {
  ------------------
  |  Branch (61:9): [True: 314k, False: 32.5k]
  |  Branch (61:15): [True: 305k, False: 9.88k]
  ------------------
   62|   305k|    s++;
   63|   305k|    if(++len > max) {
  ------------------
  |  Branch (63:8): [True: 750, False: 304k]
  ------------------
   64|    750|      return STRE_BIG;
  ------------------
  |  |   29|    750|#define STRE_BIG      1
  ------------------
   65|    750|    }
   66|   305k|  }
   67|  42.4k|  if(!len)
  ------------------
  |  Branch (67:6): [True: 1.41k, False: 41.0k]
  ------------------
   68|  1.41k|    return STRE_SHORT;
  ------------------
  |  |   30|  1.41k|#define STRE_SHORT    2
  ------------------
   69|  41.0k|  out->str = *linep;
   70|  41.0k|  out->len = len;
   71|  41.0k|  *linep = s; /* point to the first byte after the word */
   72|  41.0k|  return STRE_OK;
  ------------------
  |  |   28|  41.0k|#define STRE_OK       0
  ------------------
   73|  42.4k|}
curlx_str_word:
   78|  9.83k|{
   79|  9.83k|  return curlx_str_until(linep, out, max, ' ');
   80|  9.83k|}
curlx_str_untilnl:
   86|     86|{
   87|     86|  const char *s = *linep;
   88|     86|  size_t len = 0;
   89|     86|  DEBUGASSERT(linep && *linep && out && max);
  ------------------
  |  | 1016|     86|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (89:3): [True: 0, False: 86]
  |  Branch (89:3): [True: 0, False: 0]
  |  Branch (89:3): [True: 0, False: 0]
  |  Branch (89:3): [True: 0, False: 0]
  |  Branch (89:3): [True: 86, False: 0]
  |  Branch (89:3): [True: 86, False: 0]
  |  Branch (89:3): [True: 86, False: 0]
  |  Branch (89:3): [True: 86, False: 0]
  ------------------
   90|       |
   91|     86|  curlx_str_init(out);
   92|  3.90k|  while(*s && !ISNEWLINE(*s)) {
  ------------------
  |  |   48|  3.84k|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (48:26): [True: 9, False: 3.83k]
  |  |  |  Branch (48:43): [True: 21, False: 3.81k]
  |  |  ------------------
  ------------------
  |  Branch (92:9): [True: 3.84k, False: 56]
  ------------------
   93|  3.81k|    s++;
   94|  3.81k|    if(++len > max)
  ------------------
  |  Branch (94:8): [True: 0, False: 3.81k]
  ------------------
   95|      0|      return STRE_BIG;
  ------------------
  |  |   29|      0|#define STRE_BIG      1
  ------------------
   96|  3.81k|  }
   97|     86|  if(!len)
  ------------------
  |  Branch (97:6): [True: 0, False: 86]
  ------------------
   98|      0|    return STRE_SHORT;
  ------------------
  |  |   30|      0|#define STRE_SHORT    2
  ------------------
   99|     86|  out->str = *linep;
  100|     86|  out->len = len;
  101|     86|  *linep = s; /* point to the first byte after the word */
  102|     86|  return STRE_OK;
  ------------------
  |  |   28|     86|#define STRE_OK       0
  ------------------
  103|     86|}
curlx_str_single:
  139|   160k|{
  140|   160k|  DEBUGASSERT(linep && *linep);
  ------------------
  |  | 1016|   160k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (140:3): [True: 0, False: 160k]
  |  Branch (140:3): [True: 0, False: 0]
  |  Branch (140:3): [True: 160k, False: 0]
  |  Branch (140:3): [True: 160k, False: 0]
  ------------------
  141|   160k|  if(**linep != byte)
  ------------------
  |  Branch (141:6): [True: 149k, False: 11.2k]
  ------------------
  142|   149k|    return STRE_BYTE;
  ------------------
  |  |   33|   149k|#define STRE_BYTE     5
  ------------------
  143|  11.2k|  (*linep)++; /* move over it */
  144|  11.2k|  return STRE_OK;
  ------------------
  |  |   28|  11.2k|#define STRE_OK       0
  ------------------
  145|   160k|}
curlx_str_singlespace:
  150|  9.83k|{
  151|  9.83k|  return curlx_str_single(linep, ' ');
  152|  9.83k|}
curlx_str_number:
  214|  2.19M|{
  215|  2.19M|  return str_num_base(linep, nump, max, 10);
  216|  2.19M|}
curlx_str_octal:
  228|  14.5k|{
  229|  14.5k|  return str_num_base(linep, nump, max, 8);
  230|  14.5k|}
curlx_str_casecompare2:
  259|   127k|{
  260|   127k|  return (str->len == clen) && curl_strnequal(str->str, check, clen);
  ------------------
  |  Branch (260:10): [True: 35.3k, False: 92.5k]
  |  Branch (260:32): [True: 22.5k, False: 12.8k]
  ------------------
  261|   127k|}
curlx_str_casecompare:
  264|  94.2k|{
  265|  94.2k|  return curlx_str_casecompare2(str, check, check ? strlen(check) : 0);
  ------------------
  |  Branch (265:45): [True: 94.2k, False: 0]
  ------------------
  266|  94.2k|}
curlx_str_cmp:
  271|    103|{
  272|    103|  if(check) {
  ------------------
  |  Branch (272:6): [True: 103, False: 0]
  ------------------
  273|    103|    size_t clen = strlen(check);
  274|    103|    return ((str->len == clen) && !strncmp(str->str, check, clen));
  ------------------
  |  Branch (274:13): [True: 93, False: 10]
  |  Branch (274:35): [True: 93, False: 0]
  ------------------
  275|    103|  }
  276|      0|  return !!str->len;
  277|    103|}
curlx_str_nudge:
  282|  20.4k|{
  283|  20.4k|  if(num <= str->len) {
  ------------------
  |  Branch (283:6): [True: 20.4k, False: 0]
  ------------------
  284|  20.4k|    str->str += num;
  285|  20.4k|    str->len -= num;
  286|  20.4k|    return STRE_OK;
  ------------------
  |  |   28|  20.4k|#define STRE_OK       0
  ------------------
  287|  20.4k|  }
  288|      0|  return STRE_OVERFLOW;
  ------------------
  |  |   35|      0|#define STRE_OVERFLOW 7
  ------------------
  289|  20.4k|}
curlx_str_cspn:
  295|  3.37k|{
  296|  3.37k|  const char *s = *linep;
  297|  3.37k|  size_t len;
  298|  3.37k|  DEBUGASSERT(linep && *linep);
  ------------------
  |  | 1016|  3.37k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (298:3): [True: 0, False: 3.37k]
  |  Branch (298:3): [True: 0, False: 0]
  |  Branch (298:3): [True: 3.37k, False: 0]
  |  Branch (298:3): [True: 3.37k, False: 0]
  ------------------
  299|       |
  300|  3.37k|  len = strcspn(s, reject);
  301|  3.37k|  if(len) {
  ------------------
  |  Branch (301:6): [True: 3.29k, False: 72]
  ------------------
  302|  3.29k|    out->str = s;
  303|  3.29k|    out->len = len;
  304|  3.29k|    *linep = &s[len];
  305|  3.29k|    return STRE_OK;
  ------------------
  |  |   28|  3.29k|#define STRE_OK       0
  ------------------
  306|  3.29k|  }
  307|     72|  curlx_str_init(out);
  308|     72|  return STRE_SHORT;
  ------------------
  |  |   30|     72|#define STRE_SHORT    2
  ------------------
  309|  3.37k|}
curlx_str_trimblanks:
  313|  3.44k|{
  314|  13.2k|  while(out->len && ISBLANK(*out->str)) {
  ------------------
  |  |   43|  12.9k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 5.78k, False: 7.17k]
  |  |  |  Branch (43:38): [True: 4.06k, False: 3.11k]
  |  |  ------------------
  ------------------
  |  Branch (314:9): [True: 12.9k, False: 336]
  ------------------
  315|  9.84k|    out->str++;
  316|  9.84k|    out->len--;
  317|  9.84k|  }
  318|       |
  319|       |  /* trim trailing spaces and tabs */
  320|  8.87k|  while(out->len && ISBLANK(out->str[out->len - 1]))
  ------------------
  |  |   43|  8.53k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 4.89k, False: 3.64k]
  |  |  |  Branch (43:38): [True: 532, False: 3.11k]
  |  |  ------------------
  ------------------
  |  Branch (320:9): [True: 8.53k, False: 336]
  ------------------
  321|  5.42k|    out->len--;
  322|  3.44k|}
curlx_str_passblanks:
  326|  29.1k|{
  327|  33.9k|  while(ISBLANK(**linep))
  ------------------
  |  |   43|  33.9k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 4.57k, False: 29.3k]
  |  |  |  Branch (43:38): [True: 227, False: 29.1k]
  |  |  ------------------
  ------------------
  328|  4.80k|    (*linep)++; /* move over it */
  329|  29.1k|}
strparse.c:str_num_base:
  172|  2.21M|{
  173|  2.21M|  curl_off_t num = 0;
  174|  2.21M|  const char *p;
  175|  2.21M|  int m = (base == 10) ? '9' :   /* the largest digit possible */
  ------------------
  |  Branch (175:11): [True: 2.19M, False: 14.5k]
  ------------------
  176|  2.21M|    (base == 16) ? 'f' : '7';
  ------------------
  |  Branch (176:5): [True: 0, False: 14.5k]
  ------------------
  177|  2.21M|  DEBUGASSERT(linep && *linep && nump);
  ------------------
  |  | 1016|  2.21M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (177:3): [True: 0, False: 2.21M]
  |  Branch (177:3): [True: 0, False: 0]
  |  Branch (177:3): [True: 0, False: 0]
  |  Branch (177:3): [True: 2.21M, False: 0]
  |  Branch (177:3): [True: 2.21M, False: 0]
  |  Branch (177:3): [True: 2.21M, False: 0]
  ------------------
  178|  2.21M|  DEBUGASSERT((base == 8) || (base == 10) || (base == 16));
  ------------------
  |  | 1016|  2.21M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 2.21M, False: 0]
  |  Branch (178:3): [True: 0, False: 0]
  |  Branch (178:3): [True: 0, False: 0]
  |  Branch (178:3): [True: 14.5k, False: 2.19M]
  |  Branch (178:3): [True: 2.19M, False: 0]
  |  Branch (178:3): [True: 0, False: 0]
  ------------------
  179|  2.21M|  DEBUGASSERT(max >= 0); /* mostly to catch SIZE_MAX, which is too large */
  ------------------
  |  | 1016|  2.21M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (179:3): [True: 0, False: 2.21M]
  |  Branch (179:3): [True: 2.21M, False: 0]
  ------------------
  180|  2.21M|  *nump = 0;
  181|  2.21M|  p = *linep;
  182|  2.21M|  if(!valid_digit(*p, m))
  ------------------
  |  |  156|  2.21M|  (((x) >= '0') && ((x) <= (m)) && curlx_hexasciitable[(x) - '0'])
  |  |  ------------------
  |  |  |  Branch (156:4): [True: 2.19M, False: 19.3k]
  |  |  |  Branch (156:20): [True: 263k, False: 1.92M]
  |  |  |  Branch (156:36): [True: 263k, False: 0]
  |  |  ------------------
  ------------------
  183|  1.94M|    return STRE_NO_NUM;
  ------------------
  |  |   36|  1.94M|#define STRE_NO_NUM   8
  ------------------
  184|   263k|  if(max < base) {
  ------------------
  |  Branch (184:6): [True: 0, False: 263k]
  ------------------
  185|       |    /* special-case low max scenario because check needs to be different */
  186|      0|    do {
  187|      0|      int n = curlx_hexval(*p++);
  ------------------
  |  |  113|      0|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  188|      0|      num = (num * base) + n;
  189|      0|      if(num > max)
  ------------------
  |  Branch (189:10): [True: 0, False: 0]
  ------------------
  190|      0|        return STRE_OVERFLOW;
  ------------------
  |  |   35|      0|#define STRE_OVERFLOW 7
  ------------------
  191|      0|    } while(valid_digit(*p, m));
  ------------------
  |  |  156|      0|  (((x) >= '0') && ((x) <= (m)) && curlx_hexasciitable[(x) - '0'])
  |  |  ------------------
  |  |  |  Branch (156:4): [True: 0, False: 0]
  |  |  |  Branch (156:20): [True: 0, False: 0]
  |  |  |  Branch (156:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  192|      0|  }
  193|   263k|  else {
  194|   263k|    curl_off_t cutoff = (max - (base - 1)) / base;
  195|   778k|    while(valid_digit(*p, m)) {
  ------------------
  |  |  156|   778k|  (((x) >= '0') && ((x) <= (m)) && curlx_hexasciitable[(x) - '0'])
  |  |  ------------------
  |  |  |  Branch (156:4): [True: 728k, False: 49.4k]
  |  |  |  Branch (156:20): [True: 514k, False: 214k]
  |  |  |  Branch (156:36): [True: 514k, False: 0]
  |  |  ------------------
  ------------------
  196|   514k|      if(num <= cutoff)
  ------------------
  |  Branch (196:10): [True: 514k, False: 158]
  ------------------
  197|   514k|        num = (num * base) + curlx_hexval(*p++);
  ------------------
  |  |  113|   514k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  198|    158|      else {
  199|    158|        int n = curlx_hexval(*p++);
  ------------------
  |  |  113|    158|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  200|    158|        if(num > ((max - n) / base))
  ------------------
  |  Branch (200:12): [True: 131, False: 27]
  ------------------
  201|    131|          return STRE_OVERFLOW;
  ------------------
  |  |   35|    131|#define STRE_OVERFLOW 7
  ------------------
  202|     27|        num = (num * base) + n;
  203|     27|      }
  204|   514k|    }
  205|   263k|  }
  206|   263k|  *nump = num;
  207|   263k|  *linep = p;
  208|   263k|  return STRE_OK;
  ------------------
  |  |   28|   263k|#define STRE_OK       0
  ------------------
  209|   263k|}

curlx_pnow:
   52|  2.20M|{
   53|       |  /*
   54|       |   * clock_gettime() is granted to be increased monotonically when the
   55|       |   * monotonic clock is queried. Time starting point is unspecified, it
   56|       |   * could be the system start-up time, the Epoch, or something else,
   57|       |   * in any case the time starting point does not change once that the
   58|       |   * system has started up.
   59|       |   */
   60|  2.20M|  struct timespec tsnow;
   61|       |
   62|       |  /*
   63|       |   * clock_gettime() may be defined by Apple's SDK as weak symbol thus
   64|       |   * code compiles but fails during runtime if clock_gettime() is
   65|       |   * called on unsupported OS version.
   66|       |   */
   67|       |#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \
   68|       |  (HAVE_BUILTIN_AVAILABLE == 1)
   69|       |  bool have_clock_gettime = FALSE;
   70|       |  if(__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *))
   71|       |    have_clock_gettime = TRUE;
   72|       |#endif
   73|       |
   74|  2.20M|#ifdef HAVE_CLOCK_GETTIME_MONOTONIC_RAW
   75|  2.20M|  if(
   76|       |#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \
   77|       |  (HAVE_BUILTIN_AVAILABLE == 1)
   78|       |    have_clock_gettime &&
   79|       |#endif
   80|  2.20M|    (clock_gettime(CLOCK_MONOTONIC_RAW, &tsnow) == 0)) {
  ------------------
  |  Branch (80:5): [True: 2.20M, False: 0]
  ------------------
   81|  2.20M|    pnow->tv_sec = tsnow.tv_sec;
   82|  2.20M|    pnow->tv_usec = (int)(tsnow.tv_nsec / 1000);
   83|  2.20M|  }
   84|      0|  else
   85|      0|#endif
   86|       |
   87|      0|  if(
   88|       |#if defined(__APPLE__) && defined(HAVE_BUILTIN_AVAILABLE) && \
   89|       |  (HAVE_BUILTIN_AVAILABLE == 1)
   90|       |    have_clock_gettime &&
   91|       |#endif
   92|      0|    (clock_gettime(CLOCK_MONOTONIC, &tsnow) == 0)) {
  ------------------
  |  Branch (92:5): [True: 0, False: 0]
  ------------------
   93|      0|    pnow->tv_sec = tsnow.tv_sec;
   94|      0|    pnow->tv_usec = (int)(tsnow.tv_nsec / 1000);
   95|      0|  }
   96|       |  /*
   97|       |   * Even when the configure process has truly detected monotonic clock
   98|       |   * availability, it might happen that it is not actually available at
   99|       |   * runtime. When this occurs, fallback to other time source.
  100|       |   */
  101|      0|#ifdef HAVE_GETTIMEOFDAY
  102|      0|  else {
  103|      0|    struct timeval now;
  104|      0|    (void)gettimeofday(&now, NULL);
  105|      0|    pnow->tv_sec = now.tv_sec;
  106|      0|    pnow->tv_usec = (int)now.tv_usec;
  107|      0|  }
  108|       |#else
  109|       |  else {
  110|       |    pnow->tv_sec = time(NULL);
  111|       |    pnow->tv_usec = 0;
  112|       |  }
  113|       |#endif
  114|  2.20M|}
curlx_now:
  174|    852|{
  175|    852|  struct curltime now;
  176|    852|  curlx_pnow(&now);
  177|    852|  return now;
  178|    852|}
curlx_ptimediff_ms:
  188|  63.5k|{
  189|  63.5k|  timediff_t diff = (timediff_t)newer->tv_sec - older->tv_sec;
  190|  63.5k|  if(diff >= (TIMEDIFF_T_MAX / 1000))
  ------------------
  |  |   33|  63.5k|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  539|  63.5k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  |  Branch (190:6): [True: 0, False: 63.5k]
  ------------------
  191|      0|    return TIMEDIFF_T_MAX;
  ------------------
  |  |   33|      0|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  539|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  192|  63.5k|  else if(diff <= (TIMEDIFF_T_MIN / 1000))
  ------------------
  |  |   34|  63.5k|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  541|  63.5k|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|  63.5k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (192:11): [True: 0, False: 63.5k]
  ------------------
  193|      0|    return TIMEDIFF_T_MIN;
  ------------------
  |  |   34|      0|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  541|      0|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  194|  63.5k|  return (diff * 1000) + ((newer->tv_usec - older->tv_usec) / 1000);
  195|  63.5k|}
curlx_us_to_ceil_ms:
  218|  55.6k|{
  219|  55.6k|  return (us / 1000) + ((us > 0) && (us % 1000));
  ------------------
  |  Branch (219:25): [True: 55.6k, False: 0]
  |  Branch (219:37): [True: 55.5k, False: 41]
  ------------------
  220|  55.6k|}
curlx_ptimediff_us:
  228|  1.82M|{
  229|  1.82M|  timediff_t diff = (timediff_t)newer->tv_sec - older->tv_sec;
  230|  1.82M|  if(diff >= (TIMEDIFF_T_MAX / 1000000))
  ------------------
  |  |   33|  1.82M|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  539|  1.82M|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  |  Branch (230:6): [True: 0, False: 1.82M]
  ------------------
  231|      0|    return TIMEDIFF_T_MAX;
  ------------------
  |  |   33|      0|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  539|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  232|  1.82M|  else if(diff <= (TIMEDIFF_T_MIN / 1000000))
  ------------------
  |  |   34|  1.82M|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  541|  1.82M|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|  1.82M|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (232:11): [True: 0, False: 1.82M]
  ------------------
  233|      0|    return TIMEDIFF_T_MIN;
  ------------------
  |  |   34|      0|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  541|      0|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  1.82M|  return (diff * 1000000) + newer->tv_usec - older->tv_usec;
  235|  1.82M|}

curlx_uztosi:
   69|  87.4k|{
   70|  87.4k|  DEBUGASSERT(uznum <= (size_t)CURL_MASK_SINT);
  ------------------
  |  | 1016|  87.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (70:3): [True: 0, False: 87.4k]
  |  Branch (70:3): [True: 87.4k, False: 0]
  ------------------
   71|  87.4k|  return (int)(uznum & (size_t)CURL_MASK_SINT);
  ------------------
  |  |   44|  87.4k|#define CURL_MASK_SINT    (CURL_MASK_UINT >> 1)
  |  |  ------------------
  |  |  |  |   43|  87.4k|#define CURL_MASK_UINT    ((unsigned int)~0)
  |  |  ------------------
  ------------------
   72|  87.4k|}
curlx_sotouz:
  143|  52.5k|{
  144|  52.5k|  DEBUGASSERT(sonum >= 0);
  ------------------
  |  | 1016|  52.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (144:3): [True: 0, False: 52.5k]
  |  Branch (144:3): [True: 52.5k, False: 0]
  ------------------
  145|  52.5k|  return (size_t)(sonum & (curl_off_t)CURL_MASK_USIZE_T);
  ------------------
  |  |   48|  52.5k|#define CURL_MASK_USIZE_T ((size_t)~0)
  ------------------
  146|  52.5k|}
curlx_uitouz:
  183|  11.5k|{
  184|  11.5k|  return (size_t)uinum;
  185|  11.5k|}
curlx_sotouz_range:
  188|  4.46k|{
  189|  4.46k|  if(sonum < 0)
  ------------------
  |  Branch (189:6): [True: 0, False: 4.46k]
  ------------------
  190|      0|    return uzmin;
  191|       |#if SIZEOF_CURL_OFF_T > SIZEOF_SIZE_T
  192|       |  if(sonum > SIZE_MAX)
  193|       |    return uzmax;
  194|       |#endif
  195|  4.46k|  return CURLMIN(CURLMAX((size_t)sonum, uzmin), uzmax);
  ------------------
  |  | 1315|  8.92k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 1.39k, False: 3.06k]
  |  |  |  Branch (1315:25): [True: 4.46k, False: 0]
  |  |  |  Branch (1315:37): [True: 1.39k, False: 0]
  |  |  ------------------
  ------------------
  196|  4.46k|}
curlx_sztouz:
  199|  1.02M|{
  200|  1.02M|  if(sznum < 0) {
  ------------------
  |  Branch (200:6): [True: 16.7k, False: 1.00M]
  ------------------
  201|  16.7k|    *puznum = 0;
  202|  16.7k|    return FALSE;
  ------------------
  |  |  989|  16.7k|#define FALSE false
  ------------------
  203|  16.7k|  }
  204|  1.00M|  *puznum = (size_t)sznum;
  205|       |  return TRUE;
  ------------------
  |  |  986|  1.00M|#define TRUE true
  ------------------
  206|  1.02M|}

Curl_cw_out_done:
  495|  9.37k|{
  496|  9.37k|  struct Curl_cwriter *cw_out;
  497|  9.37k|  CURLcode result = CURLE_OK;
  498|       |
  499|  9.37k|  cw_out = Curl_cwriter_get_by_type(data, &Curl_cwt_out);
  500|  9.37k|  if(cw_out) {
  ------------------
  |  Branch (500:6): [True: 7.98k, False: 1.38k]
  ------------------
  501|  7.98k|    CURL_TRC_WRITE(data, "[OUT] done");
  ------------------
  |  |  158|  7.98k|  do {                                                     \
  |  |  159|  7.98k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|  7.98k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  15.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.98k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 725, False: 7.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  15.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 725, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    725|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  7.98k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    725|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 114, False: 611]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  7.98k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  7.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 7.98k]
  |  |  ------------------
  ------------------
  502|       |    result = Curl_client_flush(data, TRUE);
  ------------------
  |  |  986|  7.98k|#define TRUE true
  ------------------
  503|  7.98k|  }
  504|  9.37k|  return result;
  505|  9.37k|}
cw-out.c:cw_out_init:
  107|  9.37k|{
  108|  9.37k|  struct cw_out_ctx *ctx = writer->ctx;
  109|  9.37k|  (void)data;
  110|  9.37k|  ctx->buf = NULL;
  111|       |  ctx->tail = NULL;
  112|  9.37k|  ctx->buffered_len = 0;
  113|  9.37k|  return CURLE_OK;
  114|  9.37k|}
cw-out.c:cw_out_write:
  437|  36.6k|{
  438|  36.6k|  struct cw_out_ctx *ctx = writer->ctx;
  439|  36.6k|  CURLcode result;
  440|  36.6k|  bool flush_all = !!(type & CLIENTWRITE_EOS);
  ------------------
  |  |   50|  36.6k|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  441|       |
  442|  36.6k|  if((type & CLIENTWRITE_BODY) ||
  ------------------
  |  |   43|  36.6k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (442:6): [True: 650, False: 36.0k]
  ------------------
  443|  36.0k|     ((type & CLIENTWRITE_HEADER) && data->set.include_header)) {
  ------------------
  |  |   45|  36.0k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
  |  Branch (443:7): [True: 36.0k, False: 0]
  |  Branch (443:38): [True: 843, False: 35.1k]
  ------------------
  444|  1.49k|    cw_out_type otype = (!blen && (type & CLIENTWRITE_0LEN)) ?
  ------------------
  |  |   51|    533|#define CLIENTWRITE_0LEN    (1 << 8) /* write even 0-length buffers */
  ------------------
  |  Branch (444:26): [True: 533, False: 960]
  |  Branch (444:35): [True: 0, False: 533]
  ------------------
  445|  1.49k|                        CW_OUT_BODY_0LEN : CW_OUT_BODY;
  446|  1.49k|    result = cw_out_do_write(ctx, data, otype, flush_all, buf, blen);
  447|  1.49k|    if(result)
  ------------------
  |  Branch (447:8): [True: 10, False: 1.48k]
  ------------------
  448|     10|      return result;
  449|  1.49k|  }
  450|       |
  451|  36.6k|  if(type & (CLIENTWRITE_HEADER | CLIENTWRITE_INFO)) {
  ------------------
  |  |   45|  36.6k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
                if(type & (CLIENTWRITE_HEADER | CLIENTWRITE_INFO)) {
  ------------------
  |  |   44|  36.6k|#define CLIENTWRITE_INFO    (1 << 1) /* meta information, not a HEADER */
  ------------------
  |  Branch (451:6): [True: 36.0k, False: 650]
  ------------------
  452|  36.0k|    result = cw_out_do_write(ctx, data, CW_OUT_HDS, flush_all, buf, blen);
  453|  36.0k|    if(result)
  ------------------
  |  Branch (453:8): [True: 0, False: 36.0k]
  ------------------
  454|      0|      return result;
  455|  36.0k|  }
  456|       |
  457|  36.6k|  return CURLE_OK;
  458|  36.6k|}
cw-out.c:cw_out_do_write:
  386|  37.5k|{
  387|  37.5k|  CURLcode result = CURLE_OK;
  388|       |
  389|       |  /* if we have buffered data and the last chunk buffered is of a
  390|       |   * different type than what we are writing now, try to flush all */
  391|  37.5k|  if(ctx->tail && ctx->tail->type != otype) {
  ------------------
  |  Branch (391:6): [True: 0, False: 37.5k]
  |  Branch (391:19): [True: 0, False: 0]
  ------------------
  392|      0|    result = cw_out_flush_chain(ctx, data, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  393|      0|    if(result)
  ------------------
  |  Branch (393:8): [True: 0, False: 0]
  ------------------
  394|      0|      goto out;
  395|      0|  }
  396|       |
  397|  37.5k|  if(ctx->buf) {
  ------------------
  |  Branch (397:6): [True: 0, False: 37.5k]
  ------------------
  398|       |    /* still have buffered data, append and flush */
  399|      0|    result = cw_out_append(ctx, data, otype, buf, blen);
  400|      0|    if(result)
  ------------------
  |  Branch (400:8): [True: 0, False: 0]
  ------------------
  401|      0|      goto out;
  402|      0|    result = cw_out_flush_chain(ctx, data, flush_all);
  403|      0|    if(result)
  ------------------
  |  Branch (403:8): [True: 0, False: 0]
  ------------------
  404|      0|      goto out;
  405|      0|  }
  406|  37.5k|  else {
  407|       |    /* nothing buffered, try direct write */
  408|  37.5k|    size_t consumed;
  409|  37.5k|    result = cw_out_ptr_flush(ctx, data, otype, flush_all,
  410|  37.5k|                              buf, blen, &consumed);
  411|  37.5k|    if(result && (result != CURLE_AGAIN))
  ------------------
  |  Branch (411:8): [True: 10, False: 37.4k]
  |  Branch (411:18): [True: 10, False: 0]
  ------------------
  412|     10|      return result;
  413|  37.4k|    result = CURLE_OK;
  414|  37.4k|    if((consumed < blen) ||
  ------------------
  |  Branch (414:8): [True: 0, False: 37.4k]
  ------------------
  415|  37.4k|       ((otype == CW_OUT_BODY_0LEN) && data->req.writer.paused)) {
  ------------------
  |  Branch (415:9): [True: 0, False: 37.4k]
  |  Branch (415:40): [True: 0, False: 0]
  ------------------
  416|       |      /* did not write all or paused, append the rest */
  417|      0|      result = cw_out_append(ctx, data, otype,
  418|      0|                             buf + consumed, blen - consumed);
  419|      0|      if(result)
  ------------------
  |  Branch (419:10): [True: 0, False: 0]
  ------------------
  420|      0|        goto out;
  421|      0|    }
  422|  37.4k|  }
  423|       |
  424|  37.4k|out:
  425|  37.4k|  if(result) {
  ------------------
  |  Branch (425:6): [True: 0, False: 37.4k]
  ------------------
  426|       |    /* We do not want to invoke client callbacks a second time after
  427|       |     * encountering an error. See issue #13337 */
  428|       |    ctx->errored = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  429|      0|    cw_out_bufs_free(ctx);
  430|      0|  }
  431|  37.4k|  return result;
  432|  37.5k|}
cw-out.c:cw_out_ptr_flush:
  228|  37.5k|{
  229|  37.5k|  curl_write_callback wcb = NULL;
  230|  37.5k|  void *wcb_data;
  231|  37.5k|  size_t max_write, min_write;
  232|  37.5k|  size_t wlen, nwritten = 0;
  233|  37.5k|  CURLcode result = CURLE_OK;
  234|       |
  235|       |  /* If we errored once, we do not invoke the client callback again */
  236|  37.5k|  if(ctx->errored)
  ------------------
  |  Branch (236:6): [True: 0, False: 37.5k]
  ------------------
  237|      0|    return CURLE_WRITE_ERROR;
  238|       |
  239|       |  /* write callbacks may get NULLed by the client between calls. */
  240|  37.5k|  cw_get_writefunc(data, otype, &wcb, &wcb_data, &max_write, &min_write);
  241|  37.5k|  if(!wcb) {
  ------------------
  |  Branch (241:6): [True: 0, False: 37.5k]
  ------------------
  242|      0|    *pconsumed = blen;
  243|      0|    return CURLE_OK;
  244|      0|  }
  245|       |
  246|  37.5k|  *pconsumed = 0;
  247|  37.5k|  if(otype == CW_OUT_BODY_0LEN) {
  ------------------
  |  Branch (247:6): [True: 0, False: 37.5k]
  ------------------
  248|      0|    DEBUGASSERT(!blen);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (248:5): [True: 0, False: 0]
  |  Branch (248:5): [True: 0, False: 0]
  ------------------
  249|      0|    if(!data->req.writer.paused) {
  ------------------
  |  Branch (249:8): [True: 0, False: 0]
  ------------------
  250|      0|      return cw_out_cb_write(data, wcb, wcb_data, otype,
  251|      0|                             buf, blen, &nwritten);
  252|      0|    }
  253|      0|  }
  254|  37.5k|  else {
  255|  74.4k|    while(blen && !data->req.writer.paused) {
  ------------------
  |  Branch (255:11): [True: 36.9k, False: 37.4k]
  |  Branch (255:19): [True: 36.9k, False: 0]
  ------------------
  256|  36.9k|      if(!flush_all && blen < min_write)
  ------------------
  |  Branch (256:10): [True: 36.9k, False: 0]
  |  Branch (256:24): [True: 0, False: 36.9k]
  ------------------
  257|      0|        break;
  258|  36.9k|      wlen = max_write ? CURLMIN(blen, max_write) : blen;
  ------------------
  |  | 1315|    960|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 960, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (258:14): [True: 960, False: 36.0k]
  ------------------
  259|  36.9k|      if(otype == CW_OUT_BODY)
  ------------------
  |  Branch (259:10): [True: 960, False: 36.0k]
  ------------------
  260|    960|        result = Curl_pgrs_deliver_check(data, wlen);
  261|  36.9k|      if(!result)
  ------------------
  |  Branch (261:10): [True: 36.9k, False: 10]
  ------------------
  262|  36.9k|        result = cw_out_cb_write(data, wcb, wcb_data, otype,
  263|  36.9k|                                 buf, wlen, &nwritten);
  264|  36.9k|      if(result)
  ------------------
  |  Branch (264:10): [True: 10, False: 36.9k]
  ------------------
  265|     10|        return result;
  266|  36.9k|      if(otype == CW_OUT_BODY)
  ------------------
  |  Branch (266:10): [True: 950, False: 36.0k]
  ------------------
  267|    950|        Curl_pgrs_deliver_inc(data, nwritten);
  268|  36.9k|      *pconsumed += nwritten;
  269|  36.9k|      blen -= nwritten;
  270|  36.9k|      buf += nwritten;
  271|       |      /* write functions/data may have been re-setopt'ed. sigh. */
  272|  36.9k|      cw_get_writefunc(data, otype, &wcb, &wcb_data, &max_write, &min_write);
  273|  36.9k|      if(!wcb) {
  ------------------
  |  Branch (273:10): [True: 0, False: 36.9k]
  ------------------
  274|      0|        *pconsumed += blen;
  275|      0|        break;
  276|      0|      }
  277|  36.9k|    }
  278|  37.5k|  }
  279|  37.4k|  return CURLE_OK;
  280|  37.5k|}
cw-out.c:cw_get_writefunc:
  141|  74.4k|{
  142|  74.4k|  switch(otype) {
  143|  2.44k|  case CW_OUT_BODY:
  ------------------
  |  Branch (143:3): [True: 2.44k, False: 72.0k]
  ------------------
  144|  2.44k|  case CW_OUT_BODY_0LEN:
  ------------------
  |  Branch (144:3): [True: 0, False: 74.4k]
  ------------------
  145|  2.44k|    if(Curl_ftp_listmode(data)) {
  ------------------
  |  Branch (145:8): [True: 0, False: 2.44k]
  ------------------
  146|      0|      *pwcb = Curl_ftp_parselist;
  147|      0|      *pwcb_data = data;
  148|      0|    }
  149|  2.44k|    else {
  150|  2.44k|      *pwcb = data->set.fwrite_func;
  151|  2.44k|      *pwcb_data = data->set.out;
  152|  2.44k|    }
  153|  2.44k|    *pmax_write = CURL_MAX_WRITE_SIZE;
  ------------------
  |  |  267|  2.44k|#define CURL_MAX_WRITE_SIZE 16384
  ------------------
  154|       |    /* if we ever want buffering of BODY output, we can set `min_write`
  155|       |     * the preferred size. The default should always be to pass data
  156|       |     * to the client as it comes without delay */
  157|  2.44k|    *pmin_write = 0;
  158|  2.44k|    break;
  159|  72.0k|  case CW_OUT_HDS:
  ------------------
  |  Branch (159:3): [True: 72.0k, False: 2.44k]
  ------------------
  160|  72.0k|    *pwcb = data->set.fwrite_header ? data->set.fwrite_header :
  ------------------
  |  Branch (160:13): [True: 72.0k, False: 0]
  ------------------
  161|  72.0k|             (data->set.writeheader ? data->set.fwrite_func : NULL);
  ------------------
  |  Branch (161:15): [True: 0, False: 0]
  ------------------
  162|  72.0k|    *pwcb_data = data->set.writeheader;
  163|  72.0k|    *pmax_write = 0; /* do not chunk-write headers, write them as they are */
  164|  72.0k|    *pmin_write = 0;
  165|  72.0k|    break;
  166|      0|  default:
  ------------------
  |  Branch (166:3): [True: 0, False: 74.4k]
  ------------------
  167|      0|    *pwcb = NULL;
  168|      0|    *pwcb_data = NULL;
  169|      0|    *pmax_write = CURL_MAX_WRITE_SIZE;
  ------------------
  |  |  267|      0|#define CURL_MAX_WRITE_SIZE 16384
  ------------------
  170|      0|    *pmin_write = 0;
  171|  74.4k|  }
  172|  74.4k|}
cw-out.c:cw_out_cb_write:
  180|  36.9k|{
  181|  36.9k|  size_t nwritten;
  182|  36.9k|  CURLcode result;
  183|       |
  184|  36.9k|  NOVERBOSE((void)otype);
  ------------------
  |  | 1638|  36.9k|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1199|  36.9k|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:35): [Folded, False: 36.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|       |
  186|  36.9k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  36.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (186:3): [True: 0, False: 36.9k]
  |  Branch (186:3): [True: 36.9k, False: 0]
  ------------------
  187|  36.9k|  *pnwritten = 0;
  188|  36.9k|  {
  189|  36.9k|    struct Curl_mapi_guard guard;
  190|  36.9k|    CURL_CBAPI_START(&guard, data, easy_cw_out_cb);
  ------------------
  |  |  201|  36.9k|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
  191|  36.9k|    nwritten = wcb((char *)CURL_UNCONST(buf), 1, blen, wcb_data);
  ------------------
  |  |  793|  36.9k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  192|  36.9k|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|  36.9k|  Curl_cbapi_leave(g)
  ------------------
  193|  36.9k|  }
  194|  36.9k|  CURL_TRC_WRITE(data, "[OUT] wrote %zu %s bytes, type=%x -> %zu",
  ------------------
  |  |  158|  36.9k|  do {                                                     \
  |  |  159|  36.9k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|  36.9k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  73.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 36.9k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 16.4k, False: 20.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  73.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 16.4k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  16.4k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  36.9k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  16.4k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 14.1k, False: 2.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  36.9k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (160:28): [True: 14.0k, False: 168]
  |  |  ------------------
  |  |  161|  36.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 36.9k]
  |  |  ------------------
  ------------------
  195|  36.9k|                 blen, (otype == CW_OUT_HDS) ? "header" : "body",
  196|  36.9k|                 (unsigned int)otype, nwritten);
  197|  36.9k|  if(nwritten == CURL_WRITEFUNC_PAUSE) {
  ------------------
  |  |  279|  36.9k|#define CURL_WRITEFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (197:6): [True: 0, False: 36.9k]
  ------------------
  198|      0|    if(data->conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  221|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (198:8): [True: 0, False: 0]
  ------------------
  199|       |      /* Protocols that work without network cannot be paused. This is
  200|       |         actually only file:// now, and it cannot pause since the transfer is
  201|       |         not done using the "normal" procedure. */
  202|      0|      failf(data, "Write callback asked for PAUSE when not supported");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  203|      0|      return CURLE_WRITE_ERROR;
  204|      0|    }
  205|      0|    CURL_TRC_WRITE(data, "[OUT] PAUSE requested by client");
  ------------------
  |  |  158|      0|  do {                                                     \
  |  |  159|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|      0|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  206|      0|    result = Curl_xfer_pause_recv(data, TRUE, FALSE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
                  result = Curl_xfer_pause_recv(data, TRUE, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  207|      0|    return result ? result : CURLE_AGAIN;
  ------------------
  |  Branch (207:12): [True: 0, False: 0]
  ------------------
  208|      0|  }
  209|  36.9k|  else if(nwritten == CURL_WRITEFUNC_ERROR) {
  ------------------
  |  |  283|  36.9k|#define CURL_WRITEFUNC_ERROR 0xFFFFFFFF
  ------------------
  |  Branch (209:11): [True: 0, False: 36.9k]
  ------------------
  210|      0|    failf(data, "client returned ERROR on write of %zu bytes", blen);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  211|      0|    return CURLE_WRITE_ERROR;
  212|      0|  }
  213|  36.9k|  else if(nwritten != blen) {
  ------------------
  |  Branch (213:11): [True: 0, False: 36.9k]
  ------------------
  214|      0|    failf(data, "Failure writing output to destination, "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  215|      0|          "passed %zu returned %zu", blen, nwritten);
  216|      0|    return CURLE_WRITE_ERROR;
  217|      0|  }
  218|  36.9k|  *pnwritten = nwritten;
  219|  36.9k|  return CURLE_OK;
  220|  36.9k|}
cw-out.c:cw_out_bufs_free:
  117|  9.37k|{
  118|  9.37k|  while(ctx->buf) {
  ------------------
  |  Branch (118:9): [True: 0, False: 9.37k]
  ------------------
  119|      0|    struct cw_out_buf *next = ctx->buf->next;
  120|      0|    cw_out_buf_free(ctx->buf);
  121|      0|    ctx->buf = next;
  122|      0|  }
  123|       |  ctx->tail = NULL;
  124|  9.37k|  ctx->buffered_len = 0;
  125|  9.37k|}
cw-out.c:cw_out_do_flush:
  463|  7.98k|{
  464|  7.98k|  struct cw_out_ctx *ctx = (struct cw_out_ctx *)cw_out;
  465|       |
  466|  7.98k|  if(ctx->errored)
  ------------------
  |  Branch (466:6): [True: 0, False: 7.98k]
  ------------------
  467|      0|    return CURLE_WRITE_ERROR;
  468|       |
  469|  7.98k|  if(!data->req.writer.paused && ctx->buf) {
  ------------------
  |  Branch (469:6): [True: 7.98k, False: 0]
  |  Branch (469:34): [True: 0, False: 7.98k]
  ------------------
  470|      0|    CURLcode result;
  471|       |
  472|      0|    CURL_TRC_WRITE(data, "[OUT] flush");
  ------------------
  |  |  158|      0|  do {                                                     \
  |  |  159|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|      0|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  473|      0|    result = cw_out_flush_chain(ctx, data, flush_all);
  474|      0|    if(result) {
  ------------------
  |  Branch (474:8): [True: 0, False: 0]
  ------------------
  475|      0|      ctx->errored = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  476|      0|      cw_out_bufs_free(ctx);
  477|      0|      return result;
  478|      0|    }
  479|      0|  }
  480|  7.98k|  return CURLE_OK;
  481|  7.98k|}
cw-out.c:cw_out_close:
  128|  9.37k|{
  129|  9.37k|  struct cw_out_ctx *ctx = writer->ctx;
  130|       |
  131|  9.37k|  (void)data;
  132|  9.37k|  cw_out_bufs_free(ctx);
  133|  9.37k|}

Curl_dynhds_init:
   63|  20.2k|{
   64|  20.2k|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1016|  20.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (64:3): [True: 0, False: 20.2k]
  |  Branch (64:3): [True: 20.2k, False: 0]
  ------------------
   65|  20.2k|  dynhds->hds = NULL;
   66|  20.2k|  dynhds->hds_len = dynhds->hds_allc = dynhds->strs_len = 0;
   67|  20.2k|  dynhds->max_entries = max_entries ? max_entries : UINT32_MAX;
  ------------------
  |  Branch (67:25): [True: 0, False: 20.2k]
  ------------------
   68|  20.2k|  dynhds->max_strs_size = max_strs_size ? max_strs_size : UINT32_MAX;
  ------------------
  |  Branch (68:27): [True: 20.2k, False: 0]
  ------------------
   69|  20.2k|  dynhds->opts = 0;
   70|  20.2k|}
Curl_dynhds_reset:
   73|  22.1k|{
   74|  22.1k|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1016|  22.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (74:3): [True: 0, False: 22.1k]
  |  Branch (74:3): [True: 22.1k, False: 0]
  ------------------
   75|  22.1k|  if(dynhds->hds_len) {
  ------------------
  |  Branch (75:6): [True: 11.0k, False: 11.1k]
  ------------------
   76|  11.0k|    size_t i;
   77|  11.0k|    DEBUGASSERT(dynhds->hds);
  ------------------
  |  | 1016|  11.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:5): [True: 0, False: 11.0k]
  |  Branch (77:5): [True: 11.0k, False: 0]
  ------------------
   78|  62.6k|    for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (78:16): [True: 51.6k, False: 11.0k]
  ------------------
   79|  51.6k|      entry_free(dynhds->hds[i]);
   80|  51.6k|      dynhds->hds[i] = NULL;
   81|  51.6k|    }
   82|  11.0k|  }
   83|  22.1k|  dynhds->hds_len = dynhds->strs_len = 0;
   84|  22.1k|}
Curl_dynhds_cleanup:
   87|  20.2k|{
   88|  20.2k|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1016|  20.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (88:3): [True: 0, False: 20.2k]
  |  Branch (88:3): [True: 20.2k, False: 0]
  ------------------
   89|  20.2k|  Curl_dynhds_reset(dynhds);
   90|       |  curlx_safefree(dynhds->hds);
  ------------------
  |  | 1359|  20.2k|  do {                      \
  |  | 1360|  20.2k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  20.2k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  20.2k|    (ptr) = NULL;           \
  |  | 1362|  20.2k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 20.2k]
  |  |  ------------------
  ------------------
   91|  20.2k|  dynhds->hds_allc = 0;
   92|  20.2k|}
Curl_dynhds_count:
   95|  3.85k|{
   96|  3.85k|  return dynhds->hds_len;
   97|  3.85k|}
Curl_dynhds_set_opts:
  100|  1.92k|{
  101|  1.92k|  dynhds->opts = opts;
  102|  1.92k|}
Curl_dynhds_getn:
  105|  15.2k|{
  106|  15.2k|  DEBUGASSERT(dynhds);
  ------------------
  |  | 1016|  15.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (106:3): [True: 0, False: 15.2k]
  |  Branch (106:3): [True: 15.2k, False: 0]
  ------------------
  107|  15.2k|  return (n < dynhds->hds_len) ? dynhds->hds[n] : NULL;
  ------------------
  |  Branch (107:10): [True: 15.2k, False: 0]
  ------------------
  108|  15.2k|}
Curl_dynhds_get:
  112|  9.12k|{
  113|  9.12k|  size_t i;
  114|  44.8k|  for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (114:14): [True: 37.9k, False: 6.95k]
  ------------------
  115|  37.9k|    if(dynhds->hds[i]->namelen == namelen &&
  ------------------
  |  Branch (115:8): [True: 2.17k, False: 35.7k]
  ------------------
  116|  2.17k|       curl_strnequal(dynhds->hds[i]->name, name, namelen)) {
  ------------------
  |  Branch (116:8): [True: 2.17k, False: 0]
  ------------------
  117|  2.17k|      return dynhds->hds[i];
  118|  2.17k|    }
  119|  37.9k|  }
  120|  6.95k|  return NULL;
  121|  9.12k|}
Curl_dynhds_add:
  131|  51.6k|{
  132|  51.6k|  struct dynhds_entry *entry = NULL;
  133|  51.6k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  134|  51.6k|  uint32_t nlen, vlen;
  135|       |
  136|       |  /* Accept NULL value with length 0, name must have length */
  137|  51.6k|  if(!dynhds || !name || !namelen || (!value && valuelen)) {
  ------------------
  |  Branch (137:6): [True: 0, False: 51.6k]
  |  Branch (137:17): [True: 0, False: 51.6k]
  |  Branch (137:26): [True: 0, False: 51.6k]
  |  Branch (137:39): [True: 0, False: 51.6k]
  |  Branch (137:49): [True: 0, False: 0]
  ------------------
  138|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (138:5): [Folded, False: 0]
  |  Branch (138:5): [Folded, False: 0]
  ------------------
  139|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  140|      0|  }
  141|  51.6k|  if((namelen > UINT32_MAX) || (valuelen > UINT32_MAX))
  ------------------
  |  Branch (141:6): [True: 0, False: 51.6k]
  |  Branch (141:32): [True: 0, False: 51.6k]
  ------------------
  142|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  143|  51.6k|  nlen = (uint32_t)namelen;
  144|  51.6k|  vlen = (uint32_t)valuelen;
  145|       |
  146|       |  /* Does the new header fit into the limits? */
  147|  51.6k|  if((dynhds->hds_len >= dynhds->max_entries) ||
  ------------------
  |  Branch (147:6): [True: 0, False: 51.6k]
  ------------------
  148|  51.6k|     (dynhds->max_strs_size - dynhds->strs_len < nlen) ||
  ------------------
  |  Branch (148:6): [True: 0, False: 51.6k]
  ------------------
  149|  51.6k|     (dynhds->max_strs_size - dynhds->strs_len - nlen < vlen))
  ------------------
  |  Branch (149:6): [True: 0, False: 51.6k]
  ------------------
  150|      0|    return CURLE_OUT_OF_MEMORY;
  151|       |
  152|  51.6k|  entry = entry_new(name, nlen, value, vlen, dynhds->opts);
  153|  51.6k|  if(!entry)
  ------------------
  |  Branch (153:6): [True: 7, False: 51.6k]
  ------------------
  154|      7|    goto out;
  155|       |
  156|  51.6k|  if((dynhds->hds_allc - dynhds->hds_len) < 1) {
  ------------------
  |  Branch (156:6): [True: 11.0k, False: 40.5k]
  ------------------
  157|  11.0k|    struct dynhds_entry **nhds;
  158|  11.0k|    uint32_t nhds_allc;
  159|       |
  160|       |    /* start with room for 16 headers, then double, add max 512 new ones
  161|       |     * or what the limit still allows. */
  162|  11.0k|    if(dynhds->hds_allc) {
  ------------------
  |  Branch (162:8): [True: 2, False: 11.0k]
  ------------------
  163|      2|      uint32_t max_grow =
  164|      2|        CURLMIN(dynhds->max_entries - dynhds->hds_allc, 512);
  ------------------
  |  | 1315|      2|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  165|      2|      nhds_allc = dynhds->hds_allc + CURLMIN(dynhds->hds_allc, max_grow);
  ------------------
  |  | 1315|      2|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  166|      2|    }
  167|  11.0k|    else
  168|  11.0k|      nhds_allc = 16;
  169|       |
  170|  11.0k|    nhds = curlx_calloc(nhds_allc, sizeof(struct dynhds_entry *));
  ------------------
  |  | 1500|  11.0k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  171|  11.0k|    if(!nhds)
  ------------------
  |  Branch (171:8): [True: 1, False: 11.0k]
  ------------------
  172|      1|      goto out;
  173|  11.0k|    if(dynhds->hds) {
  ------------------
  |  Branch (173:8): [True: 2, False: 11.0k]
  ------------------
  174|      2|      memcpy(nhds, dynhds->hds,
  175|      2|             dynhds->hds_len * sizeof(struct dynhds_entry *));
  176|      2|      curlx_safefree(dynhds->hds);
  ------------------
  |  | 1359|      2|  do {                      \
  |  | 1360|      2|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      2|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      2|    (ptr) = NULL;           \
  |  | 1362|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
  177|      2|    }
  178|  11.0k|    dynhds->hds = nhds;
  179|  11.0k|    dynhds->hds_allc = nhds_allc;
  180|  11.0k|  }
  181|  51.6k|  dynhds->hds[dynhds->hds_len++] = entry;
  182|  51.6k|  entry = NULL;
  183|  51.6k|  dynhds->strs_len += nlen + vlen;
  184|  51.6k|  result = CURLE_OK;
  185|       |
  186|  51.6k|out:
  187|  51.6k|  if(entry)
  ------------------
  |  Branch (187:6): [True: 1, False: 51.6k]
  ------------------
  188|      1|    entry_free(entry);
  189|  51.6k|  return result;
  190|  51.6k|}
Curl_dynhds_cadd:
  194|  36.0k|{
  195|  36.0k|  if(!name)
  ------------------
  |  Branch (195:6): [True: 0, False: 36.0k]
  ------------------
  196|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  197|  36.0k|  return Curl_dynhds_add(dynhds, name, strlen(name),
  198|  36.0k|                         value, value ? strlen(value) : 0);
  ------------------
  |  Branch (198:33): [True: 36.0k, False: 0]
  ------------------
  199|  36.0k|}
Curl_dynhds_h1_add_line:
  203|  5.03k|{
  204|  5.03k|  const char *p;
  205|  5.03k|  const char *name;
  206|  5.03k|  size_t namelen;
  207|  5.03k|  const char *value;
  208|  5.03k|  size_t valuelen, i;
  209|       |
  210|  5.03k|  if(!line || !line_len)
  ------------------
  |  Branch (210:6): [True: 0, False: 5.03k]
  |  Branch (210:15): [True: 0, False: 5.03k]
  ------------------
  211|      0|    return CURLE_OK;
  212|       |
  213|  5.03k|  p = memchr(line, ':', line_len);
  214|  5.03k|  if(!p || p == line)
  ------------------
  |  Branch (214:6): [True: 5, False: 5.03k]
  |  Branch (214:12): [True: 0, False: 5.03k]
  ------------------
  215|      5|    return CURLE_BAD_FUNCTION_ARGUMENT;
  216|  5.03k|  name = line;
  217|  5.03k|  namelen = p - line;
  218|  5.03k|  p++; /* move past the colon */
  219|  10.0k|  for(i = namelen + 1; i < line_len; ++i, ++p) {
  ------------------
  |  Branch (219:24): [True: 10.0k, False: 26]
  ------------------
  220|  10.0k|    if(!ISBLANK(*p))
  ------------------
  |  |   43|  10.0k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 5.00k, False: 5.00k]
  |  |  |  Branch (43:38): [True: 5, False: 5.00k]
  |  |  ------------------
  ------------------
  221|  5.00k|      break;
  222|  10.0k|  }
  223|  5.03k|  value = p;
  224|  5.03k|  valuelen = line_len - i;
  225|       |
  226|  5.03k|  p = memchr(value, '\r', valuelen);
  227|  5.03k|  if(!p)
  ------------------
  |  Branch (227:6): [True: 4.78k, False: 250]
  ------------------
  228|  4.78k|    p = memchr(value, '\n', valuelen);
  229|  5.03k|  if(p)
  ------------------
  |  Branch (229:6): [True: 250, False: 4.78k]
  ------------------
  230|    250|    valuelen = (size_t)(p - value);
  231|       |
  232|  5.03k|  return Curl_dynhds_add(dynhds, name, namelen, value, valuelen);
  233|  5.03k|}
Curl_dynhds_h1_cadd_line:
  236|    247|{
  237|    247|  return Curl_dynhds_h1_add_line(dynhds, line, line ? strlen(line) : 0);
  ------------------
  |  Branch (237:48): [True: 247, False: 0]
  ------------------
  238|    247|}
Curl_dynhds_h1_dprint:
  360|  7.19k|{
  361|  7.19k|  CURLcode result = CURLE_OK;
  362|  7.19k|  size_t i;
  363|       |
  364|  7.19k|  if(!dynhds->hds_len)
  ------------------
  |  Branch (364:6): [True: 0, False: 7.19k]
  ------------------
  365|      0|    return result;
  366|       |
  367|  43.4k|  for(i = 0; i < dynhds->hds_len; ++i) {
  ------------------
  |  Branch (367:14): [True: 36.2k, False: 7.19k]
  ------------------
  368|  36.2k|    result = curlx_dyn_addn(dbuf, dynhds->hds[i]->name,
  369|  36.2k|                            dynhds->hds[i]->namelen);
  370|  36.2k|    if(!result)
  ------------------
  |  Branch (370:8): [True: 36.2k, False: 3]
  ------------------
  371|  36.2k|      result = curlx_dyn_addn(dbuf, STRCONST(": "));
  ------------------
  |  | 1324|  36.2k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  36.2k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  372|  36.2k|    if(!result)
  ------------------
  |  Branch (372:8): [True: 36.2k, False: 3]
  ------------------
  373|  36.2k|      result = curlx_dyn_addn(dbuf, dynhds->hds[i]->value,
  374|  36.2k|                              dynhds->hds[i]->valuelen);
  375|  36.2k|    if(!result)
  ------------------
  |  Branch (375:8): [True: 36.2k, False: 3]
  ------------------
  376|  36.2k|      result = curlx_dyn_addn(dbuf, STRCONST("\r\n"));
  ------------------
  |  | 1324|  36.2k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  36.2k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  377|  36.2k|    if(result)
  ------------------
  |  Branch (377:8): [True: 3, False: 36.2k]
  ------------------
  378|      3|      break;
  379|  36.2k|  }
  380|       |
  381|  7.19k|  return result;
  382|  7.19k|}
Curl_dynhds_add_slist:
  388|  9.14k|{
  389|  9.14k|  CURLcode result;
  390|       |
  391|  10.0k|  for(; headers; headers = headers->next) {
  ------------------
  |  Branch (391:9): [True: 909, False: 9.14k]
  ------------------
  392|    909|    struct Curl_str name, value;
  393|    909|    const char *ptr = headers->data;
  394|    909|    size_t hlen = strlen(headers->data);
  395|       |
  396|    909|    value.str = NULL;
  397|    909|    value.len = 0;
  398|       |    /* There are 2 quirks in place for custom headers:
  399|       |     * 1. setting only 'name:' to suppress a header from being sent
  400|       |     * 2. setting only 'name;' to send an empty (illegal) header
  401|       |     */
  402|    909|    if(!curlx_str_until(&ptr, &name, hlen, ';') &&
  ------------------
  |  Branch (402:8): [True: 252, False: 657]
  ------------------
  403|    252|       !curlx_str_single(&ptr, ';') &&
  ------------------
  |  Branch (403:8): [True: 2, False: 250]
  ------------------
  404|      2|       !curlx_str_single(&ptr, '\0') &&
  ------------------
  |  Branch (404:8): [True: 0, False: 2]
  ------------------
  405|      0|       !memchr(curlx_str(&name), ':', curlx_strlen(&name))) {
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
                     !memchr(curlx_str(&name), ':', curlx_strlen(&name))) {
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (405:8): [True: 0, False: 0]
  ------------------
  406|       |      /* quirk #2, send an empty header */
  407|      0|      value.str = "";
  408|      0|      value.len = 0;
  409|      0|    }
  410|    909|    else {
  411|    909|      ptr = headers->data;
  412|    909|      if(!curlx_str_until(&ptr, &name, hlen, ':') &&
  ------------------
  |  Branch (412:10): [True: 254, False: 655]
  ------------------
  413|    254|         !curlx_str_single(&ptr, ':')) {
  ------------------
  |  Branch (413:10): [True: 68, False: 186]
  ------------------
  414|     68|        curlx_str_untilnl(&ptr, &value, hlen);
  415|     68|        curlx_str_trimblanks(&value);
  416|     68|        if(!curlx_strlen(&value))
  ------------------
  |  |   50|     68|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (416:12): [True: 0, False: 68]
  ------------------
  417|       |          /* quirk #1, do not send this */
  418|      0|          continue;
  419|     68|      }
  420|    841|      else
  421|       |        /* no colon */
  422|    841|        continue;
  423|    909|    }
  424|       |
  425|     68|    DEBUGASSERT(curlx_strlen(&name) && value.str);
  ------------------
  |  | 1016|     68|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (425:5): [True: 0, False: 68]
  |  Branch (425:5): [True: 0, False: 0]
  |  Branch (425:5): [True: 68, False: 0]
  |  Branch (425:5): [True: 68, False: 0]
  ------------------
  426|       |    /* trim surrounding whitespace so a padded field name to
  427|       |     * prevent the name form passing checks */
  428|     68|    curlx_str_trimblanks(&name);
  429|     68|    if(!curlx_strlen(&name))
  ------------------
  |  |   50|     68|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (429:8): [True: 0, False: 68]
  ------------------
  430|      0|      continue;
  431|       |
  432|     68|    if(hd_cb) {
  ------------------
  |  Branch (432:8): [True: 68, False: 0]
  ------------------
  433|     68|      result = hd_cb(user_data, &name, &value, headers->data);
  434|     68|      if(result == CURLE_AGAIN)
  ------------------
  |  Branch (434:10): [True: 68, False: 0]
  ------------------
  435|     68|        continue;
  436|      0|      else if(result)
  ------------------
  |  Branch (436:15): [True: 0, False: 0]
  ------------------
  437|      0|        return result;
  438|     68|    }
  439|       |
  440|      0|    if(dynhds) {
  ------------------
  |  Branch (440:8): [True: 0, False: 0]
  ------------------
  441|      0|      result = Curl_dynhds_add(dynhds, curlx_str(&name), curlx_strlen(&name),
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
                    result = Curl_dynhds_add(dynhds, curlx_str(&name), curlx_strlen(&name),
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  442|      0|                               curlx_str(&value), curlx_strlen(&value));
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
                                             curlx_str(&value), curlx_strlen(&value));
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
  443|      0|      if(result)
  ------------------
  |  Branch (443:10): [True: 0, False: 0]
  ------------------
  444|      0|        return result;
  445|      0|    }
  446|      0|  }
  447|  9.14k|  return CURLE_OK;
  448|  9.14k|}
dynhds.c:entry_free:
   57|  51.6k|{
   58|  51.6k|  curlx_free(e);
  ------------------
  |  | 1503|  51.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   59|  51.6k|}
dynhds.c:entry_new:
   33|  51.6k|{
   34|  51.6k|  struct dynhds_entry *e;
   35|  51.6k|  char *p;
   36|       |
   37|       |  /* namelen + valuelen <= SIZE_MAX has already been checked by caller */
   38|  51.6k|  if((SIZE_MAX - namelen - valuelen) < (sizeof(*e) + 2))
  ------------------
  |  Branch (38:6): [True: 0, False: 51.6k]
  ------------------
   39|      0|    return NULL;
   40|  51.6k|  e = curlx_calloc(1, sizeof(*e) + namelen + valuelen + 2);
  ------------------
  |  | 1500|  51.6k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   41|  51.6k|  if(!e)
  ------------------
  |  Branch (41:6): [True: 7, False: 51.6k]
  ------------------
   42|      7|    return NULL;
   43|  51.6k|  e->name = p = (char *)e + sizeof(*e);
   44|  51.6k|  memcpy(p, name, namelen);
   45|  51.6k|  e->namelen = namelen;
   46|  51.6k|  e->value = p += namelen + 1; /* leave a \0 at the end of name */
   47|  51.6k|  if(valuelen) {
  ------------------
  |  Branch (47:6): [True: 51.5k, False: 42]
  ------------------
   48|  51.5k|    memcpy(p, value, valuelen);
   49|  51.5k|    e->valuelen = valuelen;
   50|  51.5k|  }
   51|  51.6k|  if(opts & DYNHDS_OPT_LOWERCASE)
  ------------------
  |  |   54|  51.6k|#define DYNHDS_OPT_LOWERCASE     (1U << 0)
  ------------------
  |  Branch (51:6): [True: 10.5k, False: 41.0k]
  ------------------
   52|  10.5k|    Curl_strntolower(e->name, e->name, e->namelen);
   53|  51.6k|  return e;
   54|  51.6k|}

curl_global_init_mem:
  252|      2|{
  253|      2|  CURLcode result;
  254|       |
  255|       |  /* Invalid input, return immediately */
  256|      2|  if(!m || !f || !r || !s || !c)
  ------------------
  |  Branch (256:6): [True: 0, False: 2]
  |  Branch (256:12): [True: 0, False: 2]
  |  Branch (256:18): [True: 0, False: 2]
  |  Branch (256:24): [True: 0, False: 2]
  |  Branch (256:30): [True: 0, False: 2]
  ------------------
  257|      0|    return CURLE_FAILED_INIT;
  258|       |
  259|      2|  global_init_lock();
  ------------------
  |  |   92|      2|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  260|       |
  261|      2|  if(initialized) {
  ------------------
  |  Branch (261:6): [True: 0, False: 2]
  ------------------
  262|       |    /* Already initialized, do not do it again, but bump the variable anyway to
  263|       |       work like curl_global_init() and require the same amount of cleanup
  264|       |       calls. */
  265|      0|    initialized++;
  266|      0|    global_init_unlock();
  ------------------
  |  |   93|      0|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  267|      0|    return CURLE_OK;
  268|      0|  }
  269|       |
  270|       |  /* set memory functions before global_init() in case it wants memory
  271|       |     functions */
  272|      2|  Curl_cmalloc = m;
  273|      2|  Curl_cfree = f;
  274|      2|  Curl_cstrdup = s;
  275|      2|  Curl_crealloc = r;
  276|      2|  Curl_ccalloc = c;
  277|       |
  278|       |  /* Call the actual init function, but without setting */
  279|      2|  result = global_init(flags, FALSE);
  ------------------
  |  |  989|      2|#define FALSE false
  ------------------
  280|       |
  281|      2|  global_init_unlock();
  ------------------
  |  |   93|      2|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  282|       |
  283|      2|  return result;
  284|      2|}
curl_global_trace:
  331|  20.9k|{
  332|  20.9k|#ifndef CURL_DISABLE_VERBOSE_STRINGS
  333|  20.9k|  CURLcode result;
  334|  20.9k|  global_init_lock();
  ------------------
  |  |   92|  20.9k|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  335|       |
  336|  20.9k|  result = Curl_trc_opt(config);
  337|       |
  338|  20.9k|  global_init_unlock();
  ------------------
  |  |   93|  20.9k|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  339|       |
  340|  20.9k|  return result;
  341|       |#else
  342|       |  (void)config;
  343|       |  return CURLE_OK;
  344|       |#endif
  345|  20.9k|}
curl_easy_init:
  369|  19.8k|{
  370|  19.8k|  CURLcode result;
  371|  19.8k|  struct Curl_easy *data;
  372|       |
  373|       |  /* Make sure we inited the global SSL stuff */
  374|  19.8k|  global_init_lock();
  ------------------
  |  |   92|  19.8k|#define global_init_lock()   curl_simple_lock_lock(&s_lock)
  ------------------
  375|       |
  376|  19.8k|  if(!initialized) {
  ------------------
  |  Branch (376:6): [True: 0, False: 19.8k]
  ------------------
  377|      0|    result = global_init(CURL_GLOBAL_DEFAULT, TRUE);
  ------------------
  |  | 3049|      0|#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
  |  |  ------------------
  |  |  |  | 3047|      0|#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 3044|      0|#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 3045|      0|#define CURL_GLOBAL_WINSOCK (1 << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  result = global_init(CURL_GLOBAL_DEFAULT, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  378|      0|    if(result) {
  ------------------
  |  Branch (378:8): [True: 0, False: 0]
  ------------------
  379|       |      /* something in the global init failed, return nothing */
  380|      0|      DEBUGF(curl_mfprintf(stderr, "Error: curl_global_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  381|      0|      global_init_unlock();
  ------------------
  |  |   93|      0|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  382|      0|      return NULL;
  383|      0|    }
  384|      0|  }
  385|  19.8k|  global_init_unlock();
  ------------------
  |  |   93|  19.8k|#define global_init_unlock() curl_simple_lock_unlock(&s_lock)
  ------------------
  386|       |
  387|       |  /* We use Curl_open() with undefined URL so far */
  388|  19.8k|  result = Curl_open(&data);
  389|  19.8k|  if(result) {
  ------------------
  |  Branch (389:6): [True: 73, False: 19.7k]
  ------------------
  390|     73|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_open failed\n"));
  ------------------
  |  | 1002|     73|#define DEBUGF(x) x
  ------------------
  391|     73|    return NULL;
  392|     73|  }
  393|       |
  394|  19.7k|  return data;
  395|  19.8k|}
curl_easy_cleanup:
  884|  9.91k|{
  885|  9.91k|  struct Curl_eapi_guard guard;
  886|       |
  887|  9.91k|  if(CURL_EAPI_ENTER(&guard, curl, easy_cleanup, NULL)) {
  ------------------
  |  |  163|  9.91k|  Curl_eapi_enter(g, curl, CURL_EAPI_FN_##fn, r) && (curl)
  |  |  ------------------
  |  |  |  Branch (163:3): [True: 9.91k, False: 0]
  |  |  |  Branch (163:53): [True: 9.91k, False: 0]
  |  |  ------------------
  ------------------
  888|  9.91k|    struct Curl_easy *data = curl;
  889|  9.91k|    struct Curl_sigpipe_ctx sigpipe_ctx;
  890|  9.91k|    sigpipe_ignore(data, &sigpipe_ctx);
  891|  9.91k|    Curl_close(&data);
  892|  9.91k|    sigpipe_restore(&sigpipe_ctx);
  893|  9.91k|  }
  894|  9.91k|  CURL_EAPI_LEAVE(&guard);
  ------------------
  |  |  165|  9.91k|  Curl_eapi_leave(g)
  ------------------
  895|  9.91k|}
curl_easy_getinfo:
  903|  59.4k|{
  904|  59.4k|  struct Curl_eapi_guard guard;
  905|  59.4k|  CURLcode result;
  906|       |
  907|  59.4k|  if(CURL_EAPI_ENTER(&guard, curl, easy_getinfo, &result)) {
  ------------------
  |  |  163|  59.4k|  Curl_eapi_enter(g, curl, CURL_EAPI_FN_##fn, r) && (curl)
  |  |  ------------------
  |  |  |  Branch (163:3): [True: 59.4k, False: 0]
  |  |  |  Branch (163:53): [True: 59.4k, False: 0]
  |  |  ------------------
  ------------------
  908|  59.4k|    struct Curl_easy *data = curl;
  909|  59.4k|    va_list arg;
  910|  59.4k|    void *paramp;
  911|       |
  912|  59.4k|    va_start(arg, info);
  913|  59.4k|    paramp = va_arg(arg, void *);
  914|       |
  915|  59.4k|    result = Curl_getinfo(data, info, paramp);
  916|       |
  917|  59.4k|    va_end(arg);
  918|  59.4k|  }
  919|  59.4k|  CURL_EAPI_LEAVE(&guard);
  ------------------
  |  |  165|  59.4k|  Curl_eapi_leave(g)
  ------------------
  920|  59.4k|  return result;
  921|  59.4k|}
Curl_meta_set:
 1508|  4.18k|{
 1509|  4.18k|  DEBUGASSERT(meta_data); /* never set to NULL */
  ------------------
  |  | 1016|  4.18k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1509:3): [True: 0, False: 4.18k]
  |  Branch (1509:3): [True: 4.18k, False: 0]
  ------------------
 1510|  4.18k|  if(!Curl_hash_add2(&data->meta_hash, key, strlen(key) + 1,
  ------------------
  |  Branch (1510:6): [True: 5, False: 4.17k]
  ------------------
 1511|  4.18k|                     meta_data, meta_dtor)) {
 1512|      5|    meta_dtor(key, strlen(key) + 1, meta_data);
 1513|      5|    return CURLE_OUT_OF_MEMORY;
 1514|      5|  }
 1515|  4.17k|  return CURLE_OK;
 1516|  4.18k|}
Curl_meta_remove:
 1519|  9.82k|{
 1520|  9.82k|  Curl_hash_delete(&data->meta_hash, key, strlen(key) + 1);
 1521|  9.82k|}
Curl_meta_get:
 1524|  28.0k|{
 1525|  28.0k|  return Curl_hash_pick(&data->meta_hash, key, strlen(key) + 1);
 1526|  28.0k|}
easy.c:global_init:
  130|      2|{
  131|      2|  (void)flags;
  132|       |
  133|      2|  if(initialized++)
  ------------------
  |  Branch (133:6): [True: 0, False: 2]
  ------------------
  134|      0|    return CURLE_OK;
  135|       |
  136|      2|  if(memoryfuncs) {
  ------------------
  |  Branch (136:6): [True: 0, False: 2]
  ------------------
  137|       |    /* Setup the default memory functions here (again) */
  138|      0|    Curl_cmalloc = (curl_malloc_callback)malloc;
  139|      0|    Curl_cfree = (curl_free_callback)free;
  140|      0|    Curl_crealloc = (curl_realloc_callback)realloc;
  141|      0|    Curl_cstrdup = (curl_strdup_callback)CURLX_STRDUP_LOW;
  ------------------
  |  | 1492|      0|#define CURLX_STRDUP_LOW strdup
  ------------------
  142|      0|    Curl_ccalloc = (curl_calloc_callback)calloc;
  143|      0|  }
  144|       |
  145|       |#ifdef _WIN32
  146|       |  curlx_verify_windows_init();
  147|       |  curlx_now_init();
  148|       |#endif
  149|       |
  150|      2|  if(Curl_trc_init()) {
  ------------------
  |  Branch (150:6): [True: 0, False: 2]
  ------------------
  151|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_trc_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  152|      0|    goto fail;
  153|      0|  }
  154|       |
  155|       |#ifdef USE_WINDOWS_SSPI
  156|       |  if(Curl_sspi_global_init()) {
  157|       |    DEBUGF(curl_mfprintf(stderr, "Error: Curl_sspi_global_init() failed\n"));
  158|       |    goto fail;
  159|       |  }
  160|       |#endif
  161|       |
  162|       |#ifdef USE_WINSOCK
  163|       |  /* CURL_GLOBAL_WINSOCK controls the *optional* part of the Windows
  164|       |     initialization which is for the Windows sockets library (Winsock). */
  165|       |  if(flags & CURL_GLOBAL_WINSOCK) {
  166|       |    WSADATA wsa;
  167|       |    if(WSAStartup(MAKEWORD(2, 2), &wsa)) {
  168|       |      DEBUGF(curl_mfprintf(stderr, "Error: WSAStartup() failed\n"));
  169|       |      goto fail;
  170|       |    }
  171|       |    winsock_initialized = TRUE;
  172|       |  }
  173|       |#endif
  174|       |
  175|      2|  if(!Curl_ssl_init()) {
  ------------------
  |  Branch (175:6): [True: 0, False: 2]
  ------------------
  176|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssl_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  177|      0|    goto fail;
  178|      0|  }
  179|       |
  180|      2|  if(Curl_hash_global_init()) {
  ------------------
  |  Branch (180:6): [True: 0, False: 2]
  ------------------
  181|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_hash_global_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  182|      0|    goto fail;
  183|      0|  }
  184|       |
  185|      2|  if(!Curl_vquic_init()) {
  ------------------
  |  Branch (185:6): [True: 0, False: 2]
  ------------------
  186|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_vquic_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  187|      0|    goto fail;
  188|      0|  }
  189|       |
  190|      2|  if(Curl_amiga_init()) {
  ------------------
  |  |   36|      2|#define Curl_amiga_init()    CURLE_OK
  |  |  ------------------
  |  |  |  Branch (36:30): [Folded, False: 2]
  |  |  ------------------
  ------------------
  191|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_amiga_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  192|      0|    goto fail;
  193|      0|  }
  194|       |
  195|      2|  if(Curl_macos_init()) {
  ------------------
  |  |   31|      2|#define Curl_macos_init() CURLE_OK
  |  |  ------------------
  |  |  |  Branch (31:27): [Folded, False: 2]
  |  |  ------------------
  ------------------
  196|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_macos_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  197|      0|    goto fail;
  198|      0|  }
  199|       |
  200|      2|  if(Curl_async_global_init()) {
  ------------------
  |  Branch (200:6): [True: 0, False: 2]
  ------------------
  201|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_async_global_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  202|      0|    goto fail;
  203|      0|  }
  204|       |
  205|      2|  if(Curl_ssh_init()) {
  ------------------
  |  |  264|      2|#define Curl_ssh_init() 0
  |  |  ------------------
  |  |  |  Branch (264:25): [Folded, False: 2]
  |  |  ------------------
  ------------------
  206|      0|    DEBUGF(curl_mfprintf(stderr, "Error: Curl_ssh_init failed\n"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  ------------------
  207|      0|    goto fail;
  208|      0|  }
  209|       |
  210|      2|#ifdef DEBUGBUILD
  211|      2|  if(getenv("CURL_GLOBAL_INIT"))
  ------------------
  |  Branch (211:6): [True: 0, False: 2]
  ------------------
  212|       |    /* alloc data that will leak if *cleanup() is not called! */
  213|      0|    leakpointer = curlx_malloc(1);
  ------------------
  |  | 1498|      0|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  214|      2|#endif
  215|       |
  216|      2|  return CURLE_OK;
  217|       |
  218|      0|fail:
  219|       |#ifdef USE_WINSOCK
  220|       |  if(winsock_initialized) {
  221|       |    WSACleanup();
  222|       |    winsock_initialized = FALSE;
  223|       |  }
  224|       |#endif
  225|      0|  initialized--; /* undo the increase */
  226|      0|  return CURLE_FAILED_INIT;
  227|      2|}

easy.c:curl_simple_lock_lock:
   64|  40.8k|{
   65|  40.8k|  for(;;) {
   66|  40.8k|    if(!atomic_exchange_explicit(lock, true, memory_order_acquire))
  ------------------
  |  Branch (66:8): [True: 40.8k, False: 0]
  ------------------
   67|  40.8k|      break;
   68|       |    /* Reduce cache coherency traffic */
   69|      0|    while(atomic_load_explicit(lock, memory_order_relaxed)) {
  ------------------
  |  Branch (69:11): [True: 0, False: 0]
  ------------------
   70|       |      /* Reduce load (not mandatory) */
   71|      0|#ifdef HAVE_BUILTIN_IA32_PAUSE
   72|      0|      __builtin_ia32_pause();
   73|       |#elif defined(__aarch64__)
   74|       |      /* NOLINTNEXTLINE(portability-no-assembler) */
   75|       |      __asm__ volatile("yield" ::: "memory");
   76|       |#elif defined(HAVE_SCHED_YIELD)
   77|       |      sched_yield();
   78|       |#endif
   79|      0|    }
   80|      0|  }
   81|  40.8k|}
easy.c:curl_simple_lock_unlock:
   84|  40.8k|{
   85|  40.8k|  atomic_store_explicit(lock, false, memory_order_release);
   86|  40.8k|}

curl_escape:
   37|      2|{
   38|       |  return curl_easy_escape(NULL, string, length);
   39|      2|}
curl_easy_escape:
  157|      2|{
  158|      2|  size_t len;
  159|      2|  const char *f = string;
  160|      2|  size_t nappend = 0;
  161|      2|  char *target;
  162|      2|  char *encoded;
  163|      2|  (void)curl;
  164|       |
  165|      2|  if(!string || (length < 0))
  ------------------
  |  Branch (165:6): [True: 0, False: 2]
  |  Branch (165:17): [True: 0, False: 2]
  ------------------
  166|      0|    return NULL;
  167|       |
  168|      2|  len = (length ? (size_t)length : strlen(string));
  ------------------
  |  Branch (168:10): [True: 0, False: 2]
  ------------------
  169|      2|  if(!len)
  ------------------
  |  Branch (169:6): [True: 0, False: 2]
  ------------------
  170|      0|    return curlx_strdup("");
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  171|       |
  172|      2|  if(len > SIZE_MAX / 16)
  ------------------
  |  Branch (172:6): [True: 0, False: 2]
  ------------------
  173|      0|    return NULL;
  174|       |
  175|      2|  encoded = target = curlx_malloc((len * 3) + 1);
  ------------------
  |  | 1498|      2|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  176|      2|  if(!target)
  ------------------
  |  Branch (176:6): [True: 0, False: 2]
  ------------------
  177|      0|    return NULL;
  178|       |
  179|     50|  while(len--) {
  ------------------
  |  Branch (179:9): [True: 48, False: 2]
  ------------------
  180|     48|    uint8_t in = (uint8_t)*string++;
  181|       |
  182|     48|    if(!(hextable[in] & 0x80))
  ------------------
  |  Branch (182:8): [True: 44, False: 4]
  ------------------
  183|       |      /* append this */
  184|     44|      nappend++;
  185|      4|    else {
  186|      4|      if(nappend) {
  ------------------
  |  Branch (186:10): [True: 4, False: 0]
  ------------------
  187|      4|        memcpy(target, f, nappend);
  188|      4|        target += nappend;
  189|      4|        nappend = 0;
  190|      4|      }
  191|      4|      f = string;
  192|       |      /* encode it */
  193|      4|      target[0] = '%';
  194|      4|      memcpy(target + 1, hexpairs[in], 2);
  195|      4|      target += 3;
  196|      4|    }
  197|     48|  }
  198|      2|  if(nappend) {
  ------------------
  |  Branch (198:6): [True: 2, False: 0]
  ------------------
  199|      2|    memcpy(target, f, nappend);
  200|      2|    target += nappend;
  201|      2|  }
  202|      2|  *target = '\0'; /* null-terminate */
  203|       |
  204|      2|  return encoded;
  205|      2|}
Curl_urldecode:
  226|  10.8k|{
  227|  10.8k|  size_t alloc;
  228|  10.8k|  char *ns;
  229|  10.8k|  uint8_t reject_limit;
  230|       |
  231|  10.8k|  DEBUGASSERT(string);
  ------------------
  |  | 1016|  10.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (231:3): [True: 0, False: 10.8k]
  |  Branch (231:3): [True: 10.8k, False: 0]
  ------------------
  232|  10.8k|  DEBUGASSERT(ctrl >= REJECT_NADA); /* crash on TRUE/FALSE */
  ------------------
  |  | 1016|  10.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (232:3): [True: 0, False: 10.8k]
  |  Branch (232:3): [True: 10.8k, False: 0]
  ------------------
  233|       |
  234|  10.8k|  alloc = (length ? length : strlen(string));
  ------------------
  |  Branch (234:12): [True: 7.28k, False: 3.55k]
  ------------------
  235|  10.8k|  ns = curlx_malloc(alloc + 1);
  ------------------
  |  | 1498|  10.8k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  236|       |
  237|  10.8k|  if(!ns)
  ------------------
  |  Branch (237:6): [True: 13, False: 10.8k]
  ------------------
  238|     13|    return CURLE_OUT_OF_MEMORY;
  239|       |
  240|       |  /* store output string */
  241|  10.8k|  *ostring = ns;
  242|       |
  243|  10.8k|  reject_limit = (ctrl == REJECT_CTRL) ? 0x20 :
  ------------------
  |  Branch (243:18): [True: 7.28k, False: 3.54k]
  ------------------
  244|  10.8k|    (ctrl == REJECT_ZERO) ? 1 : 0;
  ------------------
  |  Branch (244:5): [True: 3.54k, False: 0]
  ------------------
  245|       |
  246|  28.2k|  while(alloc) {
  ------------------
  |  Branch (246:9): [True: 17.6k, False: 10.6k]
  ------------------
  247|  17.6k|    uint8_t in;
  248|       |
  249|  17.6k|    if(*string == '%') {
  ------------------
  |  Branch (249:8): [True: 5.83k, False: 11.7k]
  ------------------
  250|  5.83k|      if(alloc > 2) {
  ------------------
  |  Branch (250:10): [True: 5.74k, False: 87]
  ------------------
  251|  5.74k|        uint8_t h1 = hextable[(uint8_t)string[1]];
  252|  5.74k|        uint8_t h2 = hextable[(uint8_t)string[2]];
  253|  5.74k|        if(!((h1 | h2) & 0xf0)) {
  ------------------
  |  Branch (253:12): [True: 2.37k, False: 3.36k]
  ------------------
  254|  2.37k|          in = (uint8_t)((h1 << 4) | h2);
  255|  2.37k|          string += 3;
  256|  2.37k|          alloc -= 3;
  257|  2.37k|          if(in < reject_limit)
  ------------------
  |  Branch (257:14): [True: 140, False: 2.23k]
  ------------------
  258|    140|            goto error;
  259|  2.23k|          *ns++ = (char)in;
  260|  2.23k|          continue;
  261|  2.37k|        }
  262|  5.74k|      }
  263|  3.45k|      in = '%';
  264|  3.45k|      string++;
  265|  3.45k|      alloc--;
  266|  3.45k|      *ns++ = (char)in;
  267|  3.45k|      continue;
  268|  5.83k|    }
  269|  11.7k|    else {
  270|  11.7k|      const char *p = memchr(string + 1, '%', alloc - 1);
  271|  11.7k|      size_t n = p ? (size_t)(p - string) : alloc;
  ------------------
  |  Branch (271:18): [True: 3.78k, False: 7.98k]
  ------------------
  272|       |
  273|  11.7k|      if(reject_limit) {
  ------------------
  |  Branch (273:10): [True: 11.7k, False: 0]
  ------------------
  274|  11.7k|        if(reject_limit == 1) {
  ------------------
  |  Branch (274:12): [True: 4.48k, False: 7.28k]
  ------------------
  275|  4.48k|          if(memchr(string, 0, n))
  ------------------
  |  Branch (275:14): [True: 0, False: 4.48k]
  ------------------
  276|      0|            goto error;
  277|  4.48k|        }
  278|  7.28k|        else {
  279|  7.28k|          size_t i;
  280|  72.8k|          for(i = 0; i < n; i++) {
  ------------------
  |  Branch (280:22): [True: 65.5k, False: 7.28k]
  ------------------
  281|  65.5k|            if((uint8_t)string[i] < 0x20)
  ------------------
  |  Branch (281:16): [True: 0, False: 65.5k]
  ------------------
  282|      0|              goto error;
  283|  65.5k|          }
  284|  7.28k|        }
  285|  11.7k|      }
  286|       |
  287|  11.7k|      memcpy(ns, string, n);
  288|  11.7k|      ns += n;
  289|  11.7k|      string += n;
  290|  11.7k|      alloc -= n;
  291|  11.7k|    }
  292|  17.6k|  }
  293|  10.6k|  *ns = 0; /* terminate it */
  294|       |
  295|  10.6k|  if(olen)
  ------------------
  |  Branch (295:6): [True: 7.28k, False: 3.40k]
  ------------------
  296|       |    /* store output size */
  297|  7.28k|    *olen = (size_t)(ns - *ostring);
  298|       |
  299|  10.6k|  return CURLE_OK;
  300|    140|error:
  301|       |  curlx_safefree(*ostring);
  ------------------
  |  | 1359|    140|  do {                      \
  |  | 1360|    140|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    140|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    140|    (ptr) = NULL;           \
  |  | 1362|    140|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 140]
  |  |  ------------------
  ------------------
  302|    140|  return CURLE_URL_MALFORMAT;
  303|  10.8k|}
curl_free:
  340|  28.7k|{
  341|  28.7k|  curlx_free(p);
  ------------------
  |  | 1503|  28.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  342|  28.7k|}
Curl_hexbyte:
  374|   311k|{
  375|   311k|  dest[0] = Curl_udigits[val >> 4];
  376|   311k|  dest[1] = Curl_udigits[val & 0x0F];
  377|   311k|}

Curl_frzn_strs_safefree:
   34|   205k|{
   35|       |  curlx_safefree(*pfstrs);
  ------------------
  |  | 1359|   205k|  do {                      \
  |  | 1360|   205k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|   205k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|   205k|    (ptr) = NULL;           \
  |  | 1362|   205k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 205k]
  |  |  ------------------
  ------------------
   36|   205k|}
Curl_frzn_strs_from_slist:
   53|  17.5k|{
   54|  17.5k|  struct curl_slist *l;
   55|  17.5k|  struct Curl_frzn_strs *fstrs = NULL;
   56|  17.5k|  size_t n = 0, i;
   57|  17.5k|  size_t all_str_lens = 0, meta_len;
   58|  17.5k|  char *cdest;
   59|       |
   60|  17.5k|  if(!src)
  ------------------
  |  Branch (60:6): [True: 7.85k, False: 9.71k]
  ------------------
   61|  7.85k|    return NULL;
   62|       |
   63|  19.4k|  for(l = src; l; l = l->next) {
  ------------------
  |  Branch (63:16): [True: 9.71k, False: 9.71k]
  ------------------
   64|  9.71k|    size_t slen = (l->data ? strlen(l->data) : 0) + 1; /* incl. 0 byte */
  ------------------
  |  Branch (64:20): [True: 9.71k, False: 0]
  ------------------
   65|  9.71k|    if((SIZE_MAX - slen) <= all_str_lens)
  ------------------
  |  Branch (65:8): [True: 0, False: 9.71k]
  ------------------
   66|      0|      return NULL;
   67|  9.71k|    ++n;
   68|  9.71k|    all_str_lens += slen;
   69|  9.71k|  }
   70|       |
   71|  9.71k|  if(n > UINT32_MAX)
  ------------------
  |  Branch (71:6): [True: 0, False: 9.71k]
  ------------------
   72|      0|    return NULL;
   73|  9.71k|  meta_len = sizeof(*fstrs) + (n ? ((n - 1) * sizeof(struct Curl_str)) : 0);
  ------------------
  |  Branch (73:32): [True: 9.71k, False: 0]
  ------------------
   74|  9.71k|  if((SIZE_MAX - all_str_lens) <= meta_len)
  ------------------
  |  Branch (74:6): [True: 0, False: 9.71k]
  ------------------
   75|      0|    return NULL;
   76|       |
   77|  9.71k|  fstrs = curlx_calloc(1, meta_len + all_str_lens);
  ------------------
  |  | 1500|  9.71k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   78|  9.71k|  if(!fstrs)
  ------------------
  |  Branch (78:6): [True: 18, False: 9.70k]
  ------------------
   79|     18|    return NULL;
   80|       |
   81|  9.70k|  fstrs->strs = &fstrs->s;
   82|  9.70k|  fstrs->n = n;
   83|  9.70k|  cdest = (char *)fstrs + meta_len;
   84|  19.4k|  for(l = src, i = 0; l && (i < n); l = l->next, ++i) {
  ------------------
  |  Branch (84:23): [True: 9.70k, False: 9.70k]
  |  Branch (84:28): [True: 9.70k, False: 0]
  ------------------
   85|  9.70k|    size_t slen = (l->data ? strlen(l->data) : 0);
  ------------------
  |  Branch (85:20): [True: 9.70k, False: 0]
  ------------------
   86|  9.70k|    cdest = frzn_strs_copy_in(cdest, fstrs, i, l->data, slen);
   87|  9.70k|  }
   88|       |
   89|  9.70k|  return fstrs;
   90|  9.71k|}
Curl_frzn_strs_add:
  139|  9.88k|{
  140|  9.88k|  return frzn_strs_dup(src, str);
  141|  9.88k|}
frzn_strs.c:frzn_strs_copy_in:
   41|  19.5k|{
   42|  19.5k|  fstrs->strs[idx].str = cdest;
   43|  19.5k|  fstrs->strs[idx].len = slen;
   44|  19.5k|  if(slen) {
  ------------------
  |  Branch (44:6): [True: 19.5k, False: 0]
  ------------------
   45|  19.5k|    memcpy(cdest, str, slen);
   46|  19.5k|    cdest += slen;
   47|  19.5k|  }
   48|  19.5k|  *cdest++ = '\0';
   49|  19.5k|  return cdest;
   50|  19.5k|}
frzn_strs.c:frzn_strs_dup:
   94|  9.88k|{
   95|  9.88k|  struct Curl_frzn_strs *fstrs;
   96|  9.88k|  size_t i, n_src = Curl_frzn_strs_count(src);
  ------------------
  |  |   38|  9.88k|  ((fstrs) ? (fstrs)->n : 0)
  |  |  ------------------
  |  |  |  Branch (38:4): [True: 0, False: 9.88k]
  |  |  ------------------
  ------------------
   97|  9.88k|  size_t n_opt = (opt_str ? 1 : 0);
  ------------------
  |  Branch (97:19): [True: 9.88k, False: 0]
  ------------------
   98|  9.88k|  size_t n = n_src + n_opt;
   99|  9.88k|  size_t all_str_lens = 0, meta_len;
  100|  9.88k|  char *cdest;
  101|       |
  102|  9.88k|  if(!src && !opt_str)
  ------------------
  |  Branch (102:6): [True: 9.88k, False: 0]
  |  Branch (102:14): [True: 0, False: 9.88k]
  ------------------
  103|      0|    return NULL;
  104|       |
  105|  9.88k|  for(i = 0; i < n_src; ++i)
  ------------------
  |  Branch (105:14): [True: 0, False: 9.88k]
  ------------------
  106|      0|    all_str_lens += Curl_frzn_strs_get_len(src, i) + 1; /* incl. 0 */
  ------------------
  |  |   45|      0|  ((fstrs) && ((idx) < (fstrs)->n) ? (fstrs)->strs[(idx)].len : 0)
  |  |  ------------------
  |  |  |  Branch (45:4): [True: 0, False: 0]
  |  |  |  Branch (45:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  107|       |
  108|  9.88k|  if(opt_str)
  ------------------
  |  Branch (108:6): [True: 9.88k, False: 0]
  ------------------
  109|  9.88k|    all_str_lens += strlen(opt_str) + 1; /* incl. 0 */
  110|       |
  111|  9.88k|  meta_len = sizeof(*fstrs) + (n ? ((n - 1) * sizeof(struct Curl_str)) : 0);
  ------------------
  |  Branch (111:32): [True: 9.88k, False: 0]
  ------------------
  112|  9.88k|  fstrs = curlx_calloc(1, meta_len + all_str_lens);
  ------------------
  |  | 1500|  9.88k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  113|  9.88k|  if(!fstrs)
  ------------------
  |  Branch (113:6): [True: 38, False: 9.84k]
  ------------------
  114|     38|    return NULL;
  115|       |
  116|  9.84k|  fstrs->strs = &fstrs->s;
  117|  9.84k|  fstrs->n = n;
  118|  9.84k|  cdest = (char *)fstrs + meta_len;
  119|  9.84k|  for(i = 0; i < n_src; ++i) {
  ------------------
  |  Branch (119:14): [True: 0, False: 9.84k]
  ------------------
  120|      0|    cdest = frzn_strs_copy_in(cdest, fstrs, i,
  121|      0|                              Curl_frzn_strs_get_str(src, i),
  ------------------
  |  |   43|      0|  ((fstrs) && ((idx) < (fstrs)->n) ? (fstrs)->strs[(idx)].str : NULL)
  |  |  ------------------
  |  |  |  Branch (43:4): [True: 0, False: 0]
  |  |  |  Branch (43:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  122|      0|                              Curl_frzn_strs_get_len(src, i));
  ------------------
  |  |   45|      0|  ((fstrs) && ((idx) < (fstrs)->n) ? (fstrs)->strs[(idx)].len : 0)
  |  |  ------------------
  |  |  |  Branch (45:4): [True: 0, False: 0]
  |  |  |  Branch (45:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  123|      0|  }
  124|  9.84k|  if(opt_str) {
  ------------------
  |  Branch (124:6): [True: 9.84k, False: 0]
  ------------------
  125|  9.84k|    frzn_strs_copy_in(cdest, fstrs, n_src,
  126|  9.84k|                      opt_str, strlen(opt_str));
  127|  9.84k|  }
  128|       |
  129|  9.84k|  return fstrs;
  130|  9.88k|}

Curl_wildcard_dtor:
  191|  29.5k|{
  192|  29.5k|  struct WildcardData *wc = *wcp;
  193|  29.5k|  if(!wc)
  ------------------
  |  Branch (193:6): [True: 29.5k, False: 0]
  ------------------
  194|  29.5k|    return;
  195|       |
  196|      0|  if(wc->dtor) {
  ------------------
  |  Branch (196:6): [True: 0, False: 0]
  ------------------
  197|      0|    wc->dtor(wc->ftpwc);
  198|      0|    wc->dtor = ZERO_NULL;
  ------------------
  |  | 1174|      0|#define ZERO_NULL 0
  ------------------
  199|      0|    wc->ftpwc = NULL;
  200|      0|  }
  201|      0|  DEBUGASSERT(!wc->ftpwc);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 0]
  |  Branch (201:3): [True: 0, False: 0]
  ------------------
  202|       |
  203|      0|  Curl_llist_destroy(&wc->filelist, NULL);
  204|      0|  curlx_safefree(wc->path);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  205|      0|  curlx_safefree(wc->pattern);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  206|      0|  wc->state = CURLWC_INIT;
  207|      0|  curlx_free(wc);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  208|       |  *wcp = NULL;
  209|      0|}
Curl_ftp_listmode:
 1033|  2.44k|{
 1034|  2.44k|  if(data->state.wildcardmatch) {
  ------------------
  |  Branch (1034:6): [True: 0, False: 2.44k]
  ------------------
 1035|      0|    struct WildcardData * const wildcard = data->wildcard;
 1036|      0|    return wildcard && (wildcard->state == CURLWC_MATCHING);
  ------------------
  |  Branch (1036:12): [True: 0, False: 0]
  |  Branch (1036:24): [True: 0, False: 0]
  ------------------
 1037|      0|  }
 1038|  2.44k|  return FALSE;
  ------------------
  |  |  989|  2.44k|#define FALSE false
  ------------------
 1039|  2.44k|}

curl_getenv:
   27|  7.69k|{
   28|       |#if defined(CURL_WINDOWS_UWP) || \
   29|       |  defined(__ORBIS__) || defined(__PROSPERO__) /* PlayStation 4 and 5 */
   30|       |  (void)variable;
   31|       |  return NULL;
   32|       |#elif defined(_WIN32)
   33|       |  /* This uses Windows API instead of C runtime getenv() to get the environment
   34|       |     variable since some changes are not always visible to the latter. #4774 */
   35|       |  char *buf = NULL;
   36|       |  char *tmp;
   37|       |  DWORD bufsize;
   38|       |  DWORD rc = 1;
   39|       |  const DWORD max = 32768; /* max env var size from MSCRT source */
   40|       |
   41|       |  for(;;) {
   42|       |    tmp = curlx_realloc(buf, rc);
   43|       |    if(!tmp) {
   44|       |      curlx_free(buf);
   45|       |      return NULL;
   46|       |    }
   47|       |
   48|       |    buf = tmp;
   49|       |    bufsize = rc;
   50|       |
   51|       |    /* it is possible for rc to be 0 if the variable was found but empty.
   52|       |       Since getenv does not make that distinction we ignore it as well. */
   53|       |    rc = GetEnvironmentVariableA(variable, buf, bufsize);
   54|       |    if(!rc || rc == bufsize || rc > max) {
   55|       |      curlx_free(buf);
   56|       |      return NULL;
   57|       |    }
   58|       |
   59|       |    /* if rc < bufsize then rc is bytes written not including
   60|       |       the null-terminator */
   61|       |    if(rc < bufsize)
   62|       |      return buf;
   63|       |
   64|       |    /* else rc is bytes needed, try again */
   65|       |  }
   66|       |#else
   67|  7.69k|  char *env = getenv(variable);
   68|  7.69k|  return (env && env[0]) ? curlx_strdup(env) : NULL;
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  |  Branch (68:11): [True: 0, False: 7.69k]
  |  Branch (68:18): [True: 0, False: 0]
  ------------------
   69|  7.69k|#endif
   70|  7.69k|}

Curl_initinfo:
   43|  29.4k|{
   44|  29.4k|  struct Progress *pro = &data->progress;
   45|  29.4k|  struct PureInfo *info = &data->info;
   46|       |
   47|  29.4k|  memset(&pro->delta, 0, sizeof(pro->delta));
   48|  29.4k|  memset(&pro->total, 0, sizeof(pro->total));
   49|  29.4k|  pro->startransfer_added = FALSE;
  ------------------
  |  |  989|  29.4k|#define FALSE false
  ------------------
   50|       |
   51|  29.4k|  info->httpcode = 0;
   52|  29.4k|  info->httpproxycode = 0;
   53|  29.4k|  info->httpversion = 0;
   54|  29.4k|  info->filetime = -1; /* -1 is an illegal time and thus means unknown */
   55|  29.4k|  info->timecond = FALSE;
  ------------------
  |  |  989|  29.4k|#define FALSE false
  ------------------
   56|       |
   57|  29.4k|  info->header_size = 0;
   58|  29.4k|  info->request_size = 0;
   59|  29.4k|  info->proxyauthavail = 0;
   60|  29.4k|  info->httpauthavail = 0;
   61|  29.4k|  info->proxyauthpicked = 0;
   62|  29.4k|  info->httpauthpicked = 0;
   63|  29.4k|  info->numconnects = 0;
   64|       |
   65|  29.4k|  curlx_safefree(info->contenttype);
  ------------------
  |  | 1359|  29.4k|  do {                      \
  |  | 1360|  29.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  29.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  29.4k|    (ptr) = NULL;           \
  |  | 1362|  29.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 29.4k]
  |  |  ------------------
  ------------------
   66|  29.4k|  curlx_safefree(info->wouldredirect);
  ------------------
  |  | 1359|  29.4k|  do {                      \
  |  | 1360|  29.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  29.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  29.4k|    (ptr) = NULL;           \
  |  | 1362|  29.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 29.4k]
  |  |  ------------------
  ------------------
   67|  29.4k|  curlx_safefree(info->effective_url);
  ------------------
  |  | 1359|  29.4k|  do {                      \
  |  | 1360|  29.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  29.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  29.4k|    (ptr) = NULL;           \
  |  | 1362|  29.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 29.4k]
  |  |  ------------------
  ------------------
   68|       |
   69|  29.4k|  memset(&info->primary, 0, sizeof(info->primary));
   70|  29.4k|  info->retry_after = 0;
   71|       |
   72|  29.4k|  info->conn_scheme = 0;
   73|  29.4k|  info->conn_protocol = 0;
   74|  29.4k|  info->used_proxy = 0;
   75|       |
   76|  29.4k|#ifdef USE_SSL
   77|  29.4k|  Curl_ssl_free_certinfo(data);
   78|  29.4k|#endif
   79|  29.4k|}
Curl_getinfo:
  659|  59.4k|{
  660|  59.4k|  va_list arg;
  661|  59.4k|  long *param_longp = NULL;
  662|  59.4k|  double *param_doublep = NULL;
  663|  59.4k|  curl_off_t *param_offt = NULL;
  664|  59.4k|  const char **param_charp = NULL;
  665|  59.4k|  struct curl_slist **param_slistp = NULL;
  666|  59.4k|  curl_socket_t *param_socketp = NULL;
  667|  59.4k|  int type;
  668|  59.4k|  CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT;
  669|       |
  670|  59.4k|  if(!data)
  ------------------
  |  Branch (670:6): [True: 0, False: 59.4k]
  ------------------
  671|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  672|       |
  673|  59.4k|  va_start(arg, info);
  674|       |
  675|  59.4k|  type = CURLINFO_TYPEMASK & (int)info;
  ------------------
  |  | 2927|  59.4k|#define CURLINFO_TYPEMASK 0xf00000
  ------------------
  676|  59.4k|  switch(type) {
  677|  9.91k|  case CURLINFO_STRING:
  ------------------
  |  | 2919|  9.91k|#define CURLINFO_STRING   0x100000
  ------------------
  |  Branch (677:3): [True: 9.91k, False: 49.5k]
  ------------------
  678|  9.91k|    param_charp = va_arg(arg, const char **);
  679|  9.91k|    if(param_charp)
  ------------------
  |  Branch (679:8): [True: 9.91k, False: 0]
  ------------------
  680|  9.91k|      result = getinfo_char(data, info, param_charp);
  681|  9.91k|    break;
  682|  9.91k|  case CURLINFO_LONG:
  ------------------
  |  | 2920|  9.91k|#define CURLINFO_LONG     0x200000
  ------------------
  |  Branch (682:3): [True: 9.91k, False: 49.5k]
  ------------------
  683|  9.91k|    param_longp = va_arg(arg, long *);
  684|  9.91k|    if(param_longp)
  ------------------
  |  Branch (684:8): [True: 9.91k, False: 0]
  ------------------
  685|  9.91k|      result = getinfo_long(data, info, param_longp);
  686|  9.91k|    break;
  687|  9.91k|  case CURLINFO_DOUBLE:
  ------------------
  |  | 2921|  9.91k|#define CURLINFO_DOUBLE   0x300000
  ------------------
  |  Branch (687:3): [True: 9.91k, False: 49.5k]
  ------------------
  688|  9.91k|    param_doublep = va_arg(arg, double *);
  689|  9.91k|    if(param_doublep)
  ------------------
  |  Branch (689:8): [True: 9.91k, False: 0]
  ------------------
  690|  9.91k|      result = getinfo_double(data, info, param_doublep);
  691|  9.91k|    break;
  692|  9.91k|  case CURLINFO_OFF_T:
  ------------------
  |  | 2925|  9.91k|#define CURLINFO_OFF_T    0x600000
  ------------------
  |  Branch (692:3): [True: 9.91k, False: 49.5k]
  ------------------
  693|  9.91k|    param_offt = va_arg(arg, curl_off_t *);
  694|  9.91k|    if(param_offt)
  ------------------
  |  Branch (694:8): [True: 9.91k, False: 0]
  ------------------
  695|  9.91k|      result = getinfo_offt(data, info, param_offt);
  696|  9.91k|    break;
  697|  9.91k|  case CURLINFO_SLIST:
  ------------------
  |  | 2922|  9.91k|#define CURLINFO_SLIST    0x400000
  ------------------
  |  Branch (697:3): [True: 9.91k, False: 49.5k]
  ------------------
  698|  9.91k|    param_slistp = va_arg(arg, struct curl_slist **);
  699|  9.91k|    if(param_slistp)
  ------------------
  |  Branch (699:8): [True: 9.91k, False: 0]
  ------------------
  700|  9.91k|      result = getinfo_slist(data, info, param_slistp);
  701|  9.91k|    break;
  702|  9.91k|  case CURLINFO_SOCKET:
  ------------------
  |  | 2924|  9.91k|#define CURLINFO_SOCKET   0x500000
  ------------------
  |  Branch (702:3): [True: 9.91k, False: 49.5k]
  ------------------
  703|  9.91k|    param_socketp = va_arg(arg, curl_socket_t *);
  704|  9.91k|    if(param_socketp)
  ------------------
  |  Branch (704:8): [True: 9.91k, False: 0]
  ------------------
  705|  9.91k|      result = getinfo_socket(data, info, param_socketp);
  706|  9.91k|    break;
  707|      0|  default:
  ------------------
  |  Branch (707:3): [True: 0, False: 59.4k]
  ------------------
  708|      0|    result = CURLE_UNKNOWN_OPTION;
  709|      0|    break;
  710|  59.4k|  }
  711|       |
  712|  59.4k|  va_end(arg);
  713|       |
  714|  59.4k|  return result;
  715|  59.4k|}
getinfo.c:getinfo_char:
  125|  9.91k|{
  126|  9.91k|  switch(info) {
  127|  9.91k|  case CURLINFO_EFFECTIVE_URL:
  ------------------
  |  Branch (127:3): [True: 9.91k, False: 0]
  ------------------
  128|  9.91k|    return effective_url(data, param_charp);
  129|      0|  case CURLINFO_EFFECTIVE_METHOD: {
  ------------------
  |  Branch (129:3): [True: 0, False: 9.91k]
  ------------------
  130|      0|    const char *m = CURL_EASY_STR(data, STRING_CUSTOMREQUEST);
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  131|      0|    if(!m) {
  ------------------
  |  Branch (131:8): [True: 0, False: 0]
  ------------------
  132|      0|      if(data->set.opt_no_body)
  ------------------
  |  Branch (132:10): [True: 0, False: 0]
  ------------------
  133|      0|        m = "HEAD";
  134|      0|#ifndef CURL_DISABLE_HTTP
  135|      0|      else {
  136|      0|        switch(data->state.httpreq) {
  137|      0|        case HTTPREQ_POST:
  ------------------
  |  Branch (137:9): [True: 0, False: 0]
  ------------------
  138|      0|        case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (138:9): [True: 0, False: 0]
  ------------------
  139|      0|        case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (139:9): [True: 0, False: 0]
  ------------------
  140|      0|          m = "POST";
  141|      0|          break;
  142|      0|        case HTTPREQ_PUT:
  ------------------
  |  Branch (142:9): [True: 0, False: 0]
  ------------------
  143|      0|          m = "PUT";
  144|      0|          break;
  145|      0|        default: /* this should never happen */
  ------------------
  |  Branch (145:9): [True: 0, False: 0]
  ------------------
  146|      0|        case HTTPREQ_GET:
  ------------------
  |  Branch (146:9): [True: 0, False: 0]
  ------------------
  147|      0|          m = "GET";
  148|      0|          break;
  149|      0|        case HTTPREQ_HEAD:
  ------------------
  |  Branch (149:9): [True: 0, False: 0]
  ------------------
  150|      0|          m = "HEAD";
  151|      0|          break;
  152|      0|        }
  153|      0|      }
  154|      0|#endif
  155|      0|    }
  156|      0|    *param_charp = m;
  157|      0|  }
  158|      0|    break;
  159|      0|  case CURLINFO_CONTENT_TYPE:
  ------------------
  |  Branch (159:3): [True: 0, False: 9.91k]
  ------------------
  160|      0|    *param_charp = data->info.contenttype;
  161|      0|    break;
  162|      0|  case CURLINFO_PRIVATE:
  ------------------
  |  Branch (162:3): [True: 0, False: 9.91k]
  ------------------
  163|      0|    *param_charp = (const char *)data->set.private_data;
  164|      0|    break;
  165|      0|  case CURLINFO_FTP_ENTRY_PATH:
  ------------------
  |  Branch (165:3): [True: 0, False: 9.91k]
  ------------------
  166|       |    /* Return the entrypath string from the most recent connection.
  167|       |       This pointer was copied from the connectdata structure by FTP.
  168|       |       The actual string may be freed by subsequent libcurl calls so
  169|       |       it must be copied to a safer area before the next libcurl call.
  170|       |       Callers must never free it themselves. */
  171|      0|    *param_charp = data->state.most_recent_ftp_entrypath;
  172|      0|    break;
  173|      0|  case CURLINFO_REDIRECT_URL:
  ------------------
  |  Branch (173:3): [True: 0, False: 9.91k]
  ------------------
  174|       |    /* Return the URL this request would have been redirected to if that
  175|       |       option had been enabled! */
  176|      0|    *param_charp = data->info.wouldredirect;
  177|      0|    break;
  178|      0|  case CURLINFO_REFERER:
  ------------------
  |  Branch (178:3): [True: 0, False: 9.91k]
  ------------------
  179|       |    /* Return the referrer header for this request, or NULL if unset */
  180|      0|    *param_charp = Curl_bufref_ptr(&data->state.referer);
  181|      0|    break;
  182|      0|  case CURLINFO_PRIMARY_IP:
  ------------------
  |  Branch (182:3): [True: 0, False: 9.91k]
  ------------------
  183|       |    /* Return the ip address of the most recent (primary) connection */
  184|      0|    *param_charp = data->info.primary.remote_ip;
  185|      0|    break;
  186|      0|  case CURLINFO_LOCAL_IP:
  ------------------
  |  Branch (186:3): [True: 0, False: 9.91k]
  ------------------
  187|       |    /* Return the source/local ip address of the most recent (primary)
  188|       |       connection */
  189|      0|    *param_charp = data->info.primary.local_ip;
  190|      0|    break;
  191|      0|  case CURLINFO_RTSP_SESSION_ID:
  ------------------
  |  Branch (191:3): [True: 0, False: 9.91k]
  ------------------
  192|      0|#ifndef CURL_DISABLE_RTSP
  193|      0|    *param_charp = CURL_EASY_STR(data, STRING_RTSP_SESSION_ID) ?
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  194|      0|      CURL_EASY_STR(data, STRING_RTSP_SESSION_ID) :
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  195|      0|      data->state.session_id;
  196|       |#else
  197|       |    *param_charp = NULL;
  198|       |#endif
  199|      0|    break;
  200|      0|  case CURLINFO_SCHEME:
  ------------------
  |  Branch (200:3): [True: 0, False: 9.91k]
  ------------------
  201|      0|    *param_charp = data->info.conn_scheme;
  202|      0|    break;
  203|      0|  case CURLINFO_CAPATH:
  ------------------
  |  Branch (203:3): [True: 0, False: 9.91k]
  ------------------
  204|       |#ifdef CURL_CA_PATH
  205|       |    *param_charp = CURL_CA_PATH;
  206|       |#else
  207|      0|    *param_charp = NULL;
  208|      0|#endif
  209|      0|    break;
  210|      0|  case CURLINFO_CAINFO:
  ------------------
  |  Branch (210:3): [True: 0, False: 9.91k]
  ------------------
  211|       |#ifdef CURL_CA_BUNDLE
  212|       |    *param_charp = CURL_CA_BUNDLE;
  213|       |#else
  214|      0|    *param_charp = NULL;
  215|      0|#endif
  216|      0|    break;
  217|      0|  default:
  ------------------
  |  Branch (217:3): [True: 0, False: 9.91k]
  ------------------
  218|      0|    return CURLE_UNKNOWN_OPTION;
  219|  9.91k|  }
  220|       |
  221|      0|  return CURLE_OK;
  222|  9.91k|}
getinfo.c:effective_url:
   83|  9.91k|{
   84|  9.91k|  const char *s = Curl_bufref_ptr(&data->state.url);
   85|       |  /* never return the URL unfiltered */
   86|  9.91k|  *param_charp = s ? NULL : "";
  ------------------
  |  Branch (86:18): [True: 9.89k, False: 17]
  ------------------
   87|  9.91k|  if(s) {
  ------------------
  |  Branch (87:6): [True: 9.89k, False: 17]
  ------------------
   88|  9.89k|    char *url = NULL;
   89|       |    /* Make a copy of the URL without credentials */
   90|  9.89k|    CURLU *u = curl_url();
   91|  9.89k|    CURLUcode uc;
   92|  9.89k|    if(!u)
  ------------------
  |  Branch (92:8): [True: 28, False: 9.87k]
  ------------------
   93|     28|      return CURLE_OUT_OF_MEMORY;
   94|       |
   95|  9.87k|    uc = curl_url_set(u, CURLUPART_URL, s,
   96|  9.87k|                      CURLU_NON_SUPPORT_SCHEME |
  ------------------
  |  |   91|  9.87k|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
   97|  9.87k|                      (data->set.path_as_is ? CURLU_PATH_AS_IS : 0));
  ------------------
  |  |   92|     35|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  |  Branch (97:24): [True: 35, False: 9.83k]
  ------------------
   98|  9.87k|    if(!uc)
  ------------------
  |  Branch (98:8): [True: 9.63k, False: 233]
  ------------------
   99|  9.63k|      uc = curl_url_set(u, CURLUPART_USER, NULL, 0);
  100|  9.87k|    if(!uc)
  ------------------
  |  Branch (100:8): [True: 9.63k, False: 233]
  ------------------
  101|  9.63k|      uc = curl_url_set(u, CURLUPART_PASSWORD, NULL, 0);
  102|  9.87k|    if(!uc)
  ------------------
  |  Branch (102:8): [True: 9.63k, False: 233]
  ------------------
  103|  9.63k|      uc = curl_url_get(u, CURLUPART_URL, &url, CURLU_GET_EMPTY);
  ------------------
  |  |  103|  9.63k|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  104|       |
  105|  9.87k|    curl_url_cleanup(u);
  106|       |
  107|  9.87k|    if(uc || !url)
  ------------------
  |  Branch (107:8): [True: 241, False: 9.62k]
  |  Branch (107:14): [True: 0, False: 9.62k]
  ------------------
  108|    241|      return uc ? Curl_uc_to_curlcode(uc) : CURLE_OUT_OF_MEMORY;
  ------------------
  |  Branch (108:14): [True: 241, False: 0]
  ------------------
  109|  9.62k|    if(strcmp(url, s)) {
  ------------------
  |  Branch (109:8): [True: 59, False: 9.57k]
  ------------------
  110|       |      /* they are different */
  111|     59|      curlx_free(data->info.effective_url);
  ------------------
  |  | 1503|     59|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  112|     59|      data->info.effective_url = url;
  113|     59|      *param_charp = url;
  114|     59|    }
  115|  9.57k|    else {
  116|  9.57k|      curl_free(url);
  117|  9.57k|      *param_charp = s;
  118|  9.57k|    }
  119|  9.62k|  }
  120|  9.64k|  return CURLE_OK;
  121|  9.91k|}
getinfo.c:getinfo_long:
  226|  9.91k|{
  227|  9.91k|  curl_socket_t sockfd;
  228|       |
  229|  9.91k|  union {
  230|  9.91k|    unsigned long *to_ulong;
  231|  9.91k|    long          *to_long;
  232|  9.91k|  } lptr;
  233|       |
  234|  9.91k|#ifdef DEBUGBUILD
  235|  9.91k|  const char *envstr;
  236|       |
  237|       |  /* use another variable for this to allow different values */
  238|  9.91k|  switch(info) {
  239|      0|  case CURLINFO_LOCAL_PORT:
  ------------------
  |  Branch (239:3): [True: 0, False: 9.91k]
  ------------------
  240|      0|    envstr = getenv("CURL_TIME");
  241|      0|    if(envstr) {
  ------------------
  |  Branch (241:8): [True: 0, False: 0]
  ------------------
  242|      0|      curl_off_t val;
  243|      0|      curlx_str_number(&envstr, &val, TIME_T_MAX);
  ------------------
  |  |  559|      0|#  define TIME_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  244|      0|      *param_longp = (long)val;
  245|      0|      return CURLE_OK;
  246|      0|    }
  247|      0|    break;
  248|      0|  case CURLINFO_HEADER_SIZE:
  ------------------
  |  Branch (248:3): [True: 0, False: 9.91k]
  ------------------
  249|      0|  case CURLINFO_REQUEST_SIZE:
  ------------------
  |  Branch (249:3): [True: 0, False: 9.91k]
  ------------------
  250|      0|    envstr = getenv("CURL_DEBUG_SIZE");
  251|      0|    if(envstr) {
  ------------------
  |  Branch (251:8): [True: 0, False: 0]
  ------------------
  252|      0|      curl_off_t val;
  253|      0|      curlx_str_number(&envstr, &val, LONG_MAX);
  254|      0|      *param_longp = (long)val;
  255|      0|      return CURLE_OK;
  256|      0|    }
  257|      0|    break;
  258|  9.91k|  default:
  ------------------
  |  Branch (258:3): [True: 9.91k, False: 0]
  ------------------
  259|  9.91k|    break;
  260|  9.91k|  }
  261|  9.91k|#endif
  262|       |
  263|  9.91k|  switch(info) {
  264|  9.91k|  case CURLINFO_RESPONSE_CODE:
  ------------------
  |  Branch (264:3): [True: 9.91k, False: 0]
  ------------------
  265|  9.91k|    *param_longp = data->info.httpcode;
  266|  9.91k|    break;
  267|      0|  case CURLINFO_HTTP_CONNECTCODE:
  ------------------
  |  Branch (267:3): [True: 0, False: 9.91k]
  ------------------
  268|      0|    *param_longp = data->info.httpproxycode;
  269|      0|    break;
  270|      0|  case CURLINFO_FILETIME:
  ------------------
  |  Branch (270:3): [True: 0, False: 9.91k]
  ------------------
  271|      0|    if(data->info.filetime > LONG_MAX)
  ------------------
  |  Branch (271:8): [True: 0, False: 0]
  ------------------
  272|      0|      *param_longp = LONG_MAX;
  273|      0|#if !defined(MSDOS) && !defined(__AMIGA__)
  274|      0|    else if(data->info.filetime < LONG_MIN)
  ------------------
  |  Branch (274:13): [True: 0, False: 0]
  ------------------
  275|      0|      *param_longp = LONG_MIN;
  276|      0|#endif
  277|      0|    else
  278|      0|      *param_longp = (long)data->info.filetime;
  279|      0|    break;
  280|      0|  case CURLINFO_HEADER_SIZE:
  ------------------
  |  Branch (280:3): [True: 0, False: 9.91k]
  ------------------
  281|      0|    *param_longp = (long)data->info.header_size;
  282|      0|    break;
  283|      0|  case CURLINFO_REQUEST_SIZE:
  ------------------
  |  Branch (283:3): [True: 0, False: 9.91k]
  ------------------
  284|      0|    *param_longp = (long)data->info.request_size;
  285|      0|    break;
  286|      0|  case CURLINFO_SSL_VERIFYRESULT:
  ------------------
  |  Branch (286:3): [True: 0, False: 9.91k]
  ------------------
  287|      0|    *param_longp = data->set.ssl.certverifyresult;
  288|      0|    break;
  289|      0|  case CURLINFO_PROXY_SSL_VERIFYRESULT:
  ------------------
  |  Branch (289:3): [True: 0, False: 9.91k]
  ------------------
  290|      0|#ifndef CURL_DISABLE_PROXY
  291|      0|    *param_longp = data->set.proxy_ssl.certverifyresult;
  292|       |#else
  293|       |    *param_longp = 0;
  294|       |#endif
  295|      0|    break;
  296|      0|  case CURLINFO_REDIRECT_COUNT:
  ------------------
  |  Branch (296:3): [True: 0, False: 9.91k]
  ------------------
  297|      0|    *param_longp = data->state.followlocation;
  298|      0|    break;
  299|      0|  case CURLINFO_HTTPAUTH_AVAIL:
  ------------------
  |  Branch (299:3): [True: 0, False: 9.91k]
  ------------------
  300|      0|    lptr.to_long = param_longp;
  301|      0|    *lptr.to_ulong = data->info.httpauthavail;
  302|      0|    break;
  303|      0|  case CURLINFO_PROXYAUTH_AVAIL:
  ------------------
  |  Branch (303:3): [True: 0, False: 9.91k]
  ------------------
  304|      0|    lptr.to_long = param_longp;
  305|      0|    *lptr.to_ulong = data->info.proxyauthavail;
  306|      0|    break;
  307|      0|  case CURLINFO_HTTPAUTH_USED:
  ------------------
  |  Branch (307:3): [True: 0, False: 9.91k]
  ------------------
  308|      0|    lptr.to_long = param_longp;
  309|      0|    *lptr.to_ulong = data->info.httpauthpicked;
  310|      0|    break;
  311|      0|  case CURLINFO_PROXYAUTH_USED:
  ------------------
  |  Branch (311:3): [True: 0, False: 9.91k]
  ------------------
  312|      0|    lptr.to_long = param_longp;
  313|      0|    *lptr.to_ulong = data->info.proxyauthpicked;
  314|      0|    break;
  315|      0|  case CURLINFO_OS_ERRNO:
  ------------------
  |  Branch (315:3): [True: 0, False: 9.91k]
  ------------------
  316|      0|    *param_longp = data->state.os_errno;
  317|      0|    break;
  318|      0|  case CURLINFO_NUM_CONNECTS:
  ------------------
  |  Branch (318:3): [True: 0, False: 9.91k]
  ------------------
  319|       |#if SIZEOF_LONG < SIZEOF_CURL_OFF_T
  320|       |    if(data->info.numconnects > LONG_MAX)
  321|       |      *param_longp = LONG_MAX;
  322|       |    else
  323|       |#endif
  324|      0|      *param_longp = (long)data->info.numconnects;
  325|      0|    break;
  326|      0|  case CURLINFO_LASTSOCKET:
  ------------------
  |  Branch (326:3): [True: 0, False: 9.91k]
  ------------------
  327|      0|    sockfd = Curl_getconnectinfo(data, NULL);
  328|       |
  329|       |    /* note: this is not a good conversion for systems with 64-bit sockets and
  330|       |       32-bit longs */
  331|      0|    if(sockfd != CURL_SOCKET_BAD)
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (331:8): [True: 0, False: 0]
  ------------------
  332|      0|      *param_longp = (long)sockfd;
  333|      0|    else
  334|       |      /* this interface is documented to return -1 in case of badness, which
  335|       |         may not be the same as the CURL_SOCKET_BAD value */
  336|      0|      *param_longp = -1;
  337|      0|    break;
  338|      0|  case CURLINFO_PRIMARY_PORT:
  ------------------
  |  Branch (338:3): [True: 0, False: 9.91k]
  ------------------
  339|       |    /* Return the (remote) port of the most recent (primary) connection */
  340|      0|    if(CUR_IP_QUAD_HAS_PORTS(&data->info.primary))
  ------------------
  |  |  241|      0|  (((x)->transport == TRNSPRT_TCP) || \
  |  |  ------------------
  |  |  |  |  225|      0|#define TRNSPRT_TCP  3
  |  |  ------------------
  |  |  |  Branch (241:4): [True: 0, False: 0]
  |  |  ------------------
  |  |  242|      0|   ((x)->transport == TRNSPRT_UDP) || \
  |  |  ------------------
  |  |  |  |  226|      0|#define TRNSPRT_UDP  4
  |  |  ------------------
  |  |  |  Branch (242:4): [True: 0, False: 0]
  |  |  ------------------
  |  |  243|      0|   ((x)->transport == TRNSPRT_QUIC))
  |  |  ------------------
  |  |  |  |  227|      0|#define TRNSPRT_QUIC 5
  |  |  ------------------
  |  |  |  Branch (243:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  341|      0|      *param_longp = data->info.primary.remote_port;
  342|      0|    else
  343|      0|      *param_longp = -1;
  344|      0|    break;
  345|      0|  case CURLINFO_LOCAL_PORT:
  ------------------
  |  Branch (345:3): [True: 0, False: 9.91k]
  ------------------
  346|       |    /* Return the local port of the most recent (primary) connection */
  347|      0|    if(CUR_IP_QUAD_HAS_PORTS(&data->info.primary))
  ------------------
  |  |  241|      0|  (((x)->transport == TRNSPRT_TCP) || \
  |  |  ------------------
  |  |  |  |  225|      0|#define TRNSPRT_TCP  3
  |  |  ------------------
  |  |  |  Branch (241:4): [True: 0, False: 0]
  |  |  ------------------
  |  |  242|      0|   ((x)->transport == TRNSPRT_UDP) || \
  |  |  ------------------
  |  |  |  |  226|      0|#define TRNSPRT_UDP  4
  |  |  ------------------
  |  |  |  Branch (242:4): [True: 0, False: 0]
  |  |  ------------------
  |  |  243|      0|   ((x)->transport == TRNSPRT_QUIC))
  |  |  ------------------
  |  |  |  |  227|      0|#define TRNSPRT_QUIC 5
  |  |  ------------------
  |  |  |  Branch (243:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  348|      0|      *param_longp = data->info.primary.local_port;
  349|      0|    else
  350|      0|      *param_longp = -1;
  351|      0|    break;
  352|      0|  case CURLINFO_PROXY_ERROR:
  ------------------
  |  Branch (352:3): [True: 0, False: 9.91k]
  ------------------
  353|      0|    *param_longp = (long)data->info.pxcode;
  354|      0|    break;
  355|      0|  case CURLINFO_CONDITION_UNMET:
  ------------------
  |  Branch (355:3): [True: 0, False: 9.91k]
  ------------------
  356|      0|    if(data->info.httpcode == 304)
  ------------------
  |  Branch (356:8): [True: 0, False: 0]
  ------------------
  357|      0|      *param_longp = 1L;
  358|      0|    else
  359|       |      /* return if the condition prevented the document to get transferred */
  360|      0|      *param_longp = data->info.timecond ? 1L : 0L;
  ------------------
  |  Branch (360:22): [True: 0, False: 0]
  ------------------
  361|      0|    break;
  362|      0|#ifndef CURL_DISABLE_RTSP
  363|      0|  case CURLINFO_RTSP_CLIENT_CSEQ:
  ------------------
  |  Branch (363:3): [True: 0, False: 9.91k]
  ------------------
  364|      0|    *param_longp = data->state.rtsp_next_client_CSeq;
  365|      0|    break;
  366|      0|  case CURLINFO_RTSP_SERVER_CSEQ:
  ------------------
  |  Branch (366:3): [True: 0, False: 9.91k]
  ------------------
  367|      0|    *param_longp = data->state.rtsp_next_server_CSeq;
  368|      0|    break;
  369|      0|  case CURLINFO_RTSP_CSEQ_RECV:
  ------------------
  |  Branch (369:3): [True: 0, False: 9.91k]
  ------------------
  370|      0|    *param_longp = data->state.rtsp_CSeq_recv;
  371|      0|    break;
  372|       |#else
  373|       |  case CURLINFO_RTSP_CLIENT_CSEQ:
  374|       |  case CURLINFO_RTSP_SERVER_CSEQ:
  375|       |  case CURLINFO_RTSP_CSEQ_RECV:
  376|       |    *param_longp = 0;
  377|       |    break;
  378|       |#endif
  379|      0|  case CURLINFO_HTTP_VERSION:
  ------------------
  |  Branch (379:3): [True: 0, False: 9.91k]
  ------------------
  380|      0|    switch(data->info.httpversion) {
  381|      0|    case 10:
  ------------------
  |  Branch (381:5): [True: 0, False: 0]
  ------------------
  382|      0|      *param_longp = CURL_HTTP_VERSION_1_0;
  ------------------
  |  | 2341|      0|#define CURL_HTTP_VERSION_1_0   1L /* please use HTTP 1.0 in the request */
  ------------------
  383|      0|      break;
  384|      0|    case 11:
  ------------------
  |  Branch (384:5): [True: 0, False: 0]
  ------------------
  385|      0|      *param_longp = CURL_HTTP_VERSION_1_1;
  ------------------
  |  | 2342|      0|#define CURL_HTTP_VERSION_1_1   2L /* please use HTTP 1.1 in the request */
  ------------------
  386|      0|      break;
  387|      0|    case 20:
  ------------------
  |  Branch (387:5): [True: 0, False: 0]
  ------------------
  388|      0|      *param_longp = CURL_HTTP_VERSION_2_0;
  ------------------
  |  | 2343|      0|#define CURL_HTTP_VERSION_2_0   3L /* please use HTTP 2 in the request */
  ------------------
  389|      0|      break;
  390|      0|    case 30:
  ------------------
  |  Branch (390:5): [True: 0, False: 0]
  ------------------
  391|      0|      *param_longp = CURL_HTTP_VERSION_3;
  ------------------
  |  | 2348|      0|#define CURL_HTTP_VERSION_3     30L /* Use HTTP/3, fallback to HTTP/2 or
  ------------------
  392|      0|      break;
  393|      0|    default:
  ------------------
  |  Branch (393:5): [True: 0, False: 0]
  ------------------
  394|      0|      *param_longp = CURL_HTTP_VERSION_NONE;
  ------------------
  |  | 2338|      0|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  395|      0|      break;
  396|      0|    }
  397|      0|    break;
  398|      0|  case CURLINFO_PROTOCOL:
  ------------------
  |  Branch (398:3): [True: 0, False: 9.91k]
  ------------------
  399|      0|    *param_longp = (long)data->info.conn_protocol;
  400|      0|    break;
  401|      0|  case CURLINFO_USED_PROXY:
  ------------------
  |  Branch (401:3): [True: 0, False: 9.91k]
  ------------------
  402|      0|    *param_longp =
  403|       |#ifdef CURL_DISABLE_PROXY
  404|       |      0
  405|       |#else
  406|      0|      data->info.used_proxy
  407|      0|#endif
  408|      0|      ;
  409|      0|    break;
  410|      0|  default:
  ------------------
  |  Branch (410:3): [True: 0, False: 9.91k]
  ------------------
  411|      0|    return CURLE_UNKNOWN_OPTION;
  412|  9.91k|  }
  413|       |
  414|  9.91k|  return CURLE_OK;
  415|  9.91k|}
getinfo.c:getinfo_double:
  523|  9.91k|{
  524|  9.91k|#ifdef DEBUGBUILD
  525|  9.91k|  const char *envstr;
  526|       |
  527|  9.91k|  switch(info) {
  528|  9.91k|  case CURLINFO_TOTAL_TIME:
  ------------------
  |  Branch (528:3): [True: 9.91k, False: 0]
  ------------------
  529|  9.91k|  case CURLINFO_NAMELOOKUP_TIME:
  ------------------
  |  Branch (529:3): [True: 0, False: 9.91k]
  ------------------
  530|  9.91k|  case CURLINFO_CONNECT_TIME:
  ------------------
  |  Branch (530:3): [True: 0, False: 9.91k]
  ------------------
  531|  9.91k|  case CURLINFO_APPCONNECT_TIME:
  ------------------
  |  Branch (531:3): [True: 0, False: 9.91k]
  ------------------
  532|  9.91k|  case CURLINFO_PRETRANSFER_TIME:
  ------------------
  |  Branch (532:3): [True: 0, False: 9.91k]
  ------------------
  533|  9.91k|  case CURLINFO_STARTTRANSFER_TIME:
  ------------------
  |  Branch (533:3): [True: 0, False: 9.91k]
  ------------------
  534|  9.91k|  case CURLINFO_REDIRECT_TIME:
  ------------------
  |  Branch (534:3): [True: 0, False: 9.91k]
  ------------------
  535|  9.91k|  case CURLINFO_SPEED_DOWNLOAD:
  ------------------
  |  Branch (535:3): [True: 0, False: 9.91k]
  ------------------
  536|  9.91k|  case CURLINFO_SPEED_UPLOAD:
  ------------------
  |  Branch (536:3): [True: 0, False: 9.91k]
  ------------------
  537|  9.91k|    envstr = getenv("CURL_TIME");
  538|  9.91k|    if(envstr) {
  ------------------
  |  Branch (538:8): [True: 0, False: 9.91k]
  ------------------
  539|      0|      curl_off_t val;
  540|      0|      curlx_str_number(&envstr, &val, CURL_OFF_T_MAX);
  ------------------
  |  |  539|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  541|      0|      *param_doublep = (double)val;
  542|      0|      return CURLE_OK;
  543|      0|    }
  544|  9.91k|    break;
  545|  9.91k|  default:
  ------------------
  |  Branch (545:3): [True: 0, False: 9.91k]
  ------------------
  546|      0|    break;
  547|  9.91k|  }
  548|  9.91k|#endif
  549|  9.91k|  switch(info) {
  550|  9.91k|  case CURLINFO_TOTAL_TIME:
  ------------------
  |  Branch (550:3): [True: 9.91k, False: 0]
  ------------------
  551|  9.91k|    *param_doublep = DOUBLE_SECS(data->progress.total.spent_us);
  ------------------
  |  |  417|  9.91k|#define DOUBLE_SECS(x) ((double)(x) / 1000000)
  ------------------
  552|  9.91k|    break;
  553|      0|  case CURLINFO_NAMELOOKUP_TIME:
  ------------------
  |  Branch (553:3): [True: 0, False: 9.91k]
  ------------------
  554|      0|    *param_doublep = DOUBLE_SECS(data->progress.total.nslookup_us);
  ------------------
  |  |  417|      0|#define DOUBLE_SECS(x) ((double)(x) / 1000000)
  ------------------
  555|      0|    break;
  556|      0|  case CURLINFO_CONNECT_TIME:
  ------------------
  |  Branch (556:3): [True: 0, False: 9.91k]
  ------------------
  557|      0|    *param_doublep = DOUBLE_SECS(data->progress.total.connect_us);
  ------------------
  |  |  417|      0|#define DOUBLE_SECS(x) ((double)(x) / 1000000)
  ------------------
  558|      0|    break;
  559|      0|  case CURLINFO_APPCONNECT_TIME:
  ------------------
  |  Branch (559:3): [True: 0, False: 9.91k]
  ------------------
  560|      0|    *param_doublep = DOUBLE_SECS(data->progress.total.appconnect_us);
  ------------------
  |  |  417|      0|#define DOUBLE_SECS(x) ((double)(x) / 1000000)
  ------------------
  561|      0|    break;
  562|      0|  case CURLINFO_PRETRANSFER_TIME:
  ------------------
  |  Branch (562:3): [True: 0, False: 9.91k]
  ------------------
  563|      0|    *param_doublep = DOUBLE_SECS(data->progress.total.pretransfer_us);
  ------------------
  |  |  417|      0|#define DOUBLE_SECS(x) ((double)(x) / 1000000)
  ------------------
  564|      0|    break;
  565|      0|  case CURLINFO_STARTTRANSFER_TIME:
  ------------------
  |  Branch (565:3): [True: 0, False: 9.91k]
  ------------------
  566|      0|    *param_doublep = DOUBLE_SECS(data->progress.total.starttransfer_us);
  ------------------
  |  |  417|      0|#define DOUBLE_SECS(x) ((double)(x) / 1000000)
  ------------------
  567|      0|    break;
  568|      0|  case CURLINFO_SIZE_UPLOAD:
  ------------------
  |  Branch (568:3): [True: 0, False: 9.91k]
  ------------------
  569|      0|    *param_doublep = (double)data->progress.ul.cur_size;
  570|      0|    break;
  571|      0|  case CURLINFO_SIZE_DOWNLOAD:
  ------------------
  |  Branch (571:3): [True: 0, False: 9.91k]
  ------------------
  572|      0|    *param_doublep = (double)data->progress.dl.cur_size;
  573|      0|    break;
  574|      0|  case CURLINFO_SPEED_DOWNLOAD:
  ------------------
  |  Branch (574:3): [True: 0, False: 9.91k]
  ------------------
  575|      0|    *param_doublep = (double)data->progress.dl.speed;
  576|      0|    break;
  577|      0|  case CURLINFO_SPEED_UPLOAD:
  ------------------
  |  Branch (577:3): [True: 0, False: 9.91k]
  ------------------
  578|      0|    *param_doublep = (double)data->progress.ul.speed;
  579|      0|    break;
  580|      0|  case CURLINFO_CONTENT_LENGTH_DOWNLOAD:
  ------------------
  |  Branch (580:3): [True: 0, False: 9.91k]
  ------------------
  581|      0|    *param_doublep = data->progress.dl_size_known ?
  ------------------
  |  Branch (581:22): [True: 0, False: 0]
  ------------------
  582|      0|      (double)data->progress.dl.total_size : -1;
  583|      0|    break;
  584|      0|  case CURLINFO_CONTENT_LENGTH_UPLOAD:
  ------------------
  |  Branch (584:3): [True: 0, False: 9.91k]
  ------------------
  585|      0|    *param_doublep = data->progress.ul_size_known ?
  ------------------
  |  Branch (585:22): [True: 0, False: 0]
  ------------------
  586|      0|      (double)data->progress.ul.total_size : -1;
  587|      0|    break;
  588|      0|  case CURLINFO_REDIRECT_TIME:
  ------------------
  |  Branch (588:3): [True: 0, False: 9.91k]
  ------------------
  589|      0|    *param_doublep = DOUBLE_SECS(data->progress.delta.startredirect_us);
  ------------------
  |  |  417|      0|#define DOUBLE_SECS(x) ((double)(x) / 1000000)
  ------------------
  590|      0|    break;
  591|       |
  592|      0|  default:
  ------------------
  |  Branch (592:3): [True: 0, False: 9.91k]
  ------------------
  593|      0|    return CURLE_UNKNOWN_OPTION;
  594|  9.91k|  }
  595|       |
  596|  9.91k|  return CURLE_OK;
  597|  9.91k|}
getinfo.c:getinfo_offt:
  421|  9.91k|{
  422|  9.91k|#ifdef DEBUGBUILD
  423|  9.91k|  const char *envstr;
  424|  9.91k|  switch(info) {
  425|      0|  case CURLINFO_TOTAL_TIME_T:
  ------------------
  |  Branch (425:3): [True: 0, False: 9.91k]
  ------------------
  426|      0|  case CURLINFO_NAMELOOKUP_TIME_T:
  ------------------
  |  Branch (426:3): [True: 0, False: 9.91k]
  ------------------
  427|      0|  case CURLINFO_CONNECT_TIME_T:
  ------------------
  |  Branch (427:3): [True: 0, False: 9.91k]
  ------------------
  428|      0|  case CURLINFO_APPCONNECT_TIME_T:
  ------------------
  |  Branch (428:3): [True: 0, False: 9.91k]
  ------------------
  429|      0|  case CURLINFO_PRETRANSFER_TIME_T:
  ------------------
  |  Branch (429:3): [True: 0, False: 9.91k]
  ------------------
  430|      0|  case CURLINFO_POSTTRANSFER_TIME_T:
  ------------------
  |  Branch (430:3): [True: 0, False: 9.91k]
  ------------------
  431|      0|  case CURLINFO_QUEUE_TIME_T:
  ------------------
  |  Branch (431:3): [True: 0, False: 9.91k]
  ------------------
  432|      0|  case CURLINFO_STARTTRANSFER_TIME_T:
  ------------------
  |  Branch (432:3): [True: 0, False: 9.91k]
  ------------------
  433|      0|  case CURLINFO_REDIRECT_TIME_T:
  ------------------
  |  Branch (433:3): [True: 0, False: 9.91k]
  ------------------
  434|      0|  case CURLINFO_SPEED_DOWNLOAD_T:
  ------------------
  |  Branch (434:3): [True: 0, False: 9.91k]
  ------------------
  435|      0|  case CURLINFO_SPEED_UPLOAD_T:
  ------------------
  |  Branch (435:3): [True: 0, False: 9.91k]
  ------------------
  436|      0|    envstr = getenv("CURL_TIME");
  437|      0|    if(envstr) {
  ------------------
  |  Branch (437:8): [True: 0, False: 0]
  ------------------
  438|      0|      curl_off_t val;
  439|      0|      curlx_str_number(&envstr, &val, CURL_OFF_T_MAX);
  ------------------
  |  |  539|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  440|      0|      *param_offt = (curl_off_t)val;
  441|      0|      return CURLE_OK;
  442|      0|    }
  443|      0|    break;
  444|  9.91k|  default:
  ------------------
  |  Branch (444:3): [True: 9.91k, False: 0]
  ------------------
  445|  9.91k|    break;
  446|  9.91k|  }
  447|  9.91k|#endif
  448|  9.91k|  switch(info) {
  449|      0|  case CURLINFO_FILETIME_T:
  ------------------
  |  Branch (449:3): [True: 0, False: 9.91k]
  ------------------
  450|      0|    *param_offt = (curl_off_t)data->info.filetime;
  451|      0|    break;
  452|      0|  case CURLINFO_SIZE_DELIVERED:
  ------------------
  |  Branch (452:3): [True: 0, False: 9.91k]
  ------------------
  453|      0|    *param_offt = data->progress.deliver;
  454|      0|    break;
  455|      0|  case CURLINFO_SIZE_UPLOAD_T:
  ------------------
  |  Branch (455:3): [True: 0, False: 9.91k]
  ------------------
  456|      0|    *param_offt = data->progress.ul.cur_size;
  457|      0|    break;
  458|  9.91k|  case CURLINFO_SIZE_DOWNLOAD_T:
  ------------------
  |  Branch (458:3): [True: 9.91k, False: 0]
  ------------------
  459|  9.91k|    *param_offt = data->progress.dl.cur_size;
  460|  9.91k|    break;
  461|      0|  case CURLINFO_SPEED_DOWNLOAD_T:
  ------------------
  |  Branch (461:3): [True: 0, False: 9.91k]
  ------------------
  462|      0|    *param_offt = data->progress.dl.speed;
  463|      0|    break;
  464|      0|  case CURLINFO_SPEED_UPLOAD_T:
  ------------------
  |  Branch (464:3): [True: 0, False: 9.91k]
  ------------------
  465|      0|    *param_offt = data->progress.ul.speed;
  466|      0|    break;
  467|      0|  case CURLINFO_CONTENT_LENGTH_DOWNLOAD_T:
  ------------------
  |  Branch (467:3): [True: 0, False: 9.91k]
  ------------------
  468|      0|    *param_offt = data->progress.dl_size_known ?
  ------------------
  |  Branch (468:19): [True: 0, False: 0]
  ------------------
  469|      0|      data->progress.dl.total_size : -1;
  470|      0|    break;
  471|      0|  case CURLINFO_CONTENT_LENGTH_UPLOAD_T:
  ------------------
  |  Branch (471:3): [True: 0, False: 9.91k]
  ------------------
  472|      0|    *param_offt = data->progress.ul_size_known ?
  ------------------
  |  Branch (472:19): [True: 0, False: 0]
  ------------------
  473|      0|      data->progress.ul.total_size : -1;
  474|      0|    break;
  475|      0|   case CURLINFO_TOTAL_TIME_T:
  ------------------
  |  Branch (475:4): [True: 0, False: 9.91k]
  ------------------
  476|      0|    *param_offt = data->progress.total.spent_us;
  477|      0|    break;
  478|      0|  case CURLINFO_NAMELOOKUP_TIME_T:
  ------------------
  |  Branch (478:3): [True: 0, False: 9.91k]
  ------------------
  479|      0|    *param_offt = data->progress.total.nslookup_us;
  480|      0|    break;
  481|      0|  case CURLINFO_CONNECT_TIME_T:
  ------------------
  |  Branch (481:3): [True: 0, False: 9.91k]
  ------------------
  482|      0|    *param_offt = data->progress.total.connect_us;
  483|      0|    break;
  484|      0|  case CURLINFO_APPCONNECT_TIME_T:
  ------------------
  |  Branch (484:3): [True: 0, False: 9.91k]
  ------------------
  485|      0|    *param_offt = data->progress.total.appconnect_us;
  486|      0|    break;
  487|      0|  case CURLINFO_PRETRANSFER_TIME_T:
  ------------------
  |  Branch (487:3): [True: 0, False: 9.91k]
  ------------------
  488|      0|    *param_offt = data->progress.total.pretransfer_us;
  489|      0|    break;
  490|      0|  case CURLINFO_POSTTRANSFER_TIME_T:
  ------------------
  |  Branch (490:3): [True: 0, False: 9.91k]
  ------------------
  491|      0|    *param_offt = data->progress.total.posttransfer_us;
  492|      0|    break;
  493|      0|  case CURLINFO_STARTTRANSFER_TIME_T:
  ------------------
  |  Branch (493:3): [True: 0, False: 9.91k]
  ------------------
  494|      0|    *param_offt = data->progress.total.starttransfer_us;
  495|      0|    break;
  496|      0|  case CURLINFO_QUEUE_TIME_T:
  ------------------
  |  Branch (496:3): [True: 0, False: 9.91k]
  ------------------
  497|      0|    *param_offt = data->progress.total.queued_us;
  498|      0|    break;
  499|      0|  case CURLINFO_REDIRECT_TIME_T:
  ------------------
  |  Branch (499:3): [True: 0, False: 9.91k]
  ------------------
  500|      0|    *param_offt = data->progress.delta.startredirect_us;
  501|      0|    break;
  502|      0|  case CURLINFO_RETRY_AFTER:
  ------------------
  |  Branch (502:3): [True: 0, False: 9.91k]
  ------------------
  503|      0|    *param_offt = data->info.retry_after;
  504|      0|    break;
  505|      0|  case CURLINFO_XFER_ID:
  ------------------
  |  Branch (505:3): [True: 0, False: 9.91k]
  ------------------
  506|      0|    *param_offt = data->id;
  507|      0|    break;
  508|      0|  case CURLINFO_CONN_ID:
  ------------------
  |  Branch (508:3): [True: 0, False: 9.91k]
  ------------------
  509|      0|    *param_offt = data->state.last_conn_id;
  510|      0|    break;
  511|      0|  case CURLINFO_EARLYDATA_SENT_T:
  ------------------
  |  Branch (511:3): [True: 0, False: 9.91k]
  ------------------
  512|      0|    *param_offt = data->progress.earlydata_sent;
  513|      0|    break;
  514|      0|  default:
  ------------------
  |  Branch (514:3): [True: 0, False: 9.91k]
  ------------------
  515|      0|    return CURLE_UNKNOWN_OPTION;
  516|  9.91k|  }
  517|       |
  518|  9.91k|  return CURLE_OK;
  519|  9.91k|}
getinfo.c:getinfo_slist:
  601|  9.91k|{
  602|  9.91k|  union {
  603|  9.91k|    struct curl_certinfo *to_certinfo;
  604|  9.91k|    struct curl_slist    *to_slist;
  605|  9.91k|  } ptr;
  606|       |
  607|  9.91k|  switch(info) {
  608|      0|  case CURLINFO_SSL_ENGINES:
  ------------------
  |  Branch (608:3): [True: 0, False: 9.91k]
  ------------------
  609|      0|    *param_slistp = Curl_ssl_engines_list(data);
  610|      0|    break;
  611|      0|  case CURLINFO_COOKIELIST:
  ------------------
  |  Branch (611:3): [True: 0, False: 9.91k]
  ------------------
  612|      0|    *param_slistp = Curl_cookie_list(data);
  613|      0|    break;
  614|  9.91k|  case CURLINFO_CERTINFO:
  ------------------
  |  Branch (614:3): [True: 9.91k, False: 0]
  ------------------
  615|       |    /* Return the a pointer to the certinfo struct. Not really an slist
  616|       |       pointer but we can pretend it is here */
  617|  9.91k|    ptr.to_certinfo = &data->info.certs;
  618|  9.91k|    *param_slistp = ptr.to_slist;
  619|  9.91k|    break;
  620|      0|  case CURLINFO_TLS_SESSION:
  ------------------
  |  Branch (620:3): [True: 0, False: 9.91k]
  ------------------
  621|      0|  case CURLINFO_TLS_SSL_PTR: {
  ------------------
  |  Branch (621:3): [True: 0, False: 9.91k]
  ------------------
  622|      0|    int query = (info == CURLINFO_TLS_SSL_PTR) ?
  ------------------
  |  Branch (622:17): [True: 0, False: 0]
  ------------------
  623|      0|      CF_QUERY_SSL_INFO : CF_QUERY_SSL_CTX_INFO;
  ------------------
  |  |  178|      0|#define CF_QUERY_SSL_INFO          12  /* -    struct curl_tlssessioninfo * */
  ------------------
                    CF_QUERY_SSL_INFO : CF_QUERY_SSL_CTX_INFO;
  ------------------
  |  |  179|      0|#define CF_QUERY_SSL_CTX_INFO      13  /* -    struct curl_tlssessioninfo * */
  ------------------
  624|      0|    struct curl_tlssessioninfo **tsip = (struct curl_tlssessioninfo **)
  625|      0|      param_slistp;
  626|      0|    struct curl_tlssessioninfo *tsi = &data->tsi;
  627|       |
  628|       |    /* we are exposing a pointer to internal memory with unknown
  629|       |     * lifetime here. */
  630|      0|    *tsip = tsi;
  631|      0|    if(!Curl_conn_get_ssl_info(data, data->conn, query, tsi)) {
  ------------------
  |  Branch (631:8): [True: 0, False: 0]
  ------------------
  632|      0|      tsi->backend = Curl_ssl_backend();
  633|      0|      tsi->internals = NULL;
  634|      0|    }
  635|      0|  }
  636|      0|    break;
  637|      0|  default:
  ------------------
  |  Branch (637:3): [True: 0, False: 9.91k]
  ------------------
  638|      0|    return CURLE_UNKNOWN_OPTION;
  639|  9.91k|  }
  640|       |
  641|  9.91k|  return CURLE_OK;
  642|  9.91k|}
getinfo.c:getinfo_socket:
  646|  9.91k|{
  647|  9.91k|  switch(info) {
  648|  9.91k|  case CURLINFO_ACTIVESOCKET:
  ------------------
  |  Branch (648:3): [True: 9.91k, False: 0]
  ------------------
  649|  9.91k|    *param_socketp = Curl_getconnectinfo(data, NULL);
  650|  9.91k|    break;
  651|      0|  default:
  ------------------
  |  Branch (651:3): [True: 0, False: 9.91k]
  ------------------
  652|      0|    return CURLE_UNKNOWN_OPTION;
  653|  9.91k|  }
  654|       |
  655|  9.91k|  return CURLE_OK;
  656|  9.91k|}

Curl_hash_global_init:
   60|      2|{
   61|      2|  static bool seeded;
   62|      2|  unsigned char buf[sizeof(size_t)];
   63|      2|  size_t seed = 0;
   64|      2|  size_t i;
   65|      2|  CURLcode result;
   66|       |
   67|      2|  if(seeded)
  ------------------
  |  Branch (67:6): [True: 0, False: 2]
  ------------------
   68|      0|    return CURLE_OK;
   69|       |
   70|      2|  result = Curl_rand_bytes(NULL,
   71|      2|#ifdef DEBUGBUILD
   72|      2|                           FALSE,
  ------------------
  |  |  989|      2|#define FALSE false
  ------------------
   73|      2|#endif
   74|      2|                           buf, sizeof(buf));
   75|      2|  if(result)
  ------------------
  |  Branch (75:6): [True: 0, False: 2]
  ------------------
   76|      0|    return result;
   77|       |
   78|     18|  for(i = 0; i < sizeof(buf); i++)
  ------------------
  |  Branch (78:14): [True: 16, False: 2]
  ------------------
   79|     16|    seed = (seed << 8) | buf[i];
   80|       |
   81|      2|  hash_seed = seed ? seed : 1;
  ------------------
  |  Branch (81:15): [True: 2, False: 0]
  ------------------
   82|       |  seeded = TRUE;
  ------------------
  |  |  986|      2|#define TRUE true
  ------------------
   83|      2|  return CURLE_OK;
   84|      2|}
hash_str_seeded:
   92|  64.6k|{
   93|  64.6k|  const char *key_str = (const char *)key;
   94|  64.6k|  const char *end = key_str + key_length;
   95|  64.6k|  size_t h = 5381 ^ seed;
   96|       |
   97|   811k|  while(key_str < end) {
  ------------------
  |  Branch (97:9): [True: 746k, False: 64.6k]
  ------------------
   98|   746k|    size_t j = (size_t)*key_str++;
   99|   746k|    h += h << 5;
  100|   746k|    h ^= j;
  101|   746k|  }
  102|       |
  103|  64.6k|  return (h % slots_num);
  104|  64.6k|}
hash_str:
  110|  64.6k|{
  111|  64.6k|  return hash_str_seeded(key, key_length, slots_num, hash_seed);
  112|  64.6k|}
Curl_hash_init:
  257|  68.4k|{
  258|  68.4k|  DEBUGASSERT(h);
  ------------------
  |  | 1016|  68.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (258:3): [True: 0, False: 68.4k]
  |  Branch (258:3): [True: 68.4k, False: 0]
  ------------------
  259|  68.4k|  DEBUGASSERT(slots);
  ------------------
  |  | 1016|  68.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (259:3): [True: 0, False: 68.4k]
  |  Branch (259:3): [True: 68.4k, False: 0]
  ------------------
  260|  68.4k|  DEBUGASSERT((unsigned int)type < CURL_HASH_TYPE_LAST);
  ------------------
  |  | 1016|  68.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (260:3): [True: 0, False: 68.4k]
  |  Branch (260:3): [True: 68.4k, False: 0]
  ------------------
  261|  68.4k|  DEBUGASSERT(dtor);
  ------------------
  |  | 1016|  68.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (261:3): [True: 0, False: 68.4k]
  |  Branch (261:3): [True: 68.4k, False: 0]
  ------------------
  262|       |
  263|  68.4k|  h->table = NULL;
  264|  68.4k|  h->dtor = dtor;
  265|  68.4k|  h->size = 0;
  266|  68.4k|  h->slots = slots;
  267|  68.4k|  h->type = (uint8_t)type;
  268|  68.4k|#ifdef DEBUGBUILD
  269|  68.4k|  h->init = HASHINIT;
  ------------------
  |  |   33|  68.4k|#define HASHINIT 0x7017e781
  ------------------
  270|  68.4k|#endif
  271|  68.4k|}
Curl_hash_add2:
  334|  27.0k|{
  335|  27.0k|  const struct hash_functions *functions;
  336|  27.0k|  struct Curl_hash_element *he, **slot;
  337|       |
  338|  27.0k|  DEBUGASSERT(h);
  ------------------
  |  | 1016|  27.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (338:3): [True: 0, False: 27.0k]
  |  Branch (338:3): [True: 27.0k, False: 0]
  ------------------
  339|  27.0k|  DEBUGASSERT(h->slots);
  ------------------
  |  | 1016|  27.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (339:3): [True: 0, False: 27.0k]
  |  Branch (339:3): [True: 27.0k, False: 0]
  ------------------
  340|  27.0k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1016|  27.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (340:3): [True: 0, False: 27.0k]
  |  Branch (340:3): [True: 27.0k, False: 0]
  ------------------
  341|  27.0k|  if(!hash_key_is_valid(h->type, key_len))
  ------------------
  |  Branch (341:6): [True: 0, False: 27.0k]
  ------------------
  342|      0|    return NULL;
  343|  27.0k|  if(!h->table) {
  ------------------
  |  Branch (343:6): [True: 25.1k, False: 1.96k]
  ------------------
  344|  25.1k|    h->table = curlx_calloc(h->slots, sizeof(struct Curl_hash_element *));
  ------------------
  |  | 1500|  25.1k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  345|  25.1k|    if(!h->table)
  ------------------
  |  Branch (345:8): [True: 11, False: 25.0k]
  ------------------
  346|     11|      return NULL; /* OOM */
  347|  25.1k|  }
  348|       |
  349|  27.0k|  functions = hash_get_functions(h->type);
  350|  27.0k|  slot = &h->table[functions->hash(key, key_len, h->slots)];
  351|  27.0k|  for(he = *slot; he; he = he->next) {
  ------------------
  |  Branch (351:19): [True: 0, False: 27.0k]
  ------------------
  352|      0|    if(functions->compare(hash_elem_key(he), he->key_len, key, key_len)) {
  ------------------
  |  Branch (352:8): [True: 0, False: 0]
  ------------------
  353|       |      /* existing key entry, overwrite by clearing old pointer */
  354|      0|      hash_elem_clear_ptr(h, he);
  355|      0|      he->ptr = p;
  356|      0|      he->dtor = dtor;
  357|      0|      return p;
  358|      0|    }
  359|      0|  }
  360|       |
  361|  27.0k|  he = hash_elem_create(key, key_len, p, dtor);
  362|  27.0k|  if(!he)
  ------------------
  |  Branch (362:6): [True: 14, False: 27.0k]
  ------------------
  363|     14|    return NULL; /* OOM */
  364|       |
  365|  27.0k|  hash_elem_link(h, slot, he);
  366|  27.0k|  return p; /* return the new entry */
  367|  27.0k|}
Curl_hash_add:
  379|  22.8k|{
  380|       |  return Curl_hash_add2(h, key, key_len, p, NULL);
  381|  22.8k|}
Curl_hash_delete:
  389|  32.7k|{
  390|  32.7k|  const struct hash_functions *functions;
  391|       |
  392|  32.7k|  DEBUGASSERT(h);
  ------------------
  |  | 1016|  32.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (392:3): [True: 0, False: 32.7k]
  |  Branch (392:3): [True: 32.7k, False: 0]
  ------------------
  393|  32.7k|  DEBUGASSERT(h->slots);
  ------------------
  |  | 1016|  32.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (393:3): [True: 0, False: 32.7k]
  |  Branch (393:3): [True: 32.7k, False: 0]
  ------------------
  394|  32.7k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1016|  32.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (394:3): [True: 0, False: 32.7k]
  |  Branch (394:3): [True: 32.7k, False: 0]
  ------------------
  395|  32.7k|  if(!hash_key_is_valid(h->type, key_len))
  ------------------
  |  Branch (395:6): [True: 0, False: 32.7k]
  ------------------
  396|      0|    return 1;
  397|  32.7k|  if(h->table) {
  ------------------
  |  Branch (397:6): [True: 15.5k, False: 17.2k]
  ------------------
  398|  15.5k|    struct Curl_hash_element *he, **he_anchor;
  399|       |
  400|  15.5k|    functions = hash_get_functions(h->type);
  401|  15.5k|    he_anchor = &h->table[functions->hash(key, key_len, h->slots)];
  402|  15.5k|    while(*he_anchor) {
  ------------------
  |  Branch (402:11): [True: 15.5k, False: 0]
  ------------------
  403|  15.5k|      he = *he_anchor;
  404|  15.5k|      if(functions->compare(hash_elem_key(he), he->key_len, key, key_len)) {
  ------------------
  |  Branch (404:10): [True: 15.5k, False: 0]
  ------------------
  405|  15.5k|        hash_elem_unlink(h, he_anchor, he);
  406|  15.5k|        hash_elem_destroy(h, he);
  407|  15.5k|        return 0;
  408|  15.5k|      }
  409|      0|      he_anchor = &he->next;
  410|      0|    }
  411|  15.5k|  }
  412|  17.2k|  return 1;
  413|  32.7k|}
Curl_hash_pick:
  420|   138k|{
  421|   138k|  const struct hash_functions *functions;
  422|       |
  423|   138k|  DEBUGASSERT(h);
  ------------------
  |  | 1016|   138k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (423:3): [True: 0, False: 138k]
  |  Branch (423:3): [True: 138k, False: 0]
  ------------------
  424|   138k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1016|   138k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (424:3): [True: 0, False: 138k]
  |  Branch (424:3): [True: 138k, False: 0]
  ------------------
  425|   138k|  if(!hash_key_is_valid(h->type, key_len))
  ------------------
  |  Branch (425:6): [True: 0, False: 138k]
  ------------------
  426|      0|    return NULL;
  427|   138k|  if(h->table) {
  ------------------
  |  Branch (427:6): [True: 82.2k, False: 56.0k]
  ------------------
  428|  82.2k|    struct Curl_hash_element *he;
  429|  82.2k|    DEBUGASSERT(h->slots);
  ------------------
  |  | 1016|  82.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (429:5): [True: 0, False: 82.2k]
  |  Branch (429:5): [True: 82.2k, False: 0]
  ------------------
  430|  82.2k|    functions = hash_get_functions(h->type);
  431|  82.2k|    he = h->table[functions->hash(key, key_len, h->slots)];
  432|  82.2k|    while(he) {
  ------------------
  |  Branch (432:11): [True: 76.7k, False: 5.51k]
  ------------------
  433|  76.7k|      if(functions->compare(hash_elem_key(he), he->key_len, key, key_len)) {
  ------------------
  |  Branch (433:10): [True: 76.7k, False: 0]
  ------------------
  434|  76.7k|        return he->ptr;
  435|  76.7k|      }
  436|      0|      he = he->next;
  437|      0|    }
  438|  82.2k|  }
  439|  61.6k|  return NULL;
  440|   138k|}
Curl_hash_destroy:
  450|  68.4k|{
  451|  68.4k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1016|  68.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (451:3): [True: 0, False: 68.4k]
  |  Branch (451:3): [True: 68.4k, False: 0]
  ------------------
  452|  68.4k|  if(h->table) {
  ------------------
  |  Branch (452:6): [True: 25.0k, False: 43.3k]
  ------------------
  453|  25.0k|    Curl_hash_clean(h);
  454|  25.0k|    curlx_safefree(h->table);
  ------------------
  |  | 1359|  25.0k|  do {                      \
  |  | 1360|  25.0k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  25.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  25.0k|    (ptr) = NULL;           \
  |  | 1362|  25.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 25.0k]
  |  |  ------------------
  ------------------
  455|  25.0k|  }
  456|  68.4k|  DEBUGASSERT(h->size == 0);
  ------------------
  |  | 1016|  68.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (456:3): [True: 0, False: 68.4k]
  |  Branch (456:3): [True: 68.4k, False: 0]
  ------------------
  457|  68.4k|  h->slots = 0;
  458|  68.4k|}
Curl_hash_clean:
  465|  25.0k|{
  466|  25.0k|  if(h && h->table) {
  ------------------
  |  Branch (466:6): [True: 25.0k, False: 0]
  |  Branch (466:11): [True: 25.0k, False: 0]
  ------------------
  467|  25.0k|    struct Curl_hash_element *he, **he_anchor;
  468|  25.0k|    size_t i;
  469|  25.0k|    DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1016|  25.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (469:5): [True: 0, False: 25.0k]
  |  Branch (469:5): [True: 25.0k, False: 0]
  ------------------
  470|  3.69M|    for(i = 0; i < h->slots; ++i) {
  ------------------
  |  Branch (470:16): [True: 3.67M, False: 25.0k]
  ------------------
  471|  3.67M|      he_anchor = &h->table[i];
  472|  3.68M|      while(*he_anchor) {
  ------------------
  |  Branch (472:13): [True: 11.5k, False: 3.67M]
  ------------------
  473|  11.5k|        he = *he_anchor;
  474|  11.5k|        hash_elem_unlink(h, he_anchor, he);
  475|  11.5k|        hash_elem_destroy(h, he);
  476|  11.5k|      }
  477|  3.67M|    }
  478|  25.0k|  }
  479|  25.0k|}
Curl_hash_count:
  482|  9.37k|{
  483|  9.37k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1016|  9.37k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (483:3): [True: 0, False: 9.37k]
  |  Branch (483:3): [True: 9.37k, False: 0]
  ------------------
  484|  9.37k|  return h->size;
  485|  9.37k|}
Curl_hash_clean_with_criterium:
  490|  9.37k|{
  491|  9.37k|  size_t i;
  492|       |
  493|  9.37k|  if(!h || !h->table)
  ------------------
  |  Branch (493:6): [True: 0, False: 9.37k]
  |  Branch (493:12): [True: 69, False: 9.30k]
  ------------------
  494|     69|    return;
  495|       |
  496|  9.30k|  DEBUGASSERT(h->init == HASHINIT);
  ------------------
  |  | 1016|  9.30k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (496:3): [True: 0, False: 9.30k]
  |  Branch (496:3): [True: 9.30k, False: 0]
  ------------------
  497|   669k|  for(i = 0; i < h->slots; ++i) {
  ------------------
  |  Branch (497:14): [True: 660k, False: 9.30k]
  ------------------
  498|   660k|    struct Curl_hash_element *he, **he_anchor = &h->table[i];
  499|   669k|    while(*he_anchor) {
  ------------------
  |  Branch (499:11): [True: 9.29k, False: 660k]
  ------------------
  500|       |      /* ask the callback function if we shall remove this entry or not */
  501|  9.29k|      if(!comp || comp(user, (*he_anchor)->ptr)) {
  ------------------
  |  Branch (501:10): [True: 0, False: 9.29k]
  |  Branch (501:19): [True: 0, False: 9.29k]
  ------------------
  502|      0|        he = *he_anchor;
  503|      0|        hash_elem_unlink(h, he_anchor, he);
  504|      0|        hash_elem_destroy(h, he);
  505|      0|      }
  506|  9.29k|      else
  507|  9.29k|        he_anchor = &(*he_anchor)->next;
  508|  9.29k|    }
  509|   660k|  }
  510|  9.30k|}
hash.c:hash_key_is_valid:
  165|   198k|{
  166|   198k|  return (type == CURL_HASH_TYPE_BYTES) ||
  ------------------
  |  Branch (166:10): [True: 126k, False: 71.8k]
  ------------------
  167|  71.8k|    ((type == CURL_HASH_TYPE_SOCKET) &&
  ------------------
  |  Branch (167:6): [True: 71.8k, False: 0]
  ------------------
  168|  71.8k|     (key_len == sizeof(curl_socket_t)));
  ------------------
  |  Branch (168:6): [True: 71.8k, False: 0]
  ------------------
  169|   198k|}
hash.c:hash_get_functions:
  157|   124k|{
  158|   124k|  DEBUGASSERT(CURL_ARRAYSIZE(hash_functions) == CURL_HASH_TYPE_LAST);
  ------------------
  |  | 1016|   124k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (158:3): [True: 0, Folded]
  |  Branch (158:3): [True: 124k, Folded]
  ------------------
  159|   124k|  if((unsigned int)type >= CURL_HASH_TYPE_LAST)
  ------------------
  |  Branch (159:6): [True: 0, False: 124k]
  ------------------
  160|      0|    type = CURL_HASH_TYPE_BYTES;
  161|   124k|  return &hash_functions[type];
  162|   124k|}
hash.c:compare_bytes:
  147|  41.7k|{
  148|  41.7k|  return (key1_len == key2_len) && !memcmp(key1, key2, key1_len);
  ------------------
  |  Branch (148:10): [True: 41.7k, False: 0]
  |  Branch (148:36): [True: 41.7k, False: 0]
  ------------------
  149|  41.7k|}
hash.c:hash_socket:
  122|  60.1k|{
  123|  60.1k|  curl_socket_t socket;
  124|       |
  125|  60.1k|  DEBUGASSERT(key_length == sizeof(socket));
  ------------------
  |  | 1016|  60.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (125:3): [True: 0, False: 60.1k]
  |  Branch (125:3): [True: 60.1k, False: 0]
  ------------------
  126|  60.1k|  if(key_length != sizeof(socket))
  ------------------
  |  Branch (126:6): [True: 0, False: 60.1k]
  ------------------
  127|      0|    return 0;
  128|  60.1k|  memcpy(&socket, key, sizeof(socket));
  129|  60.1k|  return (size_t)(socket % (curl_socket_t)slots_num);
  130|  60.1k|}
hash.c:compare_socket:
  134|  50.4k|{
  135|  50.4k|  curl_socket_t socket1;
  136|  50.4k|  curl_socket_t socket2;
  137|       |
  138|  50.4k|  if((key1_len != sizeof(socket1)) || (key2_len != sizeof(socket2)))
  ------------------
  |  Branch (138:6): [True: 0, False: 50.4k]
  |  Branch (138:39): [True: 0, False: 50.4k]
  ------------------
  139|      0|    return 0;
  140|  50.4k|  memcpy(&socket1, key1, sizeof(socket1));
  141|  50.4k|  memcpy(&socket2, key2, sizeof(socket2));
  142|  50.4k|  return socket1 == socket2;
  143|  50.4k|}
hash.c:hash_elem_key:
  116|   123k|{
  117|       |  return (char *)he + offsetof(struct Curl_hash_element, key);
  118|   123k|}
hash.c:hash_elem_clear_ptr:
  295|  27.0k|{
  296|  27.0k|  DEBUGASSERT(h);
  ------------------
  |  | 1016|  27.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (296:3): [True: 0, False: 27.0k]
  |  Branch (296:3): [True: 27.0k, False: 0]
  ------------------
  297|  27.0k|  DEBUGASSERT(he);
  ------------------
  |  | 1016|  27.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (297:3): [True: 0, False: 27.0k]
  |  Branch (297:3): [True: 27.0k, False: 0]
  ------------------
  298|  27.0k|  if(he->ptr) {
  ------------------
  |  Branch (298:6): [True: 27.0k, False: 0]
  ------------------
  299|  27.0k|    if(he->dtor)
  ------------------
  |  Branch (299:8): [True: 4.18k, False: 22.8k]
  ------------------
  300|  4.18k|      he->dtor(hash_elem_key(he), he->key_len, he->ptr);
  301|  22.8k|    else
  302|  22.8k|      h->dtor(he->ptr);
  303|       |    he->ptr = NULL;
  304|  27.0k|  }
  305|  27.0k|}
hash.c:hash_elem_create:
  277|  27.0k|{
  278|  27.0k|  struct Curl_hash_element *he;
  279|       |
  280|       |  /* allocate the struct plus memory after it to store the key */
  281|  27.0k|  he = curlx_malloc(sizeof(struct Curl_hash_element) + key_len);
  ------------------
  |  | 1498|  27.0k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  282|  27.0k|  if(he) {
  ------------------
  |  Branch (282:6): [True: 27.0k, False: 14]
  ------------------
  283|  27.0k|    he->next = NULL;
  284|       |    /* copy the key */
  285|  27.0k|    memcpy(hash_elem_key(he), key, key_len);
  286|  27.0k|    he->key_len = key_len;
  287|  27.0k|    he->ptr = p;
  288|  27.0k|    he->dtor = dtor;
  289|  27.0k|  }
  290|  27.0k|  return he;
  291|  27.0k|}
hash.c:hash_elem_link:
  325|  27.0k|{
  326|  27.0k|  he->next = *he_anchor;
  327|  27.0k|  *he_anchor = he;
  328|  27.0k|  ++h->size;
  329|  27.0k|}
hash.c:hash_elem_unlink:
  317|  27.0k|{
  318|  27.0k|  *he_anchor = he->next;
  319|  27.0k|  --h->size;
  320|  27.0k|}
hash.c:hash_elem_destroy:
  309|  27.0k|{
  310|  27.0k|  hash_elem_clear_ptr(h, he);
  311|  27.0k|  curlx_free(he);
  ------------------
  |  | 1503|  27.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  312|  27.0k|}

curl_easy_header:
   62|  9.91k|{
   63|  9.91k|  struct Curl_eapi_guard guard;
   64|  9.91k|  CURLHcode hresult = CURLHE_OK;
   65|  9.91k|  CURLcode result;
   66|       |
   67|  9.91k|  if(CURL_EAPI_ENTER(&guard, curl, easy_header, &result)) {
  ------------------
  |  |  163|  9.91k|  Curl_eapi_enter(g, curl, CURL_EAPI_FN_##fn, r) && (curl)
  |  |  ------------------
  |  |  |  Branch (163:3): [True: 9.91k, False: 0]
  |  |  |  Branch (163:53): [True: 9.91k, False: 0]
  |  |  ------------------
  ------------------
   68|  9.91k|    struct Curl_easy *data = curl;
   69|  9.91k|    struct Curl_llist_node *e;
   70|  9.91k|    struct Curl_llist_node *e_pick = NULL;
   71|  9.91k|    size_t match = 0;
   72|  9.91k|    size_t amount = 0;
   73|  9.91k|    struct Curl_header_store *hs = NULL;
   74|  9.91k|    struct Curl_header_store *pick = NULL;
   75|  9.91k|    if(!name || !hout || !data ||
  ------------------
  |  Branch (75:8): [True: 0, False: 9.91k]
  |  Branch (75:17): [True: 0, False: 9.91k]
  |  Branch (75:26): [True: 0, False: 9.91k]
  ------------------
   76|  9.91k|       (origin > (CURLH_HEADER | CURLH_TRAILER | CURLH_CONNECT | CURLH_1XX |
  ------------------
  |  |   41|  9.91k|#define CURLH_HEADER    (1 << 0) /* plain server header */
  ------------------
                     (origin > (CURLH_HEADER | CURLH_TRAILER | CURLH_CONNECT | CURLH_1XX |
  ------------------
  |  |   42|  9.91k|#define CURLH_TRAILER   (1 << 1) /* trailers */
  ------------------
                     (origin > (CURLH_HEADER | CURLH_TRAILER | CURLH_CONNECT | CURLH_1XX |
  ------------------
  |  |   43|  9.91k|#define CURLH_CONNECT   (1 << 2) /* CONNECT headers */
  ------------------
                     (origin > (CURLH_HEADER | CURLH_TRAILER | CURLH_CONNECT | CURLH_1XX |
  ------------------
  |  |   44|  9.91k|#define CURLH_1XX       (1 << 3) /* 1xx headers */
  ------------------
  |  Branch (76:8): [True: 0, False: 9.91k]
  ------------------
   77|  9.91k|                  CURLH_PSEUDO)) || !origin || (request < -1)) {
  ------------------
  |  |   45|  9.91k|#define CURLH_PSEUDO    (1 << 4) /* pseudo headers */
  ------------------
  |  Branch (77:37): [True: 0, False: 9.91k]
  |  Branch (77:48): [True: 0, False: 9.91k]
  ------------------
   78|      0|      hresult = CURLHE_BAD_ARGUMENT;
   79|      0|      goto out;
   80|      0|    }
   81|  9.91k|    if(!Curl_llist_count(&data->state.httphdrs)) {
  ------------------
  |  Branch (81:8): [True: 9.26k, False: 655]
  ------------------
   82|  9.26k|      hresult = CURLHE_NOHEADERS; /* no headers available */
   83|  9.26k|      goto out;
   84|  9.26k|    }
   85|    655|    if(request > data->state.requests) {
  ------------------
  |  Branch (85:8): [True: 0, False: 655]
  ------------------
   86|      0|      hresult = CURLHE_NOREQUEST;
   87|      0|      goto out;
   88|      0|    }
   89|    655|    if(request == -1)
  ------------------
  |  Branch (89:8): [True: 655, False: 0]
  ------------------
   90|    655|      request = data->state.requests;
   91|       |
   92|       |    /* we need a first round to count amount of this header */
   93|  30.8k|    for(e = Curl_llist_head(&data->state.httphdrs); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (93:53): [True: 30.1k, False: 655]
  ------------------
   94|  30.1k|      hs = Curl_node_elem(e);
   95|  30.1k|      if(curl_strequal(hs->name, name) &&
  ------------------
  |  Branch (95:10): [True: 50, False: 30.1k]
  ------------------
   96|     50|         (hs->type & origin) &&
  ------------------
  |  Branch (96:10): [True: 50, False: 0]
  ------------------
   97|     50|         (hs->request == request)) {
  ------------------
  |  Branch (97:10): [True: 50, False: 0]
  ------------------
   98|     50|        amount++;
   99|     50|        pick = hs;
  100|     50|        e_pick = e;
  101|     50|      }
  102|  30.1k|    }
  103|    655|    if(!amount)
  ------------------
  |  Branch (103:8): [True: 634, False: 21]
  ------------------
  104|    634|      hresult = CURLHE_MISSING;
  105|     21|    else if(nameindex >= amount)
  ------------------
  |  Branch (105:13): [True: 0, False: 21]
  ------------------
  106|      0|      hresult = CURLHE_BADINDEX;
  107|    655|    if(hresult)
  ------------------
  |  Branch (107:8): [True: 634, False: 21]
  ------------------
  108|    634|      goto out;
  109|       |
  110|     21|    if(nameindex == amount - 1)
  ------------------
  |  Branch (110:8): [True: 4, False: 17]
  ------------------
  111|       |      /* if the last or only occurrence is what's asked for, then we know it */
  112|      4|      hs = pick;
  113|     17|    else {
  114|    309|      for(e = Curl_llist_head(&data->state.httphdrs); e;
  ------------------
  |  Branch (114:55): [True: 309, False: 0]
  ------------------
  115|    309|          e = Curl_node_next(e)) {
  116|    309|        hs = Curl_node_elem(e);
  117|    309|        if(curl_strequal(hs->name, name) &&
  ------------------
  |  Branch (117:12): [True: 17, False: 292]
  ------------------
  118|     17|           (hs->type & origin) &&
  ------------------
  |  Branch (118:12): [True: 17, False: 0]
  ------------------
  119|     17|           (hs->request == request) &&
  ------------------
  |  Branch (119:12): [True: 17, False: 0]
  ------------------
  120|     17|           (match++ == nameindex)) {
  ------------------
  |  Branch (120:12): [True: 17, False: 0]
  ------------------
  121|     17|          e_pick = e;
  122|     17|          break;
  123|     17|        }
  124|    309|      }
  125|     17|      if(!e) { /* this should not happen */
  ------------------
  |  Branch (125:10): [True: 0, False: 17]
  ------------------
  126|      0|        hresult = CURLHE_MISSING;
  127|      0|        goto out;
  128|      0|      }
  129|     17|    }
  130|       |    /* this is the name we want */
  131|     21|    copy_header_external(hs, nameindex, amount, e_pick,
  132|     21|                         &data->state.headerout[0]);
  133|     21|    *hout = &data->state.headerout[0];
  134|     21|    hresult = CURLHE_OK;
  135|     21|  }
  136|  9.91k|out:
  137|  9.91k|  CURL_EAPI_LEAVE(&guard);
  ------------------
  |  |  165|  9.91k|  Curl_eapi_leave(g)
  ------------------
  138|  9.91k|  if(result)
  ------------------
  |  Branch (138:6): [True: 0, False: 9.91k]
  ------------------
  139|      0|    hresult = Curl_eapi_hcode(result);
  140|  9.91k|  return hresult;
  141|  9.91k|}
curl_easy_nextheader:
  222|  13.8k|{
  223|  13.8k|  struct Curl_eapi_guard guard;
  224|  13.8k|  struct curl_header *hd = NULL;
  225|  13.8k|  CURLcode result;
  226|       |
  227|  13.8k|  if(CURL_EAPI_ENTER(&guard, curl, easy_nextheader, &result)) {
  ------------------
  |  |  163|  13.8k|  Curl_eapi_enter(g, curl, CURL_EAPI_FN_##fn, r) && (curl)
  |  |  ------------------
  |  |  |  Branch (163:3): [True: 13.8k, False: 0]
  |  |  |  Branch (163:53): [True: 13.8k, False: 0]
  |  |  ------------------
  ------------------
  228|  13.8k|    struct Curl_easy *data = curl;
  229|  13.8k|    struct Curl_llist_node *pick;
  230|  13.8k|    struct Curl_llist_node *e;
  231|  13.8k|    struct Curl_header_store *hs;
  232|  13.8k|    size_t amount = 0;
  233|  13.8k|    size_t index = 0;
  234|  13.8k|    size_t count;
  235|       |
  236|  13.8k|    if(request > data->state.requests)
  ------------------
  |  Branch (236:8): [True: 0, False: 13.8k]
  ------------------
  237|      0|      goto out;
  238|  13.8k|    if(request == -1)
  ------------------
  |  Branch (238:8): [True: 13.8k, False: 0]
  ------------------
  239|  13.8k|      request = data->state.requests;
  240|       |
  241|  13.8k|    if(prev) {
  ------------------
  |  Branch (241:8): [True: 3.92k, False: 9.91k]
  ------------------
  242|  3.92k|      pick = prev->anchor;
  243|  3.92k|      if(!pick)
  ------------------
  |  Branch (243:10): [True: 0, False: 3.92k]
  ------------------
  244|       |        /* something is wrong */
  245|      0|        goto out;
  246|  3.92k|      pick = Curl_node_next(pick);
  247|  3.92k|    }
  248|  9.91k|    else
  249|  9.91k|      pick = Curl_llist_head(&data->state.httphdrs);
  250|       |
  251|  13.8k|    if(pick) {
  ------------------
  |  Branch (251:8): [True: 4.07k, False: 9.77k]
  ------------------
  252|       |      /* make sure it is the next header of the desired type */
  253|  4.07k|      do {
  254|  4.07k|        hs = Curl_node_elem(pick);
  255|  4.07k|        if((hs->type & origin) && (hs->request == request))
  ------------------
  |  Branch (255:12): [True: 4.07k, False: 0]
  |  Branch (255:35): [True: 4.07k, False: 0]
  ------------------
  256|  4.07k|          break;
  257|      0|        pick = Curl_node_next(pick);
  258|      0|      } while(pick);
  ------------------
  |  Branch (258:15): [True: 0, False: 0]
  ------------------
  259|  4.07k|    }
  260|       |
  261|  13.8k|    if(!pick)
  ------------------
  |  Branch (261:8): [True: 9.77k, False: 4.07k]
  ------------------
  262|       |      /* no more headers available */
  263|  9.77k|      goto out;
  264|       |
  265|  4.07k|    hs = Curl_node_elem(pick);
  266|  4.07k|    count = Curl_llist_count(&data->state.httphdrs);
  267|       |
  268|  4.07k|    if(((data->state.nh_count == count) &&
  ------------------
  |  Branch (268:9): [True: 3.41k, False: 655]
  ------------------
  269|  3.41k|        (data->state.nh_origin == origin) &&
  ------------------
  |  Branch (269:9): [True: 3.41k, False: 0]
  ------------------
  270|  3.41k|        (data->state.nh_request == request)) ||
  ------------------
  |  Branch (270:9): [True: 3.41k, False: 0]
  ------------------
  271|  4.07k|       nextheader_cache_build(data, origin, request, count)) {
  ------------------
  |  Branch (271:8): [True: 655, False: 0]
  ------------------
  272|  4.07k|      amount = hs->nh_amount;
  273|  4.07k|      index = hs->nh_index;
  274|  4.07k|    }
  275|      0|    else {
  276|       |      /* count number of occurrences of this name within the mask and figure
  277|       |         out the index for the currently selected entry */
  278|      0|      for(e = Curl_llist_head(&data->state.httphdrs); e;
  ------------------
  |  Branch (278:55): [True: 0, False: 0]
  ------------------
  279|      0|          e = Curl_node_next(e)) {
  280|      0|        struct Curl_header_store *check = Curl_node_elem(e);
  281|      0|        if(curl_strequal(hs->name, check->name) &&
  ------------------
  |  Branch (281:12): [True: 0, False: 0]
  ------------------
  282|      0|           (check->request == request) &&
  ------------------
  |  Branch (282:12): [True: 0, False: 0]
  ------------------
  283|      0|           (check->type & origin))
  ------------------
  |  Branch (283:12): [True: 0, False: 0]
  ------------------
  284|      0|          amount++;
  285|      0|        if(e == pick)
  ------------------
  |  Branch (285:12): [True: 0, False: 0]
  ------------------
  286|      0|          index = amount - 1;
  287|      0|      }
  288|      0|    }
  289|  4.07k|    copy_header_external(hs, index, amount, pick,
  290|  4.07k|                         &data->state.headerout[1]);
  291|  4.07k|    hd = &data->state.headerout[1];
  292|  4.07k|  }
  293|  13.8k|out:
  294|  13.8k|  CURL_EAPI_LEAVE(&guard);
  ------------------
  |  |  165|  13.8k|  Curl_eapi_leave(g)
  ------------------
  295|  13.8k|  return hd;
  296|  13.8k|}
Curl_headers_push:
  341|  32.8k|{
  342|  32.8k|  char *value = NULL;
  343|  32.8k|  char *name = NULL;
  344|  32.8k|  struct Curl_header_store *hs;
  345|  32.8k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  346|  32.8k|  const size_t ilen = hlen;
  347|       |
  348|  32.8k|  if((header[0] == '\r') || (header[0] == '\n'))
  ------------------
  |  Branch (348:6): [True: 1.94k, False: 30.9k]
  |  Branch (348:29): [True: 690, False: 30.2k]
  ------------------
  349|       |    /* ignore the body separator */
  350|  2.63k|    return CURLE_OK;
  351|       |
  352|       |  /* trim off newline characters */
  353|  30.2k|  if(hlen && (header[hlen - 1] == '\n'))
  ------------------
  |  Branch (353:6): [True: 30.2k, False: 0]
  |  Branch (353:14): [True: 30.2k, False: 0]
  ------------------
  354|  30.2k|    hlen--;
  355|  30.2k|  if(hlen && (header[hlen - 1] == '\r'))
  ------------------
  |  Branch (355:6): [True: 30.2k, False: 0]
  |  Branch (355:14): [True: 6.29k, False: 23.9k]
  ------------------
  356|  6.29k|    hlen--;
  357|  30.2k|  if(hlen == ilen)
  ------------------
  |  Branch (357:6): [True: 0, False: 30.2k]
  ------------------
  358|       |    /* neither CR nor LF as terminator is not a valid header */
  359|      0|    return CURLE_WEIRD_SERVER_REPLY;
  360|       |
  361|  30.2k|  if(ISBLANK(header[0])) {
  ------------------
  |  |   43|  30.2k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 30.2k]
  |  |  |  Branch (43:38): [True: 0, False: 30.2k]
  |  |  ------------------
  ------------------
  362|       |    /* pass leading blanks */
  363|      0|    while(hlen && ISBLANK(*header)) {
  ------------------
  |  |   43|      0|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  |  Branch (43:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (363:11): [True: 0, False: 0]
  ------------------
  364|      0|      header++;
  365|      0|      hlen--;
  366|      0|    }
  367|      0|    if(!hlen)
  ------------------
  |  Branch (367:8): [True: 0, False: 0]
  ------------------
  368|      0|      return CURLE_WEIRD_SERVER_REPLY;
  369|      0|  }
  370|  30.2k|  if(Curl_llist_count(&data->state.httphdrs) >= MAX_HTTP_RESP_HEADER_COUNT) {
  ------------------
  |  |  164|  30.2k|#define MAX_HTTP_RESP_HEADER_COUNT 5000
  ------------------
  |  Branch (370:6): [True: 0, False: 30.2k]
  ------------------
  371|      0|    failf(data, "Too many response headers, %d is max",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  372|      0|          MAX_HTTP_RESP_HEADER_COUNT);
  ------------------
  |  |  164|      0|#define MAX_HTTP_RESP_HEADER_COUNT 5000
  ------------------
  373|      0|    return CURLE_TOO_LARGE;
  374|      0|  }
  375|       |
  376|  30.2k|  hs = curlx_calloc(1, sizeof(*hs) + hlen);
  ------------------
  |  | 1500|  30.2k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  377|  30.2k|  if(!hs)
  ------------------
  |  Branch (377:6): [True: 0, False: 30.2k]
  ------------------
  378|      0|    return CURLE_OUT_OF_MEMORY;
  379|  30.2k|  memcpy(hs->buffer, header, hlen);
  380|  30.2k|  hs->buffer[hlen] = 0; /* null-terminate */
  381|       |
  382|  30.2k|  result = namevalue(hs->buffer, hlen, type, &name, &value);
  383|  30.2k|  if(!result) {
  ------------------
  |  Branch (383:6): [True: 30.1k, False: 44]
  ------------------
  384|  30.1k|    hs->name = name;
  385|  30.1k|    hs->value = value;
  386|  30.1k|    hs->type = type;
  387|  30.1k|    hs->request = data->state.requests;
  388|       |
  389|       |    /* insert this node into the list of headers */
  390|  30.1k|    Curl_llist_append(&data->state.httphdrs, hs, &hs->node);
  391|  30.1k|  }
  392|     44|  else {
  393|     44|    failf(data, "Invalid response header");
  ------------------
  |  |   62|     44|#define failf Curl_failf
  ------------------
  394|     44|    curlx_free(hs);
  ------------------
  |  | 1503|     44|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  395|     44|  }
  396|  30.2k|  return result;
  397|  30.2k|}
Curl_headers_init:
  444|  11.3k|{
  445|  11.3k|  struct Curl_cwriter *writer;
  446|  11.3k|  CURLcode result;
  447|       |
  448|  11.3k|  if(data->conn && (data->conn->scheme->protocol & PROTO_FAMILY_HTTP)) {
  ------------------
  |  |   83|  11.3k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|  11.3k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|  11.3k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   62|  11.3k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   84|  11.3k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   63|  11.3k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (448:6): [True: 11.3k, False: 0]
  |  Branch (448:20): [True: 11.3k, False: 0]
  ------------------
  449|       |    /* avoid installing it twice */
  450|  11.3k|    if(Curl_cwriter_get_by_name(data, hds_cw_collect.name))
  ------------------
  |  Branch (450:8): [True: 1.95k, False: 9.38k]
  ------------------
  451|  1.95k|      return CURLE_OK;
  452|       |
  453|  9.38k|    result = Curl_cwriter_create(&writer, data, &hds_cw_collect,
  454|  9.38k|                                 CURL_CW_PROTOCOL);
  455|  9.38k|    if(result)
  ------------------
  |  Branch (455:8): [True: 2, False: 9.37k]
  ------------------
  456|      2|      return result;
  457|       |
  458|  9.37k|    result = Curl_cwriter_add(data, writer);
  459|  9.37k|    if(result) {
  ------------------
  |  Branch (459:8): [True: 8, False: 9.37k]
  ------------------
  460|      8|      Curl_cwriter_free(data, writer);
  461|      8|      return result;
  462|      8|    }
  463|  9.37k|  }
  464|  9.37k|  return CURLE_OK;
  465|  11.3k|}
Curl_headers_cleanup:
  471|  29.4k|{
  472|  29.4k|  struct Curl_llist_node *e;
  473|  29.4k|  struct Curl_llist_node *n;
  474|       |
  475|  59.6k|  for(e = Curl_llist_head(&data->state.httphdrs); e; e = n) {
  ------------------
  |  Branch (475:51): [True: 30.1k, False: 29.4k]
  ------------------
  476|  30.1k|    struct Curl_header_store *hs = Curl_node_elem(e);
  477|  30.1k|    n = Curl_node_next(e);
  478|  30.1k|    curlx_free(hs);
  ------------------
  |  | 1503|  30.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  479|  30.1k|  }
  480|  29.4k|  headers_reset(data);
  481|  29.4k|  return CURLE_OK;
  482|  29.4k|}
headers.c:copy_header_external:
   41|  4.09k|{
   42|  4.09k|  struct curl_header *h = hout;
   43|  4.09k|  h->name = hs->name;
   44|  4.09k|  h->value = hs->value;
   45|  4.09k|  h->amount = amount;
   46|  4.09k|  h->index = index;
   47|       |  /* this will randomly OR a reserved bit for the sole purpose of making it
   48|       |     impossible for applications to do == comparisons, as that would otherwise
   49|       |     be tempting and then lead to the reserved bits not being reserved
   50|       |     anymore. */
   51|  4.09k|  h->origin = (unsigned int)(hs->type | (1 << 27));
   52|  4.09k|  h->anchor = e;
   53|  4.09k|}
headers.c:nextheader_cache_build:
  175|    655|{
  176|    655|  struct nextheader_cache_entry *headers;
  177|    655|  struct Curl_llist_node *e;
  178|    655|  size_t i = 0;
  179|    655|  size_t first;
  180|       |
  181|    655|  headers = curlx_malloc(sizeof(*headers) * count);
  ------------------
  |  | 1498|    655|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  182|    655|  if(!headers)
  ------------------
  |  Branch (182:6): [True: 0, False: 655]
  ------------------
  183|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  184|       |
  185|  30.8k|  for(e = Curl_llist_head(&data->state.httphdrs); e;
  ------------------
  |  Branch (185:51): [True: 30.1k, False: 655]
  ------------------
  186|  30.1k|      e = Curl_node_next(e)) {
  187|  30.1k|    struct Curl_header_store *hs = Curl_node_elem(e);
  188|  30.1k|    if((hs->type & origin) && (hs->request == request)) {
  ------------------
  |  Branch (188:8): [True: 30.1k, False: 0]
  |  Branch (188:31): [True: 30.1k, False: 0]
  ------------------
  189|  30.1k|      headers[i].header = hs;
  190|  30.1k|      headers[i].order = i;
  191|  30.1k|      i++;
  192|  30.1k|    }
  193|  30.1k|  }
  194|       |
  195|    655|  qsort(headers, i, sizeof(*headers), nextheader_compare);
  196|  2.68k|  for(first = 0; first < i;) {
  ------------------
  |  Branch (196:18): [True: 2.03k, False: 655]
  ------------------
  197|  2.03k|    size_t last = first + 1;
  198|  2.03k|    size_t index;
  199|  30.1k|    while((last < i) &&
  ------------------
  |  Branch (199:11): [True: 29.5k, False: 655]
  ------------------
  200|  29.5k|          curl_strequal(headers[first].header->name,
  ------------------
  |  Branch (200:11): [True: 28.1k, False: 1.37k]
  ------------------
  201|  29.5k|                        headers[last].header->name))
  202|  28.1k|      last++;
  203|  32.2k|    for(index = first; index < last; index++) {
  ------------------
  |  Branch (203:24): [True: 30.1k, False: 2.03k]
  ------------------
  204|  30.1k|      headers[index].header->nh_amount = last - first;
  205|  30.1k|      headers[index].header->nh_index = index - first;
  206|  30.1k|    }
  207|  2.03k|    first = last;
  208|  2.03k|  }
  209|    655|  curlx_free(headers);
  ------------------
  |  | 1503|    655|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  210|       |
  211|    655|  data->state.nh_origin = origin;
  212|    655|  data->state.nh_request = request;
  213|    655|  data->state.nh_count = count;
  214|       |  return TRUE;
  ------------------
  |  |  986|    655|#define TRUE true
  ------------------
  215|    655|}
headers.c:nextheader_compare:
  149|   212k|{
  150|   212k|  const struct nextheader_cache_entry *e1 = p1;
  151|   212k|  const struct nextheader_cache_entry *e2 = p2;
  152|   212k|  const struct Curl_header_store *h1 = e1->header;
  153|   212k|  const struct Curl_header_store *h2 = e2->header;
  154|   212k|  const char *n1 = h1->name;
  155|   212k|  const char *n2 = h2->name;
  156|       |
  157|   817k|  while(*n1 && *n2) {
  ------------------
  |  Branch (157:9): [True: 721k, False: 96.4k]
  |  Branch (157:16): [True: 680k, False: 41.1k]
  ------------------
  158|   680k|    unsigned char c1 = (unsigned char)Curl_raw_toupper(*n1++);
  159|   680k|    unsigned char c2 = (unsigned char)Curl_raw_toupper(*n2++);
  160|   680k|    if(c1 != c2)
  ------------------
  |  Branch (160:8): [True: 74.7k, False: 605k]
  ------------------
  161|  74.7k|      return c1 > c2 ? 1 : -1;
  ------------------
  |  Branch (161:14): [True: 55.6k, False: 19.1k]
  ------------------
  162|   680k|  }
  163|   137k|  if(*n1)
  ------------------
  |  Branch (163:6): [True: 41.1k, False: 96.4k]
  ------------------
  164|  41.1k|    return 1;
  165|  96.4k|  if(*n2)
  ------------------
  |  Branch (165:6): [True: 4.28k, False: 92.1k]
  ------------------
  166|  4.28k|    return -1;
  167|  92.1k|  if(e1->order != e2->order)
  ------------------
  |  Branch (167:6): [True: 92.1k, False: 0]
  ------------------
  168|  92.1k|    return e1->order > e2->order ? 1 : -1;
  ------------------
  |  Branch (168:12): [True: 0, False: 92.1k]
  ------------------
  169|      0|  return 0;
  170|  92.1k|}
headers.c:namevalue:
  300|  30.2k|{
  301|  30.2k|  char *end = header + hlen - 1; /* point to the last byte */
  302|  30.2k|  DEBUGASSERT(hlen);
  ------------------
  |  | 1016|  30.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (302:3): [True: 0, False: 30.2k]
  |  Branch (302:3): [True: 30.2k, False: 0]
  ------------------
  303|  30.2k|  *name = header;
  304|       |
  305|  30.2k|  if(type == CURLH_PSEUDO) {
  ------------------
  |  |   45|  30.2k|#define CURLH_PSEUDO    (1 << 4) /* pseudo headers */
  ------------------
  |  Branch (305:6): [True: 0, False: 30.2k]
  ------------------
  306|      0|    if(*header != ':')
  ------------------
  |  Branch (306:8): [True: 0, False: 0]
  ------------------
  307|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  308|      0|    header++;
  309|      0|  }
  310|       |
  311|       |  /* Find the end of the header name */
  312|   209k|  while(*header && (*header != ':'))
  ------------------
  |  Branch (312:9): [True: 209k, False: 44]
  |  Branch (312:20): [True: 179k, False: 30.1k]
  ------------------
  313|   179k|    ++header;
  314|       |
  315|  30.2k|  if(*header)
  ------------------
  |  Branch (315:6): [True: 30.1k, False: 44]
  ------------------
  316|       |    /* Skip over colon, null it */
  317|  30.1k|    *header++ = 0;
  318|     44|  else
  319|     44|    return CURLE_BAD_FUNCTION_ARGUMENT;
  320|       |
  321|       |  /* skip all leading blank letters */
  322|  43.0k|  while(ISBLANK(*header))
  ------------------
  |  |   43|  43.0k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 8.58k, False: 34.4k]
  |  |  |  Branch (43:38): [True: 4.26k, False: 30.1k]
  |  |  ------------------
  ------------------
  323|  12.8k|    header++;
  324|       |
  325|  30.1k|  *value = header;
  326|       |
  327|       |  /* skip all trailing space letters */
  328|  39.6k|  while((end > header) && ISBLANK(*end))
  ------------------
  |  |   43|  23.0k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 5.64k, False: 17.4k]
  |  |  |  Branch (43:38): [True: 3.79k, False: 13.6k]
  |  |  ------------------
  ------------------
  |  Branch (328:9): [True: 23.0k, False: 16.5k]
  ------------------
  329|  9.43k|    *end-- = 0; /* null-terminate */
  330|  30.1k|  return CURLE_OK;
  331|  30.2k|}
headers.c:hds_cw_collect_write:
  416|  36.7k|{
  417|  36.7k|  if((type & CLIENTWRITE_HEADER) && !(type & CLIENTWRITE_STATUS)) {
  ------------------
  |  |   45|  36.7k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
                if((type & CLIENTWRITE_HEADER) && !(type & CLIENTWRITE_STATUS)) {
  ------------------
  |  |   46|  36.0k|#define CLIENTWRITE_STATUS  (1 << 3) /* a special status HEADER */
  ------------------
  |  Branch (417:6): [True: 36.0k, False: 650]
  |  Branch (417:37): [True: 32.8k, False: 3.19k]
  ------------------
  418|  32.8k|    unsigned char htype = (unsigned char)
  419|  32.8k|      (type & CLIENTWRITE_CONNECT ? CURLH_CONNECT :
  ------------------
  |  |   47|  32.8k|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
                    (type & CLIENTWRITE_CONNECT ? CURLH_CONNECT :
  ------------------
  |  |   43|  30.5k|#define CURLH_CONNECT   (1 << 2) /* CONNECT headers */
  ------------------
  |  Branch (419:8): [True: 30.5k, False: 2.29k]
  ------------------
  420|  32.8k|       (type & CLIENTWRITE_1XX ? CURLH_1XX :
  ------------------
  |  |   48|  2.29k|#define CLIENTWRITE_1XX     (1 << 5) /* a 1xx response related HEADER */
  ------------------
                     (type & CLIENTWRITE_1XX ? CURLH_1XX :
  ------------------
  |  |   44|  1.40k|#define CURLH_1XX       (1 << 3) /* 1xx headers */
  ------------------
  |  Branch (420:9): [True: 1.40k, False: 889]
  ------------------
  421|  2.29k|        (type & CLIENTWRITE_TRAILER ? CURLH_TRAILER :
  ------------------
  |  |   49|    889|#define CLIENTWRITE_TRAILER (1 << 6) /* a trailer HEADER */
  ------------------
                      (type & CLIENTWRITE_TRAILER ? CURLH_TRAILER :
  ------------------
  |  |   42|    153|#define CURLH_TRAILER   (1 << 1) /* trailers */
  ------------------
  |  Branch (421:10): [True: 153, False: 736]
  ------------------
  422|    889|         CURLH_HEADER)));
  ------------------
  |  |   41|    736|#define CURLH_HEADER    (1 << 0) /* plain server header */
  ------------------
  423|  32.8k|    CURLcode result = Curl_headers_push(data, buf, blen, htype);
  424|  32.8k|    CURL_TRC_WRITE(data, "header_collect pushed(type=%x, len=%zu) -> %d",
  ------------------
  |  |  158|  32.8k|  do {                                                     \
  |  |  159|  32.8k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|  32.8k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  65.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 32.8k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 15.7k, False: 17.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  65.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 15.7k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  15.7k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  32.8k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  15.7k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 13.9k, False: 1.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  32.8k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  32.8k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 32.8k]
  |  |  ------------------
  ------------------
  425|  32.8k|                   htype, blen, (int)result);
  426|  32.8k|    if(result)
  ------------------
  |  Branch (426:8): [True: 44, False: 32.8k]
  ------------------
  427|     44|      return result;
  428|  32.8k|  }
  429|  36.6k|  return Curl_cwriter_write(data, writer->next, type, buf, blen);
  ------------------
  |  |  189|  36.6k|  ((w) ? (w)->cwt->do_write((d), (w), (t), (b), (n)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (189:4): [True: 36.6k, False: 0]
  |  |  ------------------
  ------------------
  430|  36.7k|}
headers.c:headers_reset:
  403|  29.4k|{
  404|       |  Curl_llist_init(&data->state.httphdrs, NULL);
  405|  29.4k|  data->state.nh_count = 0;
  406|  29.4k|  memset(data->state.headerout, 0, sizeof(data->state.headerout));
  407|  29.4k|}

Curl_hsts_init:
   69|  10.0k|{
   70|  10.0k|  struct hsts *h = curlx_calloc(1, sizeof(struct hsts));
  ------------------
  |  | 1500|  10.0k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   71|  10.0k|  if(h) {
  ------------------
  |  Branch (71:6): [True: 10.0k, False: 21]
  ------------------
   72|       |    Curl_llist_init(&h->list, NULL);
   73|  10.0k|  }
   74|  10.0k|  return h;
   75|  10.0k|}
Curl_hsts_cleanup:
   80|  20.0k|{
   81|  20.0k|  struct hsts *h = *hp;
   82|  20.0k|  if(h) {
  ------------------
  |  Branch (82:6): [True: 10.0k, False: 10.0k]
  ------------------
   83|  10.0k|    struct Curl_llist_node *e;
   84|  10.0k|    struct Curl_llist_node *n;
   85|  10.0k|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (85:40): [True: 0, False: 10.0k]
  ------------------
   86|      0|      struct stsentry *sts = Curl_node_elem(e);
   87|      0|      n = Curl_node_next(e);
   88|      0|      hsts_free(sts);
  ------------------
  |  |   77|      0|#define hsts_free(x) curlx_free(x)
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
   89|      0|    }
   90|  10.0k|    curlx_free(h->filename);
  ------------------
  |  | 1503|  10.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   91|  10.0k|    curlx_free(h);
  ------------------
  |  | 1503|  10.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   92|       |    *hp = NULL;
   93|  10.0k|  }
   94|  20.0k|}
Curl_hsts_save:
  385|  19.7k|{
  386|  19.7k|  struct Curl_llist_node *e;
  387|  19.7k|  struct Curl_llist_node *n;
  388|  19.7k|  CURLcode result = CURLE_OK;
  389|  19.7k|  FILE *out;
  390|  19.7k|  char *tempstore = NULL;
  391|       |
  392|  19.7k|  if(!h)
  ------------------
  |  Branch (392:6): [True: 9.88k, False: 9.85k]
  ------------------
  393|       |    /* no cache activated */
  394|  9.88k|    return CURLE_OK;
  395|       |
  396|       |  /* if no new name is given, use the one we stored from the load */
  397|  9.85k|  if(!file && h->filename)
  ------------------
  |  Branch (397:6): [True: 11, False: 9.84k]
  |  Branch (397:15): [True: 0, False: 11]
  ------------------
  398|      0|    file = h->filename;
  399|       |
  400|  9.85k|  if((h->flags & CURLHSTS_READONLYFILE) || !file || !file[0])
  ------------------
  |  | 1084|  9.85k|#define CURLHSTS_READONLYFILE (1L << 1)
  ------------------
  |  Branch (400:6): [True: 18, False: 9.84k]
  |  Branch (400:44): [True: 11, False: 9.82k]
  |  Branch (400:53): [True: 0, False: 9.82k]
  ------------------
  401|       |    /* marked as read-only, no file or zero length filename */
  402|     29|    goto skipsave;
  403|       |
  404|  9.82k|  result = Curl_fopen(data, file, &out, &tempstore);
  405|  9.82k|  if(!result) {
  ------------------
  |  Branch (405:6): [True: 9.82k, False: 0]
  ------------------
  406|  9.82k|    fputs("# Your HSTS cache. https://curl.se/docs/hsts.html\n"
  407|  9.82k|          "# This file was generated by libcurl! Edit at your own risk.\n",
  408|  9.82k|          out);
  409|  9.82k|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (409:40): [True: 0, False: 9.82k]
  ------------------
  410|      0|      struct stsentry *sts = Curl_node_elem(e);
  411|      0|      n = Curl_node_next(e);
  412|      0|      hsts_out(sts, out);
  413|      0|    }
  414|  9.82k|    if(fflush(out) || ferror(out))
  ------------------
  |  Branch (414:8): [True: 0, False: 9.82k]
  |  Branch (414:23): [True: 0, False: 9.82k]
  ------------------
  415|      0|      result = CURLE_WRITE_ERROR;
  416|  9.82k|    if(curlx_fclose(out))
  ------------------
  |  |   88|  9.82k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  |  |  ------------------
  |  |  |  Branch (88:33): [True: 0, False: 9.82k]
  |  |  ------------------
  ------------------
  417|      0|      result = CURLE_WRITE_ERROR;
  418|  9.82k|    if(!result && tempstore && curlx_rename(tempstore, file))
  ------------------
  |  |   74|      0|#define curlx_rename            rename
  ------------------
  |  Branch (418:8): [True: 9.82k, False: 0]
  |  Branch (418:19): [True: 0, False: 9.82k]
  |  Branch (418:32): [True: 0, False: 0]
  ------------------
  419|      0|      result = CURLE_WRITE_ERROR;
  420|       |
  421|  9.82k|    if(result && tempstore)
  ------------------
  |  Branch (421:8): [True: 0, False: 9.82k]
  |  Branch (421:18): [True: 0, False: 0]
  ------------------
  422|      0|      unlink(tempstore);
  423|  9.82k|  }
  424|  9.82k|  curlx_free(tempstore);
  ------------------
  |  | 1503|  9.82k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  425|  9.85k|skipsave:
  426|  9.85k|  if(data->set.hsts_write) {
  ------------------
  |  Branch (426:6): [True: 0, False: 9.85k]
  ------------------
  427|       |    /* if there is a write callback */
  428|      0|    struct curl_index i; /* count */
  429|      0|    i.total = Curl_llist_count(&h->list);
  430|      0|    i.index = 0;
  431|      0|    for(e = Curl_llist_head(&h->list); e; e = n) {
  ------------------
  |  Branch (431:40): [True: 0, False: 0]
  ------------------
  432|      0|      struct stsentry *sts = Curl_node_elem(e);
  433|      0|      bool stop;
  434|      0|      n = Curl_node_next(e);
  435|      0|      result = hsts_push(data, &i, sts, &stop);
  436|      0|      if(result || stop)
  ------------------
  |  Branch (436:10): [True: 0, False: 0]
  |  Branch (436:20): [True: 0, False: 0]
  ------------------
  437|      0|        break;
  438|      0|      i.index++;
  439|      0|    }
  440|      0|  }
  441|  9.85k|  return result;
  442|  9.82k|}
Curl_hsts_loadfile:
  621|  9.57k|{
  622|  9.57k|  DEBUGASSERT(h);
  ------------------
  |  | 1016|  9.57k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (622:3): [True: 0, False: 9.57k]
  |  Branch (622:3): [True: 9.57k, False: 0]
  ------------------
  623|  9.57k|  (void)data;
  624|  9.57k|  return hsts_load(h, file);
  625|  9.57k|}
Curl_hsts_loadcb:
  631|  9.66k|{
  632|  9.66k|  if(h)
  ------------------
  |  Branch (632:6): [True: 9.61k, False: 45]
  ------------------
  633|  9.61k|    return hsts_pull(data, h);
  634|     45|  return CURLE_OK;
  635|  9.66k|}
Curl_hsts_loadfiles:
  639|  9.67k|{
  640|  9.67k|  CURLcode result = CURLE_OK;
  641|  9.67k|  size_t i;
  642|  9.67k|  if(Curl_frzn_strs_count(files)) {
  ------------------
  |  |   38|  9.67k|  ((fstrs) ? (fstrs)->n : 0)
  |  |  ------------------
  |  |  |  Branch (38:3): [True: 9.57k, False: 97]
  |  |  |  Branch (38:4): [True: 9.57k, False: 97]
  |  |  ------------------
  ------------------
  643|  9.57k|    Curl_share_lock(data, CURL_LOCK_DATA_HSTS, CURL_LOCK_ACCESS_SINGLE);
  644|  19.1k|    for(i = 0; i < Curl_frzn_strs_count(files); ++i) {
  ------------------
  |  |   38|  19.1k|  ((fstrs) ? (fstrs)->n : 0)
  |  |  ------------------
  |  |  |  Branch (38:4): [True: 19.1k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (644:16): [True: 9.57k, False: 9.56k]
  ------------------
  645|  9.57k|      const char *filepath = Curl_frzn_strs_get_str(files, i);
  ------------------
  |  |   43|  9.57k|  ((fstrs) && ((idx) < (fstrs)->n) ? (fstrs)->strs[(idx)].str : NULL)
  |  |  ------------------
  |  |  |  Branch (43:4): [True: 9.57k, False: 0]
  |  |  |  Branch (43:15): [True: 9.57k, False: 0]
  |  |  ------------------
  ------------------
  646|  9.57k|      if(filepath) {
  ------------------
  |  Branch (646:10): [True: 9.57k, False: 0]
  ------------------
  647|  9.57k|        result = Curl_hsts_loadfile(data, data->hsts, filepath);
  648|  9.57k|        if(result)
  ------------------
  |  Branch (648:12): [True: 10, False: 9.56k]
  ------------------
  649|     10|          break;
  650|  9.57k|      }
  651|  9.57k|    }
  652|  9.57k|    Curl_share_unlock(data, CURL_LOCK_DATA_HSTS);
  653|  9.57k|  }
  654|  9.67k|  return result;
  655|  9.67k|}
hsts.c:hsts_load:
  576|  9.57k|{
  577|  9.57k|  CURLcode result = CURLE_OK;
  578|  9.57k|  FILE *fp;
  579|       |
  580|       |  /* we need a private copy of the filename so that the hsts cache file
  581|       |     name survives an easy handle reset */
  582|  9.57k|  curlx_free(h->filename);
  ------------------
  |  | 1503|  9.57k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  583|  9.57k|  h->filename = curlx_strdup(file);
  ------------------
  |  | 1497|  9.57k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  584|  9.57k|  if(!h->filename)
  ------------------
  |  Branch (584:6): [True: 6, False: 9.57k]
  ------------------
  585|      6|    return CURLE_OUT_OF_MEMORY;
  586|       |
  587|  9.57k|  fp = curlx_fopen(file, FOPEN_READTEXT);
  ------------------
  |  |   83|  9.57k|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
  588|  9.57k|  if(fp) {
  ------------------
  |  Branch (588:6): [True: 9.57k, False: 0]
  ------------------
  589|  9.57k|    curlx_struct_stat stat;
  ------------------
  |  |   67|  9.57k|#define curlx_struct_stat       struct stat
  ------------------
  590|  9.57k|    if((curlx_fstat(fileno(fp), &stat) == -1) || !S_ISDIR(stat.st_mode)) {
  ------------------
  |  |   66|  9.57k|#define curlx_fstat             fstat
  ------------------
  |  Branch (590:8): [True: 0, False: 9.57k]
  |  Branch (590:50): [True: 9.57k, False: 0]
  ------------------
  591|  9.57k|      struct dynbuf buf;
  592|  9.57k|      bool eof = FALSE;
  ------------------
  |  |  989|  9.57k|#define FALSE false
  ------------------
  593|  9.57k|      curlx_dyn_init(&buf, MAX_HSTS_LINE);
  ------------------
  |  |   41|  9.57k|#define MAX_HSTS_LINE    4095
  ------------------
  594|  9.57k|      do {
  595|  9.57k|        result = Curl_get_line(&buf, fp, &eof);
  596|  9.57k|        if(!result) {
  ------------------
  |  Branch (596:12): [True: 9.56k, False: 4]
  ------------------
  597|  9.56k|          const char *lineptr = curlx_dyn_ptr(&buf);
  598|  9.56k|          curlx_str_passblanks(&lineptr);
  599|       |
  600|       |          /* Skip empty or commented lines, since we know the line will have
  601|       |             a trailing newline from Curl_get_line we can treat length 1 as
  602|       |             empty. */
  603|  9.56k|          if((*lineptr == '#') || strlen(lineptr) <= 1)
  ------------------
  |  Branch (603:14): [True: 0, False: 9.56k]
  |  Branch (603:35): [True: 9.56k, False: 0]
  ------------------
  604|  9.56k|            continue;
  605|       |
  606|      0|          hsts_add(h, lineptr);
  607|      0|        }
  608|  9.57k|      } while(!result && !eof);
  ------------------
  |  Branch (608:15): [True: 9.56k, False: 4]
  |  Branch (608:26): [True: 0, False: 9.56k]
  ------------------
  609|  9.57k|      curlx_dyn_free(&buf); /* free the line buffer */
  610|  9.57k|    }
  611|  9.57k|    curlx_fclose(fp);
  ------------------
  |  |   88|  9.57k|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  612|  9.57k|  }
  613|  9.57k|  return result;
  614|  9.57k|}
hsts.c:hsts_pull:
  528|  9.61k|{
  529|       |  /* if the HSTS read callback is set, use it */
  530|  9.61k|  if(data->set.hsts_read) {
  ------------------
  |  Branch (530:6): [True: 0, False: 9.61k]
  ------------------
  531|      0|    CURLSTScode sc;
  532|      0|    DEBUGASSERT(h);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (532:5): [True: 0, False: 0]
  |  Branch (532:5): [True: 0, False: 0]
  ------------------
  533|      0|    do {
  534|      0|      char buffer[MAX_HSTS_HOSTLEN + 1];
  535|      0|      struct curl_hstsentry e;
  536|      0|      e.name = buffer;
  537|      0|      e.namelen = sizeof(buffer) - 1;
  538|      0|      e.includeSubDomains = FALSE; /* default */
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  539|      0|      e.expire[0] = 0;
  540|      0|      e.expire[MAX_HSTS_DATELEN] = 0;
  ------------------
  |  |   43|      0|#define MAX_HSTS_DATELEN 17
  ------------------
  541|      0|      e.name[0] = 0; /* to make it clean */
  542|      0|      e.name[MAX_HSTS_HOSTLEN] = 0;
  ------------------
  |  |   42|      0|#define MAX_HSTS_HOSTLEN 2048
  ------------------
  543|      0|      sc = data->set.hsts_read(data, &e, data->set.hsts_read_userp);
  544|      0|      if(sc == CURLSTS_OK) {
  ------------------
  |  Branch (544:10): [True: 0, False: 0]
  ------------------
  545|      0|        CURLcode result;
  546|      0|        const char *date = e.expire;
  547|      0|        if(!e.name[0] || e.expire[MAX_HSTS_DATELEN] ||
  ------------------
  |  |   43|      0|#define MAX_HSTS_DATELEN 17
  ------------------
  |  Branch (547:12): [True: 0, False: 0]
  |  Branch (547:26): [True: 0, False: 0]
  ------------------
  548|      0|           e.name[MAX_HSTS_HOSTLEN])
  ------------------
  |  |   42|      0|#define MAX_HSTS_HOSTLEN 2048
  ------------------
  |  Branch (548:12): [True: 0, False: 0]
  ------------------
  549|       |          /* bail out if no name was stored or if a null-terminator is gone */
  550|      0|          return CURLE_BAD_FUNCTION_ARGUMENT;
  551|      0|        if(!date[0])
  ------------------
  |  Branch (551:12): [True: 0, False: 0]
  ------------------
  552|      0|          date = UNLIMITED;
  ------------------
  |  |   44|      0|#define UNLIMITED        "unlimited"
  ------------------
  553|      0|        result = hsts_add_host_expire(h, e.name, strlen(e.name),
  554|      0|                                      date, strlen(date),
  555|       |                                      /* bitfield to bool conversion: */
  556|      0|                                      e.includeSubDomains ? TRUE : FALSE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
                                                    e.includeSubDomains ? TRUE : FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  |  Branch (556:39): [True: 0, False: 0]
  ------------------
  557|      0|        if(result)
  ------------------
  |  Branch (557:12): [True: 0, False: 0]
  ------------------
  558|      0|          return result;
  559|      0|      }
  560|      0|      else if(sc == CURLSTS_FAIL)
  ------------------
  |  Branch (560:15): [True: 0, False: 0]
  ------------------
  561|      0|        return CURLE_ABORTED_BY_CALLBACK;
  562|      0|    } while(sc == CURLSTS_OK);
  ------------------
  |  Branch (562:13): [True: 0, False: 0]
  ------------------
  563|      0|  }
  564|  9.61k|  return CURLE_OK;
  565|  9.61k|}

Curl_http_neg_init:
   88|  9.67k|{
   89|  9.67k|  memset(neg, 0, sizeof(*neg));
   90|  9.67k|  neg->accept_09 = data->set.http09_allowed;
   91|  9.67k|  switch(data->set.httpwant) {
   92|      0|  case CURL_HTTP_VERSION_1_0:
  ------------------
  |  | 2341|      0|#define CURL_HTTP_VERSION_1_0   1L /* please use HTTP 1.0 in the request */
  ------------------
  |  Branch (92:3): [True: 0, False: 9.67k]
  ------------------
   93|      0|    neg->wanted = neg->allowed = (CURL_HTTP_V1x);
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
   94|      0|    neg->only_10 = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
   95|      0|    break;
   96|      0|  case CURL_HTTP_VERSION_1_1:
  ------------------
  |  | 2342|      0|#define CURL_HTTP_VERSION_1_1   2L /* please use HTTP 1.1 in the request */
  ------------------
  |  Branch (96:3): [True: 0, False: 9.67k]
  ------------------
   97|      0|    neg->wanted = neg->allowed = (CURL_HTTP_V1x);
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
   98|      0|    break;
   99|      0|  case CURL_HTTP_VERSION_2_0:
  ------------------
  |  | 2343|      0|#define CURL_HTTP_VERSION_2_0   3L /* please use HTTP 2 in the request */
  ------------------
  |  Branch (99:3): [True: 0, False: 9.67k]
  ------------------
  100|      0|    neg->wanted = neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->wanted = neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  101|      0|    neg->h2_upgrade = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  102|      0|    break;
  103|      0|  case CURL_HTTP_VERSION_2TLS:
  ------------------
  |  | 2344|      0|#define CURL_HTTP_VERSION_2TLS  4L /* use version 2 for HTTPS, version 1.1 for
  ------------------
  |  Branch (103:3): [True: 0, False: 9.67k]
  ------------------
  104|      0|    neg->wanted = neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->wanted = neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  105|      0|    break;
  106|      0|  case CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE:
  ------------------
  |  | 2346|      0|#define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without
  ------------------
  |  Branch (106:3): [True: 0, False: 9.67k]
  ------------------
  107|      0|    neg->wanted = neg->allowed = (CURL_HTTP_V2x);
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  108|      0|    data->state.http_neg.h2_prior_knowledge = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  109|      0|    break;
  110|      0|  case CURL_HTTP_VERSION_3:
  ------------------
  |  | 2348|      0|#define CURL_HTTP_VERSION_3     30L /* Use HTTP/3, fallback to HTTP/2 or
  ------------------
  |  Branch (110:3): [True: 0, False: 9.67k]
  ------------------
  111|      0|    neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
                  neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  112|      0|    neg->allowed = neg->wanted;
  113|      0|    break;
  114|  9.67k|  case CURL_HTTP_VERSION_3ONLY:
  ------------------
  |  | 2352|  9.67k|#define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For
  ------------------
  |  Branch (114:3): [True: 9.67k, False: 0]
  ------------------
  115|  9.67k|    neg->wanted = neg->allowed = (CURL_HTTP_V3x);
  ------------------
  |  |   42|  9.67k|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  116|  9.67k|    break;
  117|      0|  case CURL_HTTP_VERSION_NONE:
  ------------------
  |  | 2338|      0|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  |  Branch (117:3): [True: 0, False: 9.67k]
  ------------------
  118|      0|  default:
  ------------------
  |  Branch (118:3): [True: 0, False: 9.67k]
  ------------------
  119|      0|    neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->wanted = (CURL_HTTP_V1x | CURL_HTTP_V2x);
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  120|      0|    neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
                  neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
                  neg->allowed = (CURL_HTTP_V1x | CURL_HTTP_V2x | CURL_HTTP_V3x);
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  121|      0|    break;
  122|  9.67k|  }
  123|  9.67k|}
Curl_checkProxyheaders:
  139|  21.8k|{
  140|  21.8k|  struct curl_slist *head;
  141|       |
  142|  21.8k|  for(head = (conn->http_proxy.peer && data->set.sep_headers) ?
  ------------------
  |  Branch (142:15): [True: 21.8k, False: 0]
  |  Branch (142:40): [True: 21.8k, False: 0]
  ------------------
  143|  21.8k|        data->set.proxyheaders : data->set.headers;
  144|  21.8k|      head; head = head->next) {
  ------------------
  |  Branch (144:7): [True: 0, False: 21.8k]
  ------------------
  145|      0|    if(curl_strnequal(head->data, thisheader, thislen) &&
  ------------------
  |  Branch (145:8): [True: 0, False: 0]
  ------------------
  146|      0|       Curl_headersep(head->data[thislen]))
  ------------------
  |  |   26|      0|#define Curl_headersep(x) ((((x) == ':') || ((x) == ';')))
  |  |  ------------------
  |  |  |  Branch (26:29): [True: 0, False: 0]
  |  |  |  Branch (26:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  147|      0|      return head->data;
  148|      0|  }
  149|       |
  150|  21.8k|  return NULL;
  151|  21.8k|}
Curl_copy_header_value:
  213|     18|{
  214|     18|  struct Curl_str out;
  215|       |
  216|       |  /* find the end of the header name */
  217|     18|  if(!curlx_str_until(&header, &out, MAX_HTTP_RESP_HEADER_SIZE, ':') &&
  ------------------
  |  |  159|     18|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  |  Branch (217:6): [True: 18, False: 0]
  ------------------
  218|     18|     !curlx_str_single(&header, ':')) {
  ------------------
  |  Branch (218:6): [True: 18, False: 0]
  ------------------
  219|     18|    curlx_str_untilnl(&header, &out, MAX_HTTP_RESP_HEADER_SIZE);
  ------------------
  |  |  159|     18|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  220|     18|    curlx_str_trimblanks(&out);
  221|     18|    return curlx_memdup0(curlx_str(&out), curlx_strlen(&out));
  ------------------
  |  |   49|     18|#define curlx_str(x)    ((x)->str)
  ------------------
                  return curlx_memdup0(curlx_str(&out), curlx_strlen(&out));
  ------------------
  |  |   50|     18|#define curlx_strlen(x) ((x)->len)
  ------------------
  222|     18|  }
  223|       |  /* bad input, should never happen */
  224|      0|  DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (224:3): [Folded, False: 0]
  |  Branch (224:3): [Folded, False: 0]
  ------------------
  225|      0|  return NULL;
  226|      0|}
Curl_http_auth_act:
  514|    745|{
  515|    745|  struct connectdata *conn = data->conn;
  516|    745|  bool pickhost = FALSE;
  ------------------
  |  |  989|    745|#define FALSE false
  ------------------
  517|    745|  bool pickproxy = FALSE;
  ------------------
  |  |  989|    745|#define FALSE false
  ------------------
  518|    745|  CURLcode result = CURLE_OK;
  519|    745|  unsigned long authmask = ~0UL;
  520|       |
  521|    745|  if(!Curl_creds_has_oauth_bearer(data->state.creds))
  ------------------
  |  |   80|    745|#define Curl_creds_has_oauth_bearer(c)   ((c) && (c)->oauth_bearer[0])
  |  |  ------------------
  |  |  |  Branch (80:43): [True: 17, False: 728]
  |  |  |  Branch (80:50): [True: 3, False: 14]
  |  |  ------------------
  ------------------
  522|    742|    authmask &= (unsigned long)~CURLAUTH_BEARER;
  ------------------
  |  |  846|    742|#define CURLAUTH_BEARER       (((unsigned long)1) << 6)
  ------------------
  523|       |
  524|    745|  if(100 <= data->req.httpcode && data->req.httpcode <= 199)
  ------------------
  |  Branch (524:6): [True: 734, False: 11]
  |  Branch (524:35): [True: 13, False: 721]
  ------------------
  525|       |    /* this is a transient response code, ignore */
  526|     13|    return CURLE_OK;
  527|       |
  528|    732|  if(data->state.authproblem)
  ------------------
  |  Branch (528:6): [True: 0, False: 732]
  ------------------
  529|      0|    return data->set.http_fail_on_error ? CURLE_HTTP_RETURNED_ERROR : CURLE_OK;
  ------------------
  |  Branch (529:12): [True: 0, False: 0]
  ------------------
  530|       |
  531|    732|  if(data->state.creds &&
  ------------------
  |  Branch (531:6): [True: 17, False: 715]
  ------------------
  532|     17|     ((data->req.httpcode == 401) ||
  ------------------
  |  Branch (532:7): [True: 3, False: 14]
  ------------------
  533|     14|      (data->req.authneg && data->req.httpcode < 300))) {
  ------------------
  |  Branch (533:8): [True: 0, False: 14]
  |  Branch (533:29): [True: 0, False: 0]
  ------------------
  534|      3|    pickhost = pickoneauth(&data->state.authhost, authmask, data->state.creds);
  535|      3|    if(!pickhost)
  ------------------
  |  Branch (535:8): [True: 3, False: 0]
  ------------------
  536|      3|      data->state.authproblem = TRUE;
  ------------------
  |  |  986|      3|#define TRUE true
  ------------------
  537|      0|    else
  538|      0|      data->info.httpauthpicked = data->state.authhost.picked;
  539|      3|  }
  540|    732|#ifndef CURL_DISABLE_PROXY
  541|    732|  if(conn->http_proxy.creds &&
  ------------------
  |  Branch (541:6): [True: 8, False: 724]
  ------------------
  542|      8|     ((data->req.httpcode == 407) ||
  ------------------
  |  Branch (542:7): [True: 3, False: 5]
  ------------------
  543|      5|      (data->req.authneg && data->req.httpcode < 300))) {
  ------------------
  |  Branch (543:8): [True: 0, False: 5]
  |  Branch (543:29): [True: 0, False: 0]
  ------------------
  544|      3|    pickproxy = pickoneauth(&data->state.authproxy,
  545|      3|                            authmask & ~CURLAUTH_BEARER,
  ------------------
  |  |  846|      3|#define CURLAUTH_BEARER       (((unsigned long)1) << 6)
  ------------------
  546|      3|                            conn->http_proxy.creds);
  547|      3|    if(!pickproxy)
  ------------------
  |  Branch (547:8): [True: 3, False: 0]
  ------------------
  548|      3|      data->state.authproblem = TRUE;
  ------------------
  |  |  986|      3|#define TRUE true
  ------------------
  549|      0|    else
  550|      0|      data->info.proxyauthpicked = data->state.authproxy.picked;
  551|      3|  }
  552|    732|#endif
  553|       |
  554|    732|  if(pickhost || pickproxy) {
  ------------------
  |  Branch (554:6): [True: 0, False: 732]
  |  Branch (554:18): [True: 0, False: 732]
  ------------------
  555|      0|    result = http_perhapsrewind(data, conn);
  556|      0|    if(result)
  ------------------
  |  Branch (556:8): [True: 0, False: 0]
  ------------------
  557|      0|      return result;
  558|       |
  559|       |    /* In case this is GSS auth, the newurl field is already allocated so
  560|       |       we must make sure to free it before allocating a new one. As figured
  561|       |       out in bug #2284386 */
  562|      0|    curlx_free(data->req.newurl);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  563|       |    /* clone URL */
  564|      0|    data->req.newurl = Curl_bufref_dup(&data->state.url);
  ------------------
  |  |   49|      0|#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  565|      0|    if(!data->req.newurl)
  ------------------
  |  Branch (565:8): [True: 0, False: 0]
  ------------------
  566|      0|      return CURLE_OUT_OF_MEMORY;
  567|      0|  }
  568|    732|  else if((data->req.httpcode < 300) &&
  ------------------
  |  Branch (568:11): [True: 607, False: 125]
  ------------------
  569|    607|          !data->state.authhost.done &&
  ------------------
  |  Branch (569:11): [True: 2, False: 605]
  ------------------
  570|      2|          data->req.authneg &&
  ------------------
  |  Branch (570:11): [True: 0, False: 2]
  ------------------
  571|       |          /* no (known) authentication available,
  572|       |             authentication is not "done" yet and
  573|       |             no authentication seems to be required and
  574|       |             we did not try HEAD or GET */
  575|      0|          (data->state.httpreq != HTTPREQ_GET) &&
  ------------------
  |  Branch (575:11): [True: 0, False: 0]
  ------------------
  576|      0|          (data->state.httpreq != HTTPREQ_HEAD)) {
  ------------------
  |  Branch (576:11): [True: 0, False: 0]
  ------------------
  577|       |    /* clone URL */
  578|      0|    data->req.newurl = Curl_bufref_dup(&data->state.url);
  ------------------
  |  |   49|      0|#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  579|      0|    if(!data->req.newurl)
  ------------------
  |  Branch (579:8): [True: 0, False: 0]
  ------------------
  580|      0|      return CURLE_OUT_OF_MEMORY;
  581|      0|    data->state.authhost.done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  582|      0|  }
  583|    732|  if(http_should_fail(data, data->req.httpcode)) {
  ------------------
  |  Branch (583:6): [True: 59, False: 673]
  ------------------
  584|     59|    failf(data, "The requested URL returned error: %d",
  ------------------
  |  |   62|     59|#define failf Curl_failf
  ------------------
  585|     59|          data->req.httpcode);
  586|     59|    result = CURLE_HTTP_RETURNED_ERROR;
  587|     59|  }
  588|       |
  589|    732|  return result;
  590|    732|}
Curl_http_output_auth:
  717|  9.16k|{
  718|  9.16k|  CURLcode result = CURLE_OK;
  719|  9.16k|  struct auth *authhost;
  720|  9.16k|  struct auth *authproxy;
  721|  9.16k|  const char *path_and_query = path;
  722|  9.16k|  char *tmp_str = NULL;
  723|  9.16k|  const char *auth_used;
  724|       |
  725|  9.16k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.16k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (725:3): [True: 0, False: 9.16k]
  |  Branch (725:3): [True: 9.16k, False: 0]
  ------------------
  726|  9.16k|  authhost = &data->state.authhost;
  727|  9.16k|  authproxy = &data->state.authproxy;
  728|       |
  729|  9.16k|  if(
  730|  9.16k|#ifndef CURL_DISABLE_PROXY
  731|  9.16k|    (!conn->http_proxy.peer || !conn->http_proxy.creds) &&
  ------------------
  |  Branch (731:6): [True: 1.95k, False: 7.20k]
  |  Branch (731:32): [True: 6.84k, False: 356]
  ------------------
  732|  8.80k|#endif
  733|       |#ifdef USE_SPNEGO
  734|       |    !(authhost->want & CURLAUTH_NEGOTIATE) &&
  735|       |    !(authproxy->want & CURLAUTH_NEGOTIATE) &&
  736|       |#endif
  737|  8.80k|#ifndef CURL_DISABLE_HTTPSIG
  738|  8.80k|    !(authhost->want & CURLAUTH_HTTPSIG) &&
  ------------------
  |  |  848|  8.80k|#define CURLAUTH_HTTPSIG      (((unsigned long)1) << 8)
  ------------------
  |  Branch (738:5): [True: 8.70k, False: 101]
  ------------------
  739|  8.70k|#endif
  740|  8.70k|    !data->state.creds) {
  ------------------
  |  Branch (740:5): [True: 8.51k, False: 190]
  ------------------
  741|       |    /* no authentication with no user or password */
  742|  8.51k|    authhost->done = TRUE;
  ------------------
  |  |  986|  8.51k|#define TRUE true
  ------------------
  743|  8.51k|    authproxy->done = TRUE;
  ------------------
  |  |  986|  8.51k|#define TRUE true
  ------------------
  744|  8.51k|    result = CURLE_OK;
  745|  8.51k|    goto out;
  746|  8.51k|  }
  747|       |
  748|    647|  if(query) {
  ------------------
  |  Branch (748:6): [True: 0, False: 647]
  ------------------
  749|      0|    tmp_str = curl_maprintf("%s?%s", path, query);
  750|      0|    if(!tmp_str) {
  ------------------
  |  Branch (750:8): [True: 0, False: 0]
  ------------------
  751|      0|      result = CURLE_OUT_OF_MEMORY;
  752|      0|      goto out;
  753|      0|    }
  754|      0|    path_and_query = tmp_str;
  755|      0|  }
  756|       |
  757|    647|  if(authhost->want && !authhost->picked)
  ------------------
  |  Branch (757:6): [True: 644, False: 3]
  |  Branch (757:24): [True: 644, False: 0]
  ------------------
  758|       |    /* The app has selected one or more methods, but none has been picked
  759|       |       so far by a server round-trip. Then we set the picked one to the
  760|       |       want one, and if this is one single bit it will be used instantly. */
  761|    644|    authhost->picked = authhost->want;
  762|       |
  763|    647|  if(authproxy->want && !authproxy->picked)
  ------------------
  |  Branch (763:6): [True: 640, False: 7]
  |  Branch (763:25): [True: 640, False: 0]
  ------------------
  764|       |    /* The app has selected one or more methods, but none has been picked so
  765|       |       far by a proxy round-trip. Then we set the picked one to the want one,
  766|       |       and if this is one single bit it will be used instantly. */
  767|    640|    authproxy->picked = authproxy->want;
  768|       |
  769|    647|#ifndef CURL_DISABLE_PROXY
  770|       |  /* Send proxy authentication header only with a forwarding proxy
  771|       |   * or when doing a CONNECT* request. */
  772|    647|  if(conn->bits.origin_is_proxy || is_connect) {
  ------------------
  |  Branch (772:6): [True: 0, False: 647]
  |  Branch (772:36): [True: 593, False: 54]
  ------------------
  773|    593|    result = output_auth_headers(data, conn, authproxy,
  774|    593|                                 method, path_and_query,
  775|    593|                                 TRUE, conn->http_proxy.creds,
  ------------------
  |  |  986|    593|#define TRUE true
  ------------------
  776|    593|                                 STRCONST("Proxy-Authorization"),
  ------------------
  |  | 1324|    593|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|    593|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  777|    593|                                 &auth_used);
  778|    593|    if(result)
  ------------------
  |  Branch (778:8): [True: 5, False: 588]
  ------------------
  779|      5|      goto out;
  780|    588|    data->info.proxyauthpicked = auth_used ? authproxy->picked : 0;
  ------------------
  |  Branch (780:34): [True: 252, False: 336]
  ------------------
  781|    588|    authproxy->multipass = auth_used ? !authproxy->done : FALSE;
  ------------------
  |  |  989|    588|#define FALSE false
  ------------------
  |  Branch (781:28): [True: 252, False: 336]
  ------------------
  782|    588|    if(auth_used)
  ------------------
  |  Branch (782:8): [True: 252, False: 336]
  ------------------
  783|    252|      infof(data, "Proxy auth using %s with user '%s'", auth_used,
  ------------------
  |  |  143|    252|  do {                               \
  |  |  144|    252|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    252|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 252, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 86, False: 166]
  |  |  |  |  ------------------
  |  |  |  |  323|    252|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 86, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     86|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    252|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 85, False: 1]
  |  |  ------------------
  |  |  146|    252|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 252]
  |  |  ------------------
  ------------------
  784|    588|            conn->http_proxy.creds ? conn->http_proxy.creds->user : "");
  785|    588|  }
  786|     54|  else
  787|     54|    authproxy->done = TRUE;
  ------------------
  |  |  986|     54|#define TRUE true
  ------------------
  788|       |#else
  789|       |  /* no proxy, pretend we are done authenticating with it */
  790|       |  (void)is_connect;
  791|       |  authproxy->done = TRUE;
  792|       |#endif /* CURL_DISABLE_PROXY */
  793|       |
  794|       |  /* Either we have credentials for the origin we talk to or
  795|       |     performing authentication is allowed here */
  796|    642|  if(!is_connect &&
  ------------------
  |  Branch (796:6): [True: 54, False: 588]
  ------------------
  797|     54|     (data->state.creds || Curl_auth_allowed_to_host(data))) {
  ------------------
  |  Branch (797:7): [True: 47, False: 7]
  |  Branch (797:28): [True: 7, False: 0]
  ------------------
  798|     54|    result = output_auth_headers(data, conn, authhost,
  799|     54|                                 method, path_and_query,
  800|     54|                                 FALSE, data->state.creds,
  ------------------
  |  |  989|     54|#define FALSE false
  ------------------
  801|     54|                                 STRCONST("Authorization"),
  ------------------
  |  | 1324|     54|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     54|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  802|     54|                                 &auth_used);
  803|     54|    if(result)
  ------------------
  |  Branch (803:8): [True: 11, False: 43]
  ------------------
  804|     11|      goto out;
  805|     43|    data->info.httpauthpicked = auth_used ? authhost->picked : 0;
  ------------------
  |  Branch (805:33): [True: 12, False: 31]
  ------------------
  806|     43|    authhost->multipass = auth_used ? !authhost->done : FALSE;
  ------------------
  |  |  989|     43|#define FALSE false
  ------------------
  |  Branch (806:27): [True: 12, False: 31]
  ------------------
  807|     43|    if(auth_used)
  ------------------
  |  Branch (807:8): [True: 12, False: 31]
  ------------------
  808|     12|      infof(data, "Server auth using %s with user '%s'", auth_used,
  ------------------
  |  |  143|     12|  do {                               \
  |  |  144|     12|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     12|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 12, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 2, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  323|     12|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     12|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 2, False: 0]
  |  |  ------------------
  |  |  146|     12|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 12]
  |  |  ------------------
  ------------------
  809|     43|            data->state.creds ? data->state.creds->user : "");
  810|     43|  }
  811|    588|  else
  812|    588|    authhost->done = TRUE;
  ------------------
  |  |  986|    588|#define TRUE true
  ------------------
  813|       |
  814|    631|  if(((authhost->multipass && !authhost->done) ||
  ------------------
  |  Branch (814:8): [True: 1, False: 630]
  |  Branch (814:31): [True: 1, False: 0]
  ------------------
  815|    630|      (authproxy->multipass && !authproxy->done)) &&
  ------------------
  |  Branch (815:8): [True: 5, False: 625]
  |  Branch (815:32): [True: 5, False: 0]
  ------------------
  816|      6|     (httpreq != HTTPREQ_GET) &&
  ------------------
  |  Branch (816:6): [True: 1, False: 5]
  ------------------
  817|      1|     (httpreq != HTTPREQ_HEAD)) {
  ------------------
  |  Branch (817:6): [True: 1, False: 0]
  ------------------
  818|       |    /* Auth is required and we are not authenticated yet. Make a PUT or POST
  819|       |       with content-length zero as a "probe". */
  820|      1|    data->req.authneg = TRUE;
  ------------------
  |  |  986|      1|#define TRUE true
  ------------------
  821|      1|  }
  822|    630|  else
  823|    630|    data->req.authneg = FALSE;
  ------------------
  |  |  989|    630|#define FALSE false
  ------------------
  824|       |
  825|  9.16k|out:
  826|  9.16k|  curlx_free(tmp_str);
  ------------------
  |  | 1503|  9.16k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  827|  9.16k|  return result;
  828|    631|}
Curl_compareheader:
 1369|  58.0k|{
 1370|       |  /* RFC2616, section 4.2 says: "Each header field consists of a name followed
 1371|       |   * by a colon (":") and the field value. Field names are case-insensitive.
 1372|       |   * The field value MAY be preceded by any amount of LWS, though a single SP
 1373|       |   * is preferred." */
 1374|       |
 1375|  58.0k|  const char *p;
 1376|  58.0k|  struct Curl_str val;
 1377|  58.0k|  DEBUGASSERT(hlen);
  ------------------
  |  | 1016|  58.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1377:3): [True: 0, False: 58.0k]
  |  Branch (1377:3): [True: 58.0k, False: 0]
  ------------------
 1378|  58.0k|  DEBUGASSERT(clen);
  ------------------
  |  | 1016|  58.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1378:3): [True: 0, False: 58.0k]
  |  Branch (1378:3): [True: 58.0k, False: 0]
  ------------------
 1379|  58.0k|  DEBUGASSERT(header);
  ------------------
  |  | 1016|  58.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1379:3): [True: 0, False: 58.0k]
  |  Branch (1379:3): [True: 58.0k, False: 0]
  ------------------
 1380|  58.0k|  DEBUGASSERT(content);
  ------------------
  |  | 1016|  58.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1380:3): [True: 0, False: 58.0k]
  |  Branch (1380:3): [True: 58.0k, False: 0]
  ------------------
 1381|       |
 1382|  58.0k|  if(!curl_strnequal(headerline, header, hlen))
  ------------------
  |  Branch (1382:6): [True: 54.7k, False: 3.36k]
  ------------------
 1383|  54.7k|    return FALSE; /* does not start with header */
  ------------------
  |  |  989|  54.7k|#define FALSE false
  ------------------
 1384|       |
 1385|       |  /* pass the header */
 1386|  3.36k|  p = &headerline[hlen];
 1387|       |
 1388|  3.36k|  if(curlx_str_cspn(&p, &val, "\r\n"))
  ------------------
  |  Branch (1388:6): [True: 72, False: 3.29k]
  ------------------
 1389|     72|    return FALSE;
  ------------------
  |  |  989|     72|#define FALSE false
  ------------------
 1390|  3.29k|  curlx_str_trimblanks(&val);
 1391|       |
 1392|       |  /* find the content string in the rest of the line */
 1393|  3.29k|  if(curlx_strlen(&val) >= clen) {
  ------------------
  |  |   50|  3.29k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (1393:6): [True: 2.86k, False: 431]
  ------------------
 1394|  2.86k|    size_t len;
 1395|  2.86k|    p = curlx_str(&val);
  ------------------
  |  |   49|  2.86k|#define curlx_str(x)    ((x)->str)
  ------------------
 1396|  4.16k|    for(len = curlx_strlen(&val); len >= clen;) {
  ------------------
  |  |   50|  2.86k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (1396:35): [True: 4.11k, False: 52]
  ------------------
 1397|  4.11k|      struct Curl_str next;
 1398|  4.11k|      const char *o = p;
 1399|       |      /* after a match there must be a comma, space, newline or NUL byte */
 1400|  4.11k|      if(curl_strnequal(p, content, clen) &&
  ------------------
  |  Branch (1400:10): [True: 1.92k, False: 2.18k]
  ------------------
 1401|  1.92k|         ((p[clen] == ',') || ISBLANK(p[clen]) || ISNEWLINE(p[clen]) ||
  ------------------
  |  |   43|  2.60k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 424, False: 250]
  |  |  |  Branch (43:38): [True: 27, False: 223]
  |  |  ------------------
  ------------------
                       ((p[clen] == ',') || ISBLANK(p[clen]) || ISNEWLINE(p[clen]) ||
  ------------------
  |  |   48|  2.15k|#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
  |  |  ------------------
  |  |  |  Branch (48:26): [True: 52, False: 171]
  |  |  |  Branch (48:43): [True: 36, False: 135]
  |  |  ------------------
  ------------------
  |  Branch (1401:11): [True: 1.25k, False: 674]
  ------------------
 1402|    135|          !p[clen]))
  ------------------
  |  Branch (1402:11): [True: 0, False: 135]
  ------------------
 1403|  1.79k|        return TRUE; /* match! */
  ------------------
  |  |  986|  1.79k|#define TRUE true
  ------------------
 1404|       |      /* advance to the next comma */
 1405|  2.32k|      if(curlx_str_until(&p, &next, len, ',') ||
  ------------------
  |  Branch (1405:10): [True: 803, False: 1.52k]
  ------------------
 1406|  1.52k|         curlx_str_single(&p, ','))
  ------------------
  |  Branch (1406:10): [True: 0, False: 1.52k]
  ------------------
 1407|    803|        break; /* no comma, get out */
 1408|       |
 1409|       |      /* if there are more dummy commas, move over them as well */
 1410|  1.52k|      do
 1411|  8.61k|        curlx_str_passblanks(&p);
 1412|  8.61k|      while(!curlx_str_single(&p, ','));
  ------------------
  |  Branch (1412:13): [True: 7.09k, False: 1.52k]
  ------------------
 1413|       |      /* trailing blanks may move the parsing point past the value end,
 1414|       |         then there is nothing left to match */
 1415|  1.52k|      if((size_t)(p - o) > len)
  ------------------
  |  Branch (1415:10): [True: 214, False: 1.30k]
  ------------------
 1416|    214|        break;
 1417|  1.30k|      len -= (p - o);
 1418|  1.30k|    }
 1419|  2.86k|  }
 1420|  1.50k|  return FALSE; /* no match */
  ------------------
  |  |  989|  1.50k|#define FALSE false
  ------------------
 1421|  3.29k|}
Curl_http_perform_pollset:
 1575|  8.50k|{
 1576|  8.50k|  struct connectdata *conn = data->conn;
 1577|  8.50k|  CURLcode result = CURLE_OK;
 1578|       |
 1579|  8.50k|  if(CURL_REQ_WANT_RECV(data)) {
  ------------------
  |  |   40|  8.50k|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  8.50k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 8.50k, False: 0]
  |  |  ------------------
  ------------------
 1580|  8.50k|    result = Curl_pollset_add_in(data, ps, conn->chain.sock);
  ------------------
  |  |  152|  8.50k|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0)
  |  |  ------------------
  |  |  |  |  283|  8.50k|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1581|  8.50k|  }
 1582|       |
 1583|       |  /* on a "Expect: 100-continue" timed wait, do not poll for outgoing */
 1584|  8.50k|  if(!result && Curl_req_want_send(data) && !http_exp100_is_waiting(data)) {
  ------------------
  |  Branch (1584:6): [True: 8.50k, False: 0]
  |  Branch (1584:17): [True: 740, False: 7.76k]
  |  Branch (1584:45): [True: 740, False: 0]
  ------------------
 1585|    740|    result = Curl_pollset_add_out(data, ps, conn->chain.sock);
  ------------------
  |  |  156|    740|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, 0)
  |  |  ------------------
  |  |  |  |  284|    740|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
 1586|    740|  }
 1587|  8.50k|  return result;
 1588|  8.50k|}
Curl_http_done:
 1624|  1.95k|{
 1625|  1.95k|  struct connectdata *conn = data->conn;
 1626|       |
 1627|       |  /* Clear multipass flag. If authentication is not done yet, then it will get
 1628|       |   * a chance to be set back to true when we output the next auth header */
 1629|  1.95k|  data->state.authhost.multipass = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 1630|  1.95k|  data->state.authproxy.multipass = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 1631|       |
 1632|  1.95k|  if(curlx_dyn_len(&data->state.headerb)) {
  ------------------
  |  Branch (1632:6): [True: 0, False: 1.95k]
  ------------------
 1633|      0|    (void)http_write_header(data, curlx_dyn_ptr(&data->state.headerb),
 1634|      0|                            curlx_dyn_len(&data->state.headerb));
 1635|      0|  }
 1636|  1.95k|  curlx_dyn_reset(&data->state.headerb);
 1637|       |
 1638|  1.95k|  if(status)
  ------------------
  |  Branch (1638:6): [True: 619, False: 1.33k]
  ------------------
 1639|    619|    return status;
 1640|       |
 1641|  1.33k|  if(!premature && /* this check is pointless when DONE is called before the
  ------------------
  |  Branch (1641:6): [True: 533, False: 806]
  ------------------
 1642|       |                      entire operation is complete */
 1643|    533|     !conn->bits.retry &&
  ------------------
  |  Branch (1643:6): [True: 533, False: 0]
  ------------------
 1644|    533|     !data->set.connect_only &&
  ------------------
  |  Branch (1644:6): [True: 533, False: 0]
  ------------------
 1645|    533|     (data->req.bytecount +
  ------------------
  |  Branch (1645:6): [True: 0, False: 533]
  ------------------
 1646|    533|      data->req.headerbytecount -
 1647|    533|      data->req.deductheadercount) <= 0) {
 1648|       |    /* If this connection is not closed to be retried, AND nothing was
 1649|       |       read from the HTTP server (that counts), this cannot be right so we
 1650|       |       return an error here */
 1651|      0|    failf(data, "Empty reply from server");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1652|       |    /* Mark it as closed to avoid the "left intact" message */
 1653|      0|    streamclose(conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 1654|      0|    return CURLE_GOT_NOTHING;
 1655|      0|  }
 1656|       |
 1657|  1.33k|  return CURLE_OK;
 1658|  1.33k|}
Curl_add_custom_headers:
 1769|  1.94k|{
 1770|  1.94k|  struct curl_slist *h[2];
 1771|  1.94k|  struct http_custom_ctx custom_ctx;
 1772|  1.94k|  int numlists = 0;
 1773|  1.94k|  int i;
 1774|       |
 1775|  1.94k|  h[numlists++] = data->set.headers;
 1776|  1.94k|#ifndef CURL_DISABLE_PROXY
 1777|  1.94k|  if(data->conn->bits.origin_is_proxy &&
  ------------------
  |  Branch (1777:6): [True: 0, False: 1.94k]
  ------------------
 1778|      0|     data->set.sep_headers)
  ------------------
  |  Branch (1778:6): [True: 0, False: 0]
  ------------------
 1779|      0|      h[numlists++] = data->set.proxyheaders;
 1780|  1.94k|#endif
 1781|       |
 1782|       |  /* loop through one or two lists */
 1783|  1.94k|  custom_ctx.data = data;
 1784|  1.94k|  custom_ctx.req = req;
 1785|  1.94k|  custom_ctx.httpversion = httpversion;
 1786|  3.89k|  for(i = 0; i < numlists; i++) {
  ------------------
  |  Branch (1786:14): [True: 1.94k, False: 1.94k]
  ------------------
 1787|  1.94k|    CURLcode result =
 1788|  1.94k|      Curl_dynhds_add_slist(NULL, h[i], http_custom_treat, &custom_ctx);
 1789|  1.94k|    if(result)
  ------------------
  |  Branch (1789:8): [True: 0, False: 1.94k]
  ------------------
 1790|      0|      return result;
 1791|  1.94k|  }
 1792|       |
 1793|  1.94k|  return CURLE_OK;
 1794|  1.94k|}
Curl_add_timecondition:
 1799|  1.94k|{
 1800|  1.94k|  const struct tm *tm;
 1801|  1.94k|  struct tm keeptime;
 1802|  1.94k|  CURLcode result;
 1803|  1.94k|  char datestr[80];
 1804|  1.94k|  const char *condp;
 1805|  1.94k|  size_t len;
 1806|       |
 1807|  1.94k|  if(data->set.timecondition == CURL_TIMECOND_NONE)
  ------------------
  |  | 2436|  1.94k|#define CURL_TIMECOND_NONE         0L
  ------------------
  |  Branch (1807:6): [True: 1.94k, False: 0]
  ------------------
 1808|       |    /* no condition was asked for */
 1809|  1.94k|    return CURLE_OK;
 1810|       |
 1811|      0|  result = curlx_gmtime(data->set.timevalue, &keeptime);
 1812|      0|  if(result) {
  ------------------
  |  Branch (1812:6): [True: 0, False: 0]
  ------------------
 1813|      0|    failf(data, "Invalid TIMEVALUE");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1814|      0|    return result;
 1815|      0|  }
 1816|      0|  tm = &keeptime;
 1817|       |
 1818|      0|  switch(data->set.timecondition) {
 1819|      0|  default:
  ------------------
  |  Branch (1819:3): [True: 0, False: 0]
  ------------------
 1820|      0|    DEBUGF(infof(data, "invalid time condition"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1821|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1822|       |
 1823|      0|  case CURL_TIMECOND_IFMODSINCE:
  ------------------
  |  | 2437|      0|#define CURL_TIMECOND_IFMODSINCE   1L
  ------------------
  |  Branch (1823:3): [True: 0, False: 0]
  ------------------
 1824|      0|    condp = "If-Modified-Since";
 1825|      0|    len = 17;
 1826|      0|    break;
 1827|      0|  case CURL_TIMECOND_IFUNMODSINCE:
  ------------------
  |  | 2438|      0|#define CURL_TIMECOND_IFUNMODSINCE 2L
  ------------------
  |  Branch (1827:3): [True: 0, False: 0]
  ------------------
 1828|      0|    condp = "If-Unmodified-Since";
 1829|      0|    len = 19;
 1830|      0|    break;
 1831|      0|  case CURL_TIMECOND_LASTMOD:
  ------------------
  |  | 2439|      0|#define CURL_TIMECOND_LASTMOD      3L
  ------------------
  |  Branch (1831:3): [True: 0, False: 0]
  ------------------
 1832|      0|    condp = "Last-Modified";
 1833|      0|    len = 13;
 1834|      0|    break;
 1835|      0|  }
 1836|       |
 1837|      0|  if(Curl_checkheaders(data, condp, len)) {
  ------------------
  |  Branch (1837:6): [True: 0, False: 0]
  ------------------
 1838|       |    /* A custom header was specified; it will be sent instead. */
 1839|      0|    return CURLE_OK;
 1840|      0|  }
 1841|       |
 1842|       |  /* The If-Modified-Since header family should have their times set in
 1843|       |   * GMT as RFC2616 defines: "All HTTP date/time stamps MUST be
 1844|       |   * represented in Greenwich Mean Time (GMT), without exception. For the
 1845|       |   * purposes of HTTP, GMT is exactly equal to UTC (Coordinated Universal
 1846|       |   * Time)." (see page 20 of RFC2616).
 1847|       |   */
 1848|       |
 1849|       |  /* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
 1850|      0|  curl_msnprintf(datestr, sizeof(datestr),
 1851|      0|                 "%s: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
 1852|      0|                 condp,
 1853|      0|                 Curl_wkday[tm->tm_wday ? tm->tm_wday - 1 : 6],
  ------------------
  |  Branch (1853:29): [True: 0, False: 0]
  ------------------
 1854|      0|                 tm->tm_mday,
 1855|      0|                 Curl_month[tm->tm_mon],
 1856|      0|                 tm->tm_year + 1900,
 1857|      0|                 tm->tm_hour,
 1858|      0|                 tm->tm_min,
 1859|      0|                 tm->tm_sec);
 1860|       |
 1861|      0|  result = curlx_dyn_add(req, datestr);
 1862|      0|  return result;
 1863|      0|}
Curl_http_method:
 1877|  1.95k|{
 1878|  1.95k|  Curl_HttpReq httpreq = (Curl_HttpReq)data->state.httpreq;
 1879|  1.95k|  const char *request;
 1880|  1.95k|#ifndef CURL_DISABLE_WEBSOCKETS
 1881|  1.95k|  if(data->conn->scheme->protocol & (CURLPROTO_WS | CURLPROTO_WSS))
  ------------------
  |  |   62|  1.95k|#define CURLPROTO_WS     (1L << 30)
  ------------------
                if(data->conn->scheme->protocol & (CURLPROTO_WS | CURLPROTO_WSS))
  ------------------
  |  |   63|  1.95k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  ------------------
  |  Branch (1881:6): [True: 0, False: 1.95k]
  ------------------
 1882|      0|    httpreq = HTTPREQ_GET;
 1883|  1.95k|  else
 1884|  1.95k|#endif
 1885|  1.95k|  if((data->conn->scheme->protocol & (PROTO_FAMILY_HTTP | CURLPROTO_FTP)) &&
  ------------------
  |  |   83|  1.95k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|  1.95k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|  1.95k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   62|  1.95k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   84|  1.95k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   63|  1.95k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
                if((data->conn->scheme->protocol & (PROTO_FAMILY_HTTP | CURLPROTO_FTP)) &&
  ------------------
  |  | 1090|  1.95k|#define CURLPROTO_FTP     (1L << 2)
  ------------------
  |  Branch (1885:6): [True: 1.95k, False: 0]
  ------------------
 1886|  1.95k|     data->state.upload)
  ------------------
  |  Branch (1886:6): [True: 37, False: 1.92k]
  ------------------
 1887|     37|    httpreq = HTTPREQ_PUT;
 1888|       |
 1889|       |  /* Now set the 'request' pointer to the proper request string */
 1890|  1.95k|  if(!data->state.http_ignorecustom &&
  ------------------
  |  Branch (1890:6): [True: 1.95k, False: 0]
  ------------------
 1891|  1.95k|     CURL_EASY_STR(data, STRING_CUSTOMREQUEST)) {
  ------------------
  |  | 1206|  1.95k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 21, False: 1.93k]
  |  |  ------------------
  ------------------
 1892|     21|    request = CURL_EASY_STR(data, STRING_CUSTOMREQUEST);
  ------------------
  |  | 1206|     21|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1893|     21|  }
 1894|  1.93k|  else {
 1895|  1.93k|    if(data->req.no_body)
  ------------------
  |  Branch (1895:8): [True: 12, False: 1.92k]
  ------------------
 1896|     12|      request = "HEAD";
 1897|  1.92k|    else {
 1898|  1.92k|      DEBUGASSERT((httpreq >= HTTPREQ_GET) && (httpreq <= HTTPREQ_HEAD));
  ------------------
  |  | 1016|  1.92k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1898:7): [True: 0, False: 1.92k]
  |  Branch (1898:7): [True: 0, False: 0]
  |  Branch (1898:7): [True: 1.92k, False: 0]
  |  Branch (1898:7): [True: 1.92k, False: 0]
  ------------------
 1899|  1.92k|      switch(httpreq) {
 1900|     22|      case HTTPREQ_POST:
  ------------------
  |  Branch (1900:7): [True: 22, False: 1.90k]
  ------------------
 1901|     22|      case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (1901:7): [True: 0, False: 1.92k]
  ------------------
 1902|    399|      case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (1902:7): [True: 377, False: 1.54k]
  ------------------
 1903|    399|        request = "POST";
 1904|    399|        break;
 1905|     36|      case HTTPREQ_PUT:
  ------------------
  |  Branch (1905:7): [True: 36, False: 1.88k]
  ------------------
 1906|     36|        request = "PUT";
 1907|     36|        break;
 1908|      0|      default: /* this should never happen */
  ------------------
  |  Branch (1908:7): [True: 0, False: 1.92k]
  ------------------
 1909|  1.49k|      case HTTPREQ_GET:
  ------------------
  |  Branch (1909:7): [True: 1.49k, False: 435]
  ------------------
 1910|  1.49k|        request = "GET";
 1911|  1.49k|        break;
 1912|      0|      case HTTPREQ_HEAD:
  ------------------
  |  Branch (1912:7): [True: 0, False: 1.92k]
  ------------------
 1913|      0|        request = "HEAD";
 1914|      0|        break;
 1915|  1.92k|      }
 1916|  1.92k|    }
 1917|  1.93k|  }
 1918|  1.95k|  *method = request;
 1919|  1.95k|  *reqp = httpreq;
 1920|  1.95k|}
Curl_http:
 2884|  1.95k|{
 2885|  1.95k|  CURLcode result = CURLE_OK;
 2886|  1.95k|  Curl_HttpReq httpreq;
 2887|  1.95k|  const char *method;
 2888|  1.95k|  struct dynbuf req;
 2889|  1.95k|  unsigned char httpversion;
 2890|  1.95k|  size_t hd_id;
 2891|       |
 2892|       |  /* Always consider the DO phase done after this function call, even if there
 2893|       |     may be parts of the request that are not yet sent, since we can deal with
 2894|       |     the rest of the request in the PERFORM phase. */
 2895|  1.95k|  *done = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
 2896|       |  /* initialize a dynamic send-buffer */
 2897|  1.95k|  curlx_dyn_init(&req, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  1.95k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 2898|       |  /* make sure the header buffer is reset - if there are leftovers from a
 2899|       |     previous transfer */
 2900|  1.95k|  curlx_dyn_reset(&data->state.headerb);
 2901|  1.95k|  data->state.maybe_folded = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 2902|  1.95k|  data->state.leading_unfold = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 2903|       |
 2904|       |  /* Add collecting of headers written to client. For a new connection,
 2905|       |   * we might have done that already, but reuse
 2906|       |   * or multiplex needs it here as well. */
 2907|  1.95k|  result = Curl_headers_init(data);
 2908|  1.95k|  if(result)
  ------------------
  |  Branch (2908:6): [True: 0, False: 1.95k]
  ------------------
 2909|      0|    goto out;
 2910|       |
 2911|  1.95k|  data->state.http_hd_te = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 2912|  1.95k|  data->state.http_hd_upgrade = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 2913|  1.95k|  data->state.http_hd_h2_settings = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 2914|       |
 2915|       |  /* what kind of request do we need to send? */
 2916|  1.95k|  Curl_http_method(data, &method, &httpreq);
 2917|       |
 2918|       |  /* select host to send */
 2919|  1.95k|  result = http_set_aptr_host(data);
 2920|       |  /* setup the authentication headers, how that method and host are known */
 2921|  1.95k|  if(!result)
  ------------------
  |  Branch (2921:6): [True: 1.95k, False: 0]
  ------------------
 2922|  1.95k|    result = Curl_http_output_auth(data, data->conn, httpreq, method,
 2923|  1.95k|                                   data->state.up.path,
 2924|  1.95k|                                   data->state.up.query, FALSE);
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 2925|       |  /* Setup input reader, resume information and ranges */
 2926|  1.95k|  if(!result)
  ------------------
  |  Branch (2926:6): [True: 1.94k, False: 11]
  ------------------
 2927|  1.94k|    result = set_reader(data, httpreq);
 2928|  1.95k|  if(!result)
  ------------------
  |  Branch (2928:6): [True: 1.94k, False: 12]
  ------------------
 2929|  1.94k|    result = http_resume(data, httpreq);
 2930|  1.95k|  if(!result)
  ------------------
  |  Branch (2930:6): [True: 1.94k, False: 12]
  ------------------
 2931|  1.94k|    result = http_range(data, httpreq);
 2932|  1.95k|  if(result)
  ------------------
  |  Branch (2932:6): [True: 12, False: 1.94k]
  ------------------
 2933|     12|    goto out;
 2934|       |
 2935|  1.94k|  httpversion = http_request_version(data);
 2936|       |  /* Add request line and all headers to `req` */
 2937|  40.8k|  for(hd_id = 0; hd_id <= H1_HD_LAST; ++hd_id) {
  ------------------
  |  Branch (2937:18): [True: 38.9k, False: 1.94k]
  ------------------
 2938|  38.9k|    result = http_add_hd(data, &req, (http_hd_t)hd_id,
 2939|  38.9k|                         httpversion, method, FALSE, httpreq);
  ------------------
  |  |  989|  38.9k|#define FALSE false
  ------------------
 2940|  38.9k|    if(result)
  ------------------
  |  Branch (2940:8): [True: 0, False: 38.9k]
  ------------------
 2941|      0|      goto out;
 2942|  38.9k|  }
 2943|       |
 2944|       |  /* setup variables for the upcoming transfer and send */
 2945|  1.94k|  Curl_xfer_setup_sendrecv(data, -1);
 2946|  1.94k|  result = Curl_req_send(data, &req, httpversion);
 2947|       |
 2948|  1.94k|  if((httpversion >= 20) && data->req.upload_chunky)
  ------------------
  |  Branch (2948:6): [True: 1.94k, False: 0]
  |  Branch (2948:29): [True: 0, False: 1.94k]
  ------------------
 2949|       |    /* upload_chunky was set above to set up the request in a chunky fashion,
 2950|       |       but is disabled here again to avoid that the chunked encoded version is
 2951|       |       actually used when sending the request body over h2 */
 2952|      0|    data->req.upload_chunky = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2953|       |
 2954|  1.95k|out:
 2955|  1.95k|  if(result == CURLE_TOO_LARGE)
  ------------------
  |  Branch (2955:6): [True: 0, False: 1.95k]
  ------------------
 2956|      0|    failf(data, "HTTP request too large");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2957|       |
 2958|  1.95k|  curlx_dyn_free(&req);
 2959|  1.95k|  return result;
 2960|  1.94k|}
Curl_verify_header:
 3696|  34.7k|{
 3697|  34.7k|  struct SingleRequest *k = &data->req;
 3698|  34.7k|  const char *nul = memchr(hd, '\0', hdlen);
 3699|  34.7k|  const char *cr = memchr(hd, '\r', nul ? (size_t)(nul - hd) : hdlen);
  ------------------
  |  Branch (3699:37): [True: 19, False: 34.7k]
  ------------------
 3700|       |  /* CR may only precede the LF, nothing else */
 3701|  34.7k|  if(cr && ((size_t)(cr - hd) < hdlen - 2)) {
  ------------------
  |  Branch (3701:6): [True: 8.74k, False: 26.0k]
  |  Branch (3701:12): [True: 4, False: 8.74k]
  ------------------
 3702|      4|    failf(data, "Carriage return found in header");
  ------------------
  |  |   62|      4|#define failf Curl_failf
  ------------------
 3703|      4|    return CURLE_WEIRD_SERVER_REPLY;
 3704|      4|  }
 3705|  34.7k|  if(nul) {
  ------------------
  |  Branch (3705:6): [True: 18, False: 34.7k]
  ------------------
 3706|       |    /* this is bad, bail out */
 3707|     18|    failf(data, "NUL byte in header");
  ------------------
  |  |   62|     18|#define failf Curl_failf
  ------------------
 3708|     18|    return CURLE_WEIRD_SERVER_REPLY;
 3709|     18|  }
 3710|  34.7k|  if(k->headerline < 2)
  ------------------
  |  Branch (3710:6): [True: 33.7k, False: 997]
  ------------------
 3711|       |    /* the first "header" is the status-line and it has no colon */
 3712|  33.7k|    return CURLE_OK;
 3713|    997|  if(((hd[0] == ' ') || (hd[0] == '\t')) && k->headerline > 2)
  ------------------
  |  Branch (3713:7): [True: 0, False: 997]
  |  Branch (3713:25): [True: 0, False: 997]
  |  Branch (3713:45): [True: 0, False: 0]
  ------------------
 3714|       |    /* line folding, cannot happen on line 2 */
 3715|      0|    ;
 3716|    997|  else if(!memchr(hd, ':', hdlen)) {
  ------------------
  |  Branch (3716:11): [True: 0, False: 997]
  ------------------
 3717|       |    /* this is bad, bail out */
 3718|      0|    failf(data, "Header without colon");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3719|      0|    return CURLE_WEIRD_SERVER_REPLY;
 3720|      0|  }
 3721|    997|  return CURLE_OK;
 3722|    997|}
Curl_bump_headersize:
 3727|  36.0k|{
 3728|  36.0k|  size_t bad = 0;
 3729|  36.0k|  unsigned int max = MAX_HTTP_RESP_HEADER_SIZE;
  ------------------
  |  |  159|  36.0k|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
 3730|  36.0k|  if(delta < MAX_HTTP_RESP_HEADER_SIZE) {
  ------------------
  |  |  159|  36.0k|#define MAX_HTTP_RESP_HEADER_SIZE (300 * 1024)
  ------------------
  |  Branch (3730:6): [True: 36.0k, False: 0]
  ------------------
 3731|  36.0k|    data->info.header_size += (unsigned int)delta;
 3732|  36.0k|    data->req.allheadercount += (unsigned int)delta;
 3733|  36.0k|    if(!connect_only)
  ------------------
  |  Branch (3733:8): [True: 3.43k, False: 32.5k]
  ------------------
 3734|  3.43k|      data->req.headerbytecount += (unsigned int)delta;
 3735|  36.0k|    if(data->req.allheadercount > max)
  ------------------
  |  Branch (3735:8): [True: 0, False: 36.0k]
  ------------------
 3736|      0|      bad = data->req.allheadercount;
 3737|  36.0k|    else if(data->info.header_size > (max * 20)) {
  ------------------
  |  Branch (3737:13): [True: 0, False: 36.0k]
  ------------------
 3738|      0|      bad = data->info.header_size;
 3739|      0|      max *= 20;
 3740|      0|    }
 3741|  36.0k|  }
 3742|      0|  else
 3743|      0|    bad = data->req.allheadercount + delta;
 3744|  36.0k|  if(bad) {
  ------------------
  |  Branch (3744:6): [True: 0, False: 36.0k]
  ------------------
 3745|      0|    failf(data, "Too large response headers: %zu > %u", bad, max);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3746|      0|    return CURLE_RECV_ERROR;
 3747|      0|  }
 3748|  36.0k|  return CURLE_OK;
 3749|  36.0k|}
Curl_http_to_fold:
 4271|  1.50k|{
 4272|  1.50k|  size_t len = curlx_dyn_len(bf);
 4273|  1.50k|  const char *hd = curlx_dyn_ptr(bf);
 4274|  1.50k|  if(len && (hd[len - 1] == '\n'))
  ------------------
  |  Branch (4274:6): [True: 1.50k, False: 0]
  |  Branch (4274:13): [True: 1.50k, False: 0]
  ------------------
 4275|  1.50k|    len--;
 4276|  1.50k|  if(len && (hd[len - 1] == '\r'))
  ------------------
  |  Branch (4276:6): [True: 1.50k, False: 0]
  |  Branch (4276:13): [True: 273, False: 1.23k]
  ------------------
 4277|    273|    len--;
 4278|  2.96k|  while(len && ISBLANK(hd[len - 1])) /* strip off trailing whitespace */
  ------------------
  |  |   43|  2.62k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.04k, False: 1.57k]
  |  |  |  Branch (43:38): [True: 414, False: 1.16k]
  |  |  ------------------
  ------------------
  |  Branch (4278:9): [True: 2.62k, False: 341]
  ------------------
 4279|  1.46k|    len--;
 4280|  1.50k|  curlx_dyn_setlen(bf, len);
 4281|  1.50k|}
Curl_http_write_resp_hd:
 4464|  3.28k|{
 4465|  3.28k|  CURLcode result;
 4466|  3.28k|  size_t consumed;
 4467|  3.28k|  char tmp = 0;
 4468|  3.28k|  DEBUGASSERT(!hd[hdlen]); /* null-terminated */
  ------------------
  |  | 1016|  3.28k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4468:3): [True: 0, False: 3.28k]
  |  Branch (4468:3): [True: 3.28k, False: 0]
  ------------------
 4469|       |
 4470|  3.28k|  result = http_rw_hd(data, hd, hdlen, &tmp, 0, &consumed);
 4471|  3.28k|  if(!result && is_eos) {
  ------------------
  |  Branch (4471:6): [True: 3.28k, False: 5]
  |  Branch (4471:17): [True: 0, False: 3.28k]
  ------------------
 4472|      0|    result = Curl_client_write(data, (CLIENTWRITE_BODY | CLIENTWRITE_EOS),
  ------------------
  |  |   43|      0|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
                  result = Curl_client_write(data, (CLIENTWRITE_BODY | CLIENTWRITE_EOS),
  ------------------
  |  |   50|      0|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
 4473|      0|                               &tmp, 0);
 4474|      0|  }
 4475|  3.28k|  return result;
 4476|  3.28k|}
Curl_http_write_resp_hds:
 4485|    650|{
 4486|    650|  if(!data->req.header) {
  ------------------
  |  Branch (4486:6): [True: 650, False: 0]
  ------------------
 4487|    650|    *pconsumed = 0;
 4488|    650|    return CURLE_OK;
 4489|    650|  }
 4490|      0|  else {
 4491|      0|    CURLcode result;
 4492|       |
 4493|      0|    result = http_parse_headers(data, buf, blen, pconsumed);
 4494|      0|    if(!result && !data->req.header) {
  ------------------
  |  Branch (4494:8): [True: 0, False: 0]
  |  Branch (4494:19): [True: 0, False: 0]
  ------------------
 4495|      0|      if(!data->req.no_body && curlx_dyn_len(&data->state.headerb)) {
  ------------------
  |  Branch (4495:10): [True: 0, False: 0]
  |  Branch (4495:32): [True: 0, False: 0]
  ------------------
 4496|       |        /* leftover from parsing something that turned out not
 4497|       |         * to be a header, only happens if we allow for
 4498|       |         * HTTP/0.9 like responses */
 4499|      0|        result = Curl_client_write(data, CLIENTWRITE_BODY,
  ------------------
  |  |   43|      0|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
 4500|      0|                                   curlx_dyn_ptr(&data->state.headerb),
 4501|      0|                                   curlx_dyn_len(&data->state.headerb));
 4502|      0|      }
 4503|      0|      curlx_dyn_free(&data->state.headerb);
 4504|      0|    }
 4505|      0|    return result;
 4506|      0|  }
 4507|    650|}
Curl_http_write_resp:
 4512|    650|{
 4513|    650|  CURLcode result;
 4514|    650|  size_t consumed;
 4515|    650|  int flags;
 4516|       |
 4517|    650|  result = Curl_http_write_resp_hds(data, buf, blen, &consumed);
 4518|    650|  if(result || data->req.done)
  ------------------
  |  Branch (4518:6): [True: 0, False: 650]
  |  Branch (4518:16): [True: 0, False: 650]
  ------------------
 4519|      0|    goto out;
 4520|       |
 4521|    650|  DEBUGASSERT(consumed <= blen);
  ------------------
  |  | 1016|    650|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4521:3): [True: 0, False: 650]
  |  Branch (4521:3): [True: 650, False: 0]
  ------------------
 4522|    650|  blen -= consumed;
 4523|    650|  buf += consumed;
 4524|       |  /* either all was consumed in header parsing, or we have data left
 4525|       |   * and are done with headers, e.g. it is BODY data */
 4526|    650|  DEBUGASSERT(!blen || !data->req.header);
  ------------------
  |  | 1016|    650|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4526:3): [True: 650, False: 0]
  |  Branch (4526:3): [True: 0, False: 0]
  |  Branch (4526:3): [True: 533, False: 117]
  |  Branch (4526:3): [True: 117, False: 0]
  ------------------
 4527|    650|  if(!data->req.header && (blen || is_eos)) {
  ------------------
  |  Branch (4527:6): [True: 650, False: 0]
  |  Branch (4527:28): [True: 117, False: 533]
  |  Branch (4527:36): [True: 533, False: 0]
  ------------------
 4528|       |    /* BODY data after header been parsed, write and consume */
 4529|    650|    flags = CLIENTWRITE_BODY;
  ------------------
  |  |   43|    650|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
 4530|    650|    if(is_eos)
  ------------------
  |  Branch (4530:8): [True: 533, False: 117]
  ------------------
 4531|    533|      flags |= CLIENTWRITE_EOS;
  ------------------
  |  |   50|    533|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
 4532|    650|    result = Curl_client_write(data, flags, buf, blen);
 4533|    650|  }
 4534|    650|out:
 4535|    650|  return result;
 4536|    650|}
Curl_http_decode_status:
 4540|  1.14k|{
 4541|  1.14k|  CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT;
 4542|  1.14k|  int32_t status = 0;
 4543|  1.14k|  int i;
 4544|       |
 4545|  1.14k|  if(len != 3)
  ------------------
  |  Branch (4545:6): [True: 0, False: 1.14k]
  ------------------
 4546|      0|    goto out;
 4547|       |
 4548|  4.58k|  for(i = 0; i < 3; ++i) {
  ------------------
  |  Branch (4548:14): [True: 3.44k, False: 1.14k]
  ------------------
 4549|  3.44k|    char c = s[i];
 4550|       |
 4551|  3.44k|    if(c < '0' || c > '9')
  ------------------
  |  Branch (4551:8): [True: 0, False: 3.44k]
  |  Branch (4551:19): [True: 0, False: 3.44k]
  ------------------
 4552|      0|      goto out;
 4553|       |
 4554|  3.44k|    status *= 10;
 4555|  3.44k|    status += c - '0';
 4556|  3.44k|  }
 4557|  1.14k|  result = CURLE_OK;
 4558|  1.14k|out:
 4559|  1.14k|  *pstatus = result ? -1 : status;
  ------------------
  |  Branch (4559:14): [True: 0, False: 1.14k]
  ------------------
 4560|  1.14k|  return result;
 4561|  1.14k|}
Curl_http_req_make:
 4568|  9.14k|{
 4569|  9.14k|  struct httpreq *req;
 4570|  9.14k|  CURLcode result = CURLE_OUT_OF_MEMORY;
 4571|       |
 4572|  9.14k|  DEBUGASSERT(method && m_len);
  ------------------
  |  | 1016|  9.14k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4572:3): [True: 0, False: 9.14k]
  |  Branch (4572:3): [True: 0, False: 0]
  |  Branch (4572:3): [True: 9.14k, False: 0]
  |  Branch (4572:3): [True: 9.14k, False: 0]
  ------------------
 4573|       |
 4574|  9.14k|  req = curlx_calloc(1, sizeof(*req) + m_len);
  ------------------
  |  | 1500|  9.14k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 4575|  9.14k|  if(!req)
  ------------------
  |  Branch (4575:6): [True: 1, False: 9.14k]
  ------------------
 4576|      1|    goto out;
 4577|       |#if defined(__GNUC__) && __GNUC__ >= 13
 4578|       |#pragma GCC diagnostic push
 4579|       |/* error: 'memcpy' offset [137, 142] from the object at 'req' is out of
 4580|       |   the bounds of referenced subobject 'method' with type 'char[1]' at
 4581|       |   offset 136 */
 4582|       |#pragma GCC diagnostic ignored "-Warray-bounds"
 4583|       |#endif
 4584|  9.14k|  memcpy(req->method, method, m_len);
 4585|       |#if defined(__GNUC__) && __GNUC__ >= 13
 4586|       |#pragma GCC diagnostic pop
 4587|       |#endif
 4588|  9.14k|  if(scheme) {
  ------------------
  |  Branch (4588:6): [True: 7.21k, False: 1.93k]
  ------------------
 4589|  7.21k|    req->scheme = curlx_memdup0(scheme, s_len);
 4590|  7.21k|    if(!req->scheme)
  ------------------
  |  Branch (4590:8): [True: 1, False: 7.21k]
  ------------------
 4591|      1|      goto out;
 4592|  7.21k|  }
 4593|  9.14k|  if(authority) {
  ------------------
  |  Branch (4593:6): [True: 7.21k, False: 1.93k]
  ------------------
 4594|  7.21k|    req->authority = curlx_memdup0(authority, a_len);
 4595|  7.21k|    if(!req->authority)
  ------------------
  |  Branch (4595:8): [True: 1, False: 7.21k]
  ------------------
 4596|      1|      goto out;
 4597|  7.21k|  }
 4598|  9.14k|  if(path) {
  ------------------
  |  Branch (4598:6): [True: 9.14k, False: 0]
  ------------------
 4599|  9.14k|    req->path = curlx_memdup0(path, p_len);
 4600|  9.14k|    if(!req->path)
  ------------------
  |  Branch (4600:8): [True: 1, False: 9.14k]
  ------------------
 4601|      1|      goto out;
 4602|  9.14k|  }
 4603|  9.14k|  Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  9.14k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 4604|  9.14k|  Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  9.14k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 4605|  9.14k|  result = CURLE_OK;
 4606|       |
 4607|  9.14k|out:
 4608|  9.14k|  if(result && req)
  ------------------
  |  Branch (4608:6): [True: 4, False: 9.14k]
  |  Branch (4608:16): [True: 3, False: 1]
  ------------------
 4609|      3|    Curl_http_req_free(req);
 4610|  9.14k|  *preq = result ? NULL : req;
  ------------------
  |  Branch (4610:11): [True: 4, False: 9.14k]
  ------------------
 4611|  9.14k|  return result;
 4612|  9.14k|}
Curl_http_req_free:
 4736|  11.0k|{
 4737|  11.0k|  if(req) {
  ------------------
  |  Branch (4737:6): [True: 9.14k, False: 1.94k]
  ------------------
 4738|  9.14k|    curlx_free(req->scheme);
  ------------------
  |  | 1503|  9.14k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4739|  9.14k|    curlx_free(req->authority);
  ------------------
  |  | 1503|  9.14k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4740|  9.14k|    curlx_free(req->path);
  ------------------
  |  | 1503|  9.14k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4741|  9.14k|    Curl_dynhds_cleanup(&req->headers);
 4742|  9.14k|    Curl_dynhds_cleanup(&req->trailers);
 4743|  9.14k|    curlx_free(req);
  ------------------
  |  | 1503|  9.14k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4744|  9.14k|  }
 4745|  11.0k|}
Curl_http_req_to_h2:
 4803|  1.92k|{
 4804|  1.92k|  const char *scheme = NULL, *authority = NULL;
 4805|  1.92k|  struct dynhds_entry *e;
 4806|  1.92k|  uint32_t i, nheaders;
 4807|  1.92k|  CURLcode result;
 4808|       |
 4809|  1.92k|  DEBUGASSERT(req);
  ------------------
  |  | 1016|  1.92k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4809:3): [True: 0, False: 1.92k]
  |  Branch (4809:3): [True: 1.92k, False: 0]
  ------------------
 4810|  1.92k|  DEBUGASSERT(h2_headers);
  ------------------
  |  | 1016|  1.92k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4810:3): [True: 0, False: 1.92k]
  |  Branch (4810:3): [True: 1.92k, False: 0]
  ------------------
 4811|       |
 4812|  1.92k|  if(req->scheme) {
  ------------------
  |  Branch (4812:6): [True: 0, False: 1.92k]
  ------------------
 4813|      0|    scheme = req->scheme;
 4814|      0|  }
 4815|  1.92k|  else if(strcmp("CONNECT", req->method)) {
  ------------------
  |  Branch (4815:11): [True: 1.92k, False: 0]
  ------------------
 4816|  1.92k|    scheme = Curl_checkheaders(data, STRCONST(HTTP_PSEUDO_SCHEME));
  ------------------
  |  | 1324|  1.92k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.92k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 4817|  1.92k|    if(scheme) {
  ------------------
  |  Branch (4817:8): [True: 0, False: 1.92k]
  ------------------
 4818|      0|      scheme += sizeof(HTTP_PSEUDO_SCHEME);
  ------------------
  |  |  232|      0|#define HTTP_PSEUDO_SCHEME    ":scheme"
  ------------------
 4819|      0|      curlx_str_passblanks(&scheme);
 4820|      0|      infof(data, "set pseudo header %s to %s", HTTP_PSEUDO_SCHEME, scheme);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4821|      0|    }
 4822|  1.92k|    else {
 4823|  1.92k|      scheme = data->state.origin->scheme->name;
 4824|  1.92k|    }
 4825|  1.92k|  }
 4826|       |
 4827|  1.92k|  if(req->authority) {
  ------------------
  |  Branch (4827:6): [True: 0, False: 1.92k]
  ------------------
 4828|      0|    authority = req->authority;
 4829|      0|  }
 4830|  1.92k|  else {
 4831|  1.92k|    e = Curl_dynhds_get(&req->headers, STRCONST("Host"));
  ------------------
  |  | 1324|  1.92k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.92k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 4832|  1.92k|    if(e)
  ------------------
  |  Branch (4832:8): [True: 1.92k, False: 1]
  ------------------
 4833|  1.92k|      authority = e->value;
 4834|  1.92k|  }
 4835|       |
 4836|  1.92k|  Curl_dynhds_reset(h2_headers);
 4837|  1.92k|  Curl_dynhds_set_opts(h2_headers, DYNHDS_OPT_LOWERCASE);
  ------------------
  |  |   54|  1.92k|#define DYNHDS_OPT_LOWERCASE     (1U << 0)
  ------------------
 4838|  1.92k|  result = Curl_dynhds_add(h2_headers, STRCONST(HTTP_PSEUDO_METHOD),
  ------------------
  |  | 1324|  1.92k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.92k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 4839|  1.92k|                           req->method, strlen(req->method));
 4840|  1.92k|  if(!result && scheme) {
  ------------------
  |  Branch (4840:6): [True: 1.92k, False: 0]
  |  Branch (4840:17): [True: 1.92k, False: 0]
  ------------------
 4841|  1.92k|    result = Curl_dynhds_add(h2_headers, STRCONST(HTTP_PSEUDO_SCHEME),
  ------------------
  |  | 1324|  1.92k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.92k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 4842|  1.92k|                             scheme, strlen(scheme));
 4843|  1.92k|  }
 4844|  1.92k|  if(!result && authority) {
  ------------------
  |  Branch (4844:6): [True: 1.92k, False: 0]
  |  Branch (4844:17): [True: 1.92k, False: 1]
  ------------------
 4845|  1.92k|    result = Curl_dynhds_add(h2_headers, STRCONST(HTTP_PSEUDO_AUTHORITY),
  ------------------
  |  | 1324|  1.92k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.92k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 4846|  1.92k|                             authority, strlen(authority));
 4847|  1.92k|  }
 4848|  1.92k|  if(!result && req->path) {
  ------------------
  |  Branch (4848:6): [True: 1.92k, False: 0]
  |  Branch (4848:17): [True: 1.92k, False: 0]
  ------------------
 4849|  1.92k|    result = Curl_dynhds_add(h2_headers, STRCONST(HTTP_PSEUDO_PATH),
  ------------------
  |  | 1324|  1.92k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.92k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 4850|  1.92k|                             req->path, strlen(req->path));
 4851|  1.92k|  }
 4852|       |
 4853|  1.92k|  nheaders = Curl_dynhds_count(&req->headers);
 4854|  6.68k|  for(i = 0; !result && (i < nheaders); ++i) {
  ------------------
  |  Branch (4854:14): [True: 6.68k, False: 0]
  |  Branch (4854:25): [True: 4.75k, False: 1.92k]
  ------------------
 4855|  4.75k|    e = Curl_dynhds_getn(&req->headers, i);
 4856|  4.75k|    if(!e)
  ------------------
  |  Branch (4856:8): [True: 0, False: 4.75k]
  ------------------
 4857|      0|      break;
 4858|       |    /* "TE" is special in that it is only permissible when it
 4859|       |     * has only value "trailers". RFC 9113 ch. 8.2.2 */
 4860|  4.75k|    if(e->namelen == 2 && curl_strequal("TE", e->name)) {
  ------------------
  |  Branch (4860:8): [True: 4, False: 4.75k]
  |  Branch (4860:27): [True: 4, False: 0]
  ------------------
 4861|      4|      if(http_TE_has_token(e->value, "trailers"))
  ------------------
  |  Branch (4861:10): [True: 0, False: 4]
  ------------------
 4862|      0|        result = Curl_dynhds_add(h2_headers, e->name, e->namelen,
 4863|      0|                                 "trailers", CURL_CSTRLEN("trailers"));
  ------------------
  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
 4864|      4|    }
 4865|  4.75k|    else if(h2_permissible_field(e)) {
  ------------------
  |  Branch (4865:13): [True: 2.81k, False: 1.93k]
  ------------------
 4866|  2.81k|      result = Curl_dynhds_add(h2_headers, e->name, e->namelen,
 4867|  2.81k|                               e->value, e->valuelen);
 4868|  2.81k|    }
 4869|  4.75k|  }
 4870|       |
 4871|  1.92k|  return result;
 4872|  1.92k|}
Curl_http_setup_conn:
 4916|  9.41k|{
 4917|       |  /* allocate the HTTP-specific struct for the Curl_easy, only to survive
 4918|       |     during this request */
 4919|  9.41k|  if(data->state.http_neg.wanted == CURL_HTTP_V3x) {
  ------------------
  |  |   42|  9.41k|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (4919:6): [True: 9.41k, False: 0]
  ------------------
 4920|       |    /* only HTTP/3, needs to work */
 4921|  9.41k|    CURLcode result = Curl_conn_may_http3(data, conn);
 4922|  9.41k|    if(result)
  ------------------
  |  Branch (4922:8): [True: 0, False: 9.41k]
  ------------------
 4923|      0|      return result;
 4924|  9.41k|  }
 4925|  9.41k|  return CURLE_OK;
 4926|  9.41k|}
Curl_http_setup_filters:
 4930|  1.95k|{
 4931|  1.95k|  const char *alpn = Curl_conn_cf_get_alpn_negotiated(cf, data);
 4932|  1.95k|  CURLcode result;
 4933|       |
 4934|  1.95k|  if(alpn && !strcmp("h3", alpn)) {
  ------------------
  |  Branch (4934:6): [True: 1.95k, False: 0]
  |  Branch (4934:14): [True: 1.95k, False: 0]
  ------------------
 4935|  1.95k|    CURL_TRC_CF(data, cf, "using HTTP/3 (via ALPN)");
  ------------------
  |  |  153|  1.95k|  do {                                          \
  |  |  154|  1.95k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.95k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.91k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.91k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.95k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 4, False: 143]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.95k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.95k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
 4936|  1.95k|  }
 4937|      0|  else if(alpn && !strcmp("h2", alpn)) {
  ------------------
  |  Branch (4937:11): [True: 0, False: 0]
  |  Branch (4937:19): [True: 0, False: 0]
  ------------------
 4938|      0|    if(Curl_conn_cf_http_version(data, cf) != 20) {
  ------------------
  |  Branch (4938:8): [True: 0, False: 0]
  ------------------
 4939|      0|      CURL_TRC_CF(data, cf, "adding HTTP/2 filter");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4940|      0|      result = Curl_http2_switch_at(data, cf);
 4941|      0|      if(result)
  ------------------
  |  Branch (4941:10): [True: 0, False: 0]
  ------------------
 4942|      0|        return result;
 4943|      0|    }
 4944|      0|    CURL_TRC_CF(data, cf, "using HTTP/2 (via ALPN)");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4945|      0|  }
 4946|      0|  else {
 4947|       |    /* Check if user wants to use HTTP/2 with clear TCP */
 4948|      0|    if(Curl_http2_may_switch_at(data, cf)) {
  ------------------
  |  Branch (4948:8): [True: 0, False: 0]
  ------------------
 4949|      0|      CURL_TRC_CF(data, cf, "adding HTTP/2 filter");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4950|      0|      result = Curl_http2_switch_at(data, cf);
 4951|      0|      if(result)
  ------------------
  |  Branch (4951:10): [True: 0, False: 0]
  ------------------
 4952|      0|        return result;
 4953|      0|      CURL_TRC_CF(data, cf, "using HTTP/2 (over clean TCP)");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4954|      0|    }
 4955|      0|    else
 4956|      0|      CURL_TRC_CF(data, cf, "using HTTP/1.x");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4957|      0|  }
 4958|  1.95k|  return CURLE_OK;
 4959|  1.95k|}
http.c:pickoneauth:
  323|      6|{
  324|      6|  bool have_user_pass = Curl_creds_has_user_or_pass(creds);
  ------------------
  |  |   79|      6|    ((c) && ((c)->user[0] || (c)->passwd[0]))
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 6, False: 0]
  |  |  |  Branch (79:14): [True: 2, False: 4]
  |  |  |  Branch (79:30): [True: 0, False: 4]
  |  |  ------------------
  ------------------
  325|      6|  bool picked;
  326|       |  /* only deal with authentication we want */
  327|      6|  unsigned long avail = pick->avail & pick->want & mask;
  328|      6|  picked = TRUE;
  ------------------
  |  |  986|      6|#define TRUE true
  ------------------
  329|       |
  330|       |  /* The order of these checks is highly relevant, as this will be the order
  331|       |     of preference in case of the existence of multiple accepted types. */
  332|      6|  if(avail & CURLAUTH_NEGOTIATE)  /* available on empty creds */
  ------------------
  |  |  835|      6|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  ------------------
  |  Branch (332:6): [True: 0, False: 6]
  ------------------
  333|      0|    pick->picked = CURLAUTH_NEGOTIATE;
  ------------------
  |  |  835|      0|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  ------------------
  334|      6|#ifndef CURL_DISABLE_BEARER_AUTH
  335|      6|  else if((avail & CURLAUTH_BEARER) && Curl_creds_has_oauth_bearer(creds))
  ------------------
  |  |  846|      6|#define CURLAUTH_BEARER       (((unsigned long)1) << 6)
  ------------------
                else if((avail & CURLAUTH_BEARER) && Curl_creds_has_oauth_bearer(creds))
  ------------------
  |  |   80|      0|#define Curl_creds_has_oauth_bearer(c)   ((c) && (c)->oauth_bearer[0])
  |  |  ------------------
  |  |  |  Branch (80:43): [True: 0, False: 0]
  |  |  |  Branch (80:50): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (335:11): [True: 0, False: 6]
  ------------------
  336|      0|    pick->picked = CURLAUTH_BEARER;
  ------------------
  |  |  846|      0|#define CURLAUTH_BEARER       (((unsigned long)1) << 6)
  ------------------
  337|      6|#endif
  338|      6|#ifndef CURL_DISABLE_DIGEST_AUTH
  339|      6|  else if((avail & CURLAUTH_DIGEST) && have_user_pass)
  ------------------
  |  |  834|      6|#define CURLAUTH_DIGEST       (((unsigned long)1) << 1)
  ------------------
  |  Branch (339:11): [True: 0, False: 6]
  |  Branch (339:40): [True: 0, False: 0]
  ------------------
  340|      0|    pick->picked = CURLAUTH_DIGEST;
  ------------------
  |  |  834|      0|#define CURLAUTH_DIGEST       (((unsigned long)1) << 1)
  ------------------
  341|      6|#endif
  342|      6|#ifndef CURL_DISABLE_BASIC_AUTH
  343|      6|  else if((avail & CURLAUTH_BASIC) && have_user_pass)
  ------------------
  |  |  833|      6|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  |  Branch (343:11): [True: 0, False: 6]
  |  Branch (343:39): [True: 0, False: 0]
  ------------------
  344|      0|    pick->picked = CURLAUTH_BASIC;
  ------------------
  |  |  833|      0|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  345|      6|#endif
  346|      6|#ifndef CURL_DISABLE_AWS
  347|      6|  else if(avail & CURLAUTH_AWS_SIGV4)
  ------------------
  |  |  847|      6|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
  |  Branch (347:11): [True: 0, False: 6]
  ------------------
  348|      0|    pick->picked = CURLAUTH_AWS_SIGV4;
  ------------------
  |  |  847|      0|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
  349|      6|#endif
  350|      6|#ifndef CURL_DISABLE_HTTPSIG
  351|      6|  else if(avail & CURLAUTH_HTTPSIG)
  ------------------
  |  |  848|      6|#define CURLAUTH_HTTPSIG      (((unsigned long)1) << 8)
  ------------------
  |  Branch (351:11): [True: 0, False: 6]
  ------------------
  352|      0|    pick->picked = CURLAUTH_HTTPSIG;
  ------------------
  |  |  848|      0|#define CURLAUTH_HTTPSIG      (((unsigned long)1) << 8)
  ------------------
  353|      6|#endif
  354|      6|  else {
  355|      6|    pick->picked = CURLAUTH_PICKNONE; /* we select to use nothing */
  ------------------
  |  |  130|      6|#define CURLAUTH_PICKNONE (1 << 30) /* do not use auth */
  ------------------
  356|      6|    picked = FALSE;
  ------------------
  |  |  989|      6|#define FALSE false
  ------------------
  357|      6|  }
  358|      6|  pick->avail = CURLAUTH_NONE; /* clear it here */
  ------------------
  |  |  832|      6|#define CURLAUTH_NONE         ((unsigned long)0)
  ------------------
  359|       |
  360|      6|  return picked;
  361|      6|}
http.c:http_should_fail:
  445|  1.36k|{
  446|  1.36k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  1.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (446:3): [True: 0, False: 1.36k]
  |  Branch (446:3): [True: 1.36k, False: 0]
  ------------------
  447|  1.36k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  1.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (447:3): [True: 0, False: 1.36k]
  |  Branch (447:3): [True: 1.36k, False: 0]
  ------------------
  448|       |
  449|       |  /*
  450|       |   * If we have not been asked to fail on error,
  451|       |   * do not fail.
  452|       |   */
  453|  1.36k|  if(!data->set.http_fail_on_error)
  ------------------
  |  Branch (453:6): [True: 1.30k, False: 66]
  ------------------
  454|  1.30k|    return FALSE;
  ------------------
  |  |  989|  1.30k|#define FALSE false
  ------------------
  455|       |
  456|       |  /*
  457|       |   * Any code < 400 is never terminal.
  458|       |   */
  459|     66|  if(httpcode < 400)
  ------------------
  |  Branch (459:6): [True: 4, False: 62]
  ------------------
  460|      4|    return FALSE;
  ------------------
  |  |  989|      4|#define FALSE false
  ------------------
  461|       |
  462|       |  /*
  463|       |   * A 416 response to a resume request is presumably because the file is
  464|       |   * already completely downloaded and thus not actually a fail.
  465|       |   */
  466|     62|  if(data->state.resume_from && data->state.httpreq == HTTPREQ_GET &&
  ------------------
  |  Branch (466:6): [True: 56, False: 6]
  |  Branch (466:33): [True: 55, False: 1]
  ------------------
  467|     55|     httpcode == 416)
  ------------------
  |  Branch (467:6): [True: 3, False: 52]
  ------------------
  468|      3|    return FALSE;
  ------------------
  |  |  989|      3|#define FALSE false
  ------------------
  469|       |
  470|       |  /*
  471|       |   * Any code >= 400 that is not 401 or 407 is always
  472|       |   * a terminal error
  473|       |   */
  474|     59|  if((httpcode != 401) && (httpcode != 407))
  ------------------
  |  Branch (474:6): [True: 51, False: 8]
  |  Branch (474:27): [True: 30, False: 21]
  ------------------
  475|     30|    return TRUE;
  ------------------
  |  |  986|     30|#define TRUE true
  ------------------
  476|       |
  477|       |  /*
  478|       |   * All we have left to deal with is 401 and 407
  479|       |   */
  480|     29|  DEBUGASSERT((httpcode == 401) || (httpcode == 407));
  ------------------
  |  | 1016|     29|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (480:3): [True: 29, False: 0]
  |  Branch (480:3): [True: 0, False: 0]
  |  Branch (480:3): [True: 8, False: 21]
  |  Branch (480:3): [True: 21, False: 0]
  ------------------
  481|       |
  482|       |  /*
  483|       |   * Examine the current authentication state to see if this is an error. The
  484|       |   * idea is for this function to get called after processing all the headers
  485|       |   * in a response message. If we have been asked to authenticate at
  486|       |   * a particular stage, and we have done it, we are OK. If we are already
  487|       |   * completely authenticated, it is not OK to get another 401 or 407.
  488|       |   *
  489|       |   * It is possible for authentication to go stale such that the client needs
  490|       |   * to reauthenticate. Once that info is available, use it here.
  491|       |   */
  492|       |
  493|       |  /*
  494|       |   * Either we are not authenticating, or we are supposed to be authenticating
  495|       |   * something else. This is an error.
  496|       |   */
  497|     29|  if((httpcode == 401) && !data->state.creds)
  ------------------
  |  Branch (497:6): [True: 8, False: 21]
  |  Branch (497:27): [True: 7, False: 1]
  ------------------
  498|      7|    return TRUE;
  ------------------
  |  |  986|      7|#define TRUE true
  ------------------
  499|     22|#ifndef CURL_DISABLE_PROXY
  500|     22|  if((httpcode == 407) && !data->conn->http_proxy.creds)
  ------------------
  |  Branch (500:6): [True: 21, False: 1]
  |  Branch (500:27): [True: 20, False: 1]
  ------------------
  501|     20|    return TRUE;
  ------------------
  |  |  986|     20|#define TRUE true
  ------------------
  502|      2|#endif
  503|       |
  504|      2|  return (bool)data->state.authproblem;
  505|     22|}
http.c:output_auth_headers:
  607|    647|{
  608|    647|  CURLcode result = CURLE_OK;
  609|       |
  610|    647|  *pauth_used = NULL;
  611|    647|  switch(authstatus->picked) {
  612|       |
  613|      0|#ifndef CURL_DISABLE_AWS
  614|     10|  case CURLAUTH_AWS_SIGV4:
  ------------------
  |  |  847|     10|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
  |  Branch (614:3): [True: 10, False: 637]
  ------------------
  615|     10|    if(!proxy) {
  ------------------
  |  Branch (615:8): [True: 9, False: 1]
  ------------------
  616|       |      /* this method is never for proxy */
  617|      9|      *pauth_used = "AWS_SIGV4";
  618|      9|      result = Curl_output_aws_sigv4(data);
  619|      9|    }
  620|     10|    break;
  621|      0|#endif
  622|       |
  623|      0|#ifndef CURL_DISABLE_HTTPSIG
  624|      3|  case CURLAUTH_HTTPSIG:
  ------------------
  |  |  848|      3|#define CURLAUTH_HTTPSIG      (((unsigned long)1) << 8)
  ------------------
  |  Branch (624:3): [True: 3, False: 644]
  ------------------
  625|      3|    if(!proxy) {
  ------------------
  |  Branch (625:8): [True: 2, False: 1]
  ------------------
  626|       |      /* HTTPSIG uses its own configured key material rather than
  627|       |         data->state.creds. Do not let unrelated credentials from a
  628|       |         redirected URL bypass the cross-host auth boundary. */
  629|      2|      if(Curl_auth_allowed_to_host(data)) {
  ------------------
  |  Branch (629:10): [True: 2, False: 0]
  ------------------
  630|      2|        *pauth_used = "HTTPSIG";
  631|      2|        result = Curl_output_httpsig(data);
  632|      2|      }
  633|      0|      else
  634|      0|        authstatus->done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  635|      2|    }
  636|      3|    break;
  637|      0|#endif
  638|       |
  639|       |#ifdef USE_SPNEGO
  640|       |  case CURLAUTH_NEGOTIATE:
  641|       |    if(
  642|       |#ifndef CURL_DISABLE_PROXY
  643|       |      (proxy && !Curl_checkProxyheaders(data, conn, hd_name, hd_len)) ||
  644|       |#endif
  645|       |      (!proxy && !Curl_checkheaders(data, hd_name, hd_len) &&
  646|       |       Curl_auth_allowed_to_host(data))) {
  647|       |      *pauth_used = "Negotiate";
  648|       |      result = Curl_output_negotiate(data, conn, hd_name, proxy);
  649|       |    }
  650|       |    else
  651|       |      authstatus->done = TRUE;
  652|       |    break;
  653|       |#endif
  654|       |
  655|      0|#ifndef CURL_DISABLE_DIGEST_AUTH
  656|      6|  case CURLAUTH_DIGEST:
  ------------------
  |  |  834|      6|#define CURLAUTH_DIGEST       (((unsigned long)1) << 1)
  ------------------
  |  Branch (656:3): [True: 6, False: 641]
  ------------------
  657|      6|    *pauth_used = "Digest";
  658|      6|    result = Curl_output_digest(data, creds, hd_name, proxy,
  659|      6|                                (const unsigned char *)method,
  660|      6|                                (const unsigned char *)path);
  661|      6|    break;
  662|      0|#endif
  663|       |
  664|      0|#ifndef CURL_DISABLE_BASIC_AUTH
  665|    554|  case CURLAUTH_BASIC:
  ------------------
  |  |  833|    554|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  |  Branch (665:3): [True: 554, False: 93]
  ------------------
  666|    554|    if(creds && Curl_creds_has_user_or_pass(creds) && (
  ------------------
  |  |   79|    925|    ((c) && ((c)->user[0] || (c)->passwd[0]))
  |  |  ------------------
  |  |  |  Branch (79:6): [True: 371, False: 0]
  |  |  |  Branch (79:14): [True: 254, False: 117]
  |  |  |  Branch (79:30): [True: 9, False: 108]
  |  |  ------------------
  ------------------
  |  Branch (666:8): [True: 371, False: 183]
  ------------------
  667|    263|#ifndef CURL_DISABLE_PROXY
  668|    263|       (proxy && !Curl_checkProxyheaders(data, conn, hd_name, hd_len)) ||
  ------------------
  |  Branch (668:9): [True: 252, False: 11]
  |  Branch (668:18): [True: 252, False: 0]
  ------------------
  669|     11|#endif
  670|    263|       (!proxy && !Curl_checkheaders(data, hd_name, hd_len)))) {
  ------------------
  |  Branch (670:9): [True: 11, False: 0]
  |  Branch (670:19): [True: 11, False: 0]
  ------------------
  671|    263|      *pauth_used = "Basic";
  672|    263|      result = http_output_basic(data, creds, hd_name, proxy);
  673|    263|      if(result)
  ------------------
  |  Branch (673:10): [True: 5, False: 258]
  ------------------
  674|      5|        return result;
  675|    263|    }
  676|       |    /* NOTE: this function should set 'done' TRUE, as the other auth
  677|       |       functions work that way */
  678|    549|    authstatus->done = TRUE;
  ------------------
  |  |  986|    549|#define TRUE true
  ------------------
  679|    549|    break;
  680|      0|#endif
  681|       |
  682|      0|#ifndef CURL_DISABLE_BEARER_AUTH
  683|      1|  case CURLAUTH_BEARER:
  ------------------
  |  |  846|      1|#define CURLAUTH_BEARER       (((unsigned long)1) << 6)
  ------------------
  |  Branch (683:3): [True: 1, False: 646]
  ------------------
  684|      1|    if(!proxy && Curl_creds_has_oauth_bearer(creds) &&
  ------------------
  |  |   80|      1|#define Curl_creds_has_oauth_bearer(c)   ((c) && (c)->oauth_bearer[0])
  |  |  ------------------
  |  |  |  Branch (80:43): [True: 0, False: 0]
  |  |  |  Branch (80:50): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (684:8): [True: 0, False: 1]
  ------------------
  685|      0|       !Curl_checkheaders(data, hd_name, hd_len)) {
  ------------------
  |  Branch (685:8): [True: 0, False: 0]
  ------------------
  686|      0|      *pauth_used = "Bearer";
  687|      0|      result = http_output_bearer(data);
  688|      0|      if(result)
  ------------------
  |  Branch (688:10): [True: 0, False: 0]
  ------------------
  689|      0|        return result;
  690|      0|    }
  691|       |    /* NOTE: this function should set 'done' TRUE, as the other auth
  692|       |       functions work that way */
  693|      1|    authstatus->done = TRUE;
  ------------------
  |  |  986|      1|#define TRUE true
  ------------------
  694|      1|    break;
  695|      0|#endif
  696|       |
  697|     73|  default:
  ------------------
  |  Branch (697:3): [True: 73, False: 574]
  ------------------
  698|       |    /* a pick we do not support? */
  699|     73|    (void)conn;
  700|       |#ifdef CURL_DISABLE_DIGEST_AUTH
  701|       |    (void)method;
  702|       |    (void)path;
  703|       |#endif
  704|     73|    break;
  705|    647|  } /* end of switch */
  706|       |
  707|    642|  return result;
  708|    647|}
http.c:http_output_basic:
  241|    263|{
  242|    263|  size_t size = 0;
  243|    263|  char *authorization = NULL;
  244|    263|  char **p_hd;
  245|    263|  CURLcode result;
  246|    263|  char *out;
  247|       |
  248|       |  /* credentials are unique per transfer for HTTP, do not use the ones for the
  249|       |     connection */
  250|    263|  if(proxy) {
  ------------------
  |  Branch (250:6): [True: 252, False: 11]
  ------------------
  251|    252|#ifndef CURL_DISABLE_PROXY
  252|    252|    p_hd = &data->req.hd_proxy_auth;
  253|       |#else
  254|       |    return CURLE_NOT_BUILT_IN;
  255|       |#endif
  256|    252|  }
  257|     11|  else {
  258|     11|    p_hd = &data->req.hd_auth;
  259|     11|  }
  260|       |
  261|    263|  if(!creds) {
  ------------------
  |  Branch (261:6): [True: 0, False: 263]
  ------------------
  262|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (262:5): [Folded, False: 0]
  |  Branch (262:5): [Folded, False: 0]
  ------------------
  263|      0|    return CURLE_FAILED_INIT;
  264|      0|  }
  265|       |
  266|    263|  out = curl_maprintf("%s:%s", creds->user, creds->passwd);
  267|    263|  if(!out)
  ------------------
  |  Branch (267:6): [True: 0, False: 263]
  ------------------
  268|      0|    return CURLE_OUT_OF_MEMORY;
  269|       |
  270|    263|  result = curlx_base64_encode((uint8_t *)out, strlen(out),
  271|    263|                               &authorization, &size);
  272|    263|  if(result)
  ------------------
  |  Branch (272:6): [True: 1, False: 262]
  ------------------
  273|      1|    goto fail;
  274|       |
  275|    262|  if(!authorization) {
  ------------------
  |  Branch (275:6): [True: 0, False: 262]
  ------------------
  276|      0|    result = CURLE_REMOTE_ACCESS_DENIED;
  277|      0|    goto fail;
  278|      0|  }
  279|       |
  280|    262|  curlx_free(*p_hd);
  ------------------
  |  | 1503|    262|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  281|    262|  *p_hd = curl_maprintf("%s: Basic %s\r\n", hd_name, authorization);
  282|    262|  curlx_free(authorization);
  ------------------
  |  | 1503|    262|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  283|    262|  if(!*p_hd) {
  ------------------
  |  Branch (283:6): [True: 4, False: 258]
  ------------------
  284|      4|    result = CURLE_OUT_OF_MEMORY;
  285|      4|    goto fail;
  286|      4|  }
  287|       |
  288|    263|fail:
  289|    263|  curlx_free(out);
  ------------------
  |  | 1503|    263|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  290|    263|  return result;
  291|    262|}
http.c:http_exp100_is_waiting:
 1541|    740|{
 1542|    740|  struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100);
 1543|    740|  if(r) {
  ------------------
  |  Branch (1543:6): [True: 0, False: 740]
  ------------------
 1544|      0|    struct cr_exp100_ctx *ctx = r->ctx;
 1545|      0|    return ctx->state == EXP100_AWAITING_CONTINUE;
 1546|      0|  }
 1547|    740|  return FALSE;
  ------------------
  |  |  989|    740|#define FALSE false
  ------------------
 1548|    740|}
http.c:http_write_header:
 1592|  1.14k|{
 1593|  1.14k|  CURLcode result;
 1594|  1.14k|  int writetype;
 1595|       |
 1596|       |  /* now, only output this if the header AND body are requested:
 1597|       |   */
 1598|  1.14k|  Curl_debug(data, CURLINFO_HEADER_IN, hd, hdlen);
 1599|       |
 1600|  1.14k|  writetype = CLIENTWRITE_HEADER |
  ------------------
  |  |   45|  1.14k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
 1601|  1.14k|    ((data->req.httpcode / 100 == 1) ? CLIENTWRITE_1XX : 0);
  ------------------
  |  |   48|    507|#define CLIENTWRITE_1XX     (1 << 5) /* a 1xx response related HEADER */
  ------------------
  |  Branch (1601:6): [True: 507, False: 634]
  ------------------
 1602|       |
 1603|  1.14k|  result = Curl_client_write(data, writetype, hd, hdlen);
 1604|  1.14k|  if(result)
  ------------------
  |  Branch (1604:6): [True: 0, False: 1.14k]
  ------------------
 1605|      0|    return result;
 1606|       |
 1607|  1.14k|  result = Curl_bump_headersize(data, hdlen, FALSE);
  ------------------
  |  |  989|  1.14k|#define FALSE false
  ------------------
 1608|  1.14k|  if(result)
  ------------------
  |  Branch (1608:6): [True: 0, False: 1.14k]
  ------------------
 1609|      0|    return result;
 1610|       |
 1611|  1.14k|  data->req.deductheadercount = (100 <= data->req.httpcode &&
  ------------------
  |  Branch (1611:34): [True: 1.14k, False: 0]
  ------------------
 1612|  1.14k|                                 199 >= data->req.httpcode) ?
  ------------------
  |  Branch (1612:34): [True: 507, False: 634]
  ------------------
 1613|    634|    data->req.headerbytecount : 0;
 1614|  1.14k|  return result;
 1615|  1.14k|}
http.c:http_custom_treat:
 1714|     68|{
 1715|     68|  struct http_custom_ctx *x = user_data;
 1716|     68|  CURLcode result;
 1717|       |
 1718|     68|  if(x->data->state.http_host &&
  ------------------
  |  Branch (1718:6): [True: 68, False: 0]
  ------------------
 1719|       |     /* a Host: header was sent already, do not pass on any custom
 1720|       |        Host: header as that will produce *two* in the same
 1721|       |        request! */
 1722|     68|     curlx_str_casecompare2(name, STRCONST("Host")))
  ------------------
  |  | 1324|     68|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     68|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1722:6): [True: 0, False: 68]
  ------------------
 1723|      0|    goto out;
 1724|     68|  else if(x->data->state.httpreq == HTTPREQ_POST_FORM &&
  ------------------
  |  Branch (1724:11): [True: 0, False: 68]
  ------------------
 1725|       |          /* this header (extended by formdata.c) is sent later */
 1726|      0|          curlx_str_casecompare2(name, STRCONST("Content-Type")))
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1726:11): [True: 0, False: 0]
  ------------------
 1727|      0|    goto out;
 1728|     68|  else if(x->data->state.httpreq == HTTPREQ_POST_MIME &&
  ------------------
  |  Branch (1728:11): [True: 33, False: 35]
  ------------------
 1729|       |          /* this header is sent later */
 1730|     33|          curlx_str_casecompare2(name, STRCONST("Content-Type")))
  ------------------
  |  | 1324|     33|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     33|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1730:11): [True: 0, False: 33]
  ------------------
 1731|      0|    goto out;
 1732|     68|  else if(x->data->req.authneg &&
  ------------------
  |  Branch (1732:11): [True: 0, False: 68]
  ------------------
 1733|       |          /* while doing auth neg, do not allow the custom length since
 1734|       |             we will force length zero then */
 1735|      0|          curlx_str_casecompare2(name, STRCONST("Content-Length")))
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1735:11): [True: 0, False: 0]
  ------------------
 1736|      0|    goto out;
 1737|     68|  else if(curlx_str_casecompare2(name, STRCONST("Connection")))
  ------------------
  |  | 1324|     68|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     68|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1737:11): [True: 0, False: 68]
  ------------------
 1738|       |    /* Connection headers are handled specially */
 1739|      0|    goto out;
 1740|     68|  else if((x->httpversion >= 20) &&
  ------------------
  |  Branch (1740:11): [True: 68, False: 0]
  ------------------
 1741|     68|          curlx_str_casecompare2(name, STRCONST("Transfer-Encoding")))
  ------------------
  |  | 1324|     68|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     68|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1741:11): [True: 0, False: 68]
  ------------------
 1742|       |    /* HTTP/2 does not support chunked requests */
 1743|      0|    goto out;
 1744|     68|  else if((curlx_str_casecompare2(name, STRCONST("Authorization")) ||
  ------------------
  |  | 1324|     68|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     68|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1744:12): [True: 0, False: 68]
  ------------------
 1745|     68|           curlx_str_casecompare2(name, STRCONST("Cookie"))) &&
  ------------------
  |  | 1324|     68|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     68|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1745:12): [True: 0, False: 68]
  ------------------
 1746|       |          /* be careful of sending this potentially sensitive header to
 1747|       |             other hosts */
 1748|      0|          !Curl_auth_allowed_to_host(x->data))
  ------------------
  |  Branch (1748:11): [True: 0, False: 0]
  ------------------
 1749|      0|    goto out;
 1750|       |
 1751|     68|  if(!curlx_strlen(value)) {
  ------------------
  |  |   50|     68|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (1751:6): [True: 0, False: 68]
  ------------------
 1752|      0|    result = curlx_dyn_addn(x->req, curlx_str(name), curlx_strlen(name));
  ------------------
  |  |   49|      0|#define curlx_str(x)    ((x)->str)
  ------------------
                  result = curlx_dyn_addn(x->req, curlx_str(name), curlx_strlen(name));
  ------------------
  |  |   50|      0|#define curlx_strlen(x) ((x)->len)
  ------------------
 1753|      0|    if(!result)
  ------------------
  |  Branch (1753:8): [True: 0, False: 0]
  ------------------
 1754|      0|      result = curlx_dyn_addn(x->req, STRCONST(":\r\n"));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 1755|      0|  }
 1756|     68|  else
 1757|     68|    result = curlx_dyn_addf(x->req, "%s\r\n", orig_data);
 1758|       |
 1759|     68|  if(result)
  ------------------
  |  Branch (1759:6): [True: 0, False: 68]
  ------------------
 1760|      0|    return result;
 1761|       |
 1762|     68|out:
 1763|     68|  return CURLE_AGAIN;
 1764|     68|}
http.c:http_set_aptr_host:
 1923|  1.95k|{
 1924|  1.95k|  struct connectdata *conn = data->conn;
 1925|  1.95k|  const char *ptr = NULL;
 1926|       |
 1927|  1.95k|  curlx_safefree(data->state.http_host);
  ------------------
  |  | 1359|  1.95k|  do {                      \
  |  | 1360|  1.95k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.95k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.95k|    (ptr) = NULL;           \
  |  | 1362|  1.95k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
 1928|  1.95k|#ifndef CURL_DISABLE_COOKIES
 1929|  1.95k|  curlx_safefree(data->req.cookiehost);
  ------------------
  |  | 1359|  1.95k|  do {                      \
  |  | 1360|  1.95k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.95k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.95k|    (ptr) = NULL;           \
  |  | 1362|  1.95k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
 1930|  1.95k|#endif
 1931|       |
 1932|  1.95k|  if(Curl_peer_equal(data->state.initial_origin, data->state.origin))
  ------------------
  |  Branch (1932:6): [True: 1.95k, False: 0]
  ------------------
 1933|  1.95k|    ptr = Curl_checkheaders(data, STRCONST("Host"));
  ------------------
  |  | 1324|  1.95k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.95k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 1934|       |
 1935|  1.95k|  if(ptr) {
  ------------------
  |  Branch (1935:6): [True: 0, False: 1.95k]
  ------------------
 1936|      0|#ifndef CURL_DISABLE_COOKIES
 1937|       |    /* If we have a given custom Host: header, we extract the hostname in
 1938|       |       order to possibly use it for cookie reasons later on. We only allow the
 1939|       |       custom Host: header if this is NOT a redirect, as setting Host: in the
 1940|       |       redirected request is being out on thin ice. Except if the hostname
 1941|       |       is the same as the first one! */
 1942|      0|    char *cookiehost;
 1943|      0|    CURLcode result = copy_custom_value(ptr, &cookiehost);
 1944|      0|    if(result)
  ------------------
  |  Branch (1944:8): [True: 0, False: 0]
  ------------------
 1945|      0|      return result;
 1946|      0|    if(!*cookiehost)
  ------------------
  |  Branch (1946:8): [True: 0, False: 0]
  ------------------
 1947|       |      /* ignore empty data */
 1948|      0|      curlx_free(cookiehost);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1949|      0|    else {
 1950|       |      /* If the host begins with '[', we start searching for the port after
 1951|       |         the bracket has been closed */
 1952|      0|      if(*cookiehost == '[') {
  ------------------
  |  Branch (1952:10): [True: 0, False: 0]
  ------------------
 1953|      0|        char *closingbracket;
 1954|       |        /* since the 'cookiehost' is an allocated memory area that will be
 1955|       |           freed later we cannot increment the pointer */
 1956|      0|        memmove(cookiehost, cookiehost + 1, strlen(cookiehost) - 1);
 1957|      0|        closingbracket = strchr(cookiehost, ']');
 1958|      0|        if(closingbracket)
  ------------------
  |  Branch (1958:12): [True: 0, False: 0]
  ------------------
 1959|      0|          *closingbracket = 0;
 1960|      0|      }
 1961|      0|      else {
 1962|      0|        int startsearch = 0;
 1963|      0|        char *colon = strchr(cookiehost + startsearch, ':');
 1964|      0|        if(colon)
  ------------------
  |  Branch (1964:12): [True: 0, False: 0]
  ------------------
 1965|      0|          *colon = 0; /* The host must not include an embedded port number */
 1966|      0|      }
 1967|      0|      data->req.cookiehost = cookiehost;
 1968|      0|    }
 1969|      0|#endif
 1970|       |
 1971|      0|    if(!curl_strequal("Host:", ptr)) {
  ------------------
  |  Branch (1971:8): [True: 0, False: 0]
  ------------------
 1972|      0|      data->state.http_host = curl_maprintf("Host:%s", &ptr[5]);
 1973|      0|      if(!data->state.http_host)
  ------------------
  |  Branch (1973:10): [True: 0, False: 0]
  ------------------
 1974|      0|        return CURLE_OUT_OF_MEMORY;
 1975|      0|    }
 1976|      0|  }
 1977|  1.95k|  else {
 1978|       |    /* This is the  HTTP Host: header, so we want
 1979|       |     * - for IPv6 origins: "[ipv6-address]" where the IPv6 address is
 1980|       |     *  found in origin->hostname, stripped of zoneid/scopeid.
 1981|       |     * - the (IDN converted) origin->hostname (DNS name or IPv4) otherwise.
 1982|       |     * Note: zoneid/scopeid  only applies to local routing and has no
 1983|       |     * meaning on the remote HTTP server (eg. would confuse it). */
 1984|  1.95k|    bool ipv6 = (bool)data->state.origin->ipv6;
 1985|  1.95k|    struct dynbuf tmp;
 1986|  1.95k|    size_t hlen;
 1987|  1.95k|    CURLcode result;
 1988|       |
 1989|  1.95k|    curlx_dyn_init(&tmp, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  1.95k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
 1990|  1.95k|    result = curlx_dyn_addn(&tmp, STRCONST("Host: "));
  ------------------
  |  | 1324|  1.95k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.95k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 1991|  1.95k|    if(!result && ipv6)
  ------------------
  |  Branch (1991:8): [True: 1.95k, False: 0]
  |  Branch (1991:19): [True: 0, False: 1.95k]
  ------------------
 1992|      0|      result = curlx_dyn_addn(&tmp, STRCONST("["));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 1993|  1.95k|    if(!result)
  ------------------
  |  Branch (1993:8): [True: 1.95k, False: 0]
  ------------------
 1994|  1.95k|      result = curlx_dyn_add(&tmp, data->state.origin->hostname);
 1995|  1.95k|    if(!result && ipv6)
  ------------------
  |  Branch (1995:8): [True: 1.95k, False: 0]
  |  Branch (1995:19): [True: 0, False: 1.95k]
  ------------------
 1996|      0|      result = curlx_dyn_addn(&tmp, STRCONST("]"));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 1997|  1.95k|    if(!result &&
  ------------------
  |  Branch (1997:8): [True: 1.95k, False: 0]
  ------------------
 1998|  1.95k|       ((data->state.origin->port != data->state.origin->scheme->defport) ||
  ------------------
  |  Branch (1998:9): [True: 0, False: 1.95k]
  ------------------
 1999|  1.95k|       (data->state.origin->scheme->family != conn->scheme->family))) {
  ------------------
  |  Branch (1999:8): [True: 0, False: 1.95k]
  ------------------
 2000|      0|      result = curlx_dyn_addf(&tmp, ":%u", data->state.origin->port);
 2001|      0|    }
 2002|       |
 2003|  1.95k|    data->state.http_host = result ? NULL : curlx_dyn_take(&tmp, &hlen);
  ------------------
  |  Branch (2003:29): [True: 0, False: 1.95k]
  ------------------
 2004|  1.95k|    curlx_dyn_free(&tmp);
 2005|  1.95k|    return result;
 2006|  1.95k|  }
 2007|      0|  return CURLE_OK;
 2008|  1.95k|}
http.c:set_reader:
 2215|  1.94k|{
 2216|  1.94k|  CURLcode result = CURLE_OK;
 2217|  1.94k|  curl_off_t postsize = data->state.infilesize;
 2218|       |
 2219|  1.94k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2219:3): [True: 0, False: 1.94k]
  |  Branch (2219:3): [True: 1.94k, False: 0]
  ------------------
 2220|       |
 2221|  1.94k|  if(data->req.authneg) {
  ------------------
  |  Branch (2221:6): [True: 1, False: 1.94k]
  ------------------
 2222|      1|    return Curl_creader_set_null(data);
 2223|      1|  }
 2224|       |
 2225|  1.94k|  switch(httpreq) {
 2226|     36|  case HTTPREQ_PUT: /* Let's PUT the data to the server! */
  ------------------
  |  Branch (2226:3): [True: 36, False: 1.91k]
  ------------------
 2227|     36|    return postsize ? Curl_creader_set_fread(data, postsize) :
  ------------------
  |  Branch (2227:12): [True: 36, False: 0]
  ------------------
 2228|     36|      Curl_creader_set_null(data);
 2229|       |
 2230|      0|#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
 2231|      0|  case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (2231:3): [True: 0, False: 1.94k]
  ------------------
 2232|    377|  case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (2232:3): [True: 377, False: 1.56k]
  ------------------
 2233|    377|    return set_post_reader(data, httpreq);
 2234|      0|#endif
 2235|       |
 2236|     22|  case HTTPREQ_POST:
  ------------------
  |  Branch (2236:3): [True: 22, False: 1.92k]
  ------------------
 2237|       |    /* this is the simple POST, using x-www-form-urlencoded style */
 2238|       |    /* the size of the post body */
 2239|     22|    if(!postsize) {
  ------------------
  |  Branch (2239:8): [True: 7, False: 15]
  ------------------
 2240|      7|      result = Curl_creader_set_null(data);
 2241|      7|    }
 2242|     15|    else if(data->set.postfields) {
  ------------------
  |  Branch (2242:13): [True: 7, False: 8]
  ------------------
 2243|      7|      size_t plen = curlx_sotouz_range(postsize, 0, SIZE_MAX);
 2244|      7|      if(plen == SIZE_MAX)
  ------------------
  |  Branch (2244:10): [True: 0, False: 7]
  ------------------
 2245|      0|        return CURLE_OUT_OF_MEMORY;
 2246|      7|      else if(plen)
  ------------------
  |  Branch (2246:15): [True: 7, False: 0]
  ------------------
 2247|      7|        result = Curl_creader_set_buf(data, data->set.postfields, plen);
 2248|      0|      else
 2249|      0|        result = Curl_creader_set_null(data);
 2250|      7|    }
 2251|      8|    else {
 2252|       |      /* we read the bytes from the callback. In case "chunked" encoding
 2253|       |       * is forced by the application, we disregard `postsize`. This is
 2254|       |       * a backward compatibility decision to earlier versions where
 2255|       |       * chunking disregarded this. See issue #13229. */
 2256|      8|      bool chunked = FALSE;
  ------------------
  |  |  989|      8|#define FALSE false
  ------------------
 2257|      8|      char *ptr = Curl_checkheaders(data, STRCONST("Transfer-Encoding"));
  ------------------
  |  | 1324|      8|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      8|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2258|      8|      if(ptr) {
  ------------------
  |  Branch (2258:10): [True: 0, False: 8]
  ------------------
 2259|       |        /* Some kind of TE is requested, check if 'chunked' is chosen */
 2260|      0|        chunked = Curl_compareheader(ptr, STRCONST("Transfer-Encoding:"),
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2261|      0|                                     STRCONST("chunked"));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2262|      0|      }
 2263|      8|      result = Curl_creader_set_fread(data, chunked ? -1 : postsize);
  ------------------
  |  Branch (2263:45): [True: 0, False: 8]
  ------------------
 2264|      8|    }
 2265|     22|    return result;
 2266|       |
 2267|  1.51k|  default:
  ------------------
  |  Branch (2267:3): [True: 1.51k, False: 435]
  ------------------
 2268|       |    /* HTTP GET/HEAD download, has no body, needs no Content-Length */
 2269|  1.51k|    data->state.infilesize = 0;
 2270|  1.51k|    return Curl_creader_set_null(data);
 2271|  1.94k|  }
 2272|       |  /* not reached */
 2273|  1.94k|}
http.c:set_post_reader:
 2137|    377|{
 2138|    377|  CURLcode result;
 2139|       |
 2140|    377|  switch(httpreq) {
 2141|      0|#ifndef CURL_DISABLE_MIME
 2142|    377|  case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (2142:3): [True: 377, False: 0]
  ------------------
 2143|    377|    data->state.mimepost = data->set.a.mimepostp;
 2144|    377|    break;
 2145|      0|#endif
 2146|      0|#ifndef CURL_DISABLE_FORM_API
 2147|      0|  case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (2147:3): [True: 0, False: 377]
  ------------------
 2148|       |    /* Convert the form structure into a mime structure, then keep
 2149|       |       the conversion */
 2150|      0|    if(!data->state.formp) {
  ------------------
  |  Branch (2150:8): [True: 0, False: 0]
  ------------------
 2151|      0|      data->state.formp = curlx_calloc(1, sizeof(curl_mimepart));
  ------------------
  |  | 1500|      0|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 2152|      0|      if(!data->state.formp)
  ------------------
  |  Branch (2152:10): [True: 0, False: 0]
  ------------------
 2153|      0|        return CURLE_OUT_OF_MEMORY;
 2154|      0|      Curl_mime_cleanpart(data->state.formp);
 2155|      0|      result = Curl_getformdata(data, data->state.formp, data->set.httppost,
 2156|      0|                                data->state.fread_func);
 2157|      0|      if(result) {
  ------------------
  |  Branch (2157:10): [True: 0, False: 0]
  ------------------
 2158|      0|        curlx_safefree(data->state.formp);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2159|      0|        return result;
 2160|      0|      }
 2161|      0|      data->state.mimepost = data->state.formp;
 2162|      0|    }
 2163|      0|    break;
 2164|      0|#endif
 2165|      0|  default:
  ------------------
  |  Branch (2165:3): [True: 0, False: 377]
  ------------------
 2166|      0|    data->state.mimepost = NULL;
 2167|      0|    break;
 2168|    377|  }
 2169|       |
 2170|    377|  switch(httpreq) {
 2171|      0|  case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (2171:3): [True: 0, False: 377]
  ------------------
 2172|    377|  case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (2172:3): [True: 377, False: 0]
  ------------------
 2173|       |    /* This is form posting using mime data. */
 2174|    377|#ifndef CURL_DISABLE_MIME
 2175|    377|    if(data->state.mimepost) {
  ------------------
  |  Branch (2175:8): [True: 377, False: 0]
  ------------------
 2176|    377|      const char *cthdr = Curl_checkheaders(data, STRCONST("Content-Type"));
  ------------------
  |  | 1324|    377|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|    377|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2177|       |
 2178|       |      /* Read and seek body only. */
 2179|    377|      data->state.mimepost->flags |= MIME_BODY_ONLY;
  ------------------
  |  |   35|    377|#define MIME_BODY_ONLY          (1 << 1)
  ------------------
 2180|       |
 2181|       |      /* Prepare the mime structure headers & set content type. */
 2182|       |
 2183|    377|      if(cthdr)
  ------------------
  |  Branch (2183:10): [True: 0, False: 377]
  ------------------
 2184|      0|        for(cthdr += 13; *cthdr == ' '; cthdr++)
  ------------------
  |  Branch (2184:26): [True: 0, False: 0]
  ------------------
 2185|      0|          ;
 2186|    377|      else if(data->state.mimepost->kind == MIMEKIND_MULTIPART)
  ------------------
  |  Branch (2186:15): [True: 377, False: 0]
  ------------------
 2187|    377|        cthdr = "multipart/form-data";
 2188|       |
 2189|    377|      curl_mime_headers(data->state.mimepost, data->set.headers, 0);
 2190|    377|      result = Curl_mime_prepare_headers(data, data->state.mimepost, cthdr,
 2191|    377|                                         NULL, MIMESTRATEGY_FORM);
 2192|    377|      curl_mime_headers(data->state.mimepost, NULL, 0);
 2193|    377|      if(result)
  ------------------
  |  Branch (2193:10): [True: 1, False: 376]
  ------------------
 2194|      1|        return result;
 2195|    376|      result = Curl_creader_set_mime(data, data->state.mimepost);
 2196|    376|      if(result)
  ------------------
  |  Branch (2196:10): [True: 0, False: 376]
  ------------------
 2197|      0|        return result;
 2198|    376|    }
 2199|      0|    else
 2200|      0|#endif
 2201|      0|    {
 2202|      0|      result = Curl_creader_set_null(data);
 2203|      0|    }
 2204|    376|    data->state.infilesize = Curl_creader_total_length(data);
 2205|    376|    return result;
 2206|       |
 2207|      0|  default:
  ------------------
  |  Branch (2207:3): [True: 0, False: 377]
  ------------------
 2208|      0|    return Curl_creader_set_null(data);
 2209|    377|  }
 2210|       |  /* never reached */
 2211|    377|}
http.c:http_resume:
 2276|  1.94k|{
 2277|  1.94k|  if((HTTPREQ_POST == httpreq || HTTPREQ_POST_FORM == httpreq ||
  ------------------
  |  Branch (2277:7): [True: 22, False: 1.92k]
  |  Branch (2277:34): [True: 0, False: 1.92k]
  ------------------
 2278|  1.92k|      HTTPREQ_POST_MIME == httpreq || HTTPREQ_PUT == httpreq) &&
  ------------------
  |  Branch (2278:7): [True: 376, False: 1.54k]
  |  Branch (2278:39): [True: 37, False: 1.51k]
  ------------------
 2279|    435|     data->state.resume_from) {
  ------------------
  |  Branch (2279:6): [True: 0, False: 435]
  ------------------
 2280|      0|    failf(data, "HTTP upload cannot be resumed");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2281|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 2282|      0|  }
 2283|  1.94k|  return CURLE_OK;
 2284|  1.94k|}
http.c:http_range:
 2522|  1.94k|{
 2523|  1.94k|  if(data->state.use_range) {
  ------------------
  |  Branch (2523:6): [True: 13, False: 1.93k]
  ------------------
 2524|       |    /*
 2525|       |     * A range is selected. We use different headers whether we are downloading
 2526|       |     * or uploading and we always let customized headers override our internal
 2527|       |     * ones if any such are specified.
 2528|       |     */
 2529|     13|    if(((httpreq == HTTPREQ_GET) || (httpreq == HTTPREQ_HEAD)) &&
  ------------------
  |  Branch (2529:9): [True: 13, False: 0]
  |  Branch (2529:37): [True: 0, False: 0]
  ------------------
 2530|     13|       !Curl_checkheaders(data, STRCONST("Range"))) {
  ------------------
  |  | 1324|     13|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     13|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2530:8): [True: 13, False: 0]
  ------------------
 2531|       |      /* if a line like this was already allocated, free the previous one */
 2532|     13|      curlx_free(data->state.rangeline);
  ------------------
  |  | 1503|     13|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2533|     13|      data->state.rangeline = curl_maprintf("Range: bytes=%s\r\n",
 2534|     13|                                                 data->state.range);
 2535|     13|      if(!data->state.rangeline)
  ------------------
  |  Branch (2535:10): [True: 0, False: 13]
  ------------------
 2536|      0|        return CURLE_OUT_OF_MEMORY;
 2537|     13|    }
 2538|      0|    else if((httpreq == HTTPREQ_POST || httpreq == HTTPREQ_PUT) &&
  ------------------
  |  Branch (2538:14): [True: 0, False: 0]
  |  Branch (2538:41): [True: 0, False: 0]
  ------------------
 2539|      0|            !Curl_checkheaders(data, STRCONST("Content-Range"))) {
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2539:13): [True: 0, False: 0]
  ------------------
 2540|      0|      curl_off_t req_clen = Curl_creader_total_length(data);
 2541|       |      /* if a line like this was already allocated, free the previous one */
 2542|      0|      curlx_free(data->state.rangeline);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2543|       |
 2544|      0|      if(data->set.set_resume_from < 0) {
  ------------------
  |  Branch (2544:10): [True: 0, False: 0]
  ------------------
 2545|       |        /* Upload resume was asked for, but we do not know the size of the
 2546|       |           remote part so we tell the server (and act accordingly) that we
 2547|       |           upload the whole file (again) */
 2548|      0|        data->state.rangeline =
 2549|      0|          curl_maprintf("Content-Range: bytes 0-%" FMT_OFF_T "/"
 2550|      0|                        "%" FMT_OFF_T "\r\n", req_clen - 1, req_clen);
 2551|      0|      }
 2552|      0|      else if(data->state.resume_from) {
  ------------------
  |  Branch (2552:15): [True: 0, False: 0]
  ------------------
 2553|       |        /* This is because "resume" was selected */
 2554|       |        /* Not sure if we want to send this header during authentication
 2555|       |         * negotiation, but test1084 checks for it. In which case we have a
 2556|       |         * "null" client reader installed that gives an unexpected length. */
 2557|      0|        curl_off_t total_len = data->req.authneg ?
  ------------------
  |  Branch (2557:32): [True: 0, False: 0]
  ------------------
 2558|      0|                               data->state.infilesize :
 2559|      0|                               (data->state.resume_from + req_clen);
 2560|      0|        data->state.rangeline =
 2561|      0|          curl_maprintf("Content-Range: bytes %s%" FMT_OFF_T "/"
 2562|      0|                        "%" FMT_OFF_T "\r\n",
 2563|      0|                        data->state.range, total_len - 1, total_len);
 2564|      0|      }
 2565|      0|      else {
 2566|       |        /* Range was selected and then we pass the incoming range and append
 2567|       |           total size */
 2568|      0|        data->state.rangeline =
 2569|      0|          curl_maprintf("Content-Range: bytes %s/%" FMT_OFF_T "\r\n",
 2570|      0|                        data->state.range, req_clen);
 2571|      0|      }
 2572|      0|      if(!data->state.rangeline)
  ------------------
  |  Branch (2572:10): [True: 0, False: 0]
  ------------------
 2573|      0|        return CURLE_OUT_OF_MEMORY;
 2574|      0|    }
 2575|     13|  }
 2576|  1.94k|  return CURLE_OK;
 2577|  1.94k|}
http.c:http_request_version:
 1681|  1.94k|{
 1682|  1.94k|  unsigned char v = Curl_conn_http_version(data, data->conn);
 1683|  1.94k|  if(!v) {
  ------------------
  |  Branch (1683:6): [True: 0, False: 1.94k]
  ------------------
 1684|       |    /* No specific HTTP connection filter installed. */
 1685|      0|    v = http_may_use_1_1(data) ? 11 : 10;
  ------------------
  |  Branch (1685:9): [True: 0, False: 0]
  ------------------
 1686|      0|  }
 1687|  1.94k|  return v;
 1688|  1.94k|}
http.c:http_add_hd:
 2737|  38.9k|{
 2738|  38.9k|  struct connectdata *conn = data->conn;
 2739|  38.9k|  CURLcode result = CURLE_OK;
 2740|       |
 2741|  38.9k|  switch(id) {
  ------------------
  |  Branch (2741:10): [True: 38.9k, False: 0]
  ------------------
 2742|  1.94k|  case H1_HD_REQUEST:
  ------------------
  |  Branch (2742:3): [True: 1.94k, False: 36.9k]
  ------------------
 2743|       |    /* add the main request stuff */
 2744|       |    /* GET/HEAD/POST/PUT */
 2745|  1.94k|    result = curlx_dyn_addf(req, "%s ", method);
 2746|  1.94k|    if(!result)
  ------------------
  |  Branch (2746:8): [True: 1.94k, False: 0]
  ------------------
 2747|  1.94k|      result = http_target(data, req);
 2748|  1.94k|    if(!result)
  ------------------
  |  Branch (2748:8): [True: 1.94k, False: 0]
  ------------------
 2749|  1.94k|      result = curlx_dyn_addf(req, " HTTP/%s\r\n",
 2750|  1.94k|                              get_http_string(httpversion));
 2751|  1.94k|    break;
 2752|       |
 2753|  1.94k|  case H1_HD_HOST:
  ------------------
  |  Branch (2753:3): [True: 1.94k, False: 36.9k]
  ------------------
 2754|  1.94k|    if(data->state.http_host) {
  ------------------
  |  Branch (2754:8): [True: 1.94k, False: 0]
  ------------------
 2755|  1.94k|      result = curlx_dyn_add(req, data->state.http_host);
 2756|  1.94k|      if(!result)
  ------------------
  |  Branch (2756:10): [True: 1.94k, False: 0]
  ------------------
 2757|  1.94k|        result = curlx_dyn_addn(req, STRCONST("\r\n"));
  ------------------
  |  | 1324|  1.94k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.94k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2758|  1.94k|    }
 2759|  1.94k|    break;
 2760|       |
 2761|      0|#ifndef CURL_DISABLE_PROXY
 2762|  1.94k|  case H1_HD_PROXY_AUTH:
  ------------------
  |  Branch (2762:3): [True: 1.94k, False: 36.9k]
  ------------------
 2763|  1.94k|    if(data->req.hd_proxy_auth && (conn->bits.origin_is_proxy || is_connect))
  ------------------
  |  Branch (2763:8): [True: 0, False: 1.94k]
  |  Branch (2763:36): [True: 0, False: 0]
  |  Branch (2763:66): [True: 0, False: 0]
  ------------------
 2764|      0|      result = curlx_dyn_add(req, data->req.hd_proxy_auth);
 2765|  1.94k|    break;
 2766|      0|#endif
 2767|       |
 2768|  1.94k|  case H1_HD_AUTH:
  ------------------
  |  Branch (2768:3): [True: 1.94k, False: 36.9k]
  ------------------
 2769|  1.94k|    if(data->req.hd_auth && !is_connect)
  ------------------
  |  Branch (2769:8): [True: 11, False: 1.93k]
  |  Branch (2769:29): [True: 11, False: 0]
  ------------------
 2770|     11|      result = curlx_dyn_add(req, data->req.hd_auth);
 2771|  1.94k|    break;
 2772|       |
 2773|  1.94k|  case H1_HD_RANGE:
  ------------------
  |  Branch (2773:3): [True: 1.94k, False: 36.9k]
  ------------------
 2774|  1.94k|    if(data->state.use_range && data->state.rangeline)
  ------------------
  |  Branch (2774:8): [True: 13, False: 1.93k]
  |  Branch (2774:33): [True: 13, False: 0]
  ------------------
 2775|     13|      result = curlx_dyn_add(req, data->state.rangeline);
 2776|  1.94k|    break;
 2777|       |
 2778|  1.94k|  case H1_HD_USER_AGENT: {
  ------------------
  |  Branch (2778:3): [True: 1.94k, False: 36.9k]
  ------------------
 2779|  1.94k|    const char *ua = CURL_EASY_STR(data, STRING_USERAGENT);
  ------------------
  |  | 1206|  1.94k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2780|  1.94k|    if(ua && *ua && !Curl_checkheaders(data, STRCONST("User-Agent")))
  ------------------
  |  | 1324|      5|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      5|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2780:8): [True: 8, False: 1.93k]
  |  Branch (2780:14): [True: 5, False: 3]
  |  Branch (2780:21): [True: 5, False: 0]
  ------------------
 2781|      5|      result = curlx_dyn_addf(req, "User-Agent: %s\r\n", ua);
 2782|  1.94k|    break;
 2783|      0|  }
 2784|       |
 2785|  1.94k|  case H1_HD_ACCEPT:
  ------------------
  |  Branch (2785:3): [True: 1.94k, False: 36.9k]
  ------------------
 2786|  1.94k|    if(!Curl_checkheaders(data, STRCONST("Accept")))
  ------------------
  |  | 1324|  1.94k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.94k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2786:8): [True: 1.93k, False: 7]
  ------------------
 2787|  1.93k|      result = curlx_dyn_add(req, "Accept: */*\r\n");
 2788|  1.94k|    break;
 2789|       |
 2790|  1.94k|  case H1_HD_TE:
  ------------------
  |  Branch (2790:3): [True: 1.94k, False: 36.9k]
  ------------------
 2791|  1.94k|#ifdef HAVE_LIBZ
 2792|  1.94k|    if(!Curl_checkheaders(data, STRCONST("TE")) &&
  ------------------
  |  | 1324|  1.94k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.94k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2792:8): [True: 1.94k, False: 0]
  ------------------
 2793|  1.94k|       data->set.http_transfer_encoding) {
  ------------------
  |  Branch (2793:8): [True: 4, False: 1.94k]
  ------------------
 2794|      4|      data->state.http_hd_te = TRUE;
  ------------------
  |  |  986|      4|#define TRUE true
  ------------------
 2795|      4|      result = curlx_dyn_add(req, "TE: gzip\r\n");
 2796|      4|    }
 2797|  1.94k|#endif
 2798|  1.94k|    break;
 2799|       |
 2800|  1.94k|  case H1_HD_ACCEPT_ENCODING: {
  ------------------
  |  Branch (2800:3): [True: 1.94k, False: 36.9k]
  ------------------
 2801|  1.94k|    const char *enc = CURL_EASY_STR(data, STRING_ENCODING);
  ------------------
  |  | 1206|  1.94k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2802|  1.94k|    if(enc && !Curl_checkheaders(data, STRCONST("Accept-Encoding")))
  ------------------
  |  | 1324|     19|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     19|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2802:8): [True: 19, False: 1.92k]
  |  Branch (2802:15): [True: 19, False: 0]
  ------------------
 2803|     19|      result = curlx_dyn_addf(req, "Accept-Encoding: %s\r\n", enc);
 2804|  1.94k|    break;
 2805|      0|  }
 2806|       |
 2807|  1.94k|  case H1_HD_REFERER:
  ------------------
  |  Branch (2807:3): [True: 1.94k, False: 36.9k]
  ------------------
 2808|  1.94k|    if(Curl_bufref_ptr(&data->state.referer) &&
  ------------------
  |  Branch (2808:8): [True: 13, False: 1.93k]
  ------------------
 2809|     13|       !Curl_checkheaders(data, STRCONST("Referer")))
  ------------------
  |  | 1324|     13|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     13|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2809:8): [True: 13, False: 0]
  ------------------
 2810|     13|      result = curlx_dyn_addf(req, "Referer: %s\r\n",
 2811|     13|                              Curl_bufref_ptr(&data->state.referer));
 2812|  1.94k|    break;
 2813|       |
 2814|      0|#ifndef CURL_DISABLE_PROXY
 2815|  1.94k|  case H1_HD_PROXY_CONNECTION:
  ------------------
  |  Branch (2815:3): [True: 1.94k, False: 36.9k]
  ------------------
 2816|  1.94k|    if(conn->bits.origin_is_proxy &&
  ------------------
  |  Branch (2816:8): [True: 0, False: 1.94k]
  ------------------
 2817|      0|       !Curl_checkheaders(data, STRCONST("Proxy-Connection")) &&
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2817:8): [True: 0, False: 0]
  ------------------
 2818|      0|       !Curl_checkProxyheaders(data, conn, STRCONST("Proxy-Connection")))
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2818:8): [True: 0, False: 0]
  ------------------
 2819|      0|      result = curlx_dyn_add(req, "Proxy-Connection: Keep-Alive\r\n");
 2820|  1.94k|    break;
 2821|      0|#endif
 2822|       |
 2823|  1.94k|  case H1_HD_TRANSFER_ENCODING:
  ------------------
  |  Branch (2823:3): [True: 1.94k, False: 36.9k]
  ------------------
 2824|  1.94k|    result = http_req_set_TE(data, req, httpversion);
 2825|  1.94k|    break;
 2826|       |
 2827|      0|#ifndef CURL_DISABLE_ALTSVC
 2828|  1.94k|  case H1_HD_ALT_USED:
  ------------------
  |  Branch (2828:3): [True: 1.94k, False: 36.9k]
  ------------------
 2829|  1.94k|    if(conn->bits.altused && conn->via_peer &&
  ------------------
  |  Branch (2829:8): [True: 0, False: 1.94k]
  |  Branch (2829:30): [True: 0, False: 0]
  ------------------
 2830|      0|       !Curl_checkheaders(data, STRCONST("Alt-Used")))
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2830:8): [True: 0, False: 0]
  ------------------
 2831|      0|      result = curlx_dyn_addf(req, "Alt-Used: %s:%u\r\n",
 2832|      0|                              conn->via_peer->hostname, conn->via_peer->port);
 2833|  1.94k|    break;
 2834|      0|#endif
 2835|       |
 2836|  1.94k|  case H1_HD_UPGRADE:
  ------------------
  |  Branch (2836:3): [True: 1.94k, False: 36.9k]
  ------------------
 2837|  1.94k|    if(!Curl_conn_is_ssl(conn) && (httpversion < 20) &&
  ------------------
  |  Branch (2837:8): [True: 0, False: 1.94k]
  |  Branch (2837:35): [True: 0, False: 0]
  ------------------
 2838|      0|       (data->state.http_neg.wanted & CURL_HTTP_V2x) &&
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (2838:8): [True: 0, False: 0]
  ------------------
 2839|      0|       data->state.http_neg.h2_upgrade) {
  ------------------
  |  Branch (2839:8): [True: 0, False: 0]
  ------------------
 2840|       |      /* append HTTP2 upgrade magic stuff to the HTTP request if it is not done
 2841|       |         over SSL */
 2842|      0|      result = Curl_http2_request_upgrade(req, data);
 2843|      0|    }
 2844|  1.94k|#ifndef CURL_DISABLE_WEBSOCKETS
 2845|  1.94k|    if(!result && conn->scheme->protocol & (CURLPROTO_WS | CURLPROTO_WSS))
  ------------------
  |  |   62|  1.94k|#define CURLPROTO_WS     (1L << 30)
  ------------------
                  if(!result && conn->scheme->protocol & (CURLPROTO_WS | CURLPROTO_WSS))
  ------------------
  |  |   63|  1.94k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  ------------------
  |  Branch (2845:8): [True: 1.94k, False: 0]
  |  Branch (2845:19): [True: 0, False: 1.94k]
  ------------------
 2846|      0|      result = Curl_ws_request(data, req);
 2847|  1.94k|#endif
 2848|  1.94k|    break;
 2849|       |
 2850|  1.94k|  case H1_HD_COOKIES:
  ------------------
  |  Branch (2850:3): [True: 1.94k, False: 36.9k]
  ------------------
 2851|  1.94k|    result = http_cookies(data, req);
 2852|  1.94k|    break;
 2853|       |
 2854|  1.94k|  case H1_HD_CONDITIONALS:
  ------------------
  |  Branch (2854:3): [True: 1.94k, False: 36.9k]
  ------------------
 2855|  1.94k|    result = Curl_add_timecondition(data, req);
 2856|  1.94k|    break;
 2857|       |
 2858|  1.94k|  case H1_HD_CUSTOM:
  ------------------
  |  Branch (2858:3): [True: 1.94k, False: 36.9k]
  ------------------
 2859|  1.94k|    result = Curl_add_custom_headers(data, httpversion, req);
 2860|  1.94k|    break;
 2861|       |
 2862|  1.94k|  case H1_HD_CONTENT:
  ------------------
  |  Branch (2862:3): [True: 1.94k, False: 36.9k]
  ------------------
 2863|  1.94k|    result = http_add_content_hds(data, req, httpversion, httpreq);
 2864|  1.94k|    break;
 2865|       |
 2866|  1.94k|  case H1_HD_CONNECTION: {
  ------------------
  |  Branch (2866:3): [True: 1.94k, False: 36.9k]
  ------------------
 2867|  1.94k|    result = http_add_connection_hd(data, req);
 2868|  1.94k|    break;
 2869|      0|  }
 2870|       |
 2871|  1.94k|  case H1_HD_LAST:
  ------------------
  |  Branch (2871:3): [True: 1.94k, False: 36.9k]
  ------------------
 2872|  1.94k|    result = curlx_dyn_addn(req, STRCONST("\r\n"));
  ------------------
  |  | 1324|  1.94k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.94k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2873|  1.94k|    break;
 2874|  38.9k|  }
 2875|  38.9k|  return result;
 2876|  38.9k|}
http.c:http_target:
 2015|  1.94k|{
 2016|  1.94k|  CURLcode result = CURLE_OK;
 2017|  1.94k|  const char *path = data->state.up.path;
 2018|  1.94k|  const char *query = data->state.up.query;
 2019|  1.94k|#ifndef CURL_DISABLE_PROXY
 2020|  1.94k|  struct connectdata *conn = data->conn;
 2021|  1.94k|#endif
 2022|       |
 2023|  1.94k|  if(CURL_EASY_STR(data, STRING_TARGET)) {
  ------------------
  |  | 1206|  1.94k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 10, False: 1.93k]
  |  |  ------------------
  ------------------
 2024|     10|    path = CURL_EASY_STR(data, STRING_TARGET);
  ------------------
  |  | 1206|     10|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2025|     10|    query = NULL;
 2026|     10|  }
 2027|       |
 2028|  1.94k|#ifndef CURL_DISABLE_PROXY
 2029|  1.94k|  if(conn->bits.origin_is_proxy) {
  ------------------
  |  Branch (2029:6): [True: 0, False: 1.94k]
  ------------------
 2030|       |    /* Using a proxy but does not tunnel through it */
 2031|       |
 2032|       |    /* The path sent to the proxy is in fact the entire URL, but if the remote
 2033|       |       host is a IDN-name, we must make sure that the request we produce only
 2034|       |       uses the decoded hostname! */
 2035|       |
 2036|       |    /* and no fragment part */
 2037|      0|    CURLUcode uc;
 2038|      0|    char *url;
 2039|      0|    CURLU *h = curl_url_dup(data->state.uh);
 2040|      0|    if(!h)
  ------------------
  |  Branch (2040:8): [True: 0, False: 0]
  ------------------
 2041|      0|      return CURLE_OUT_OF_MEMORY;
 2042|       |
 2043|      0|    if(!data->state.origin->ipv6 &&
  ------------------
  |  Branch (2043:8): [True: 0, False: 0]
  ------------------
 2044|      0|       (data->state.origin->user_hostname != data->state.origin->hostname)) {
  ------------------
  |  Branch (2044:8): [True: 0, False: 0]
  ------------------
 2045|      0|      uc = curl_url_set(h, CURLUPART_HOST, data->state.origin->hostname, 0);
 2046|      0|      if(uc) {
  ------------------
  |  Branch (2046:10): [True: 0, False: 0]
  ------------------
 2047|      0|        curl_url_cleanup(h);
 2048|      0|        return CURLE_OUT_OF_MEMORY;
 2049|      0|      }
 2050|      0|    }
 2051|      0|    uc = curl_url_set(h, CURLUPART_FRAGMENT, NULL, 0);
 2052|      0|    if(uc) {
  ------------------
  |  Branch (2052:8): [True: 0, False: 0]
  ------------------
 2053|      0|      curl_url_cleanup(h);
 2054|      0|      return CURLE_OUT_OF_MEMORY;
 2055|      0|    }
 2056|       |
 2057|      0|    if(data->state.origin->scheme == &Curl_scheme_http) {
  ------------------
  |  Branch (2057:8): [True: 0, False: 0]
  ------------------
 2058|       |      /* when getting HTTP, we do not want the userinfo the URL */
 2059|      0|      uc = curl_url_set(h, CURLUPART_USER, NULL, 0);
 2060|      0|      if(uc) {
  ------------------
  |  Branch (2060:10): [True: 0, False: 0]
  ------------------
 2061|      0|        curl_url_cleanup(h);
 2062|      0|        return CURLE_OUT_OF_MEMORY;
 2063|      0|      }
 2064|      0|      uc = curl_url_set(h, CURLUPART_PASSWORD, NULL, 0);
 2065|      0|      if(uc) {
  ------------------
  |  Branch (2065:10): [True: 0, False: 0]
  ------------------
 2066|      0|        curl_url_cleanup(h);
 2067|      0|        return CURLE_OUT_OF_MEMORY;
 2068|      0|      }
 2069|      0|    }
 2070|      0|    else if(data->state.creds && (data->state.creds->source != CREDS_URL)) {
  ------------------
  |  |   31|      0|#define CREDS_URL    1 /* username/passwd from URL */
  ------------------
  |  Branch (2070:13): [True: 0, False: 0]
  |  Branch (2070:34): [True: 0, False: 0]
  ------------------
 2071|       |        /* credentials not from the URL need to be set */
 2072|      0|      uc = curl_url_set(h, CURLUPART_USER,
 2073|      0|                        data->state.creds->user, CURLU_URLENCODE);
  ------------------
  |  |   95|      0|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 2074|      0|      if(!uc)
  ------------------
  |  Branch (2074:10): [True: 0, False: 0]
  ------------------
 2075|      0|        uc = curl_url_set(h, CURLUPART_PASSWORD,
 2076|      0|                          data->state.creds->passwd, CURLU_URLENCODE);
  ------------------
  |  |   95|      0|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 2077|      0|      if(uc) {
  ------------------
  |  Branch (2077:10): [True: 0, False: 0]
  ------------------
 2078|      0|        curl_url_cleanup(h);
 2079|      0|        return Curl_uc_to_curlcode(uc);
 2080|      0|      }
 2081|      0|    }
 2082|       |
 2083|       |    /* Extract the URL to use in the request. */
 2084|      0|    uc = curl_url_get(h, CURLUPART_URL, &url, CURLU_NO_DEFAULT_PORT);
  ------------------
  |  |   86|      0|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
 2085|      0|    if(uc) {
  ------------------
  |  Branch (2085:8): [True: 0, False: 0]
  ------------------
 2086|      0|      curl_url_cleanup(h);
 2087|      0|      return CURLE_OUT_OF_MEMORY;
 2088|      0|    }
 2089|       |
 2090|      0|    curl_url_cleanup(h);
 2091|       |
 2092|       |    /* target or URL */
 2093|      0|    result = curlx_dyn_add(r, CURL_EASY_STR(data, STRING_TARGET) ?
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2094|      0|      CURL_EASY_STR(data, STRING_TARGET) : url);
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2095|      0|    curlx_free(url);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2096|      0|    if(result)
  ------------------
  |  Branch (2096:8): [True: 0, False: 0]
  ------------------
 2097|      0|      return result;
 2098|       |
 2099|      0|    if((data->state.origin->scheme == &Curl_scheme_ftp) &&
  ------------------
  |  Branch (2099:8): [True: 0, False: 0]
  ------------------
 2100|      0|       data->set.proxy_transfer_mode) {
  ------------------
  |  Branch (2100:8): [True: 0, False: 0]
  ------------------
 2101|       |      /* when doing ftp, append ;type=<a|i> if not present */
 2102|      0|      size_t len = strlen(path);
 2103|      0|      bool type_present = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2104|      0|      if((len >= 7) && !memcmp(&path[len - 7], ";type=", 6)) {
  ------------------
  |  Branch (2104:10): [True: 0, False: 0]
  |  Branch (2104:24): [True: 0, False: 0]
  ------------------
 2105|      0|        switch(Curl_raw_toupper(path[len - 1])) {
  ------------------
  |  Branch (2105:16): [True: 0, False: 0]
  ------------------
 2106|      0|        case 'A':
  ------------------
  |  Branch (2106:9): [True: 0, False: 0]
  ------------------
 2107|      0|        case 'D':
  ------------------
  |  Branch (2107:9): [True: 0, False: 0]
  ------------------
 2108|      0|        case 'I':
  ------------------
  |  Branch (2108:9): [True: 0, False: 0]
  ------------------
 2109|      0|          type_present = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2110|      0|          break;
 2111|      0|        }
 2112|      0|      }
 2113|      0|      if(!type_present) {
  ------------------
  |  Branch (2113:10): [True: 0, False: 0]
  ------------------
 2114|      0|        result = curlx_dyn_addf(r, ";type=%c",
 2115|      0|                                data->state.prefer_ascii ? 'a' : 'i');
  ------------------
  |  Branch (2115:33): [True: 0, False: 0]
  ------------------
 2116|      0|        if(result)
  ------------------
  |  Branch (2116:12): [True: 0, False: 0]
  ------------------
 2117|      0|          return result;
 2118|      0|      }
 2119|      0|    }
 2120|      0|  }
 2121|       |
 2122|  1.94k|  else
 2123|  1.94k|#endif
 2124|  1.94k|  {
 2125|  1.94k|    result = curlx_dyn_add(r, path);
 2126|  1.94k|    if(result)
  ------------------
  |  Branch (2126:8): [True: 0, False: 1.94k]
  ------------------
 2127|      0|      return result;
 2128|  1.94k|    if(query)
  ------------------
  |  Branch (2128:8): [True: 14, False: 1.93k]
  ------------------
 2129|     14|      result = curlx_dyn_addf(r, "?%s", query);
 2130|  1.94k|  }
 2131|       |
 2132|  1.94k|  return result;
 2133|  1.94k|}
http.c:get_http_string:
 1691|  1.94k|{
 1692|  1.94k|  switch(httpversion) {
 1693|  1.94k|  case 30:
  ------------------
  |  Branch (1693:3): [True: 1.94k, False: 0]
  ------------------
 1694|  1.94k|    return "3";
 1695|      0|  case 20:
  ------------------
  |  Branch (1695:3): [True: 0, False: 1.94k]
  ------------------
 1696|      0|    return "2";
 1697|      0|  case 11:
  ------------------
  |  Branch (1697:3): [True: 0, False: 1.94k]
  ------------------
 1698|      0|    return "1.1";
 1699|      0|  default:
  ------------------
  |  Branch (1699:3): [True: 0, False: 1.94k]
  ------------------
 1700|      0|    return "1.0";
 1701|  1.94k|  }
 1702|  1.94k|}
http.c:http_req_set_TE:
 2289|  1.94k|{
 2290|  1.94k|  CURLcode result = CURLE_OK;
 2291|  1.94k|  const char *ptr;
 2292|       |
 2293|  1.94k|  ptr = Curl_checkheaders(data, STRCONST("Transfer-Encoding"));
  ------------------
  |  | 1324|  1.94k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.94k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2294|  1.94k|  if(ptr) {
  ------------------
  |  Branch (2294:6): [True: 0, False: 1.94k]
  ------------------
 2295|       |    /* Some kind of TE is requested, check if 'chunked' is chosen */
 2296|      0|    data->req.upload_chunky =
 2297|      0|      Curl_compareheader(ptr,
 2298|      0|                         STRCONST("Transfer-Encoding:"), STRCONST("chunked"));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
                                       STRCONST("Transfer-Encoding:"), STRCONST("chunked"));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2299|      0|    if(data->req.upload_chunky && (httpversion >= 20)) {
  ------------------
  |  Branch (2299:8): [True: 0, False: 0]
  |  Branch (2299:35): [True: 0, False: 0]
  ------------------
 2300|      0|      infof(data, "suppressing chunked transfer encoding on connection "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2301|      0|            "using HTTP version 2 or higher");
 2302|      0|      data->req.upload_chunky = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2303|      0|    }
 2304|      0|  }
 2305|  1.94k|  else {
 2306|  1.94k|    curl_off_t req_clen = Curl_creader_total_length(data);
 2307|       |
 2308|  1.94k|    if(req_clen < 0) {
  ------------------
  |  Branch (2308:8): [True: 52, False: 1.89k]
  ------------------
 2309|       |      /* indeterminate request content length */
 2310|     52|      if(httpversion > 10) {
  ------------------
  |  Branch (2310:10): [True: 52, False: 0]
  ------------------
 2311|       |        /* On HTTP/1.1, enable chunked, on HTTP/2 and later we do not
 2312|       |         * need it */
 2313|     52|        data->req.upload_chunky = (httpversion < 20);
 2314|     52|      }
 2315|      0|      else {
 2316|      0|        failf(data, "Chunky upload is not supported by HTTP 1.0");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2317|      0|        return CURLE_UPLOAD_FAILED;
 2318|      0|      }
 2319|     52|    }
 2320|  1.89k|    else {
 2321|       |      /* else, no chunky upload */
 2322|  1.89k|      data->req.upload_chunky = FALSE;
  ------------------
  |  |  989|  1.89k|#define FALSE false
  ------------------
 2323|  1.89k|    }
 2324|       |
 2325|  1.94k|    if(data->req.upload_chunky)
  ------------------
  |  Branch (2325:8): [True: 0, False: 1.94k]
  ------------------
 2326|      0|      result = curlx_dyn_add(req, "Transfer-Encoding: chunked\r\n");
 2327|  1.94k|  }
 2328|  1.94k|  return result;
 2329|  1.94k|}
http.c:http_cookies:
 2448|  1.94k|{
 2449|  1.94k|  CURLcode result = CURLE_OK;
 2450|  1.94k|  const char *addcookies = NULL;
 2451|  1.94k|  bool linecap = FALSE;
  ------------------
  |  |  989|  1.94k|#define FALSE false
  ------------------
 2452|  1.94k|  if(CURL_EASY_STR(data, STRING_COOKIE) &&
  ------------------
  |  | 1206|  3.89k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 15, False: 1.93k]
  |  |  ------------------
  ------------------
 2453|     15|     !Curl_checkheaders(data, STRCONST("Cookie")) &&
  ------------------
  |  | 1324|     15|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     15|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2453:6): [True: 15, False: 0]
  ------------------
 2454|     15|     Curl_auth_allowed_to_host(data))
  ------------------
  |  Branch (2454:6): [True: 15, False: 0]
  ------------------
 2455|     15|    addcookies = CURL_EASY_STR(data, STRING_COOKIE);
  ------------------
  |  | 1206|     15|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2456|       |
 2457|  1.94k|  if(data->cookies || addcookies) {
  ------------------
  |  Branch (2457:6): [True: 1.94k, False: 0]
  |  Branch (2457:23): [True: 0, False: 0]
  ------------------
 2458|  1.94k|    struct Curl_llist list;
 2459|  1.94k|    int count = 0;
 2460|       |
 2461|  1.94k|    if(data->cookies && data->state.cookie_engine) {
  ------------------
  |  Branch (2461:8): [True: 1.94k, False: 0]
  |  Branch (2461:25): [True: 1.94k, False: 0]
  ------------------
 2462|  1.94k|      bool okay;
 2463|  1.94k|      const char *host = data->req.cookiehost ?
  ------------------
  |  Branch (2463:26): [True: 0, False: 1.94k]
  ------------------
 2464|  1.94k|        data->req.cookiehost : data->state.origin->hostname;
 2465|  1.94k|      Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 2466|  1.94k|      result = Curl_cookie_getlist(data, &okay, host, &list);
 2467|  1.94k|      if(!result && okay) {
  ------------------
  |  Branch (2467:10): [True: 1.94k, False: 0]
  |  Branch (2467:21): [True: 1, False: 1.94k]
  ------------------
 2468|      1|        struct Curl_llist_node *n;
 2469|      1|        size_t clen = 8; /* hold the size of the generated Cookie: header */
 2470|       |
 2471|       |        /* loop through all cookies that matched */
 2472|      1|        for(n = Curl_llist_head(&list); n; n = Curl_node_next(n)) {
  ------------------
  |  Branch (2472:41): [True: 0, False: 1]
  ------------------
 2473|      0|          struct Cookie *co = Curl_node_elem(n);
 2474|      0|          if(co->value) {
  ------------------
  |  Branch (2474:14): [True: 0, False: 0]
  ------------------
 2475|      0|            size_t add;
 2476|      0|            if(!count) {
  ------------------
  |  Branch (2476:16): [True: 0, False: 0]
  ------------------
 2477|      0|              result = curlx_dyn_addn(r, STRCONST("Cookie: "));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2478|      0|              if(result)
  ------------------
  |  Branch (2478:18): [True: 0, False: 0]
  ------------------
 2479|      0|                break;
 2480|      0|            }
 2481|      0|            add = strlen(co->name) + strlen(co->value) + 1;
 2482|      0|            if(clen + add >= MAX_COOKIE_HEADER_LEN) {
  ------------------
  |  |   98|      0|#define MAX_COOKIE_HEADER_LEN 8190
  ------------------
  |  Branch (2482:16): [True: 0, False: 0]
  ------------------
 2483|      0|              infof(data, "Restricted outgoing cookies due to header size, "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2484|      0|                    "'%s' not sent", co->name);
 2485|      0|              linecap = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2486|      0|              break;
 2487|      0|            }
 2488|      0|            result = curlx_dyn_addf(r, "%s%s=%s", count ? "; " : "",
  ------------------
  |  Branch (2488:51): [True: 0, False: 0]
  ------------------
 2489|      0|                                    co->name, co->value);
 2490|      0|            if(result)
  ------------------
  |  Branch (2490:16): [True: 0, False: 0]
  ------------------
 2491|      0|              break;
 2492|      0|            clen += add + (count ? 2 : 0);
  ------------------
  |  Branch (2492:28): [True: 0, False: 0]
  ------------------
 2493|      0|            count++;
 2494|      0|          }
 2495|      0|        }
 2496|      1|        Curl_llist_destroy(&list, NULL);
 2497|      1|      }
 2498|  1.94k|      Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 2499|  1.94k|    }
 2500|  1.94k|    if(addcookies && !result && !linecap) {
  ------------------
  |  Branch (2500:8): [True: 15, False: 1.93k]
  |  Branch (2500:22): [True: 15, False: 0]
  |  Branch (2500:33): [True: 15, False: 0]
  ------------------
 2501|     15|      if(!count)
  ------------------
  |  Branch (2501:10): [True: 15, False: 0]
  ------------------
 2502|     15|        result = curlx_dyn_addn(r, STRCONST("Cookie: "));
  ------------------
  |  | 1324|     15|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     15|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2503|     15|      if(!result) {
  ------------------
  |  Branch (2503:10): [True: 15, False: 0]
  ------------------
 2504|     15|        result = curlx_dyn_addf(r, "%s%s", count ? "; " : "", addcookies);
  ------------------
  |  Branch (2504:44): [True: 0, False: 15]
  ------------------
 2505|     15|        count++;
 2506|     15|      }
 2507|     15|    }
 2508|  1.94k|    if(count && !result)
  ------------------
  |  Branch (2508:8): [True: 15, False: 1.93k]
  |  Branch (2508:17): [True: 15, False: 0]
  ------------------
 2509|     15|      result = curlx_dyn_addn(r, STRCONST("\r\n"));
  ------------------
  |  | 1324|     15|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     15|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2510|       |
 2511|  1.94k|    if(result)
  ------------------
  |  Branch (2511:8): [True: 0, False: 1.94k]
  ------------------
 2512|      0|      return result;
 2513|  1.94k|  }
 2514|  1.94k|  return result;
 2515|  1.94k|}
http.c:http_add_content_hds:
 2370|  1.94k|{
 2371|  1.94k|  CURLcode result = CURLE_OK;
 2372|  1.94k|  curl_off_t req_clen;
 2373|  1.94k|  bool announced_exp100 = FALSE;
  ------------------
  |  |  989|  1.94k|#define FALSE false
  ------------------
 2374|       |
 2375|  1.94k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2375:3): [True: 0, False: 1.94k]
  |  Branch (2375:3): [True: 1.94k, False: 0]
  ------------------
 2376|  1.94k|  if(data->req.upload_chunky) {
  ------------------
  |  Branch (2376:6): [True: 0, False: 1.94k]
  ------------------
 2377|      0|    result = Curl_httpchunk_add_reader(data);
 2378|      0|    if(result)
  ------------------
  |  Branch (2378:8): [True: 0, False: 0]
  ------------------
 2379|      0|      return result;
 2380|      0|  }
 2381|       |
 2382|       |  /* Get the request body length that has been set up */
 2383|  1.94k|  req_clen = Curl_creader_total_length(data);
 2384|  1.94k|  switch(httpreq) {
 2385|     37|  case HTTPREQ_PUT:
  ------------------
  |  Branch (2385:3): [True: 37, False: 1.90k]
  ------------------
 2386|     59|  case HTTPREQ_POST:
  ------------------
  |  Branch (2386:3): [True: 22, False: 1.92k]
  ------------------
 2387|     59|#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
 2388|     59|  case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (2388:3): [True: 0, False: 1.94k]
  ------------------
 2389|    435|  case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (2389:3): [True: 376, False: 1.57k]
  ------------------
 2390|    435|#endif
 2391|       |    /* We only set Content-Length and allow a custom Content-Length if
 2392|       |       we do not upload data chunked, as RFC2616 forbids us to set both
 2393|       |       kinds of headers (Transfer-Encoding: chunked and Content-Length).
 2394|       |       We do not override a custom "Content-Length" header, but during
 2395|       |       authentication negotiation that header is suppressed.
 2396|       |     */
 2397|    435|    if(req_clen >= 0 && !data->req.upload_chunky &&
  ------------------
  |  Branch (2397:8): [True: 383, False: 52]
  |  Branch (2397:25): [True: 383, False: 0]
  ------------------
 2398|    383|       (data->req.authneg ||
  ------------------
  |  Branch (2398:9): [True: 1, False: 382]
  ------------------
 2399|    383|        !Curl_checkheaders(data, STRCONST("Content-Length")))) {
  ------------------
  |  | 1324|    382|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|    382|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2399:9): [True: 382, False: 0]
  ------------------
 2400|       |      /* we allow replacing this header if not during auth negotiation,
 2401|       |         although it is not wise to actually set your own */
 2402|    383|      result = curlx_dyn_addf(r, "Content-Length: %" FMT_OFF_T "\r\n",
 2403|    383|                              req_clen);
 2404|    383|    }
 2405|    435|    if(result)
  ------------------
  |  Branch (2405:8): [True: 0, False: 435]
  ------------------
 2406|      0|      goto out;
 2407|       |
 2408|    435|#ifndef CURL_DISABLE_MIME
 2409|       |    /* Output mime-generated headers. */
 2410|    435|    if(data->state.mimepost &&
  ------------------
  |  Branch (2410:8): [True: 376, False: 59]
  ------------------
 2411|    376|       ((httpreq == HTTPREQ_POST_FORM) || (httpreq == HTTPREQ_POST_MIME))) {
  ------------------
  |  Branch (2411:9): [True: 0, False: 376]
  |  Branch (2411:43): [True: 376, False: 0]
  ------------------
 2412|    376|      struct curl_slist *hdr;
 2413|       |
 2414|    752|      for(hdr = data->state.mimepost->curlheaders; hdr; hdr = hdr->next) {
  ------------------
  |  Branch (2414:52): [True: 376, False: 376]
  ------------------
 2415|    376|        result = curlx_dyn_addf(r, "%s\r\n", hdr->data);
 2416|    376|        if(result)
  ------------------
  |  Branch (2416:12): [True: 0, False: 376]
  ------------------
 2417|      0|          goto out;
 2418|    376|      }
 2419|    376|    }
 2420|    435|#endif
 2421|    435|    if(httpreq == HTTPREQ_POST &&
  ------------------
  |  Branch (2421:8): [True: 22, False: 413]
  ------------------
 2422|     22|       !Curl_checkheaders(data, STRCONST("Content-Type"))) {
  ------------------
  |  | 1324|     22|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     22|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (2422:8): [True: 22, False: 0]
  ------------------
 2423|     22|      result = curlx_dyn_addn(r, STRCONST("Content-Type: application/"
  ------------------
  |  | 1324|     22|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|     22|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2424|     22|                                          "x-www-form-urlencoded\r\n"));
 2425|     22|      if(result)
  ------------------
  |  Branch (2425:10): [True: 0, False: 22]
  ------------------
 2426|      0|        goto out;
 2427|     22|    }
 2428|    435|    result = addexpect(data, r, httpversion, &announced_exp100);
 2429|    435|    if(result)
  ------------------
  |  Branch (2429:8): [True: 0, False: 435]
  ------------------
 2430|      0|      goto out;
 2431|    435|    break;
 2432|  1.51k|  default:
  ------------------
  |  Branch (2432:3): [True: 1.51k, False: 435]
  ------------------
 2433|  1.51k|    break;
 2434|  1.94k|  }
 2435|       |
 2436|  1.94k|  Curl_pgrsSetUploadSize(data, req_clen);
 2437|  1.94k|  if(announced_exp100)
  ------------------
  |  Branch (2437:6): [True: 0, False: 1.94k]
  ------------------
 2438|      0|    result = http_exp100_add_reader(data);
 2439|       |
 2440|  1.94k|out:
 2441|  1.94k|  return result;
 2442|  1.94k|}
http.c:addexpect:
 2333|    435|{
 2334|    435|  CURLcode result;
 2335|    435|  char *ptr;
 2336|       |
 2337|    435|  *announced_exp100 = FALSE;
  ------------------
  |  |  989|    435|#define FALSE false
  ------------------
 2338|       |  /* Avoid Expect: 100-continue if Upgrade: is used */
 2339|    435|  if(data->req.upgr101 != UPGR101_NONE)
  ------------------
  |  Branch (2339:6): [True: 0, False: 435]
  ------------------
 2340|      0|    return CURLE_OK;
 2341|       |
 2342|       |  /* For really small puts we do not use Expect: headers at all, and for
 2343|       |     the somewhat bigger ones we allow the app to disable it. Make
 2344|       |     sure that the expect100header is always set to the preferred value
 2345|       |     here. */
 2346|    435|  ptr = Curl_checkheaders(data, STRCONST("Expect"));
  ------------------
  |  | 1324|    435|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|    435|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2347|    435|  if(ptr) {
  ------------------
  |  Branch (2347:6): [True: 0, False: 435]
  ------------------
 2348|      0|    *announced_exp100 =
 2349|      0|      Curl_compareheader(ptr, STRCONST("Expect:"), STRCONST("100-continue"));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
                    Curl_compareheader(ptr, STRCONST("Expect:"), STRCONST("100-continue"));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2350|      0|  }
 2351|    435|  else if(!data->state.disableexpect && (httpversion == 11)) {
  ------------------
  |  Branch (2351:11): [True: 435, False: 0]
  |  Branch (2351:41): [True: 0, False: 435]
  ------------------
 2352|       |    /* if not doing HTTP 1.0 or version 2, or disabled explicitly, we add an
 2353|       |       Expect: 100-continue to the headers which actually speeds up post
 2354|       |       operations (as there is one packet coming back from the web server) */
 2355|      0|    curl_off_t client_len = Curl_creader_client_length(data);
 2356|      0|    if(client_len > EXPECT_100_THRESHOLD || client_len < 0) {
  ------------------
  |  |  153|      0|#define EXPECT_100_THRESHOLD (1024 * 1024)
  ------------------
  |  Branch (2356:8): [True: 0, False: 0]
  |  Branch (2356:45): [True: 0, False: 0]
  ------------------
 2357|      0|      result = curlx_dyn_addn(r, STRCONST("Expect: 100-continue\r\n"));
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2358|      0|      if(result)
  ------------------
  |  Branch (2358:10): [True: 0, False: 0]
  ------------------
 2359|      0|        return result;
 2360|      0|      *announced_exp100 = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2361|      0|    }
 2362|      0|  }
 2363|    435|  return CURLE_OK;
 2364|    435|}
http.c:http_add_connection_hd:
 2641|  1.94k|{
 2642|  1.94k|  struct curl_slist *head;
 2643|  1.94k|  const char *sep = "Connection: ";
 2644|  1.94k|  CURLcode result = CURLE_OK;
 2645|  1.94k|  size_t rlen = curlx_dyn_len(req);
 2646|  1.94k|  bool skip;
 2647|       |
 2648|       |  /* Add the 1st custom "Connection: " header, if there is one */
 2649|  2.85k|  for(head = data->set.headers; head; head = head->next) {
  ------------------
  |  Branch (2649:33): [True: 909, False: 1.94k]
  ------------------
 2650|    909|    if(curl_strnequal(head->data, "Connection", 10) &&
  ------------------
  |  Branch (2650:8): [True: 0, False: 909]
  ------------------
 2651|      0|       Curl_headersep(head->data[10]) &&
  ------------------
  |  |   26|    909|#define Curl_headersep(x) ((((x) == ':') || ((x) == ';')))
  |  |  ------------------
  |  |  |  Branch (26:29): [True: 0, False: 0]
  |  |  |  Branch (26:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2652|      0|       !http_header_is_empty(head->data)) {
  ------------------
  |  Branch (2652:8): [True: 0, False: 0]
  ------------------
 2653|      0|      char *value;
 2654|      0|      result = copy_custom_value(head->data, &value);
 2655|      0|      if(result)
  ------------------
  |  Branch (2655:10): [True: 0, False: 0]
  ------------------
 2656|      0|        return result;
 2657|      0|      result = curlx_dyn_addf(req, "%s%s", sep, value);
 2658|      0|      sep = ", ";
 2659|      0|      curlx_free(value);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2660|      0|      break; /* leave, having added 1st one */
 2661|      0|    }
 2662|    909|  }
 2663|       |
 2664|       |  /* add our internal Connection: header values, if we have any */
 2665|  1.94k|  if(!result && data->state.http_hd_te) {
  ------------------
  |  Branch (2665:6): [True: 1.94k, False: 0]
  |  Branch (2665:17): [True: 4, False: 1.94k]
  ------------------
 2666|      4|    result = curlx_dyn_addf(req, "%s%s", sep, "TE");
 2667|      4|    sep = ", ";
 2668|      4|  }
 2669|  1.94k|  if(!result && data->state.http_hd_upgrade) {
  ------------------
  |  Branch (2669:6): [True: 1.94k, False: 0]
  |  Branch (2669:17): [True: 0, False: 1.94k]
  ------------------
 2670|      0|    result = curlx_dyn_addf(req, "%s%s", sep, "Upgrade");
 2671|      0|    sep = ", ";
 2672|      0|  }
 2673|  1.94k|  if(!result && data->state.http_hd_h2_settings) {
  ------------------
  |  Branch (2673:6): [True: 1.94k, False: 0]
  |  Branch (2673:17): [True: 0, False: 1.94k]
  ------------------
 2674|      0|    result = curlx_dyn_addf(req, "%s%s", sep, "HTTP2-Settings");
 2675|      0|  }
 2676|  1.94k|  if(!result && (rlen < curlx_dyn_len(req)))
  ------------------
  |  Branch (2676:6): [True: 1.94k, False: 0]
  |  Branch (2676:17): [True: 4, False: 1.94k]
  ------------------
 2677|      4|    result = curlx_dyn_addn(req, STRCONST("\r\n"));
  ------------------
  |  | 1324|      4|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      4|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 2678|  1.94k|  if(result)
  ------------------
  |  Branch (2678:6): [True: 0, False: 1.94k]
  ------------------
 2679|      0|    return result;
 2680|       |
 2681|       |  /* Add all user-defined Connection: headers after the first */
 2682|  1.94k|  skip = TRUE;
  ------------------
  |  |  986|  1.94k|#define TRUE true
  ------------------
 2683|  2.85k|  for(head = data->set.headers; head; head = head->next) {
  ------------------
  |  Branch (2683:33): [True: 909, False: 1.94k]
  ------------------
 2684|    909|    if(curl_strnequal(head->data, "Connection", 10) &&
  ------------------
  |  Branch (2684:8): [True: 0, False: 909]
  ------------------
 2685|      0|       Curl_headersep(head->data[10]) &&
  ------------------
  |  |   26|    909|#define Curl_headersep(x) ((((x) == ':') || ((x) == ';')))
  |  |  ------------------
  |  |  |  Branch (26:29): [True: 0, False: 0]
  |  |  |  Branch (26:45): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2686|      0|       !http_header_is_empty(head->data)) {
  ------------------
  |  Branch (2686:8): [True: 0, False: 0]
  ------------------
 2687|      0|      if(skip) {
  ------------------
  |  Branch (2687:10): [True: 0, False: 0]
  ------------------
 2688|      0|        skip = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2689|      0|        continue;
 2690|      0|      }
 2691|      0|      result = curlx_dyn_addf(req, "%s\r\n", head->data);
 2692|      0|      if(result)
  ------------------
  |  Branch (2692:10): [True: 0, False: 0]
  ------------------
 2693|      0|        return result;
 2694|      0|    }
 2695|    909|  }
 2696|       |
 2697|  1.94k|  return CURLE_OK;
 2698|  1.94k|}
http.c:http_rw_hd:
 4098|  3.28k|{
 4099|  3.28k|  CURLcode result = CURLE_OK;
 4100|  3.28k|  struct SingleRequest *k = &data->req;
 4101|  3.28k|  int writetype;
 4102|  3.28k|  DEBUGASSERT(!hd[hdlen]); /* null-terminated */
  ------------------
  |  | 1016|  3.28k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4102:3): [True: 0, False: 3.28k]
  |  Branch (4102:3): [True: 3.28k, False: 0]
  ------------------
 4103|       |
 4104|  3.28k|  *pconsumed = 0;
 4105|  3.28k|  if((0x0a == *hd) || (0x0d == *hd)) {
  ------------------
  |  Branch (4105:6): [True: 0, False: 3.28k]
  |  Branch (4105:23): [True: 1.14k, False: 2.14k]
  ------------------
 4106|       |    /* Empty header line means end of headers! */
 4107|  1.14k|    struct dynbuf last_header;
 4108|  1.14k|    size_t consumed;
 4109|       |
 4110|  1.14k|    if((hdlen != 1 || hd[0] != '\n') &&
  ------------------
  |  Branch (4110:9): [True: 1.14k, False: 0]
  |  Branch (4110:23): [True: 0, False: 0]
  ------------------
 4111|  1.14k|       (hdlen != 2 || hd[0] != '\r' || hd[1] != '\n')) {
  ------------------
  |  Branch (4111:9): [True: 0, False: 1.14k]
  |  Branch (4111:23): [True: 0, False: 1.14k]
  |  Branch (4111:40): [True: 0, False: 1.14k]
  ------------------
 4112|      0|      failf(data, "Invalid header termination");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4113|      0|      return CURLE_WEIRD_SERVER_REPLY;
 4114|      0|    }
 4115|       |
 4116|  1.14k|    curlx_dyn_init(&last_header, hdlen + 1);
 4117|  1.14k|    result = curlx_dyn_addn(&last_header, hd, hdlen);
 4118|  1.14k|    if(result)
  ------------------
  |  Branch (4118:8): [True: 0, False: 1.14k]
  ------------------
 4119|      0|      return result;
 4120|       |
 4121|       |    /* analyze the response to find out what to do. */
 4122|       |    /* Caveat: we clear anything in the header brigade, because a
 4123|       |     * response might switch HTTP version which may call use recursively.
 4124|       |     * Not nice, but that is currently the way of things. */
 4125|  1.14k|    curlx_dyn_reset(&data->state.headerb);
 4126|  1.14k|    result = http_on_response(data, curlx_dyn_ptr(&last_header),
 4127|  1.14k|                              curlx_dyn_len(&last_header),
 4128|  1.14k|                              buf_remain, blen, &consumed);
 4129|  1.14k|    *pconsumed += consumed;
 4130|  1.14k|    curlx_dyn_free(&last_header);
 4131|  1.14k|    return result;
 4132|  1.14k|  }
 4133|       |
 4134|       |  /*
 4135|       |   * Checks for special headers coming up.
 4136|       |   */
 4137|       |
 4138|  2.14k|  writetype = CLIENTWRITE_HEADER;
  ------------------
  |  |   45|  2.14k|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
 4139|  2.14k|  if(!k->headerline++) {
  ------------------
  |  Branch (4139:6): [True: 1.14k, False: 997]
  ------------------
 4140|       |    /* This is the first header, it MUST be the error code line
 4141|       |       or else we consider this to be the body right away! */
 4142|  1.14k|    bool fine_statusline = FALSE;
  ------------------
  |  |  989|  1.14k|#define FALSE false
  ------------------
 4143|       |
 4144|  1.14k|    k->httpversion = 0; /* Do not know yet */
 4145|  1.14k|    if(data->conn->scheme->protocol & PROTO_FAMILY_HTTP) {
  ------------------
  |  |   83|  1.14k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|  1.14k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|  1.14k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   62|  1.14k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   84|  1.14k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   63|  1.14k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (4145:8): [True: 1.14k, False: 0]
  ------------------
 4146|       |      /*
 4147|       |       * https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2
 4148|       |       *
 4149|       |       * The response code is always a three-digit number in HTTP as the spec
 4150|       |       * says. We allow any three-digit number here, but we cannot make
 4151|       |       * guarantees on future behaviors since it is not within the protocol.
 4152|       |       */
 4153|  1.14k|      const char *p = hd;
 4154|       |
 4155|  1.14k|      curlx_str_passblanks(&p);
 4156|  1.14k|      if(!strncmp(p, "HTTP/", 5)) {
  ------------------
  |  Branch (4156:10): [True: 1.14k, False: 0]
  ------------------
 4157|  1.14k|        p += 5;
 4158|  1.14k|        switch(*p) {
 4159|      0|        case '1':
  ------------------
  |  Branch (4159:9): [True: 0, False: 1.14k]
  ------------------
 4160|      0|          p++;
 4161|      0|          if((p[0] == '.') && (p[1] == '0' || p[1] == '1')) {
  ------------------
  |  Branch (4161:14): [True: 0, False: 0]
  |  Branch (4161:32): [True: 0, False: 0]
  |  Branch (4161:47): [True: 0, False: 0]
  ------------------
 4162|      0|            if(ISBLANK(p[2])) {
  ------------------
  |  |   43|      0|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  |  Branch (43:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4163|      0|              k->httpversion = (unsigned char)(10 + (p[1] - '0'));
 4164|      0|              p += 3;
 4165|      0|              if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   42|      0|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 0, False: 0]
  |  |  |  Branch (42:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                            if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   42|      0|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 0, False: 0]
  |  |  |  Branch (42:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                            if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   42|      0|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 0, False: 0]
  |  |  |  Branch (42:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4166|      0|                k->httpcode = ((p[0] - '0') * 100) + ((p[1] - '0') * 10) +
 4167|      0|                  (p[2] - '0');
 4168|       |                /* RFC 9112 requires a single space following the status code,
 4169|       |                   but the browsers do not so let's not insist */
 4170|      0|                fine_statusline = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 4171|      0|              }
 4172|      0|            }
 4173|      0|          }
 4174|      0|          if(!fine_statusline) {
  ------------------
  |  Branch (4174:14): [True: 0, False: 0]
  ------------------
 4175|      0|            failf(data, "Unsupported HTTP/1 subversion in response");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4176|      0|            return CURLE_UNSUPPORTED_PROTOCOL;
 4177|      0|          }
 4178|      0|          break;
 4179|      0|        case '2':
  ------------------
  |  Branch (4179:9): [True: 0, False: 1.14k]
  ------------------
 4180|  1.14k|        case '3':
  ------------------
  |  Branch (4180:9): [True: 1.14k, False: 0]
  ------------------
 4181|  1.14k|          if(!ISBLANK(p[1]))
  ------------------
  |  |   43|  1.14k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.14k, False: 0]
  |  |  |  Branch (43:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4182|      0|            break;
 4183|  1.14k|          k->httpversion = (unsigned char)((*p - '0') * 10);
 4184|  1.14k|          p += 2;
 4185|  1.14k|          if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   42|  2.29k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 1.14k, False: 0]
  |  |  |  Branch (42:38): [True: 1.14k, False: 0]
  |  |  ------------------
  ------------------
                        if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   42|  2.29k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 1.14k, False: 0]
  |  |  |  Branch (42:38): [True: 1.14k, False: 0]
  |  |  ------------------
  ------------------
                        if(ISDIGIT(p[0]) && ISDIGIT(p[1]) && ISDIGIT(p[2])) {
  ------------------
  |  |   42|  1.14k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 1.14k, False: 0]
  |  |  |  Branch (42:38): [True: 1.14k, False: 0]
  |  |  ------------------
  ------------------
 4186|  1.14k|            k->httpcode = ((p[0] - '0') * 100) + ((p[1] - '0') * 10) +
 4187|  1.14k|              (p[2] - '0');
 4188|  1.14k|            p += 3;
 4189|  1.14k|            if(!ISBLANK(*p))
  ------------------
  |  |   43|  1.14k|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 1.14k, False: 0]
  |  |  |  Branch (43:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4190|      0|              break;
 4191|  1.14k|            fine_statusline = TRUE;
  ------------------
  |  |  986|  1.14k|#define TRUE true
  ------------------
 4192|  1.14k|          }
 4193|  1.14k|          break;
 4194|  1.14k|        default: /* unsupported */
  ------------------
  |  Branch (4194:9): [True: 0, False: 1.14k]
  ------------------
 4195|      0|          failf(data, "Unsupported HTTP version in response");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4196|      0|          return CURLE_UNSUPPORTED_PROTOCOL;
 4197|  1.14k|        }
 4198|  1.14k|      }
 4199|       |
 4200|  1.14k|      if(!fine_statusline) {
  ------------------
  |  Branch (4200:10): [True: 0, False: 1.14k]
  ------------------
 4201|       |        /* If user has set option HTTP200ALIASES,
 4202|       |           compare header line against list of aliases */
 4203|      0|        statusline check = checkhttpprefix(data, hd, hdlen);
 4204|      0|        if(check == STATUS_DONE) {
  ------------------
  |  Branch (4204:12): [True: 0, False: 0]
  ------------------
 4205|      0|          fine_statusline = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 4206|      0|          k->httpcode = 200;
 4207|      0|          k->httpversion = 10;
 4208|      0|        }
 4209|      0|      }
 4210|  1.14k|    }
 4211|      0|    else if(data->conn->scheme->protocol & CURLPROTO_RTSP) {
  ------------------
  |  | 1106|      0|#define CURLPROTO_RTSP    (1L << 18)
  ------------------
  |  Branch (4211:13): [True: 0, False: 0]
  ------------------
 4212|      0|      const char *p = hd;
 4213|      0|      struct Curl_str ver;
 4214|      0|      curl_off_t status;
 4215|       |      /* we set the max string a little excessive to forgive some leading
 4216|       |         spaces */
 4217|      0|      if(!curlx_str_until(&p, &ver, 32, ' ') &&
  ------------------
  |  Branch (4217:10): [True: 0, False: 0]
  ------------------
 4218|      0|         !curlx_str_single(&p, ' ') &&
  ------------------
  |  Branch (4218:10): [True: 0, False: 0]
  ------------------
 4219|      0|         !curlx_str_number(&p, &status, 999)) {
  ------------------
  |  Branch (4219:10): [True: 0, False: 0]
  ------------------
 4220|      0|        curlx_str_trimblanks(&ver);
 4221|      0|        if(curlx_str_cmp(&ver, "RTSP/1.0")) {
  ------------------
  |  Branch (4221:12): [True: 0, False: 0]
  ------------------
 4222|      0|          k->httpcode = (int)status;
 4223|      0|          fine_statusline = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 4224|      0|          k->httpversion = 11; /* RTSP acts like HTTP 1.1 */
 4225|      0|        }
 4226|      0|      }
 4227|      0|      if(!fine_statusline)
  ------------------
  |  Branch (4227:10): [True: 0, False: 0]
  ------------------
 4228|      0|        return CURLE_WEIRD_SERVER_REPLY;
 4229|      0|    }
 4230|       |
 4231|  1.14k|    if(fine_statusline) {
  ------------------
  |  Branch (4231:8): [True: 1.14k, False: 0]
  ------------------
 4232|  1.14k|      result = http_statusline(data, data->conn);
 4233|  1.14k|      if(result)
  ------------------
  |  Branch (4233:10): [True: 0, False: 1.14k]
  ------------------
 4234|      0|        return result;
 4235|  1.14k|      writetype |= CLIENTWRITE_STATUS;
  ------------------
  |  |   46|  1.14k|#define CLIENTWRITE_STATUS  (1 << 3) /* a special status HEADER */
  ------------------
 4236|  1.14k|    }
 4237|      0|    else {
 4238|      0|      k->header = FALSE;   /* this is not a header line */
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 4239|      0|      return CURLE_WEIRD_SERVER_REPLY;
 4240|      0|    }
 4241|  1.14k|  }
 4242|       |
 4243|  2.14k|  result = Curl_verify_header(data, hd, hdlen);
 4244|  2.14k|  if(result)
  ------------------
  |  Branch (4244:6): [True: 0, False: 2.14k]
  ------------------
 4245|      0|    return result;
 4246|       |
 4247|  2.14k|  result = http_header(data, hd, hdlen);
 4248|  2.14k|  if(result)
  ------------------
  |  Branch (4248:6): [True: 0, False: 2.14k]
  ------------------
 4249|      0|    return result;
 4250|       |
 4251|       |  /*
 4252|       |   * Taken in one (more) header. Write it to the client.
 4253|       |   */
 4254|  2.14k|  Curl_debug(data, CURLINFO_HEADER_IN, hd, hdlen);
 4255|       |
 4256|  2.14k|  if(k->httpcode / 100 == 1)
  ------------------
  |  Branch (4256:6): [True: 1.40k, False: 738]
  ------------------
 4257|  1.40k|    writetype |= CLIENTWRITE_1XX;
  ------------------
  |  |   48|  1.40k|#define CLIENTWRITE_1XX     (1 << 5) /* a 1xx response related HEADER */
  ------------------
 4258|  2.14k|  result = Curl_client_write(data, writetype, hd, hdlen);
 4259|  2.14k|  if(result)
  ------------------
  |  Branch (4259:6): [True: 0, False: 2.14k]
  ------------------
 4260|      0|    return result;
 4261|       |
 4262|  2.14k|  result = Curl_bump_headersize(data, hdlen, FALSE);
  ------------------
  |  |  989|  2.14k|#define FALSE false
  ------------------
 4263|  2.14k|  if(result)
  ------------------
  |  Branch (4263:6): [True: 0, False: 2.14k]
  ------------------
 4264|      0|    return result;
 4265|       |
 4266|  2.14k|  return CURLE_OK;
 4267|  2.14k|}
http.c:http_on_response:
 3963|  1.14k|{
 3964|  1.14k|  struct connectdata *conn = data->conn;
 3965|  1.14k|  CURLcode result = CURLE_OK;
 3966|  1.14k|  struct SingleRequest *k = &data->req;
 3967|  1.14k|  bool conn_changed = FALSE;
  ------------------
  |  |  989|  1.14k|#define FALSE false
  ------------------
 3968|       |
 3969|  1.14k|  (void)buf; /* not used without HTTP2 enabled */
 3970|  1.14k|  *pconsumed = 0;
 3971|       |
 3972|  1.14k|  if(k->upgr101 == UPGR101_RECEIVED) {
  ------------------
  |  Branch (3972:6): [True: 0, False: 1.14k]
  ------------------
 3973|       |    /* supposedly upgraded to http2 now */
 3974|      0|    if(data->req.httpversion != 20)
  ------------------
  |  Branch (3974:8): [True: 0, False: 0]
  ------------------
 3975|      0|      infof(data, "Lying server, not serving HTTP/2");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3976|      0|  }
 3977|       |
 3978|  1.14k|  if(k->httpcode < 200 && last_hd) {
  ------------------
  |  Branch (3978:6): [True: 507, False: 634]
  |  Branch (3978:27): [True: 507, False: 0]
  ------------------
 3979|       |    /* Intermediate responses might trigger processing of more responses,
 3980|       |     * write the last header to the client before proceeding. */
 3981|    507|    result = http_write_header(data, last_hd, last_hd_len);
 3982|    507|    last_hd = NULL; /* handled it */
 3983|    507|    if(result)
  ------------------
  |  Branch (3983:8): [True: 0, False: 507]
  ------------------
 3984|      0|      goto out;
 3985|    507|  }
 3986|       |
 3987|  1.14k|  if(k->httpcode < 100) {
  ------------------
  |  Branch (3987:6): [True: 0, False: 1.14k]
  ------------------
 3988|      0|    failf(data, "Unsupported response code in HTTP response");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3989|      0|    result = CURLE_UNSUPPORTED_PROTOCOL;
 3990|      0|    goto out;
 3991|      0|  }
 3992|  1.14k|  else if(k->httpcode < 200) {
  ------------------
  |  Branch (3992:11): [True: 507, False: 634]
  ------------------
 3993|    507|    result = http_on_1xx_response(data, buf, blen, pconsumed, &conn_changed);
 3994|    507|    goto out;
 3995|    507|  }
 3996|       |
 3997|       |  /* k->httpcode >= 200, final response */
 3998|    634|  k->header = FALSE;
  ------------------
  |  |  989|    634|#define FALSE false
  ------------------
 3999|    634|  if(conn->bits.upgrade_in_progress) {
  ------------------
  |  Branch (3999:6): [True: 0, False: 634]
  ------------------
 4000|       |    /* Asked for protocol upgrade, but it was not selected */
 4001|      0|    conn->bits.upgrade_in_progress = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 4002|      0|    conn_changed = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 4003|      0|  }
 4004|       |
 4005|    634|  if((k->size == -1) && !k->chunk && !conn->bits.close &&
  ------------------
  |  Branch (4005:6): [True: 634, False: 0]
  |  Branch (4005:25): [True: 634, False: 0]
  |  Branch (4005:38): [True: 634, False: 0]
  ------------------
 4006|    634|     (k->httpversion == 11) &&
  ------------------
  |  Branch (4006:6): [True: 0, False: 634]
  ------------------
 4007|      0|     !(conn->scheme->protocol & CURLPROTO_RTSP) &&
  ------------------
  |  | 1106|      0|#define CURLPROTO_RTSP    (1L << 18)
  ------------------
  |  Branch (4007:6): [True: 0, False: 0]
  ------------------
 4008|      0|     data->state.httpreq != HTTPREQ_HEAD) {
  ------------------
  |  Branch (4008:6): [True: 0, False: 0]
  ------------------
 4009|       |    /* On HTTP 1.1, when connection is not to get closed, but no
 4010|       |       Content-Length nor Transfer-Encoding chunked have been received,
 4011|       |       according to RFC2616 section 4.4 point 5, we assume that the server
 4012|       |       will close the connection to signal the end of the document. */
 4013|      0|    infof(data, "no chunk, no close, no size. Assume close to signal end");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4014|      0|    streamclose(conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 4015|      0|  }
 4016|       |
 4017|    634|  http_check_auth_closure(data, conn);
 4018|       |
 4019|    634|#ifndef CURL_DISABLE_WEBSOCKETS
 4020|       |  /* All >=200 HTTP status codes are errors when wanting ws */
 4021|    634|  if(data->req.upgr101 == UPGR101_WS) {
  ------------------
  |  Branch (4021:6): [True: 0, False: 634]
  ------------------
 4022|      0|    failf(data, "Refused WebSocket upgrade: %d", k->httpcode);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4023|      0|    result = CURLE_HTTP_RETURNED_ERROR;
 4024|      0|    goto out;
 4025|      0|  }
 4026|    634|#endif
 4027|       |
 4028|       |  /* Check if this response means the transfer errored. */
 4029|    634|  if(http_should_fail(data, data->req.httpcode)) {
  ------------------
  |  Branch (4029:6): [True: 0, False: 634]
  ------------------
 4030|      0|    failf(data, "The requested URL returned error: %d",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4031|      0|          k->httpcode);
 4032|      0|    result = CURLE_HTTP_RETURNED_ERROR;
 4033|      0|    goto out;
 4034|      0|  }
 4035|       |
 4036|       |  /* Curl_http_auth_act() checks what authentication methods that are
 4037|       |   * available and decides which one (if any) to use. It will set 'newurl' if
 4038|       |   * an auth method was picked. */
 4039|    634|  result = Curl_http_auth_act(data);
 4040|    634|  if(result)
  ------------------
  |  Branch (4040:6): [True: 0, False: 634]
  ------------------
 4041|      0|    goto out;
 4042|       |
 4043|    634|  if(k->httpcode >= 300) {
  ------------------
  |  Branch (4043:6): [True: 38, False: 596]
  ------------------
 4044|     38|    result = http_handle_send_error(data);
 4045|     38|    if(result)
  ------------------
  |  Branch (4045:8): [True: 0, False: 38]
  ------------------
 4046|      0|      goto out;
 4047|     38|  }
 4048|       |
 4049|       |  /* final response without error, prepare to receive the body */
 4050|    634|  result = http_firstwrite(data);
 4051|    634|  if(result)
  ------------------
  |  Branch (4051:6): [True: 5, False: 629]
  ------------------
 4052|      5|    goto out;
 4053|       |
 4054|       |  /* This is the last response that we get for the current request. Check on
 4055|       |   * the body size and determine if the response is complete. */
 4056|    629|  result = http_size(data);
 4057|    629|  if(result)
  ------------------
  |  Branch (4057:6): [True: 0, False: 629]
  ------------------
 4058|      0|    goto out;
 4059|       |
 4060|    629|#ifndef CURL_DISABLE_RTSP
 4061|       |  /* An RTSP response to any method may carry a body, which is announced
 4062|       |     with Content-Length (RFC 2326 section 12.14). Read it instead of
 4063|       |     treating it as excess data, unless the application asked for no body
 4064|       |     with CURLOPT_NOBODY. */
 4065|    629|  if((conn->scheme->protocol & CURLPROTO_RTSP) && data->req.no_body &&
  ------------------
  |  | 1106|    629|#define CURLPROTO_RTSP    (1L << 18)
  ------------------
  |  Branch (4065:6): [True: 0, False: 629]
  |  Branch (4065:51): [True: 0, False: 0]
  ------------------
 4066|      0|     !data->set.opt_no_body && (k->size > 0))
  ------------------
  |  Branch (4066:6): [True: 0, False: 0]
  |  Branch (4066:32): [True: 0, False: 0]
  ------------------
 4067|      0|    data->req.no_body = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 4068|    629|#endif
 4069|       |
 4070|       |  /* If we requested a "no body", this is a good time to get
 4071|       |   * out and return home.
 4072|       |   */
 4073|    629|  if(data->req.no_body)
  ------------------
  |  Branch (4073:6): [True: 7, False: 622]
  ------------------
 4074|      7|    k->download_done = TRUE;
  ------------------
  |  |  986|      7|#define TRUE true
  ------------------
 4075|       |
 4076|       |  /* If max download size is *zero* (nothing) we already have nothing and can
 4077|       |     safely return ok now! For HTTP/2, we would like to call
 4078|       |     http2_handle_stream_close to properly close a stream. In order to do
 4079|       |     this, we keep reading until we close the stream. */
 4080|    629|  if((k->maxdownload == 0) && (k->httpversion_sent < 20))
  ------------------
  |  Branch (4080:6): [True: 0, False: 629]
  |  Branch (4080:31): [True: 0, False: 0]
  ------------------
 4081|      0|    k->download_done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 4082|       |
 4083|  1.14k|out:
 4084|  1.14k|  if(last_hd)
  ------------------
  |  Branch (4084:6): [True: 634, False: 507]
  ------------------
 4085|       |    /* if not written yet, write it now */
 4086|    634|    result = Curl_1st_fatal(result,
 4087|    634|                            http_write_header(data, last_hd, last_hd_len));
 4088|  1.14k|  if(conn_changed)
  ------------------
  |  Branch (4088:6): [True: 0, False: 1.14k]
  ------------------
 4089|       |    /* poke the multi handle to allow pending pipewait to retry */
 4090|      0|    Curl_multi_connchanged(data->multi);
 4091|  1.14k|  return result;
 4092|    629|}
http.c:http_on_1xx_response:
 3822|    507|{
 3823|    507|  struct SingleRequest *k = &data->req;
 3824|       |
 3825|       |  /* "A user agent MAY ignore unexpected 1xx status responses."
 3826|       |   * By default, we expect to get more responses after this one. */
 3827|    507|  k->header = TRUE;
  ------------------
  |  |  986|    507|#define TRUE true
  ------------------
 3828|    507|  k->headerline = 0; /* restart the header line counter */
 3829|       |
 3830|    507|  switch(k->httpcode) {
 3831|      9|  case 100:
  ------------------
  |  Branch (3831:3): [True: 9, False: 498]
  ------------------
 3832|       |    /* We have made an HTTP PUT or POST and this is 1.1-lingo that tells us
 3833|       |     * that the server is OK with this and ready to receive the data. */
 3834|      9|    http_exp100_got100(data);
 3835|      9|    break;
 3836|      0|  case 101:
  ------------------
  |  Branch (3836:3): [True: 0, False: 507]
  ------------------
 3837|      0|    return http_on_101_upgrade(data, buf, blen, pconsumed, conn_changed);
 3838|    498|  default:
  ------------------
  |  Branch (3838:3): [True: 498, False: 9]
  ------------------
 3839|       |    /* The server may send us other 1xx responses, like informative 103. This
 3840|       |     * has no influence on request processing and we expect to receive a
 3841|       |     * final response eventually. */
 3842|    498|    break;
 3843|    507|  }
 3844|    507|  return CURLE_OK;
 3845|    507|}
http.c:http_exp100_got100:
 1534|      9|{
 1535|      9|  struct Curl_creader *r = Curl_creader_get_by_type(data, &cr_exp100);
 1536|      9|  if(r)
  ------------------
  |  Branch (1536:6): [True: 0, False: 9]
  ------------------
 1537|      0|    http_exp100_continue(data, r);
 1538|      9|}
http.c:http_handle_send_error:
 3884|     38|{
 3885|     38|  struct connectdata *conn = data->conn;
 3886|     38|  struct SingleRequest *k = &data->req;
 3887|     38|  CURLcode result = CURLE_OK;
 3888|       |
 3889|     38|  if(!data->req.authneg && !conn->bits.close &&
  ------------------
  |  Branch (3889:6): [True: 38, False: 0]
  |  Branch (3889:28): [True: 38, False: 0]
  ------------------
 3890|     38|     !Curl_creader_will_rewind(data)) {
  ------------------
  |  Branch (3890:6): [True: 38, False: 0]
  ------------------
 3891|       |    /*
 3892|       |     * General treatment of errors when about to send data.
 3893|       |     * Including: "417 Expectation Failed", while waiting for
 3894|       |     * 100-continue.
 3895|       |     *
 3896|       |     * The check for close above is done because if something
 3897|       |     * else has already deemed the connection to get closed then
 3898|       |     * something else should have considered the big picture and
 3899|       |     * we avoid this check.
 3900|       |     */
 3901|       |
 3902|     38|    switch(data->state.httpreq) {
 3903|      0|    case HTTPREQ_PUT:
  ------------------
  |  Branch (3903:5): [True: 0, False: 38]
  ------------------
 3904|      0|    case HTTPREQ_POST:
  ------------------
  |  Branch (3904:5): [True: 0, False: 38]
  ------------------
 3905|      0|    case HTTPREQ_POST_FORM:
  ------------------
  |  Branch (3905:5): [True: 0, False: 38]
  ------------------
 3906|      1|    case HTTPREQ_POST_MIME:
  ------------------
  |  Branch (3906:5): [True: 1, False: 37]
  ------------------
 3907|       |      /* We got an error response. If this happened before the
 3908|       |       * whole request body has been sent we stop sending and
 3909|       |       * mark the connection for closure after we have read the
 3910|       |       * entire response. */
 3911|      1|      if(!Curl_req_done_sending(data)) {
  ------------------
  |  Branch (3911:10): [True: 0, False: 1]
  ------------------
 3912|      0|        if((k->httpcode == 417) && http_exp100_is_selected(data)) {
  ------------------
  |  Branch (3912:12): [True: 0, False: 0]
  |  Branch (3912:36): [True: 0, False: 0]
  ------------------
 3913|       |          /* 417 Expectation Failed - try again without the
 3914|       |             Expect header */
 3915|      0|          if(!k->writebytecount && http_exp100_is_waiting(data)) {
  ------------------
  |  Branch (3915:14): [True: 0, False: 0]
  |  Branch (3915:36): [True: 0, False: 0]
  ------------------
 3916|      0|            infof(data, "Got HTTP failure 417 while waiting for a 100");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3917|      0|          }
 3918|      0|          else {
 3919|      0|            infof(data, "Got HTTP failure 417 while sending data");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3920|      0|            streamclose(conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 3921|      0|            result = http_perhapsrewind(data, conn);
 3922|      0|            if(result)
  ------------------
  |  Branch (3922:16): [True: 0, False: 0]
  ------------------
 3923|      0|              return result;
 3924|      0|          }
 3925|      0|          data->state.disableexpect = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3926|      0|          Curl_req_abort_sending(data);
 3927|      0|          DEBUGASSERT(!data->req.newurl);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3927:11): [True: 0, False: 0]
  |  Branch (3927:11): [True: 0, False: 0]
  ------------------
 3928|      0|          data->req.newurl = Curl_bufref_dup(&data->state.url);
  ------------------
  |  |   49|      0|#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
 3929|      0|          if(!data->req.newurl)
  ------------------
  |  Branch (3929:14): [True: 0, False: 0]
  ------------------
 3930|      0|            return CURLE_OUT_OF_MEMORY;
 3931|      0|        }
 3932|      0|        else if(data->set.http_keep_sending_on_error) {
  ------------------
  |  Branch (3932:17): [True: 0, False: 0]
  ------------------
 3933|      0|          infof(data, "HTTP error before end of send, keep sending");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3934|      0|          http_exp100_send_anyway(data);
 3935|      0|        }
 3936|      0|        else {
 3937|      0|          infof(data, "HTTP error before end of send, stop sending");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3938|      0|          streamclose(conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 3939|      0|          result = Curl_req_abort_sending(data);
 3940|      0|          if(result)
  ------------------
  |  Branch (3940:14): [True: 0, False: 0]
  ------------------
 3941|      0|            return result;
 3942|      0|        }
 3943|      0|      }
 3944|      1|      break;
 3945|       |
 3946|     37|    default: /* default label present to avoid compiler warnings */
  ------------------
  |  Branch (3946:5): [True: 37, False: 1]
  ------------------
 3947|     37|      break;
 3948|     38|    }
 3949|     38|  }
 3950|       |
 3951|     38|  if(Curl_creader_will_rewind(data) && !Curl_req_done_sending(data)) {
  ------------------
  |  Branch (3951:6): [True: 0, False: 38]
  |  Branch (3951:40): [True: 0, False: 0]
  ------------------
 3952|       |    /* We rewind before next send, continue sending now */
 3953|      0|    infof(data, "Keep sending data to get tossed away");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3954|      0|    CURL_REQ_SET_SEND(data);
  ------------------
  |  |   44|      0|#define CURL_REQ_SET_SEND(d)   ((d)->req.io_flags |= REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|      0|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
 3955|      0|  }
 3956|     38|  return result;
 3957|     38|}
http.c:http_firstwrite:
 2580|    634|{
 2581|    634|  struct connectdata *conn = data->conn;
 2582|    634|  struct SingleRequest *k = &data->req;
 2583|       |
 2584|    634|  if(data->req.newurl) {
  ------------------
  |  Branch (2584:6): [True: 0, False: 634]
  ------------------
 2585|      0|    if(conn->bits.close) {
  ------------------
  |  Branch (2585:8): [True: 0, False: 0]
  ------------------
 2586|       |      /* Abort after the headers if "follow Location" is set
 2587|       |         and we are set to close anyway. */
 2588|      0|      CURL_REQ_CLEAR_RECV(data);
  ------------------
  |  |   49|      0|  ((d)->req.io_flags &= (uint8_t)~REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|      0|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
 2589|      0|      k->done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2590|      0|      return CURLE_OK;
 2591|      0|    }
 2592|       |    /* We have a new URL to load, but since we want to be able to reuse this
 2593|       |       connection properly, we read the full response in "ignore more" */
 2594|      0|    k->ignorebody = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2595|      0|    infof(data, "Ignoring the response-body");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2596|      0|  }
 2597|    634|  if(data->state.resume_from && !k->content_range &&
  ------------------
  |  Branch (2597:6): [True: 5, False: 629]
  |  Branch (2597:33): [True: 5, False: 0]
  ------------------
 2598|      5|     (data->state.httpreq == HTTPREQ_GET) &&
  ------------------
  |  Branch (2598:6): [True: 5, False: 0]
  ------------------
 2599|      5|     !k->ignorebody) {
  ------------------
  |  Branch (2599:6): [True: 5, False: 0]
  ------------------
 2600|       |
 2601|      5|    if(k->size == data->state.resume_from) {
  ------------------
  |  Branch (2601:8): [True: 0, False: 5]
  ------------------
 2602|       |      /* The resume point is at the end of file, consider this fine even if it
 2603|       |         does not allow resume from here. */
 2604|      0|      infof(data, "The entire document is already downloaded");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2605|      0|      streamclose(conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 2606|       |      /* Abort download */
 2607|      0|      CURL_REQ_CLEAR_RECV(data);
  ------------------
  |  |   49|      0|  ((d)->req.io_flags &= (uint8_t)~REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|      0|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
 2608|      0|      k->done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2609|      0|      return CURLE_OK;
 2610|      0|    }
 2611|       |
 2612|       |    /* we wanted to resume a download, although the server does not seem to
 2613|       |     * support this and we did this with a GET (if it was not a GET we did a
 2614|       |     * POST or PUT resume) */
 2615|      5|    failf(data, "HTTP server does not seem to support "
  ------------------
  |  |   62|      5|#define failf Curl_failf
  ------------------
 2616|      5|          "byte ranges. Cannot resume.");
 2617|      5|    return CURLE_RANGE_ERROR;
 2618|      5|  }
 2619|       |
 2620|    629|  if(data->set.timecondition && !data->state.range &&
  ------------------
  |  Branch (2620:6): [True: 0, False: 629]
  |  Branch (2620:33): [True: 0, False: 0]
  ------------------
 2621|       |     /* A time condition has been set AND no ranges have been requested. This
 2622|       |        seems to be what chapter 13.3.4 of RFC 2616 defines to be the correct
 2623|       |        action for an HTTP/1.1 client */
 2624|      0|     !Curl_meets_timecondition(data, k->timeofdoc)) {
  ------------------
  |  Branch (2624:6): [True: 0, False: 0]
  ------------------
 2625|      0|    k->done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2626|       |    /* We are simulating an HTTP 304 from server so we return
 2627|       |       what should have been returned from the server */
 2628|      0|    data->info.httpcode = 304;
 2629|      0|    infof(data, "Simulate an HTTP 304 response");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2630|       |    /* we abort the transfer before it is completed == we ruin the
 2631|       |       reuse ability. Close the connection */
 2632|      0|    streamclose(conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 2633|      0|    return CURLE_OK;
 2634|      0|  } /* we have a time condition */
 2635|       |
 2636|    629|  return CURLE_OK;
 2637|    629|}
http.c:http_size:
 3674|    629|{
 3675|    629|  struct SingleRequest *k = &data->req;
 3676|    629|  if(data->req.ignore_cl || k->chunk) {
  ------------------
  |  Branch (3676:6): [True: 0, False: 629]
  |  Branch (3676:29): [True: 0, False: 629]
  ------------------
 3677|      0|    k->size = k->maxdownload = -1;
 3678|      0|  }
 3679|    629|  else if(k->size != -1) {
  ------------------
  |  Branch (3679:11): [True: 0, False: 629]
  ------------------
 3680|      0|    if(data->set.max_filesize &&
  ------------------
  |  Branch (3680:8): [True: 0, False: 0]
  ------------------
 3681|      0|       !k->ignorebody &&
  ------------------
  |  Branch (3681:8): [True: 0, False: 0]
  ------------------
 3682|      0|       (k->size > data->set.max_filesize)) {
  ------------------
  |  Branch (3682:8): [True: 0, False: 0]
  ------------------
 3683|      0|      failf(data, "Maximum file size exceeded");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3684|      0|      return CURLE_FILESIZE_EXCEEDED;
 3685|      0|    }
 3686|      0|    if(k->ignorebody)
  ------------------
  |  Branch (3686:8): [True: 0, False: 0]
  ------------------
 3687|      0|      infof(data, "setting size while ignoring");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3688|      0|    Curl_pgrsSetDownloadSize(data, k->size);
 3689|      0|    k->maxdownload = k->size;
 3690|      0|  }
 3691|    629|  return CURLE_OK;
 3692|    629|}
http.c:http_statusline:
 3584|  1.14k|{
 3585|  1.14k|  struct SingleRequest *k = &data->req;
 3586|       |
 3587|  1.14k|  switch(k->httpversion) {
 3588|      0|  case 10:
  ------------------
  |  Branch (3588:3): [True: 0, False: 1.14k]
  ------------------
 3589|      0|  case 11:
  ------------------
  |  Branch (3589:3): [True: 0, False: 1.14k]
  ------------------
 3590|      0|#ifdef USE_HTTP2
 3591|      0|  case 20:
  ------------------
  |  Branch (3591:3): [True: 0, False: 1.14k]
  ------------------
 3592|      0|#endif
 3593|      0|#ifdef USE_HTTP3
 3594|  1.14k|  case 30:
  ------------------
  |  Branch (3594:3): [True: 1.14k, False: 0]
  ------------------
 3595|  1.14k|#endif
 3596|       |    /* no major version switch mid-connection */
 3597|  1.14k|    if(k->httpversion_sent &&
  ------------------
  |  Branch (3597:8): [True: 1.14k, False: 0]
  ------------------
 3598|  1.14k|       (k->httpversion / 10 != k->httpversion_sent / 10)) {
  ------------------
  |  Branch (3598:8): [True: 0, False: 1.14k]
  ------------------
 3599|      0|      failf(data, "Version mismatch (from HTTP/%d to HTTP/%d)",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3600|      0|            k->httpversion_sent / 10, k->httpversion / 10);
 3601|      0|      return CURLE_WEIRD_SERVER_REPLY;
 3602|      0|    }
 3603|  1.14k|    break;
 3604|  1.14k|  default:
  ------------------
  |  Branch (3604:3): [True: 0, False: 1.14k]
  ------------------
 3605|      0|    failf(data, "Unsupported HTTP version (%d.%d) in response",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3606|      0|          k->httpversion / 10, k->httpversion % 10);
 3607|      0|    return CURLE_UNSUPPORTED_PROTOCOL;
 3608|  1.14k|  }
 3609|       |
 3610|  1.14k|  data->info.httpcode = k->httpcode;
 3611|  1.14k|  data->info.httpversion = k->httpversion;
 3612|  1.14k|  conn->httpversion_seen = k->httpversion;
 3613|       |
 3614|  1.14k|  if(!data->state.http_neg.rcvd_min ||
  ------------------
  |  Branch (3614:6): [True: 881, False: 266]
  ------------------
 3615|    266|     data->state.http_neg.rcvd_min > k->httpversion)
  ------------------
  |  Branch (3615:6): [True: 0, False: 266]
  ------------------
 3616|       |    /* store the lowest server version we encounter */
 3617|    881|    data->state.http_neg.rcvd_min = k->httpversion;
 3618|       |
 3619|       |  /*
 3620|       |   * This code executes as part of processing the header. As a
 3621|       |   * result, it is not totally clear how to interpret the
 3622|       |   * response code yet as that depends on what other headers may
 3623|       |   * be present. 401 and 407 may be errors, but may be OK
 3624|       |   * depending on how authentication is working. Other codes
 3625|       |   * are definitely errors, so give up here.
 3626|       |   */
 3627|  1.14k|  if(data->state.resume_from && data->state.httpreq == HTTPREQ_GET &&
  ------------------
  |  Branch (3627:6): [True: 5, False: 1.14k]
  |  Branch (3627:33): [True: 5, False: 0]
  ------------------
 3628|      5|     k->httpcode == 416) {
  ------------------
  |  Branch (3628:6): [True: 0, False: 5]
  ------------------
 3629|       |    /* "Requested Range Not Satisfiable", proceed and pretend this is no
 3630|       |       error */
 3631|      0|    k->ignorebody = TRUE; /* Avoid appending error msg to good data. */
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3632|      0|  }
 3633|       |
 3634|  1.14k|  if(k->httpversion == 10) {
  ------------------
  |  Branch (3634:6): [True: 0, False: 1.14k]
  ------------------
 3635|       |    /* Default action for HTTP/1.0 must be to close, unless
 3636|       |       we get one of those fancy headers that tell us the
 3637|       |       server keeps it open for us! */
 3638|      0|    infof(data, "HTTP 1.0, assume close after body");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3639|      0|    connclose(conn);
  ------------------
  |  |   72|      0|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   66|      0|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
 3640|      0|  }
 3641|       |
 3642|  1.14k|  k->http_bodyless = k->httpcode >= 100 && k->httpcode < 200;
  ------------------
  |  Branch (3642:22): [True: 1.14k, False: 0]
  |  Branch (3642:44): [True: 511, False: 636]
  ------------------
 3643|  1.14k|  switch(k->httpcode) {
 3644|      0|  case 304:
  ------------------
  |  Branch (3644:3): [True: 0, False: 1.14k]
  ------------------
 3645|       |    /* (quote from RFC2616, section 10.3.5): The 304 response
 3646|       |     * MUST NOT contain a message-body, and thus is always
 3647|       |     * terminated by the first empty line after the header
 3648|       |     * fields. */
 3649|      0|    if(data->set.timecondition)
  ------------------
  |  Branch (3649:8): [True: 0, False: 0]
  ------------------
 3650|      0|      data->info.timecond = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3651|      0|    FALLTHROUGH();
  ------------------
  |  |  752|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
 3652|      0|  case 204:
  ------------------
  |  Branch (3652:3): [True: 0, False: 1.14k]
  ------------------
 3653|       |    /* (quote from RFC2616, section 10.2.5): The server has
 3654|       |     * fulfilled the request but does not need to return an
 3655|       |     * entity-body ... The 204 response MUST NOT include a
 3656|       |     * message-body, and thus is always terminated by the first
 3657|       |     * empty line after the header fields. */
 3658|      0|    k->size = 0;
 3659|      0|    k->maxdownload = 0;
 3660|      0|    k->http_bodyless = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3661|      0|    break;
 3662|  1.14k|  default:
  ------------------
  |  Branch (3662:3): [True: 1.14k, False: 0]
  ------------------
 3663|  1.14k|    break;
 3664|  1.14k|  }
 3665|  1.14k|  return CURLE_OK;
 3666|  1.14k|}
http.c:http_header:
 3532|  2.14k|{
 3533|  2.14k|  CURLcode result = CURLE_OK;
 3534|       |
 3535|  2.14k|  switch(hd[0]) {
  ------------------
  |  Branch (3535:10): [True: 100, False: 2.04k]
  ------------------
 3536|     57|  case 'a':
  ------------------
  |  Branch (3536:3): [True: 57, False: 2.08k]
  ------------------
 3537|     57|  case 'A':
  ------------------
  |  Branch (3537:3): [True: 0, False: 2.14k]
  ------------------
 3538|     57|    result = http_header_a(data, hd, hdlen);
 3539|     57|    break;
 3540|     24|  case 'c':
  ------------------
  |  Branch (3540:3): [True: 24, False: 2.12k]
  ------------------
 3541|     24|  case 'C':
  ------------------
  |  Branch (3541:3): [True: 0, False: 2.14k]
  ------------------
 3542|     24|    result = http_header_c(data, hd, hdlen);
 3543|     24|    break;
 3544|     11|  case 'l':
  ------------------
  |  Branch (3544:3): [True: 11, False: 2.13k]
  ------------------
 3545|     11|  case 'L':
  ------------------
  |  Branch (3545:3): [True: 0, False: 2.14k]
  ------------------
 3546|     11|    result = http_header_l(data, hd, hdlen);
 3547|     11|    break;
 3548|      0|  case 'p':
  ------------------
  |  Branch (3548:3): [True: 0, False: 2.14k]
  ------------------
 3549|      0|  case 'P':
  ------------------
  |  Branch (3549:3): [True: 0, False: 2.14k]
  ------------------
 3550|      0|    result = http_header_p(data, hd, hdlen);
 3551|      0|    break;
 3552|      0|  case 'r':
  ------------------
  |  Branch (3552:3): [True: 0, False: 2.14k]
  ------------------
 3553|      0|  case 'R':
  ------------------
  |  Branch (3553:3): [True: 0, False: 2.14k]
  ------------------
 3554|      0|    result = http_header_r(data, hd, hdlen);
 3555|      0|    break;
 3556|      0|  case 's':
  ------------------
  |  Branch (3556:3): [True: 0, False: 2.14k]
  ------------------
 3557|      0|  case 'S':
  ------------------
  |  Branch (3557:3): [True: 0, False: 2.14k]
  ------------------
 3558|      0|    result = http_header_s(data, hd, hdlen);
 3559|      0|    break;
 3560|      7|  case 't':
  ------------------
  |  Branch (3560:3): [True: 7, False: 2.13k]
  ------------------
 3561|      7|  case 'T':
  ------------------
  |  Branch (3561:3): [True: 0, False: 2.14k]
  ------------------
 3562|      7|    result = http_header_t(data, hd, hdlen);
 3563|      7|    break;
 3564|      1|  case 'w':
  ------------------
  |  Branch (3564:3): [True: 1, False: 2.14k]
  ------------------
 3565|      1|  case 'W':
  ------------------
  |  Branch (3565:3): [True: 0, False: 2.14k]
  ------------------
 3566|      1|    result = http_header_w(data, hd, hdlen);
 3567|      1|    break;
 3568|  2.14k|  }
 3569|       |
 3570|  2.14k|  if(!result) {
  ------------------
  |  Branch (3570:6): [True: 2.14k, False: 0]
  ------------------
 3571|  2.14k|    struct connectdata *conn = data->conn;
 3572|  2.14k|    if(conn->scheme->protocol & CURLPROTO_RTSP)
  ------------------
  |  | 1106|  2.14k|#define CURLPROTO_RTSP    (1L << 18)
  ------------------
  |  Branch (3572:8): [True: 0, False: 2.14k]
  ------------------
 3573|      0|      result = Curl_rtsp_parseheader(data, hd);
 3574|  2.14k|  }
 3575|  2.14k|  return result;
 3576|  2.14k|}
http.c:http_header_a:
 3050|     57|{
 3051|     57|#ifndef CURL_DISABLE_ALTSVC
 3052|     57|  const char *v;
 3053|     57|  v = (data->asi &&
  ------------------
  |  Branch (3053:8): [True: 57, False: 0]
  ------------------
 3054|     57|       (Curl_xfer_is_secure(data) ||
  ------------------
  |  Branch (3054:9): [True: 57, False: 0]
  ------------------
 3055|      0|#ifdef DEBUGBUILD
 3056|       |        /* allow debug builds to circumvent the HTTPS restriction */
 3057|      0|        getenv("CURL_ALTSVC_HTTP")
  ------------------
  |  Branch (3057:9): [True: 0, False: 0]
  ------------------
 3058|       |#else
 3059|       |        0
 3060|       |#endif
 3061|     57|         )) ? HD_VAL(hd, hdlen, "Alt-Svc:") : NULL;
  ------------------
  |  | 3035|     57|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3035:5): [True: 57, False: 0]
  |  |  |  Branch (3035:37): [True: 57, False: 0]
  |  |  ------------------
  |  | 3036|     57|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3036:5): [True: 0, False: 57]
  |  |  ------------------
  ------------------
 3062|     57|  if(v) {
  ------------------
  |  Branch (3062:6): [True: 0, False: 57]
  ------------------
 3063|       |    /* the ALPN of the current request */
 3064|      0|    struct SingleRequest *k = &data->req;
 3065|      0|    enum alpnid id = (k->httpversion == 30) ? ALPN_h3 :
  ------------------
  |  Branch (3065:22): [True: 0, False: 0]
  ------------------
 3066|      0|      (k->httpversion == 20) ? ALPN_h2 : ALPN_h1;
  ------------------
  |  Branch (3066:7): [True: 0, False: 0]
  ------------------
 3067|      0|    return Curl_altsvc_parse(data, data->asi, v, data->state.origin, id);
 3068|      0|  }
 3069|       |#else
 3070|       |  (void)data;
 3071|       |  (void)hd;
 3072|       |  (void)hdlen;
 3073|       |#endif
 3074|     57|  return CURLE_OK;
 3075|     57|}
http.c:http_header_c:
 3082|     24|{
 3083|     24|  struct connectdata *conn = data->conn;
 3084|     24|  struct SingleRequest *k = &data->req;
 3085|     24|  const char *v;
 3086|       |
 3087|       |  /* Check for Content-Length: header lines to get size. Browsers insist we
 3088|       |     should accept multiple Content-Length headers and that a comma separated
 3089|       |     list also is fine and then we should accept them all as long as they are
 3090|       |     the same value. Different values trigger error.
 3091|       |   */
 3092|     24|  v = (!k->http_bodyless && !data->set.ignorecl && !k->ignore_cl) ?
  ------------------
  |  Branch (3092:8): [True: 6, False: 18]
  |  Branch (3092:29): [True: 6, False: 0]
  |  Branch (3092:52): [True: 6, False: 0]
  ------------------
 3093|     24|    HD_VAL(hd, hdlen, "Content-Length:") : NULL;
  ------------------
  |  | 3035|      6|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3035:5): [True: 6, False: 0]
  |  |  |  Branch (3035:37): [True: 6, False: 0]
  |  |  ------------------
  |  | 3036|      6|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3036:5): [True: 0, False: 6]
  |  |  ------------------
  ------------------
 3094|     24|  if(v) {
  ------------------
  |  Branch (3094:6): [True: 0, False: 24]
  ------------------
 3095|      0|    do {
 3096|      0|      curl_off_t contentlength;
 3097|      0|      int offt = curlx_str_numblanks(&v, &contentlength);
 3098|       |
 3099|      0|      if(offt == STRE_OVERFLOW) {
  ------------------
  |  |   35|      0|#define STRE_OVERFLOW 7
  ------------------
  |  Branch (3099:10): [True: 0, False: 0]
  ------------------
 3100|       |        /* out of range */
 3101|      0|        if(data->set.max_filesize) {
  ------------------
  |  Branch (3101:12): [True: 0, False: 0]
  ------------------
 3102|      0|          failf(data, "Maximum file size exceeded");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3103|      0|          return CURLE_FILESIZE_EXCEEDED;
 3104|      0|        }
 3105|      0|        streamclose(conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 3106|      0|        infof(data, "Overflow Content-Length: value");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3107|      0|        return CURLE_OK;
 3108|      0|      }
 3109|      0|      else {
 3110|      0|        if((offt == STRE_OK) &&
  ------------------
  |  |   28|      0|#define STRE_OK       0
  ------------------
  |  Branch (3110:12): [True: 0, False: 0]
  ------------------
 3111|      0|           ((k->size == -1) || /* not set to something before */
  ------------------
  |  Branch (3111:13): [True: 0, False: 0]
  ------------------
 3112|      0|            (k->size == contentlength))) { /* or the same value */
  ------------------
  |  Branch (3112:13): [True: 0, False: 0]
  ------------------
 3113|       |
 3114|      0|          k->size = contentlength;
 3115|      0|          curlx_str_passblanks(&v);
 3116|       |
 3117|       |          /* on a comma, loop and get the next instead */
 3118|      0|          if(!curlx_str_single(&v, ','))
  ------------------
  |  Branch (3118:14): [True: 0, False: 0]
  ------------------
 3119|      0|            continue;
 3120|       |
 3121|      0|          if(!curlx_str_newline(&v)) {
  ------------------
  |  Branch (3121:14): [True: 0, False: 0]
  ------------------
 3122|      0|            k->maxdownload = k->size;
 3123|      0|            return CURLE_OK;
 3124|      0|          }
 3125|      0|        }
 3126|       |        /* negative, different value or rubbish - bad HTTP */
 3127|      0|        failf(data, "Invalid Content-Length: value");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3128|      0|        return CURLE_WEIRD_SERVER_REPLY;
 3129|      0|      }
 3130|      0|    } while(1);
  ------------------
  |  Branch (3130:13): [True: 0, Folded]
  ------------------
 3131|      0|  }
 3132|     24|  v = (!k->http_bodyless && CURL_EASY_STR(data, STRING_ENCODING)) ?
  ------------------
  |  | 1206|      6|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 6]
  |  |  ------------------
  ------------------
  |  Branch (3132:8): [True: 6, False: 18]
  ------------------
 3133|     24|    HD_VAL(hd, hdlen, "Content-Encoding:") : NULL;
  ------------------
  |  | 3035|      0|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3035:5): [True: 0, False: 0]
  |  |  |  Branch (3035:37): [True: 0, False: 0]
  |  |  ------------------
  |  | 3036|      0|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3036:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3134|     24|  if(v) {
  ------------------
  |  Branch (3134:6): [True: 0, False: 24]
  ------------------
 3135|       |    /*
 3136|       |     * Process Content-Encoding. Look for the values: identity, gzip, deflate,
 3137|       |     * compress, x-gzip and x-compress. x-gzip and x-compress are the same as
 3138|       |     * gzip and compress. (Sec 3.5 RFC 2616). zlib cannot handle compress.
 3139|       |     * Errors are handled further down when the response body is processed
 3140|       |     */
 3141|      0|    return Curl_build_unencoding_stack(data, v, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 3142|      0|  }
 3143|       |  /* check for Content-Type: header lines to get the MIME-type */
 3144|     24|  v = HD_VAL(hd, hdlen, "Content-Type:");
  ------------------
  |  | 3035|     24|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3035:5): [True: 22, False: 2]
  |  |  |  Branch (3035:37): [True: 22, False: 0]
  |  |  ------------------
  |  | 3036|     24|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3036:5): [True: 18, False: 4]
  |  |  ------------------
  ------------------
 3145|     24|  if(v) {
  ------------------
  |  Branch (3145:6): [True: 18, False: 6]
  ------------------
 3146|     18|    char *contenttype = Curl_copy_header_value(hd);
 3147|     18|    if(!contenttype)
  ------------------
  |  Branch (3147:8): [True: 0, False: 18]
  ------------------
 3148|      0|      return CURLE_OUT_OF_MEMORY;
 3149|     18|    if(!*contenttype)
  ------------------
  |  Branch (3149:8): [True: 13, False: 5]
  ------------------
 3150|       |      /* ignore empty data */
 3151|     13|      curlx_free(contenttype);
  ------------------
  |  | 1503|     13|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3152|      5|    else {
 3153|      5|      curlx_free(data->info.contenttype);
  ------------------
  |  | 1503|      5|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3154|      5|      data->info.contenttype = contenttype;
 3155|      5|    }
 3156|     18|    return CURLE_OK;
 3157|     18|  }
 3158|      6|  if((k->httpversion < 20) &&
  ------------------
  |  Branch (3158:6): [True: 0, False: 6]
  ------------------
 3159|      0|     HD_IS_AND_SAYS(hd, hdlen, "Connection:", "close")) {
  ------------------
  |  | 3041|      0|  (HD_IS(hd, hdlen, n) && \
  |  |  ------------------
  |  |  |  | 3032|      0|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3032:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (3032:36): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3042|      0|   ((hdlen) > ((sizeof(n) - 1) + (sizeof(v) - 1))) && \
  |  |  ------------------
  |  |  |  Branch (3042:4): [True: 0, False: 0]
  |  |  ------------------
  |  | 3043|      0|   Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                  Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3043:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3160|       |    /*
 3161|       |     * [RFC 2616, section 8.1.2.1]
 3162|       |     * "Connection: close" is HTTP/1.1 language and means that
 3163|       |     * the connection will close when this request has been
 3164|       |     * served.
 3165|       |     */
 3166|      0|    connclose(conn);
  ------------------
  |  |   72|      0|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   66|      0|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
 3167|      0|    return CURLE_OK;
 3168|      0|  }
 3169|      6|  if((k->httpversion == 10) &&
  ------------------
  |  Branch (3169:6): [True: 0, False: 6]
  ------------------
 3170|      0|     HD_IS_AND_SAYS(hd, hdlen, "Connection:", "keep-alive")) {
  ------------------
  |  | 3041|      0|  (HD_IS(hd, hdlen, n) && \
  |  |  ------------------
  |  |  |  | 3032|      0|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (3032:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (3032:36): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3042|      0|   ((hdlen) > ((sizeof(n) - 1) + (sizeof(v) - 1))) && \
  |  |  ------------------
  |  |  |  Branch (3042:4): [True: 0, False: 0]
  |  |  ------------------
  |  | 3043|      0|   Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                  Curl_compareheader(hd, STRCONST(n), STRCONST(v)))
  |  |  ------------------
  |  |  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (3043:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3171|       |    /*
 3172|       |     * An HTTP/1.0 reply with the 'Connection: keep-alive' line
 3173|       |     * tells us the connection will be kept alive for our
 3174|       |     * pleasure. Default action for 1.0 is to close.
 3175|       |     *
 3176|       |     * [RFC2068, section 19.7.1] */
 3177|      0|    connkeep(conn);
  ------------------
  |  |   73|      0|#define connkeep(x)    Curl_conncontrol((x), CONNCTRL_CONN_KEEP)
  |  |  ------------------
  |  |  |  |   65|      0|#define CONNCTRL_CONN_KEEP       0
  |  |  ------------------
  ------------------
 3178|      0|    infof(data, "HTTP/1.0 connection set to keep alive");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3179|      0|    return CURLE_OK;
 3180|      0|  }
 3181|      6|  v = !k->http_bodyless ? HD_VAL(hd, hdlen, "Content-Range:") : NULL;
  ------------------
  |  | 3035|      2|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3035:5): [True: 2, False: 0]
  |  |  |  Branch (3035:37): [True: 2, False: 0]
  |  |  ------------------
  |  | 3036|      2|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3036:5): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  |  Branch (3181:7): [True: 2, False: 4]
  ------------------
 3182|      6|  if(v) {
  ------------------
  |  Branch (3182:6): [True: 0, False: 6]
  ------------------
 3183|       |    /* Content-Range: bytes [num]-
 3184|       |       Content-Range: bytes: [num]-
 3185|       |       Content-Range: [num]-
 3186|       |       Content-Range: [asterisk]/[total]
 3187|       |
 3188|       |       The second format was added since Sun's webserver
 3189|       |       JavaWebServer/1.1.1 obviously sends the header this way!
 3190|       |       The third added since some servers use that!
 3191|       |       The fourth means the requested range was unsatisfied.
 3192|       |     */
 3193|       |
 3194|      0|    const char *ptr = v;
 3195|       |
 3196|       |    /* Move forward until first digit or asterisk */
 3197|      0|    while(*ptr && !ISDIGIT(*ptr) && *ptr != '*')
  ------------------
  |  |   42|      0|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 0, False: 0]
  |  |  |  Branch (42:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3197:11): [True: 0, False: 0]
  |  Branch (3197:37): [True: 0, False: 0]
  ------------------
 3198|      0|      ptr++;
 3199|       |
 3200|       |    /* if it truly stopped on a digit */
 3201|      0|    if(ISDIGIT(*ptr)) {
  ------------------
  |  |   42|      0|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 0, False: 0]
  |  |  |  Branch (42:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3202|      0|      if(!curlx_str_number(&ptr, &k->offset, CURL_OFF_T_MAX) &&
  ------------------
  |  |  539|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (3202:10): [True: 0, False: 0]
  ------------------
 3203|      0|         (data->state.resume_from == k->offset))
  ------------------
  |  Branch (3203:10): [True: 0, False: 0]
  ------------------
 3204|       |        /* we asked for a resume and we got it */
 3205|      0|        k->content_range = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3206|      0|    }
 3207|      0|    else if(*ptr == '*' && ptr[1] == '/' && k->httpcode == 416 &&
  ------------------
  |  Branch (3207:13): [True: 0, False: 0]
  |  Branch (3207:28): [True: 0, False: 0]
  |  Branch (3207:45): [True: 0, False: 0]
  ------------------
 3208|      0|            data->state.resume_from && data->state.httpreq == HTTPREQ_GET) {
  ------------------
  |  Branch (3208:13): [True: 0, False: 0]
  |  Branch (3208:40): [True: 0, False: 0]
  ------------------
 3209|      0|      curl_off_t total;
 3210|      0|      ptr += 2;
 3211|      0|      if(!curlx_str_number(&ptr, &total, CURL_OFF_T_MAX)) {
  ------------------
  |  |  539|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (3211:10): [True: 0, False: 0]
  ------------------
 3212|      0|        while(ISBLANK(*ptr))
  ------------------
  |  |   43|      0|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  |  Branch (43:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3213|      0|          ptr++;
 3214|      0|        if((*ptr == '\r' || *ptr == '\n' || !*ptr) &&
  ------------------
  |  Branch (3214:13): [True: 0, False: 0]
  |  Branch (3214:29): [True: 0, False: 0]
  |  Branch (3214:45): [True: 0, False: 0]
  ------------------
 3215|      0|           total != data->state.resume_from) {
  ------------------
  |  Branch (3215:12): [True: 0, False: 0]
  ------------------
 3216|      0|          failf(data, "Cannot resume: remote file size differs from offset");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3217|      0|          return CURLE_RANGE_ERROR;
 3218|      0|        }
 3219|      0|      }
 3220|      0|    }
 3221|      0|    else if(k->httpcode < 300)
  ------------------
  |  Branch (3221:13): [True: 0, False: 0]
  ------------------
 3222|      0|      data->state.resume_from = 0; /* get everything */
 3223|      0|  }
 3224|      6|  return CURLE_OK;
 3225|      6|}
http.c:http_header_l:
 3232|     11|{
 3233|     11|  struct connectdata *conn = data->conn;
 3234|     11|  struct SingleRequest *k = &data->req;
 3235|     11|  const char *v = (!k->http_bodyless &&
  ------------------
  |  Branch (3235:20): [True: 3, False: 8]
  ------------------
 3236|      3|                   (data->set.timecondition || data->set.get_filetime)) ?
  ------------------
  |  Branch (3236:21): [True: 0, False: 3]
  |  Branch (3236:48): [True: 0, False: 3]
  ------------------
 3237|     11|    HD_VAL(hd, hdlen, "Last-Modified:") : NULL;
  ------------------
  |  | 3035|      0|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3035:5): [True: 0, False: 0]
  |  |  |  Branch (3035:37): [True: 0, False: 0]
  |  |  ------------------
  |  | 3036|      0|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3036:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3238|     11|  if(v) {
  ------------------
  |  Branch (3238:6): [True: 0, False: 11]
  ------------------
 3239|      0|    if(Curl_getdate_capped(v, &k->timeofdoc))
  ------------------
  |  Branch (3239:8): [True: 0, False: 0]
  ------------------
 3240|      0|      k->timeofdoc = 0;
 3241|      0|    if(data->set.get_filetime)
  ------------------
  |  Branch (3241:8): [True: 0, False: 0]
  ------------------
 3242|      0|      data->info.filetime = k->timeofdoc;
 3243|      0|    return CURLE_OK;
 3244|      0|  }
 3245|     11|  if(HD_IS(hd, hdlen, "Location:") && (k->httpcode/100 >= 2)) {
  ------------------
  |  | 3032|     22|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  ------------------
  |  |  |  Branch (3032:4): [True: 10, False: 1]
  |  |  |  Branch (3032:36): [True: 0, False: 10]
  |  |  ------------------
  ------------------
  |  Branch (3245:39): [True: 0, False: 0]
  ------------------
 3246|       |    /* this is the URL that the server advises us to use instead */
 3247|      0|    char *location = Curl_copy_header_value(hd);
 3248|      0|    if(!location)
  ------------------
  |  Branch (3248:8): [True: 0, False: 0]
  ------------------
 3249|      0|      return CURLE_OUT_OF_MEMORY;
 3250|      0|    if(!*location ||
  ------------------
  |  Branch (3250:8): [True: 0, False: 0]
  ------------------
 3251|      0|       (data->req.location && !strcmp(data->req.location, location))) {
  ------------------
  |  Branch (3251:9): [True: 0, False: 0]
  |  Branch (3251:31): [True: 0, False: 0]
  ------------------
 3252|       |      /* ignore empty header, or exact repeat of a previous one */
 3253|      0|      curlx_free(location);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3254|      0|      return CURLE_OK;
 3255|      0|    }
 3256|      0|    else {
 3257|       |      /* has value and is not an exact repeat */
 3258|      0|      if(data->req.location) {
  ------------------
  |  Branch (3258:10): [True: 0, False: 0]
  ------------------
 3259|      0|        failf(data, "Multiple Location headers");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3260|      0|        curlx_free(location);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3261|      0|        return CURLE_WEIRD_SERVER_REPLY;
 3262|      0|      }
 3263|      0|      data->req.location = location;
 3264|       |
 3265|      0|      if(data->set.http_follow_mode && (k->httpcode/100 == 3)) {
  ------------------
  |  Branch (3265:10): [True: 0, False: 0]
  |  Branch (3265:40): [True: 0, False: 0]
  ------------------
 3266|      0|        CURLcode result;
 3267|      0|        DEBUGASSERT(!data->req.newurl);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3267:9): [True: 0, False: 0]
  |  Branch (3267:9): [True: 0, False: 0]
  ------------------
 3268|      0|        data->req.newurl = curlx_strdup(data->req.location); /* clone */
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 3269|      0|        if(!data->req.newurl)
  ------------------
  |  Branch (3269:12): [True: 0, False: 0]
  ------------------
 3270|      0|          return CURLE_OUT_OF_MEMORY;
 3271|       |
 3272|       |        /* some cases of POST and PUT etc needs to rewind the data
 3273|       |           stream at this point */
 3274|      0|        result = http_perhapsrewind(data, conn);
 3275|      0|        if(result)
  ------------------
  |  Branch (3275:12): [True: 0, False: 0]
  ------------------
 3276|      0|          return result;
 3277|       |
 3278|       |        /* mark the next request as a followed location: */
 3279|      0|        data->state.this_is_a_follow = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3280|      0|      }
 3281|      0|    }
 3282|      0|  }
 3283|     11|  return CURLE_OK;
 3284|     11|}
http.c:http_header_t:
 3464|      7|{
 3465|      7|  struct connectdata *conn = data->conn;
 3466|      7|  struct SingleRequest *k = &data->req;
 3467|       |
 3468|       |  /* RFC 9112, ch. 6.1
 3469|       |   * "Transfer-Encoding MAY be sent in a response to a HEAD request or
 3470|       |   *  in a 304 (Not Modified) response (Section 15.4.5 of [HTTP]) to a
 3471|       |   *  GET request, neither of which includes a message body, to indicate
 3472|       |   *  that the origin server would have applied a transfer coding to the
 3473|       |   *  message body if the request had been an unconditional GET."
 3474|       |   *
 3475|       |   * Read: in these cases the 'Transfer-Encoding' does not apply
 3476|       |   * to any data following the response headers. Do not add any decoders.
 3477|       |   */
 3478|      7|  const char *v = (!k->http_bodyless &&
  ------------------
  |  Branch (3478:20): [True: 3, False: 4]
  ------------------
 3479|      3|                   (data->state.httpreq != HTTPREQ_HEAD) &&
  ------------------
  |  Branch (3479:20): [True: 3, False: 0]
  ------------------
 3480|      3|                   (k->httpcode != 304)) ?
  ------------------
  |  Branch (3480:20): [True: 3, False: 0]
  ------------------
 3481|      7|    HD_VAL(hd, hdlen, "Transfer-Encoding:") : NULL;
  ------------------
  |  | 3035|      3|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3035:5): [True: 0, False: 3]
  |  |  |  Branch (3035:37): [True: 0, False: 0]
  |  |  ------------------
  |  | 3036|      3|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3036:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3482|      7|  if(v) {
  ------------------
  |  Branch (3482:6): [True: 0, False: 7]
  ------------------
 3483|       |    /* One or more encodings. We check for chunked and/or a compression
 3484|       |       algorithm. */
 3485|      0|    CURLcode result = Curl_build_unencoding_stack(data, v, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3486|      0|    if(result)
  ------------------
  |  Branch (3486:8): [True: 0, False: 0]
  ------------------
 3487|      0|      return result;
 3488|      0|    if(!k->chunk) {
  ------------------
  |  Branch (3488:8): [True: 0, False: 0]
  ------------------
 3489|       |      /* if this is not chunked, only close can signal the end of this
 3490|       |       * transfer as Content-Length is said not to be trusted for
 3491|       |       * transfer-encoding! */
 3492|      0|      CURL_TRC_M(data, "HTTP/1.1 transfer-encoding without chunks");
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3493|      0|      connclose(conn);
  ------------------
  |  |   72|      0|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   66|      0|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
 3494|      0|      k->ignore_cl = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3495|      0|    }
 3496|      0|    return CURLE_OK;
 3497|      0|  }
 3498|      7|  v = HD_VAL(hd, hdlen, "Trailer:");
  ------------------
  |  | 3035|      7|  ((((hdlen) >= (sizeof(n) - 1)) && (hd) && \
  |  |  ------------------
  |  |  |  Branch (3035:5): [True: 7, False: 0]
  |  |  |  Branch (3035:37): [True: 7, False: 0]
  |  |  ------------------
  |  | 3036|      7|    curl_strnequal(n, hd, sizeof(n) - 1)) ? ((hd) + (sizeof(n) - 1)) : NULL)
  |  |  ------------------
  |  |  |  Branch (3036:5): [True: 0, False: 7]
  |  |  ------------------
  ------------------
 3499|      7|  if(v) {
  ------------------
  |  Branch (3499:6): [True: 0, False: 7]
  ------------------
 3500|      0|    data->req.resp_trailer = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3501|      0|    return CURLE_OK;
 3502|      0|  }
 3503|      7|  return CURLE_OK;
 3504|      7|}
http.c:http_header_w:
 3511|      1|{
 3512|      1|  struct SingleRequest *k = &data->req;
 3513|      1|  CURLcode result = CURLE_OK;
 3514|       |
 3515|      1|  if((401 == k->httpcode) && HD_IS(hd, hdlen, "WWW-Authenticate:")) {
  ------------------
  |  | 3032|      0|  (((hdlen) >= (sizeof(n) - 1)) && curl_strnequal(n, hd, sizeof(n) - 1))
  |  |  ------------------
  |  |  |  Branch (3032:4): [True: 0, False: 0]
  |  |  |  Branch (3032:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3515:6): [True: 0, False: 1]
  ------------------
 3516|      0|    char *auth = Curl_copy_header_value(hd);
 3517|      0|    if(!auth)
  ------------------
  |  Branch (3517:8): [True: 0, False: 0]
  ------------------
 3518|      0|      result = CURLE_OUT_OF_MEMORY;
 3519|      0|    else {
 3520|      0|      result = Curl_http_input_auth(data, FALSE, auth);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 3521|      0|      curlx_free(auth);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3522|      0|    }
 3523|      0|  }
 3524|      1|  return result;
 3525|      1|}
http.c:http_TE_has_token:
 4773|      4|{
 4774|      8|  while(*fvalue) {
  ------------------
  |  Branch (4774:9): [True: 4, False: 4]
  ------------------
 4775|      4|    struct Curl_str name;
 4776|       |
 4777|       |    /* skip to first token */
 4778|      4|    while(ISBLANK(*fvalue) || *fvalue == ',')
  ------------------
  |  |   43|      8|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 4]
  |  |  |  Branch (43:38): [True: 0, False: 4]
  |  |  ------------------
  ------------------
  |  Branch (4778:31): [True: 0, False: 4]
  ------------------
 4779|      0|      fvalue++;
 4780|      4|    if(curlx_str_cspn(&fvalue, &name, " \t\r;,"))
  ------------------
  |  Branch (4780:8): [True: 0, False: 4]
  ------------------
 4781|      0|      return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 4782|      4|    if(curlx_str_casecompare(&name, token))
  ------------------
  |  Branch (4782:8): [True: 0, False: 4]
  ------------------
 4783|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 4784|       |
 4785|       |    /* skip any remainder after token, e.g. parameters with quoted strings */
 4786|      4|    while(*fvalue && *fvalue != ',') {
  ------------------
  |  Branch (4786:11): [True: 0, False: 4]
  |  Branch (4786:22): [True: 0, False: 0]
  ------------------
 4787|      0|      if(*fvalue == '"') {
  ------------------
  |  Branch (4787:10): [True: 0, False: 0]
  ------------------
 4788|      0|        struct Curl_str qw;
 4789|       |        /* if we do not cleanly find a quoted word here, the header value
 4790|       |         * does not follow HTTP syntax and we reject */
 4791|      0|        if(curlx_str_quotedword(&fvalue, &qw, CURL_MAX_HTTP_HEADER))
  ------------------
  |  |  274|      0|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  |  Branch (4791:12): [True: 0, False: 0]
  ------------------
 4792|      0|          return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 4793|      0|      }
 4794|      0|      else
 4795|      0|        fvalue++;
 4796|      0|    }
 4797|      4|  }
 4798|      4|  return FALSE;
  ------------------
  |  |  989|      4|#define FALSE false
  ------------------
 4799|      4|}
http.c:h2_permissible_field:
 4762|  4.75k|{
 4763|  4.75k|  size_t i;
 4764|  21.6k|  for(i = 0; i < CURL_ARRAYSIZE(H2_NON_FIELD); ++i) {
  ------------------
  |  | 1326|  21.6k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (4764:14): [True: 18.8k, False: 2.81k]
  ------------------
 4765|  18.8k|    if(e->namelen == H2_NON_FIELD[i].namelen &&
  ------------------
  |  Branch (4765:8): [True: 1.95k, False: 16.8k]
  ------------------
 4766|  1.95k|       curl_strnequal(H2_NON_FIELD[i].name, e->name, e->namelen))
  ------------------
  |  Branch (4766:8): [True: 1.93k, False: 22]
  ------------------
 4767|  1.93k|      return FALSE;
  ------------------
  |  |  989|  1.93k|#define FALSE false
  ------------------
 4768|  18.8k|  }
 4769|  2.81k|  return TRUE;
  ------------------
  |  |  986|  2.81k|#define TRUE true
  ------------------
 4770|  4.75k|}

Curl_h1_req_parse_init:
   37|  1.94k|{
   38|  1.94k|  memset(parser, 0, sizeof(*parser));
   39|  1.94k|  parser->max_line_len = max_line_len;
   40|  1.94k|  curlx_dyn_init(&parser->scratch, max_line_len);
   41|  1.94k|}
Curl_h1_req_parse_free:
   44|  3.87k|{
   45|  3.87k|  if(parser) {
  ------------------
  |  Branch (45:6): [True: 3.87k, False: 0]
  ------------------
   46|  3.87k|    Curl_http_req_free(parser->req);
   47|  3.87k|    curlx_dyn_free(&parser->scratch);
   48|  3.87k|    parser->req = NULL;
   49|       |    parser->done = FALSE;
  ------------------
  |  |  989|  3.87k|#define FALSE false
  ------------------
   50|  3.87k|  }
   51|  3.87k|}
Curl_h1_req_parse_read:
  267|  1.94k|{
  268|  1.94k|  CURLcode result = CURLE_OK;
  269|  1.94k|  size_t nread;
  270|       |
  271|  1.94k|  *pnread = 0;
  272|       |
  273|  1.94k|  DEBUGASSERT(buf);
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 1.94k]
  |  Branch (273:3): [True: 1.94k, False: 0]
  ------------------
  274|  1.94k|  if(!buf)
  ------------------
  |  Branch (274:6): [True: 0, False: 1.94k]
  ------------------
  275|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  276|       |
  277|  10.5k|  while(!parser->done) {
  ------------------
  |  Branch (277:9): [True: 8.66k, False: 1.92k]
  ------------------
  278|  8.66k|    result = next_line(parser, buf, buflen, options, &nread);
  279|  8.66k|    if(result) {
  ------------------
  |  Branch (279:8): [True: 0, False: 8.66k]
  ------------------
  280|      0|      if(result == CURLE_AGAIN)
  ------------------
  |  Branch (280:10): [True: 0, False: 0]
  ------------------
  281|      0|        result = CURLE_OK;
  282|      0|      goto out;
  283|      0|    }
  284|       |
  285|       |    /* Consume this line */
  286|  8.66k|    *pnread += nread;
  287|  8.66k|    buf += nread;
  288|  8.66k|    buflen -= nread;
  289|       |
  290|  8.66k|    if(!parser->line) {
  ------------------
  |  Branch (290:8): [True: 1, False: 8.66k]
  ------------------
  291|       |      /* consumed bytes, but line not complete */
  292|      1|      if(!buflen)
  ------------------
  |  Branch (292:10): [True: 1, False: 0]
  ------------------
  293|      1|        goto out;
  294|      1|    }
  295|  8.66k|    else if(!parser->req) {
  ------------------
  |  Branch (295:13): [True: 1.94k, False: 6.71k]
  ------------------
  296|  1.94k|      result = start_req(parser, scheme_default, custom_method, options);
  297|  1.94k|      if(result)
  ------------------
  |  Branch (297:10): [True: 11, False: 1.93k]
  ------------------
  298|     11|        goto out;
  299|  1.94k|    }
  300|  6.71k|    else if(parser->line_len == 0) {
  ------------------
  |  Branch (300:13): [True: 1.92k, False: 4.78k]
  ------------------
  301|       |      /* last, empty line, we are finished */
  302|  1.92k|      if(!parser->req) {
  ------------------
  |  Branch (302:10): [True: 0, False: 1.92k]
  ------------------
  303|      0|        result = CURLE_URL_MALFORMAT;
  304|      0|        goto out;
  305|      0|      }
  306|  1.92k|      parser->done = TRUE;
  ------------------
  |  |  986|  1.92k|#define TRUE true
  ------------------
  307|  1.92k|      curlx_dyn_reset(&parser->scratch);
  308|       |      /* last chance adjustments */
  309|  1.92k|    }
  310|  4.78k|    else {
  311|  4.78k|      result = Curl_dynhds_h1_add_line(&parser->req->headers,
  312|  4.78k|                                       parser->line, parser->line_len);
  313|  4.78k|      if(result)
  ------------------
  |  Branch (313:10): [True: 6, False: 4.78k]
  ------------------
  314|      6|        goto out;
  315|  4.78k|    }
  316|  8.66k|  }
  317|       |
  318|  1.94k|out:
  319|  1.94k|  return result;
  320|  1.94k|}
Curl_h1_req_write_head:
  324|  7.19k|{
  325|  7.19k|  CURLcode result;
  326|       |
  327|  7.19k|  result = curlx_dyn_addf(dbuf, "%s %s%s%s%s HTTP/1.%d\r\n",
  328|  7.19k|                          req->method,
  329|  7.19k|                          req->scheme ? req->scheme : "",
  ------------------
  |  Branch (329:27): [True: 7.19k, False: 0]
  ------------------
  330|  7.19k|                          req->scheme ? "://" : "",
  ------------------
  |  Branch (330:27): [True: 7.19k, False: 0]
  ------------------
  331|  7.19k|                          req->authority ? req->authority : "",
  ------------------
  |  Branch (331:27): [True: 7.19k, False: 0]
  ------------------
  332|  7.19k|                          req->path ? req->path : "",
  ------------------
  |  Branch (332:27): [True: 7.19k, False: 0]
  ------------------
  333|  7.19k|                          http_minor);
  334|  7.19k|  if(result)
  ------------------
  |  Branch (334:6): [True: 3, False: 7.19k]
  ------------------
  335|      3|    goto out;
  336|       |
  337|  7.19k|  result = Curl_dynhds_h1_dprint(&req->headers, dbuf);
  338|  7.19k|  if(result)
  ------------------
  |  Branch (338:6): [True: 3, False: 7.19k]
  ------------------
  339|      3|    goto out;
  340|       |
  341|  7.19k|  result = curlx_dyn_addn(dbuf, STRCONST("\r\n"));
  ------------------
  |  | 1324|  7.19k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  7.19k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  342|       |
  343|  7.19k|out:
  344|  7.19k|  return result;
  345|  7.19k|}
http1.c:next_line:
   97|  8.66k|{
   98|  8.66k|  CURLcode result;
   99|       |
  100|  8.66k|  *pnread = 0;
  101|  8.66k|  if(parser->line) {
  ------------------
  |  Branch (101:6): [True: 6.71k, False: 1.94k]
  ------------------
  102|  6.71k|    parser->line = NULL;
  103|  6.71k|    parser->line_len = 0;
  104|  6.71k|    curlx_dyn_reset(&parser->scratch);
  105|  6.71k|  }
  106|       |
  107|  8.66k|  result = detect_line(parser, buf, buflen, pnread);
  108|  8.66k|  if(!result) {
  ------------------
  |  Branch (108:6): [True: 8.66k, False: 1]
  ------------------
  109|  8.66k|    if(curlx_dyn_len(&parser->scratch)) {
  ------------------
  |  Branch (109:8): [True: 1, False: 8.66k]
  ------------------
  110|       |      /* append detected line to scratch to have the complete line */
  111|      1|      result = curlx_dyn_addn(&parser->scratch, parser->line,
  112|      1|                              parser->line_len);
  113|      1|      if(result)
  ------------------
  |  Branch (113:10): [True: 0, False: 1]
  ------------------
  114|      0|        return result;
  115|      1|      parser->line = curlx_dyn_ptr(&parser->scratch);
  116|      1|      parser->line_len = curlx_dyn_len(&parser->scratch);
  117|      1|    }
  118|  8.66k|    result = trim_line(parser, options);
  119|  8.66k|    if(result)
  ------------------
  |  Branch (119:8): [True: 0, False: 8.66k]
  ------------------
  120|      0|      return result;
  121|  8.66k|  }
  122|      1|  else if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (122:11): [True: 1, False: 0]
  ------------------
  123|       |    /* no line end in `buf`, add it to our scratch */
  124|      1|    result = curlx_dyn_addn(&parser->scratch, (const unsigned char *)buf,
  125|      1|                            buflen);
  126|      1|    *pnread = buflen;
  127|      1|  }
  128|  8.66k|  return result;
  129|  8.66k|}
http1.c:detect_line:
   80|  8.66k|{
   81|  8.66k|  const char *line_end;
   82|       |
   83|  8.66k|  DEBUGASSERT(!parser->line);
  ------------------
  |  | 1016|  8.66k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (83:3): [True: 0, False: 8.66k]
  |  Branch (83:3): [True: 8.66k, False: 0]
  ------------------
   84|  8.66k|  *pnread = 0;
   85|  8.66k|  line_end = memchr(buf, '\n', buflen);
   86|  8.66k|  if(!line_end)
  ------------------
  |  Branch (86:6): [True: 1, False: 8.66k]
  ------------------
   87|      1|    return CURLE_AGAIN;
   88|  8.66k|  parser->line = (const char *)buf;
   89|  8.66k|  parser->line_len = line_end - parser->line + 1;
   90|  8.66k|  *pnread = parser->line_len;
   91|  8.66k|  return CURLE_OK;
   92|  8.66k|}
http1.c:trim_line:
   54|  8.66k|{
   55|  8.66k|  DEBUGASSERT(parser->line);
  ------------------
  |  | 1016|  8.66k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (55:3): [True: 0, False: 8.66k]
  |  Branch (55:3): [True: 8.66k, False: 0]
  ------------------
   56|  8.66k|  if(parser->line_len) {
  ------------------
  |  Branch (56:6): [True: 8.66k, False: 0]
  ------------------
   57|  8.66k|    if(parser->line[parser->line_len - 1] == '\n')
  ------------------
  |  Branch (57:8): [True: 8.66k, False: 0]
  ------------------
   58|  8.66k|      --parser->line_len;
   59|  8.66k|    if(parser->line_len) {
  ------------------
  |  Branch (59:8): [True: 8.66k, False: 2]
  ------------------
   60|  8.66k|      if(parser->line[parser->line_len - 1] == '\r')
  ------------------
  |  Branch (60:10): [True: 8.64k, False: 16]
  ------------------
   61|  8.64k|        --parser->line_len;
   62|     16|      else if(options & H1_PARSE_OPT_STRICT)
  ------------------
  |  |   33|     16|#define H1_PARSE_OPT_STRICT     (1 << 0)
  ------------------
  |  Branch (62:15): [True: 0, False: 16]
  ------------------
   63|      0|        return CURLE_URL_MALFORMAT;
   64|  8.66k|    }
   65|      2|    else if(options & H1_PARSE_OPT_STRICT)
  ------------------
  |  |   33|      2|#define H1_PARSE_OPT_STRICT     (1 << 0)
  ------------------
  |  Branch (65:13): [True: 0, False: 2]
  ------------------
   66|      0|      return CURLE_URL_MALFORMAT;
   67|  8.66k|  }
   68|      0|  else if(options & H1_PARSE_OPT_STRICT)
  ------------------
  |  |   33|      0|#define H1_PARSE_OPT_STRICT     (1 << 0)
  ------------------
  |  Branch (68:11): [True: 0, False: 0]
  ------------------
   69|      0|    return CURLE_URL_MALFORMAT;
   70|       |
   71|  8.66k|  if(parser->line_len > parser->max_line_len) {
  ------------------
  |  Branch (71:6): [True: 0, False: 8.66k]
  ------------------
   72|      0|    return CURLE_URL_MALFORMAT;
   73|      0|  }
   74|  8.66k|  return CURLE_OK;
   75|  8.66k|}
http1.c:start_req:
  135|  1.94k|{
  136|  1.94k|  const char *p, *m, *target, *hv, *scheme, *authority, *path;
  137|  1.94k|  size_t m_len, target_len, hv_len, scheme_len, authority_len, path_len;
  138|  1.94k|  size_t i;
  139|  1.94k|  CURLU *url = NULL;
  140|  1.94k|  CURLcode result = CURLE_URL_MALFORMAT; /* Use this as default fail */
  141|       |
  142|  1.94k|  DEBUGASSERT(!parser->req);
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (142:3): [True: 0, False: 1.94k]
  |  Branch (142:3): [True: 1.94k, False: 0]
  ------------------
  143|       |  /* line must match: "METHOD TARGET HTTP_VERSION" */
  144|  1.94k|  if(custom_method && custom_method[0] &&
  ------------------
  |  Branch (144:6): [True: 14, False: 1.93k]
  |  Branch (144:23): [True: 6, False: 8]
  ------------------
  145|      6|     !strncmp(custom_method, parser->line, strlen(custom_method))) {
  ------------------
  |  Branch (145:6): [True: 6, False: 0]
  ------------------
  146|      6|    p = parser->line + strlen(custom_method);
  147|      6|  }
  148|  1.94k|  else {
  149|  1.94k|    p = memchr(parser->line, ' ', parser->line_len);
  150|  1.94k|    if(!p || p == parser->line)
  ------------------
  |  Branch (150:8): [True: 0, False: 1.94k]
  |  Branch (150:14): [True: 8, False: 1.93k]
  ------------------
  151|      8|      goto out;
  152|  1.94k|  }
  153|       |
  154|  1.93k|  m = parser->line;
  155|  1.93k|  m_len = p - parser->line;
  156|  1.93k|  target = p + 1;
  157|  1.93k|  target_len = hv_len = 0;
  158|  1.93k|  hv = NULL;
  159|       |
  160|       |  /* URL may contain spaces so scan backwards */
  161|  15.5k|  for(i = parser->line_len; i > m_len; --i) {
  ------------------
  |  Branch (161:29): [True: 15.5k, False: 0]
  ------------------
  162|  15.5k|    if(parser->line[i] == ' ') {
  ------------------
  |  Branch (162:8): [True: 1.93k, False: 13.5k]
  ------------------
  163|  1.93k|      hv = &parser->line[i + 1];
  164|  1.93k|      hv_len = parser->line_len - i;
  165|  1.93k|      target_len = (hv - target) - 1;
  166|  1.93k|      break;
  167|  1.93k|    }
  168|  15.5k|  }
  169|       |  /* no SPACE found or empty TARGET or empty HTTP_VERSION */
  170|  1.93k|  if(!target_len || !hv_len)
  ------------------
  |  Branch (170:6): [True: 3, False: 1.93k]
  |  Branch (170:21): [True: 0, False: 1.93k]
  ------------------
  171|      3|    goto out;
  172|       |
  173|  1.93k|  (void)hv;
  174|       |
  175|       |  /* The TARGET can be (rfc 9112, ch. 3.2):
  176|       |   * origin-form:     path + optional query
  177|       |   * absolute-form:   absolute URI
  178|       |   * authority-form:  host+port for CONNECT
  179|       |   * asterisk-form:   '*' for OPTIONS
  180|       |   *
  181|       |   * from TARGET, we derive `scheme` `authority` `path`
  182|       |   * origin-form            --        --          TARGET
  183|       |   * absolute-form          URL*      URL*        URL*
  184|       |   * authority-form         --        TARGET      --
  185|       |   * asterisk-form          --        --          TARGET
  186|       |   */
  187|  1.93k|  scheme = authority = path = NULL;
  188|  1.93k|  scheme_len = authority_len = path_len = 0;
  189|       |
  190|  1.93k|  if(target_len == 1 && target[0] == '*') {
  ------------------
  |  Branch (190:6): [True: 1.63k, False: 297]
  |  Branch (190:25): [True: 0, False: 1.63k]
  ------------------
  191|       |    /* asterisk-form */
  192|      0|    path = target;
  193|      0|    path_len = target_len;
  194|      0|  }
  195|  1.93k|  else if(!strncmp("CONNECT", m, m_len)) {
  ------------------
  |  Branch (195:11): [True: 0, False: 1.93k]
  ------------------
  196|       |    /* authority-form */
  197|      0|    authority = target;
  198|      0|    authority_len = target_len;
  199|      0|  }
  200|  1.93k|  else if(target[0] == '/') {
  ------------------
  |  Branch (200:11): [True: 1.92k, False: 6]
  ------------------
  201|       |    /* origin-form */
  202|  1.92k|    path = target;
  203|  1.92k|    path_len = target_len;
  204|  1.92k|  }
  205|      6|  else {
  206|       |    /* origin-form OR absolute-form */
  207|      6|    CURLUcode uc;
  208|      6|    char tmp[H1_MAX_URL_LEN];
  209|       |
  210|       |    /* default, unless we see an absolute URL */
  211|      6|    path = target;
  212|      6|    path_len = target_len;
  213|       |
  214|       |    /* URL parser wants null-termination */
  215|      6|    if(target_len >= sizeof(tmp))
  ------------------
  |  Branch (215:8): [True: 0, False: 6]
  ------------------
  216|      0|      goto out;
  217|      6|    memcpy(tmp, target, target_len);
  218|      6|    tmp[target_len] = '\0';
  219|       |    /* See if treating TARGET as an absolute URL makes sense */
  220|      6|    if(Curl_is_absolute_url(tmp, NULL, 0, FALSE)) {
  ------------------
  |  |  989|      6|#define FALSE false
  ------------------
  |  Branch (220:8): [True: 0, False: 6]
  ------------------
  221|      0|      unsigned int url_options;
  222|       |
  223|      0|      url = curl_url();
  224|      0|      if(!url) {
  ------------------
  |  Branch (224:10): [True: 0, False: 0]
  ------------------
  225|      0|        result = CURLE_OUT_OF_MEMORY;
  226|      0|        goto out;
  227|      0|      }
  228|      0|      url_options = (CURLU_NON_SUPPORT_SCHEME |
  ------------------
  |  |   91|      0|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
  229|      0|                     CURLU_PATH_AS_IS |
  ------------------
  |  |   92|      0|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  230|      0|                     CURLU_NO_DEFAULT_PORT);
  ------------------
  |  |   86|      0|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
  231|      0|      if(!(options & H1_PARSE_OPT_STRICT))
  ------------------
  |  |   33|      0|#define H1_PARSE_OPT_STRICT     (1 << 0)
  ------------------
  |  Branch (231:10): [True: 0, False: 0]
  ------------------
  232|      0|        url_options |= CURLU_ALLOW_SPACE;
  ------------------
  |  |  100|      0|#define CURLU_ALLOW_SPACE (1 << 11)       /* Allow spaces in the URL */
  ------------------
  233|      0|      uc = curl_url_set(url, CURLUPART_URL, tmp, url_options);
  234|      0|      if(uc) {
  ------------------
  |  Branch (234:10): [True: 0, False: 0]
  ------------------
  235|      0|        goto out;
  236|      0|      }
  237|      0|    }
  238|       |
  239|      6|    if(!url && (options & H1_PARSE_OPT_STRICT)) {
  ------------------
  |  |   33|      6|#define H1_PARSE_OPT_STRICT     (1 << 0)
  ------------------
  |  Branch (239:8): [True: 6, False: 0]
  |  Branch (239:16): [True: 0, False: 6]
  ------------------
  240|       |      /* we should have an absolute URL or have seen `/` earlier */
  241|      0|      goto out;
  242|      0|    }
  243|      6|  }
  244|       |
  245|  1.93k|  if(url) {
  ------------------
  |  Branch (245:6): [True: 0, False: 1.93k]
  ------------------
  246|      0|    result = Curl_http_req_make2(&parser->req, m, m_len, url, scheme_default);
  247|      0|  }
  248|  1.93k|  else {
  249|  1.93k|    if(!scheme && scheme_default) {
  ------------------
  |  Branch (249:8): [True: 1.93k, False: 0]
  |  Branch (249:19): [True: 0, False: 1.93k]
  ------------------
  250|      0|      scheme = scheme_default;
  251|      0|      scheme_len = strlen(scheme_default);
  252|      0|    }
  253|  1.93k|    result = Curl_http_req_make(&parser->req, m, m_len, scheme, scheme_len,
  254|  1.93k|                                authority, authority_len, path, path_len);
  255|  1.93k|  }
  256|       |
  257|  1.94k|out:
  258|  1.94k|  curl_url_cleanup(url);
  259|  1.94k|  return result;
  260|  1.93k|}

Curl_output_aws_sigv4:
 1200|      9|{
 1201|      9|  CURLcode result = CURLE_OUT_OF_MEMORY;
 1202|      9|  struct Curl_str provider0 = { NULL, 0 };
 1203|      9|  struct Curl_str provider1 = { NULL, 0 };
 1204|      9|  struct Curl_str region = { NULL, 0 };
 1205|      9|  struct Curl_str service = { NULL, 0 };
 1206|      9|  const char *hostname = data->state.origin->hostname;
 1207|      9|  char timestamp[TIMESTAMP_SIZE];
 1208|      9|  char date[9];
 1209|      9|  struct dynbuf canonical_headers;
 1210|      9|  struct dynbuf signed_headers;
 1211|      9|  char *date_header = NULL;
 1212|      9|  Curl_HttpReq httpreq;
 1213|      9|  const char *method = NULL;
 1214|      9|  const char *payload_hash = NULL;
 1215|      9|  size_t payload_hash_len = 0;
 1216|      9|  uint8_t sha_hash[CURL_SHA256_DIGEST_LEN];
 1217|      9|  char sha_hex[SHA256_HEX_LENGTH];
 1218|      9|  char content_sha256_hdr[CONTENT_SHA256_HDR_LEN + 2] = ""; /* add \r\n */
 1219|      9|  char *canonical_request = NULL;
 1220|      9|  char *request_type = NULL;
 1221|      9|  char *credential_scope = NULL;
 1222|      9|  char *str_to_sign = NULL;
 1223|       |
 1224|      9|  if(data->set.path_as_is) {
  ------------------
  |  Branch (1224:6): [True: 0, False: 9]
  ------------------
 1225|      0|    failf(data, "Cannot use sigv4 authentication with path-as-is flag");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1226|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1227|      0|  }
 1228|       |
 1229|      9|  if(Curl_checkheaders(data, STRCONST("Authorization")))
  ------------------
  |  | 1324|      9|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      9|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1229:6): [True: 0, False: 9]
  ------------------
 1230|       |    /* Authorization already present, Bailing out */
 1231|      0|    return CURLE_OK;
 1232|       |
 1233|       |  /* we init those buffers here, so goto fail will free initialized dynbuf */
 1234|      9|  curlx_dyn_init(&canonical_headers, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|      9|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
 1235|      9|  curlx_dyn_init(&signed_headers, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|      9|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
 1236|       |
 1237|      9|  result = parse_sigv4_params(data, hostname, &provider0, &provider1,
 1238|      9|                              &region, &service);
 1239|      9|  if(!result) {
  ------------------
  |  Branch (1239:6): [True: 0, False: 9]
  ------------------
 1240|      0|    Curl_http_method(data, &method, &httpreq);
 1241|      0|    result = get_payload_hash(data, httpreq, &provider0, &provider1, &service,
 1242|      0|                              sha_hash, sha_hex, content_sha256_hdr,
 1243|      0|                              &payload_hash, &payload_hash_len);
 1244|      0|  }
 1245|       |
 1246|      9|  if(!result)
  ------------------
  |  Branch (1246:6): [True: 0, False: 9]
  ------------------
 1247|      0|    result = get_timestamp(timestamp, sizeof(timestamp));
 1248|       |
 1249|      9|  if(!result)
  ------------------
  |  Branch (1249:6): [True: 0, False: 9]
  ------------------
 1250|      0|    result = make_canonical_request(data, timestamp,
 1251|      0|                                    &provider1, &service,
 1252|      0|                                    method, payload_hash, payload_hash_len,
 1253|      0|                                    &date_header, content_sha256_hdr,
 1254|      0|                                    &canonical_headers, &signed_headers,
 1255|      0|                                    &canonical_request);
 1256|      9|  if(!result) {
  ------------------
  |  Branch (1256:6): [True: 0, False: 9]
  ------------------
 1257|       |    /* the timestamp might have been updated in make_canonical_request */
 1258|      0|    memcpy(date, timestamp, sizeof(date) - 1);
 1259|      0|    date[sizeof(date) - 1] = 0;
 1260|       |
 1261|      0|    result = make_string_to_sign(data, &provider0, &region, &service,
 1262|      0|                                 date, timestamp, canonical_request,
 1263|      0|                                 &request_type, &credential_scope,
 1264|      0|                                 &str_to_sign);
 1265|      0|  }
 1266|      9|  if(!result)
  ------------------
  |  Branch (1266:6): [True: 0, False: 9]
  ------------------
 1267|      0|    result = sign_and_set_auth_headers(data, &provider0, &region, &service,
 1268|      0|                                       request_type, credential_scope,
 1269|      0|                                       date, str_to_sign, date_header,
 1270|      0|                                       content_sha256_hdr, &signed_headers);
 1271|       |
 1272|      9|  curlx_dyn_free(&canonical_headers);
 1273|      9|  curlx_dyn_free(&signed_headers);
 1274|      9|  curlx_free(canonical_request);
  ------------------
  |  | 1503|      9|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1275|      9|  curlx_free(request_type);
  ------------------
  |  | 1503|      9|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1276|      9|  curlx_free(credential_scope);
  ------------------
  |  | 1503|      9|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1277|      9|  curlx_free(str_to_sign);
  ------------------
  |  | 1503|      9|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1278|      9|  curlx_free(date_header);
  ------------------
  |  | 1503|      9|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1279|      9|  return result;
 1280|      9|}
http_aws_sigv4.c:parse_sigv4_params:
  844|      9|{
  845|      9|  const char *line = CURL_EASY_STR(data, STRING_AWS_SIGV4);
  ------------------
  |  | 1206|      9|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  846|      9|  if(!line || !*line)
  ------------------
  |  Branch (846:6): [True: 0, False: 9]
  |  Branch (846:15): [True: 7, False: 2]
  ------------------
  847|      7|    line = "aws:amz";
  848|       |
  849|       |  /* provider0[:provider1[:region[:service]]]
  850|       |
  851|       |     No string can be longer than N bytes of non-whitespace */
  852|      9|  if(curlx_str_until(&line, provider0, MAX_SIGV4_LEN, ':')) {
  ------------------
  |  |  279|      9|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (852:6): [True: 0, False: 9]
  ------------------
  853|      0|    failf(data, "first aws-sigv4 provider cannot be empty");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  854|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  855|      0|  }
  856|      9|  if(curlx_str_single(&line, ':') ||
  ------------------
  |  Branch (856:6): [True: 2, False: 7]
  ------------------
  857|      7|     curlx_str_until(&line, provider1, MAX_SIGV4_LEN, ':')) {
  ------------------
  |  |  279|      7|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (857:6): [True: 0, False: 7]
  ------------------
  858|      2|    *provider1 = *provider0;
  859|      2|  }
  860|      7|  else if(curlx_str_single(&line, ':') ||
  ------------------
  |  Branch (860:11): [True: 7, False: 0]
  ------------------
  861|      0|          curlx_str_until(&line, region, MAX_SIGV4_LEN, ':') ||
  ------------------
  |  |  279|      0|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (861:11): [True: 0, False: 0]
  ------------------
  862|      0|          curlx_str_single(&line, ':') ||
  ------------------
  |  Branch (862:11): [True: 0, False: 0]
  ------------------
  863|      7|          curlx_str_until(&line, service, MAX_SIGV4_LEN, ':')) {
  ------------------
  |  |  279|      0|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (863:11): [True: 0, False: 0]
  ------------------
  864|       |    /* nothing to do */
  865|      7|  }
  866|       |
  867|      9|  if(!curlx_strlen(service)) {
  ------------------
  |  |   50|      9|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (867:6): [True: 9, False: 0]
  ------------------
  868|      9|    const char *p = hostname;
  869|      9|    if(curlx_str_until(&p, service, MAX_SIGV4_LEN, '.') ||
  ------------------
  |  |  279|      9|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (869:8): [True: 0, False: 9]
  ------------------
  870|      9|       curlx_str_single(&p, '.')) {
  ------------------
  |  Branch (870:8): [True: 0, False: 9]
  ------------------
  871|      0|      failf(data, "aws-sigv4: service missing in parameters and hostname");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  872|      0|      return CURLE_URL_MALFORMAT;
  873|      0|    }
  874|       |
  875|      9|    infof(data, "aws_sigv4: picked service %.*s from host",
  ------------------
  |  |  143|      9|  do {                               \
  |  |  144|      9|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      9|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 9, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 1, False: 8]
  |  |  |  |  ------------------
  |  |  |  |  323|      9|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      1|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      9|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      9|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 9]
  |  |  ------------------
  ------------------
  876|      9|          (int)curlx_strlen(service), curlx_str(service));
  877|       |
  878|      9|    if(!curlx_strlen(region)) {
  ------------------
  |  |   50|      9|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (878:8): [True: 9, False: 0]
  ------------------
  879|      9|      if(curlx_str_until(&p, region, MAX_SIGV4_LEN, '.') ||
  ------------------
  |  |  279|      9|#define MAX_SIGV4_LEN    64
  ------------------
  |  Branch (879:10): [True: 0, False: 9]
  ------------------
  880|      9|         curlx_str_single(&p, '.')) {
  ------------------
  |  Branch (880:10): [True: 9, False: 0]
  ------------------
  881|      9|        failf(data, "aws-sigv4: region missing in parameters and hostname");
  ------------------
  |  |   62|      9|#define failf Curl_failf
  ------------------
  882|      9|        return CURLE_URL_MALFORMAT;
  883|      9|      }
  884|      0|      infof(data, "aws_sigv4: picked region %.*s from host",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  885|      0|            (int)curlx_strlen(region), curlx_str(region));
  886|      0|    }
  887|      9|  }
  888|       |
  889|      0|  return CURLE_OK;
  890|      9|}

Curl_httpchunk_init:
   75|  7.21k|{
   76|  7.21k|  (void)data;
   77|  7.21k|  ch->hexindex = 0;      /* start at 0 */
   78|  7.21k|  ch->state = CHUNK_HEX; /* we get hex first! */
   79|  7.21k|  ch->last_code = CHUNKE_OK;
   80|  7.21k|  curlx_dyn_init(&ch->trailer, DYN_H1_TRAILER);
  ------------------
  |  |   75|  7.21k|#define DYN_H1_TRAILER      4096
  ------------------
   81|  7.21k|  ch->ignore_body = ignore_body;
   82|  7.21k|  ch->in_connect = in_connect;
   83|  7.21k|}
Curl_httpchunk_free:
   97|  7.21k|{
   98|  7.21k|  (void)data;
   99|  7.21k|  curlx_dyn_free(&ch->trailer);
  100|  7.21k|}

Curl_output_digest:
  116|      6|{
  117|      6|  struct Curl_peer *origin = NULL;
  118|      6|  CURLcode result;
  119|      6|  char *response;
  120|      6|  size_t len;
  121|       |  /* Point to the address of the pointer that holds the header. */
  122|      6|  char **pauth_hd;
  123|       |  /* Point to the correct struct with this */
  124|      6|  struct digestdata *digest;
  125|      6|  struct auth *authp;
  126|       |
  127|      6|  if(proxy) {
  ------------------
  |  Branch (127:6): [True: 5, False: 1]
  ------------------
  128|       |#ifdef CURL_DISABLE_PROXY
  129|       |    return CURLE_NOT_BUILT_IN;
  130|       |#else
  131|      5|    digest = &data->state.proxydigest;
  132|      5|    origin = data->conn->http_proxy.peer;
  133|      5|    pauth_hd = &data->req.hd_proxy_auth;
  134|      5|    authp = &data->state.authproxy;
  135|      5|#endif
  136|      5|  }
  137|      1|  else {
  138|      1|    DEBUGASSERT(data->state.origin);
  ------------------
  |  | 1016|      1|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (138:5): [True: 0, False: 1]
  |  Branch (138:5): [True: 1, False: 0]
  ------------------
  139|      1|    digest = &data->state.digest;
  140|      1|    origin = data->state.origin;
  141|      1|    pauth_hd = &data->req.hd_auth;
  142|      1|    authp = &data->state.authhost;
  143|      1|  }
  144|       |
  145|      6|  digest_flush_stale(data, digest, origin, creds);
  146|      6|  curlx_safefree(*pauth_hd);
  ------------------
  |  | 1359|      6|  do {                      \
  |  | 1360|      6|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      6|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      6|    (ptr) = NULL;           \
  |  | 1362|      6|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 6]
  |  |  ------------------
  ------------------
  147|       |
  148|       |#ifdef USE_WINDOWS_SSPI
  149|       |  if(!digest->input_token) {
  150|       |#else
  151|      6|  if(!digest->nonce) {
  ------------------
  |  Branch (151:6): [True: 6, False: 0]
  ------------------
  152|      6|#endif
  153|      6|    authp->done = FALSE;
  ------------------
  |  |  989|      6|#define FALSE false
  ------------------
  154|      6|    return CURLE_OK;
  155|      6|  }
  156|       |
  157|      0|  result = Curl_auth_create_digest_http_message(data, creds, request,
  158|      0|                                                uripath, digest,
  159|      0|                                                &response, &len);
  160|      0|  if(result)
  ------------------
  |  Branch (160:6): [True: 0, False: 0]
  ------------------
  161|      0|    return result;
  162|       |
  163|      0|  *pauth_hd = curl_maprintf("%s: Digest %s\r\n", hd_name, response);
  164|      0|  curlx_free(response);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  165|      0|  if(!*pauth_hd)
  ------------------
  |  Branch (165:6): [True: 0, False: 0]
  ------------------
  166|      0|    return CURLE_OUT_OF_MEMORY;
  167|       |
  168|      0|  authp->done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  169|       |
  170|      0|  return CURLE_OK;
  171|      0|}
Curl_http_auth_cleanup_digest:
  174|  19.7k|{
  175|  19.7k|  Curl_auth_digest_cleanup(&data->state.digest);
  176|  19.7k|  Curl_auth_digest_cleanup(&data->state.proxydigest);
  177|  19.7k|}
http_digest.c:digest_flush_stale:
   42|      6|{
   43|      6|  bool flush = FALSE;
  ------------------
  |  |  989|      6|#define FALSE false
  ------------------
   44|      6|  if(!digest->origin || !Curl_peer_equal(peer, digest->origin)) {
  ------------------
  |  Branch (44:6): [True: 6, False: 0]
  |  Branch (44:25): [True: 0, False: 0]
  ------------------
   45|      6|    CURL_TRC_M(data, "http_digest, reset on peer change to %s:%u",
  ------------------
  |  |  148|      6|  do {                                   \
  |  |  149|      6|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      6|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      6|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|     12|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 6, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 2, False: 4]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|     12|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      6|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      2|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 1, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      6|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 1, False: 0]
  |  |  |  Branch (150:28): [True: 1, False: 0]
  |  |  ------------------
  |  |  151|      6|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 6]
  |  |  ------------------
  ------------------
   46|      6|               peer ? peer->hostname : "-",
   47|      6|               (unsigned int)(peer ? peer->port : 0));
   48|      6|    flush = TRUE;
  ------------------
  |  |  986|      6|#define TRUE true
  ------------------
   49|      6|  }
   50|      0|  else if(digest->creds && !Curl_creds_same(creds, digest->creds)) {
  ------------------
  |  Branch (50:11): [True: 0, False: 0]
  |  Branch (50:28): [True: 0, False: 0]
  ------------------
   51|      0|    CURL_TRC_M(data, "http_digest, reset on creds change to %s",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
   52|      0|               creds ? creds->user : "-");
   53|      0|    flush = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
   54|      0|  }
   55|       |
   56|      6|  if(flush) {
  ------------------
  |  Branch (56:6): [True: 6, False: 0]
  ------------------
   57|       |    /* flush Digest state */
   58|      6|    Curl_auth_digest_cleanup(digest);
   59|      6|  }
   60|       |
   61|      6|  Curl_peer_link(&digest->origin, peer);
   62|      6|  Curl_creds_link(&digest->creds, creds);
   63|      6|}

Curl_output_httpsig:
  527|      2|{
  528|      2|  CURLcode result = CURLE_OUT_OF_MEMORY;
  529|      2|  struct connectdata *conn = data->conn;
  530|      2|  const char *path;
  531|      2|  const char *query;
  532|      2|  Curl_HttpReq httpreq;
  533|      2|  const char *method = NULL;
  534|      2|  const char *hexkey = CURL_EASY_STR(data, STRING_HTTPSIG_KEY);
  ------------------
  |  | 1206|      2|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  535|      2|  const char *keyid = CURL_EASY_STR(data, STRING_HTTPSIG_KEYID);
  ------------------
  |  | 1206|      2|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  536|      2|  enum httpsig_alg alg;
  537|      2|  time_t created;
  538|      2|  struct dynbuf sig_params;
  539|      2|  struct dynbuf sig_base;
  540|      2|  struct dynbuf sig_hdr;
  541|      2|  struct dynbuf input_hdr;
  542|      2|  struct dynbuf authority_buf;
  543|      2|  const char *authority;
  544|      2|  const char *components[HTTPSIG_MAX_COMPONENTS];
  545|      2|  size_t ncomp = 0;
  546|      2|  uint8_t *keybuf = NULL;
  547|      2|  size_t keylen = 0;
  548|      2|  uint8_t raw_sig[HTTPSIG_MAX_RAW_SIG];
  549|      2|  size_t raw_sig_len = 0;
  550|      2|  char *auth_headers = NULL;
  551|      2|  char *hdrs_copy = NULL;
  552|      2|  struct dynbuf query_dyn;
  553|       |
  554|      2|  alg = id_to_alg(data->set.httpsig_algorithm);
  555|      2|  if(alg == HTTPSIG_ALG_UNKNOWN) {
  ------------------
  |  Branch (555:6): [True: 2, False: 0]
  ------------------
  556|      2|    failf(data, "httpsig: CURLOPT_HTTPSIG_ALGORITHM is required");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  557|      2|    return CURLE_BAD_FUNCTION_ARGUMENT;
  558|      2|  }
  559|       |
  560|      0|  if(!hexkey || !*hexkey) {
  ------------------
  |  Branch (560:6): [True: 0, False: 0]
  |  Branch (560:17): [True: 0, False: 0]
  ------------------
  561|      0|    failf(data, "httpsig: CURLOPT_HTTPSIG_KEY is required");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  562|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  563|      0|  }
  564|      0|  if(!keyid || !*keyid) {
  ------------------
  |  Branch (564:6): [True: 0, False: 0]
  |  Branch (564:16): [True: 0, False: 0]
  ------------------
  565|      0|    failf(data, "httpsig: CURLOPT_HTTPSIG_KEYID is required");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  566|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  567|      0|  }
  568|       |
  569|      0|  curlx_dyn_init(&sig_params, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|      0|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  570|      0|  curlx_dyn_init(&sig_base, HTTPSIG_MAX_SIG_BASE);
  ------------------
  |  |   45|      0|#define HTTPSIG_MAX_SIG_BASE   CURL_MAX_HTTP_HEADER
  |  |  ------------------
  |  |  |  |  274|      0|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  |  |  ------------------
  ------------------
  571|      0|  curlx_dyn_init(&sig_hdr, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|      0|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  572|      0|  curlx_dyn_init(&input_hdr, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|      0|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  573|      0|  curlx_dyn_init(&authority_buf, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|      0|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  574|      0|  curlx_dyn_init(&query_dyn, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|      0|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  575|       |
  576|      0|  if(Curl_checkheaders(data, STRCONST("Signature")) ||
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (576:6): [True: 0, False: 0]
  ------------------
  577|      0|     Curl_checkheaders(data, STRCONST("Signature-Input"))) {
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (577:6): [True: 0, False: 0]
  ------------------
  578|       |    /* user provides their own Signature / Signature-Input headers, consider
  579|       |       this done */
  580|      0|    goto done;
  581|      0|  }
  582|       |
  583|      0|  result = decode_hex_key(data, hexkey, &keybuf, &keylen);
  584|      0|  if(result)
  ------------------
  |  Branch (584:6): [True: 0, False: 0]
  ------------------
  585|      0|    goto fail;
  586|       |
  587|      0|  if(alg == HTTPSIG_ALG_ED25519 && keylen != 32) {
  ------------------
  |  Branch (587:6): [True: 0, False: 0]
  |  Branch (587:36): [True: 0, False: 0]
  ------------------
  588|      0|    failf(data, "httpsig: ed25519 requires a 32-byte key (got %zu)", keylen);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  589|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  590|      0|    goto fail;
  591|      0|  }
  592|       |
  593|      0|  Curl_http_method(data, &method, &httpreq);
  594|       |
  595|      0|  path = data->state.up.path;
  596|      0|  if(!path || !*path)
  ------------------
  |  Branch (596:6): [True: 0, False: 0]
  |  Branch (596:15): [True: 0, False: 0]
  ------------------
  597|      0|    path = "/";
  598|       |
  599|      0|  query = data->state.up.query;
  600|       |
  601|      0|  result = httpsig_authority(data, conn, &authority_buf);
  602|      0|  if(result)
  ------------------
  |  Branch (602:6): [True: 0, False: 0]
  ------------------
  603|      0|    goto fail;
  604|      0|  authority = curlx_dyn_ptr(&authority_buf);
  605|       |
  606|       |  /* Build @query value: RFC 9421 Section 2.2.7 - always starts with "?" */
  607|      0|  if(query && *query)
  ------------------
  |  Branch (607:6): [True: 0, False: 0]
  |  Branch (607:15): [True: 0, False: 0]
  ------------------
  608|      0|    result = curlx_dyn_addf(&query_dyn, "?%s", query);
  609|      0|  else
  610|      0|    result = curlx_dyn_add(&query_dyn, "?");
  611|      0|  if(result)
  ------------------
  |  Branch (611:6): [True: 0, False: 0]
  ------------------
  612|      0|    goto fail;
  613|       |
  614|      0|  result = parse_components(data, query, components, &ncomp, &hdrs_copy);
  615|      0|  if(result)
  ------------------
  |  Branch (615:6): [True: 0, False: 0]
  ------------------
  616|      0|    goto fail;
  617|       |
  618|      0|  created = httpsig_get_created();
  619|       |
  620|      0|  result = build_sig_params(&sig_params, components, ncomp,
  621|      0|                            created, keyid, alg);
  622|      0|  if(result)
  ------------------
  |  Branch (622:6): [True: 0, False: 0]
  ------------------
  623|      0|    goto fail;
  624|       |
  625|      0|  infof(data, "httpsig: Signature-Input params: %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  626|      0|        curlx_dyn_ptr(&sig_params));
  627|       |
  628|      0|  result = build_sig_base(&sig_base, components, ncomp,
  629|      0|                          method, authority, path,
  630|      0|                          curlx_dyn_ptr(&query_dyn),
  631|      0|                          data, curlx_dyn_ptr(&sig_params));
  632|      0|  if(result)
  ------------------
  |  Branch (632:6): [True: 0, False: 0]
  ------------------
  633|      0|    goto fail;
  634|       |
  635|      0|  infof(data, "httpsig: Signature base: [%s]",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  636|      0|        curlx_dyn_ptr(&sig_base));
  637|       |
  638|      0|  result = httpsig_sign_base(data, alg, keybuf, keylen, &sig_base,
  639|      0|                             raw_sig, &raw_sig_len);
  640|      0|  if(result)
  ------------------
  |  Branch (640:6): [True: 0, False: 0]
  ------------------
  641|      0|    goto fail;
  642|       |
  643|      0|  result = curlx_dyn_add(&sig_hdr, HTTPSIG_DEFAULT_LABEL "=");
  ------------------
  |  |   48|      0|#define HTTPSIG_DEFAULT_LABEL  "sig1"
  ------------------
  644|      0|  if(result)
  ------------------
  |  Branch (644:6): [True: 0, False: 0]
  ------------------
  645|      0|    goto fail;
  646|      0|  result = sf_encode_byte_seq(raw_sig, raw_sig_len, &sig_hdr);
  647|      0|  if(result)
  ------------------
  |  Branch (647:6): [True: 0, False: 0]
  ------------------
  648|      0|    goto fail;
  649|       |
  650|      0|  result = curlx_dyn_addf(&input_hdr, "%s=%s", HTTPSIG_DEFAULT_LABEL,
  ------------------
  |  |   48|      0|#define HTTPSIG_DEFAULT_LABEL  "sig1"
  ------------------
  651|      0|                          curlx_dyn_ptr(&sig_params));
  652|      0|  if(result)
  ------------------
  |  Branch (652:6): [True: 0, False: 0]
  ------------------
  653|      0|    goto fail;
  654|       |
  655|      0|  auth_headers = curl_maprintf("Signature-Input: %s\r\n"
  656|      0|                               "Signature: %s\r\n",
  657|      0|                               curlx_dyn_ptr(&input_hdr),
  658|      0|                               curlx_dyn_ptr(&sig_hdr));
  659|      0|  if(!auth_headers)
  ------------------
  |  Branch (659:6): [True: 0, False: 0]
  ------------------
  660|      0|    goto fail;
  661|       |
  662|      0|  infof(data, "httpsig: Signature-Input: %s", curlx_dyn_ptr(&input_hdr));
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  663|      0|  infof(data, "httpsig: Signature: %s", curlx_dyn_ptr(&sig_hdr));
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  664|      0|done:
  665|      0|  curlx_free(data->req.hd_auth);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  666|      0|  data->req.hd_auth = auth_headers;
  667|      0|  data->state.authhost.done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  668|      0|  result = CURLE_OK;
  669|       |
  670|      0|fail:
  671|      0|  if(keybuf) {
  ------------------
  |  Branch (671:6): [True: 0, False: 0]
  ------------------
  672|      0|    memset(keybuf, 0, keylen);
  673|      0|    curlx_free(keybuf);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  674|      0|  }
  675|      0|  memset(raw_sig, 0, sizeof(raw_sig));
  676|      0|  curlx_free(hdrs_copy);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  677|      0|  curlx_dyn_free(&sig_params);
  678|      0|  curlx_dyn_free(&sig_base);
  679|      0|  curlx_dyn_free(&sig_hdr);
  680|      0|  curlx_dyn_free(&input_hdr);
  681|      0|  curlx_dyn_free(&authority_buf);
  682|      0|  curlx_dyn_free(&query_dyn);
  683|      0|  return result;
  684|      0|}
http_httpsig.c:id_to_alg:
   70|      2|{
   71|      2|  switch(val) {
   72|      0|  case CURLHTTPSIG_ED25519:
  ------------------
  |  |  859|      0|#define CURLHTTPSIG_ED25519       1L
  ------------------
  |  Branch (72:3): [True: 0, False: 2]
  ------------------
   73|      0|    return HTTPSIG_ALG_ED25519;
   74|      0|  case CURLHTTPSIG_HMAC_SHA256:
  ------------------
  |  |  860|      0|#define CURLHTTPSIG_HMAC_SHA256   2L
  ------------------
  |  Branch (74:3): [True: 0, False: 2]
  ------------------
   75|      0|    return HTTPSIG_ALG_HMAC_SHA256;
   76|      2|  default:
  ------------------
  |  Branch (76:3): [True: 2, False: 0]
  ------------------
   77|      2|    break;
   78|      2|  }
   79|      2|  return HTTPSIG_ALG_UNKNOWN;
   80|      2|}

Curl_http_proxy_create_tunnel_request:
  361|  7.21k|{
  362|  7.21k|  CURLcode result = udp_tunnel ?
  ------------------
  |  Branch (362:21): [True: 7.21k, False: 0]
  ------------------
  363|  7.21k|    http_proxy_create_CONNECTUDP(preq, cf, data, peer, dest, ver) :
  364|  7.21k|    http_proxy_create_CONNECT(preq, cf, data, peer, dest, ver);
  365|  7.21k|  if(result)
  ------------------
  |  Branch (365:6): [True: 20, False: 7.19k]
  ------------------
  366|     20|    return result;
  367|       |
  368|  7.19k|  infof(data, "Establishing %s proxy %stunnel to %s:%u",
  ------------------
  |  |  143|  7.19k|  do {                               \
  |  |  144|  7.19k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  7.19k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 7.19k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 714, False: 6.48k]
  |  |  |  |  ------------------
  |  |  |  |  323|  7.19k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 714, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    714|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  7.19k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 714]
  |  |  |  Branch (145:24): [True: 0, False: 714]
  |  |  |  Branch (145:24): [True: 714, False: 0]
  |  |  ------------------
  |  |  146|  7.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 7.19k]
  |  |  ------------------
  ------------------
  369|  7.19k|        (ver == PROXY_HTTP_V2) ? "HTTP/2" :
  370|  7.19k|        (ver == PROXY_HTTP_V3) ? "HTTP/3" : "HTTP",
  371|  7.19k|        udp_tunnel ? "UDP " : "",
  372|  7.19k|        dest->user_hostname, dest->port);
  373|  7.19k|  return CURLE_OK;
  374|  7.21k|}
Curl_cf_http_proxy_insert_after:
  644|  7.22k|{
  645|  7.22k|  struct Curl_cfilter *cf;
  646|  7.22k|  struct cf_proxy_ctx *ctx = NULL;
  647|  7.22k|  CURLcode result;
  648|       |
  649|  7.22k|  (void)data;
  650|  7.22k|  if(!peer || !tunnel_peer)
  ------------------
  |  Branch (650:6): [True: 0, False: 7.22k]
  |  Branch (650:15): [True: 0, False: 7.22k]
  ------------------
  651|      0|    return CURLE_FAILED_INIT;
  652|       |
  653|  7.22k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|  7.22k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  654|  7.22k|  if(!ctx) {
  ------------------
  |  Branch (654:6): [True: 2, False: 7.22k]
  ------------------
  655|      2|    result = CURLE_OUT_OF_MEMORY;
  656|      2|    goto out;
  657|      2|  }
  658|  7.22k|  Curl_peer_link(&ctx->peer, peer);
  659|  7.22k|  Curl_peer_link(&ctx->tunnel_peer, tunnel_peer);
  660|  7.22k|  ctx->proxytype = proxytype;
  661|  7.22k|  ctx->tunnel_transport = tunnel_transport;
  662|       |
  663|  7.22k|  result = Curl_cf_create(&cf, &Curl_cft_http_proxy, ctx);
  664|  7.22k|  if(result)
  ------------------
  |  Branch (664:6): [True: 2, False: 7.22k]
  ------------------
  665|      2|    goto out;
  666|  7.22k|  ctx = NULL;
  667|  7.22k|  Curl_conn_cf_insert_after(cf_at, cf);
  668|       |
  669|  7.22k|out:
  670|  7.22k|  cf_https_proxy_ctx_free(ctx);
  671|  7.22k|  return result;
  672|  7.22k|}
Curl_http_proxy_transport:
  675|  7.23k|{
  676|  7.23k|  switch(proxytype) {
  677|      0|  case CURLPROXY_HTTPS3:
  ------------------
  |  |  807|      0|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (677:3): [True: 0, False: 7.23k]
  ------------------
  678|      0|    return TRNSPRT_QUIC;
  ------------------
  |  |  227|      0|#define TRNSPRT_QUIC 5
  ------------------
  679|  7.23k|  default:
  ------------------
  |  Branch (679:3): [True: 7.23k, False: 0]
  ------------------
  680|  7.23k|    return TRNSPRT_TCP;
  ------------------
  |  |  225|  7.23k|#define TRNSPRT_TCP  3
  ------------------
  681|  7.23k|  }
  682|  7.23k|}
http_proxy.c:http_proxy_create_CONNECTUDP:
  229|  7.21k|{
  230|  7.21k|  struct connectdata *conn = CF_CONN(cf);
  ------------------
  |  |  260|  7.21k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  231|  7.21k|  const char *proxy_scheme = "http", *ua;
  232|  7.21k|  int httpversion = proxy_http_ver_major(ver);
  233|  7.21k|  char *authority = NULL;
  234|  7.21k|  char *path = NULL;
  235|  7.21k|  char *encoded_host = NULL;
  236|  7.21k|  struct httpreq *req = NULL;
  237|  7.21k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  238|       |
  239|  7.21k|  if(conn->http_proxy.proxytype == CURLPROXY_HTTPS ||
  ------------------
  |  |  796|  14.4k|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  ------------------
  |  Branch (239:6): [True: 0, False: 7.21k]
  ------------------
  240|  7.21k|     conn->http_proxy.proxytype == CURLPROXY_HTTPS2 ||
  ------------------
  |  |  798|  14.4k|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  ------------------
  |  Branch (240:6): [True: 0, False: 7.21k]
  ------------------
  241|  7.21k|     conn->http_proxy.proxytype == CURLPROXY_HTTPS3)
  ------------------
  |  |  807|  7.21k|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (241:6): [True: 0, False: 7.21k]
  ------------------
  242|      0|    proxy_scheme = "https";
  243|       |
  244|  7.21k|  authority = curl_maprintf("%s%s%s:%d",
  245|  7.21k|                            peer->ipv6 ? "[" : "",
  ------------------
  |  Branch (245:29): [True: 0, False: 7.21k]
  ------------------
  246|  7.21k|                            peer->hostname,
  247|  7.21k|                            peer->ipv6 ? "]" : "",
  ------------------
  |  Branch (247:29): [True: 0, False: 7.21k]
  ------------------
  248|  7.21k|                            peer->port);
  249|  7.21k|  if(!authority)
  ------------------
  |  Branch (249:6): [True: 2, False: 7.21k]
  ------------------
  250|      2|    goto out;
  251|       |
  252|  7.21k|  if(dest->ipv6) {
  ------------------
  |  Branch (252:6): [True: 5.63k, False: 1.58k]
  ------------------
  253|       |    /* RFC 9298: colons in IPv6 addresses MUST be percent-encoded
  254|       |     * in the URI template (e.g. "2001:db8::1" -> "2001%3Adb8%3A%3A1") */
  255|  5.63k|    const char *s = dest->hostname;
  256|  5.63k|    char *d;
  257|  5.63k|    size_t hlen = strlen(s);
  258|  5.63k|    encoded_host = curlx_malloc(hlen * 3 + 1);
  ------------------
  |  | 1498|  5.63k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  259|  5.63k|    if(!encoded_host) {
  ------------------
  |  Branch (259:8): [True: 1, False: 5.63k]
  ------------------
  260|      1|      result = CURLE_OUT_OF_MEMORY;
  261|      1|      goto out;
  262|      1|    }
  263|  5.63k|    d = encoded_host;
  264|  22.5k|    while(*s) {
  ------------------
  |  Branch (264:11): [True: 16.8k, False: 5.63k]
  ------------------
  265|  16.8k|      if(*s == ':') {
  ------------------
  |  Branch (265:10): [True: 11.2k, False: 5.63k]
  ------------------
  266|  11.2k|        *d++ = '%';
  267|  11.2k|        *d++ = '3';
  268|  11.2k|        *d++ = 'A';
  269|  11.2k|      }
  270|  5.63k|      else
  271|  5.63k|        *d++ = *s;
  272|  16.8k|      s++;
  273|  16.8k|    }
  274|  5.63k|    *d = '\0';
  275|  5.63k|    path = curl_maprintf("/.well-known/masque/udp/%s/%u/",
  276|  5.63k|                         encoded_host, (unsigned int)dest->port);
  277|  5.63k|  }
  278|  1.58k|  else {
  279|  1.58k|    path = curl_maprintf("/.well-known/masque/udp/%s/%u/",
  280|  1.58k|                         dest->hostname, (unsigned int)dest->port);
  281|  1.58k|  }
  282|  7.21k|  if(!path)
  ------------------
  |  Branch (282:6): [True: 1, False: 7.21k]
  ------------------
  283|      1|    goto out;
  284|       |
  285|  7.21k|  if(ver == PROXY_HTTP_V1) {
  ------------------
  |  Branch (285:6): [True: 7.21k, False: 0]
  ------------------
  286|  7.21k|    result = Curl_http_req_make(&req, "GET", CURL_CSTRLEN("GET"),
  ------------------
  |  | 1319|  7.21k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
  287|  7.21k|                                proxy_scheme, strlen(proxy_scheme),
  288|  7.21k|                                authority, strlen(authority),
  289|  7.21k|                                path, strlen(path));
  290|  7.21k|  }
  291|      0|  else if(ver == PROXY_HTTP_V2 || ver == PROXY_HTTP_V3) {
  ------------------
  |  Branch (291:11): [True: 0, False: 0]
  |  Branch (291:35): [True: 0, False: 0]
  ------------------
  292|      0|    result = Curl_http_req_make(&req, STRCONST("CONNECT"),
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  293|      0|                                proxy_scheme, strlen(proxy_scheme),
  294|      0|                                authority, strlen(authority),
  295|      0|                                path, strlen(path));
  296|      0|  }
  297|      0|  else
  298|      0|    result = CURLE_FAILED_INIT;
  299|  7.21k|  if(result)
  ------------------
  |  Branch (299:6): [True: 4, False: 7.20k]
  ------------------
  300|      4|    goto out;
  301|       |
  302|  7.20k|  if(ver > PROXY_HTTP_V1) {
  ------------------
  |  Branch (302:6): [True: 0, False: 7.20k]
  ------------------
  303|       |    /* Pseudo header must go first */
  304|      0|    result = Curl_dynhds_cadd(&req->headers, ":Protocol", "connect-udp");
  305|      0|  }
  306|  7.20k|  else {
  307|       |    /* If user is not overriding Host: header, we add for HTTP/1.x */
  308|  7.20k|    if(!Curl_checkProxyheaders(data, conn, STRCONST("Host"))) {
  ------------------
  |  | 1324|  7.20k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  7.20k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (308:8): [True: 7.20k, False: 0]
  ------------------
  309|  7.20k|      result = Curl_dynhds_cadd(&req->headers, "Host", authority);
  310|  7.20k|    }
  311|  7.20k|    if(!result &&
  ------------------
  |  Branch (311:8): [True: 7.20k, False: 2]
  ------------------
  312|  7.20k|       !Curl_checkProxyheaders(data, conn, STRCONST("Proxy-Connection"))) {
  ------------------
  |  | 1324|  7.20k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  7.20k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (312:8): [True: 7.20k, False: 0]
  ------------------
  313|  7.20k|      result = Curl_dynhds_cadd(&req->headers, "Proxy-Connection",
  314|  7.20k|                                "Keep-Alive");
  315|  7.20k|    }
  316|  7.20k|    if(!result)
  ------------------
  |  Branch (316:8): [True: 7.20k, False: 3]
  ------------------
  317|  7.20k|      result = Curl_dynhds_cadd(&req->headers, "Connection", "Upgrade");
  318|  7.20k|    if(!result)
  ------------------
  |  Branch (318:8): [True: 7.20k, False: 4]
  ------------------
  319|  7.20k|      result = Curl_dynhds_cadd(&req->headers, "Upgrade", "connect-udp");
  320|  7.20k|  }
  321|       |
  322|  7.20k|  if(!result)
  ------------------
  |  Branch (322:6): [True: 7.20k, False: 5]
  ------------------
  323|       |    /* Setup the proxy-authorization header, if any */
  324|  7.20k|    result = Curl_http_output_auth(data, conn, HTTPREQ_GET, req->method,
  325|  7.20k|                                   req->authority, NULL, TRUE);
  ------------------
  |  |  986|  7.20k|#define TRUE true
  ------------------
  326|  7.20k|  if(!result && data->req.hd_proxy_auth)
  ------------------
  |  Branch (326:6): [True: 7.19k, False: 10]
  |  Branch (326:17): [True: 247, False: 6.95k]
  ------------------
  327|    247|    result = Curl_dynhds_h1_cadd_line(&req->headers,
  328|    247|                                      data->req.hd_proxy_auth);
  329|  7.20k|  if(!result)
  ------------------
  |  Branch (329:6): [True: 7.19k, False: 11]
  ------------------
  330|  7.19k|    result = Curl_dynhds_cadd(&req->headers, "Capsule-Protocol", "?1");
  331|  7.20k|  if(!result) {
  ------------------
  |  Branch (331:6): [True: 7.19k, False: 12]
  ------------------
  332|  7.19k|    ua = CURL_EASY_STR(data, STRING_USERAGENT);
  ------------------
  |  | 1206|  7.19k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  333|  7.19k|    if(ver == PROXY_HTTP_V1 &&
  ------------------
  |  Branch (333:8): [True: 7.19k, False: 0]
  ------------------
  334|  7.19k|       !Curl_checkProxyheaders(data, conn, STRCONST("User-Agent")) &&
  ------------------
  |  | 1324|  7.19k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  7.19k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (334:8): [True: 7.19k, False: 0]
  ------------------
  335|  7.19k|       ua && *ua) {
  ------------------
  |  Branch (335:8): [True: 58, False: 7.13k]
  |  Branch (335:14): [True: 42, False: 16]
  ------------------
  336|     42|      result = Curl_dynhds_cadd(&req->headers, "User-Agent", ua);
  337|     42|      if(result)
  ------------------
  |  Branch (337:10): [True: 0, False: 42]
  ------------------
  338|      0|        goto out;
  339|     42|    }
  340|  7.19k|  }
  341|  7.20k|  if(!result)
  ------------------
  |  Branch (341:6): [True: 7.19k, False: 12]
  ------------------
  342|  7.19k|    result = dynhds_add_custom(data, TRUE, httpversion, &req->headers);
  ------------------
  |  |  986|  7.19k|#define TRUE true
  ------------------
  343|       |
  344|  7.21k|out:
  345|  7.21k|  if(result && req) {
  ------------------
  |  Branch (345:6): [True: 20, False: 7.19k]
  |  Branch (345:16): [True: 12, False: 8]
  ------------------
  346|     12|    Curl_http_req_free(req);
  347|     12|    req = NULL;
  348|     12|  }
  349|  7.21k|  curlx_safefree(data->req.hd_proxy_auth); /* not needed any more */
  ------------------
  |  | 1359|  7.21k|  do {                      \
  |  | 1360|  7.21k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  7.21k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  7.21k|    (ptr) = NULL;           \
  |  | 1362|  7.21k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 7.21k]
  |  |  ------------------
  ------------------
  350|  7.21k|  curlx_free(authority);
  ------------------
  |  | 1503|  7.21k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  351|  7.21k|  curlx_free(path);
  ------------------
  |  | 1503|  7.21k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  352|  7.21k|  curlx_free(encoded_host);
  ------------------
  |  | 1503|  7.21k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  353|  7.21k|  *preq = req;
  354|  7.21k|  return result;
  355|  7.20k|}
http_proxy.c:proxy_http_ver_major:
  131|  7.21k|{
  132|  7.21k|  switch(ver) {
  ------------------
  |  Branch (132:10): [True: 7.21k, False: 0]
  ------------------
  133|  7.21k|  case PROXY_HTTP_V1:
  ------------------
  |  Branch (133:3): [True: 7.21k, False: 0]
  ------------------
  134|  7.21k|    return 11;
  135|      0|  case PROXY_HTTP_V2:
  ------------------
  |  Branch (135:3): [True: 0, False: 7.21k]
  ------------------
  136|      0|    return 20;
  137|      0|  case PROXY_HTTP_V3:
  ------------------
  |  Branch (137:3): [True: 0, False: 7.21k]
  ------------------
  138|      0|    return 30;
  139|  7.21k|  }
  140|      0|  return 0;
  141|  7.21k|}
http_proxy.c:dynhds_add_custom:
   89|  7.19k|{
   90|  7.19k|  struct connectdata *conn = data->conn;
   91|  7.19k|  struct curl_slist *h[2];
   92|  7.19k|  int numlists = 0; /* by default */
   93|  7.19k|  struct proxy_custom_ctx ign_ctx;
   94|  7.19k|  int i;
   95|       |
   96|  7.19k|  if(is_connect) {
  ------------------
  |  Branch (96:6): [True: 7.19k, False: 0]
  ------------------
   97|  7.19k|    h[numlists++] = data->set.sep_headers ?
  ------------------
  |  Branch (97:21): [True: 7.19k, False: 0]
  ------------------
   98|  7.19k|                    data->set.proxyheaders : data->set.headers;
   99|  7.19k|  }
  100|      0|  else if(conn->bits.origin_is_proxy) {
  ------------------
  |  Branch (100:11): [True: 0, False: 0]
  ------------------
  101|      0|    h[numlists++] = data->set.headers;
  102|      0|    if(data->set.sep_headers)
  ------------------
  |  Branch (102:8): [True: 0, False: 0]
  ------------------
  103|      0|      h[numlists++] = data->set.proxyheaders;
  104|      0|  }
  105|      0|  else {
  106|      0|    h[numlists++] = data->set.headers;
  107|      0|  }
  108|       |
  109|       |  /* loop through one or two lists, adding custom headers */
  110|  7.19k|  ign_ctx.data = data;
  111|  7.19k|  ign_ctx.httpversion = httpversion;
  112|  14.3k|  for(i = 0; i < numlists; i++) {
  ------------------
  |  Branch (112:14): [True: 7.19k, False: 7.19k]
  ------------------
  113|  7.19k|    CURLcode result =
  114|  7.19k|      Curl_dynhds_add_slist(hds, h[i], prox_custom_ignore, &ign_ctx);
  115|  7.19k|      if(result)
  ------------------
  |  Branch (115:10): [True: 0, False: 7.19k]
  ------------------
  116|      0|        return result;
  117|  7.19k|  }
  118|       |
  119|  7.19k|  return CURLE_OK;
  120|  7.19k|}
http_proxy.c:http_proxy_cf_destroy:
  613|  7.22k|{
  614|  7.22k|  struct cf_proxy_ctx *ctx = cf->ctx;
  615|  7.22k|  if(ctx) {
  ------------------
  |  Branch (615:6): [True: 7.22k, False: 0]
  ------------------
  616|  7.22k|    CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  7.22k|  do {                                          \
  |  |  154|  7.22k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  7.22k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  14.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.22k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 7.22k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.22k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.22k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.22k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.22k]
  |  |  ------------------
  ------------------
  617|  7.22k|    cf_https_proxy_ctx_free(ctx);
  618|  7.22k|  }
  619|  7.22k|}
http_proxy.c:http_proxy_cf_connect:
  463|  14.5k|{
  464|  14.5k|  struct cf_proxy_ctx *ctx = cf->ctx;
  465|  14.5k|  CURLcode result;
  466|  14.5k|  bool udp_tunnel = TRNSPRT_IS_DGRAM(ctx->tunnel_transport);
  ------------------
  |  |  230|  14.5k|#define TRNSPRT_IS_DGRAM(x)   (((x) == TRNSPRT_UDP) || ((x) == TRNSPRT_QUIC))
  |  |  ------------------
  |  |  |  |  226|  14.5k|#define TRNSPRT_UDP  4
  |  |  ------------------
  |  |               #define TRNSPRT_IS_DGRAM(x)   (((x) == TRNSPRT_UDP) || ((x) == TRNSPRT_QUIC))
  |  |  ------------------
  |  |  |  |  227|  14.5k|#define TRNSPRT_QUIC 5
  |  |  ------------------
  |  |  |  Branch (230:32): [True: 0, False: 14.5k]
  |  |  |  Branch (230:56): [True: 14.5k, False: 0]
  |  |  ------------------
  ------------------
  467|       |
  468|  14.5k|  if(cf->connected) {
  ------------------
  |  Branch (468:6): [True: 1.37k, False: 13.1k]
  ------------------
  469|  1.37k|    *done = TRUE;
  ------------------
  |  |  986|  1.37k|#define TRUE true
  ------------------
  470|  1.37k|    return CURLE_OK;
  471|  1.37k|  }
  472|       |
  473|  13.1k|  CURL_TRC_CF(data, cf, "CONNECT%s", udp_tunnel ? "-UDP" : "");
  ------------------
  |  |  153|  13.1k|  do {                                          \
  |  |  154|  13.1k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  13.1k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  26.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 13.1k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 2.71k, False: 10.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  26.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 2.71k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  2.71k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  13.1k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  2.71k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 2.71k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 1.13k, False: 1.57k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  13.1k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 1.13k, False: 0]
  |  |  ------------------
  |  |  156|  13.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 13.1k]
  |  |  ------------------
  ------------------
  474|  20.4k|connect_sub:
  475|       |  /* in case of h3_proxy, cf->next will be NULL initially */
  476|  20.4k|  if(cf->next) {
  ------------------
  |  Branch (476:6): [True: 20.4k, False: 0]
  ------------------
  477|  20.4k|    result = cf->next->cft->do_connect(cf->next, data, done);
  478|  20.4k|    if(result || !*done)
  ------------------
  |  Branch (478:8): [True: 5.83k, False: 14.5k]
  |  Branch (478:18): [True: 5.97k, False: 8.60k]
  ------------------
  479|  11.8k|      return result;
  480|  20.4k|  }
  481|       |
  482|  8.60k|  *done = FALSE;
  ------------------
  |  |  989|  8.60k|#define FALSE false
  ------------------
  483|  8.60k|  if(!ctx->sub_filter_installed) {
  ------------------
  |  Branch (483:6): [True: 7.22k, False: 1.38k]
  ------------------
  484|  7.22k|    const char *alpn = NULL;
  485|       |
  486|       |    /* in case of h3_proxy, cf->next will be NULL initially */
  487|  7.22k|    if(cf->next) {
  ------------------
  |  Branch (487:8): [True: 7.22k, False: 0]
  ------------------
  488|  7.22k|      alpn = Curl_conn_cf_get_alpn_negotiated(cf->next, data);
  489|  7.22k|    }
  490|       |
  491|  7.22k|    if(alpn)
  ------------------
  |  Branch (491:8): [True: 0, False: 7.22k]
  ------------------
  492|      0|      infof(data, "CONNECT%s: '%s' negotiated",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  493|  7.22k|            udp_tunnel ? "-UDP" : "", alpn);
  494|  7.22k|    else if(!alpn) {
  ------------------
  |  Branch (494:13): [True: 7.22k, False: 0]
  ------------------
  495|       |      /* No ALPN, proxytype rules. Fake ALPN */
  496|  7.22k|      infof(data, "CONNECT%s: no ALPN negotiated", udp_tunnel ? "-UDP" : "");
  ------------------
  |  |  143|  7.22k|  do {                               \
  |  |  144|  7.22k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  7.22k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 7.22k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 717, False: 6.50k]
  |  |  |  |  ------------------
  |  |  |  |  323|  7.22k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 717, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    717|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  7.22k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 717, False: 0]
  |  |  ------------------
  |  |  146|  7.22k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 7.22k]
  |  |  ------------------
  ------------------
  497|  7.22k|      switch(ctx->proxytype) {
  498|      0|      case CURLPROXY_HTTP_1_0:
  ------------------
  |  |  794|      0|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (498:7): [True: 0, False: 7.22k]
  ------------------
  499|      0|        alpn = "http/1.0";
  500|      0|        break;
  501|      0|      case CURLPROXY_HTTPS2:
  ------------------
  |  |  798|      0|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  ------------------
  |  Branch (501:7): [True: 0, False: 7.22k]
  ------------------
  502|      0|        alpn = "h2";
  503|      0|        break;
  504|      0|      case CURLPROXY_HTTPS3:
  ------------------
  |  |  807|      0|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (504:7): [True: 0, False: 7.22k]
  ------------------
  505|      0|        alpn = "h3";
  506|      0|        break;
  507|  7.22k|      default:
  ------------------
  |  Branch (507:7): [True: 7.22k, False: 0]
  ------------------
  508|  7.22k|        alpn = "http/1.1";
  509|  7.22k|        break;
  510|  7.22k|      }
  511|  7.22k|    }
  512|       |
  513|  7.22k|    if(!strcmp(alpn, "http/1.0")) {
  ------------------
  |  Branch (513:8): [True: 0, False: 7.22k]
  ------------------
  514|      0|      CURL_TRC_CF(data, cf, "installing subfilter for HTTP/1.0");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  515|      0|      result = Curl_cf_h1_proxy_insert_after(cf, data, ctx->peer,
  516|      0|                                             ctx->tunnel_peer, 10, udp_tunnel);
  517|      0|      if(result)
  ------------------
  |  Branch (517:10): [True: 0, False: 0]
  ------------------
  518|      0|        goto out;
  519|      0|    }
  520|  7.22k|    else if(!strcmp(alpn, "http/1.1")) {
  ------------------
  |  Branch (520:13): [True: 7.22k, False: 0]
  ------------------
  521|  7.22k|      int httpversion = (ctx->proxytype == CURLPROXY_HTTP_1_0) ? 10 : 11;
  ------------------
  |  |  794|  7.22k|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (521:25): [True: 0, False: 7.22k]
  ------------------
  522|  7.22k|      CURL_TRC_CF(data, cf, "installing subfilter for HTTP/1.%d",
  ------------------
  |  |  153|  7.22k|  do {                                          \
  |  |  154|  7.22k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  7.22k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  14.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.22k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 717, False: 6.50k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  14.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 717, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    717|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  7.22k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    717|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 717, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 152, False: 565]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  7.22k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  7.22k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 7.22k]
  |  |  ------------------
  ------------------
  523|  7.22k|                  httpversion % 10);
  524|  7.22k|      result = Curl_cf_h1_proxy_insert_after(cf, data, ctx->peer,
  525|  7.22k|                                             ctx->tunnel_peer,
  526|  7.22k|                                             httpversion, udp_tunnel);
  527|  7.22k|      if(result)
  ------------------
  |  Branch (527:10): [True: 3, False: 7.21k]
  ------------------
  528|      3|        goto out;
  529|  7.22k|    }
  530|      0|#ifdef USE_NGHTTP2
  531|      0|    else if(!strcmp(alpn, "h2")) {
  ------------------
  |  Branch (531:13): [True: 0, False: 0]
  ------------------
  532|      0|      CURL_TRC_CF(data, cf, "installing subfilter for HTTP/2");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  533|      0|      result = Curl_cf_h2_proxy_insert_after(cf, data, ctx->peer,
  534|      0|                                             ctx->tunnel_peer, udp_tunnel);
  535|      0|      if(result)
  ------------------
  |  Branch (535:10): [True: 0, False: 0]
  ------------------
  536|      0|        goto out;
  537|      0|    }
  538|      0|#endif /* USE_NGHTTP2 */
  539|       |#if defined(USE_PROXY_HTTP3) && defined(USE_NGHTTP3) && \
  540|       |  defined(USE_NGTCP2) && defined(USE_OPENSSL)
  541|       |    else if(!strcmp(alpn, "h3")) {
  542|       |      CURL_TRC_CF(data, cf, "installing subfilter for HTTP/3");
  543|       |      result = Curl_cf_h3_proxy_insert_after(cf, data, ctx->peer, ctx->peer,
  544|       |                                             ctx->tunnel_peer,
  545|       |                                             ctx->tunnel_transport);
  546|       |      if(result)
  547|       |        goto out;
  548|       |    }
  549|       |#endif /* USE_PROXY_HTTP3 && USE_NGHTTP3 && USE_NGTCP2 && USE_OPENSSL */
  550|      0|    else {
  551|      0|      failf(data, "CONNECT%s: negotiated ALPN '%s' not supported",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  552|      0|            udp_tunnel ? "-UDP" : "", alpn);
  ------------------
  |  Branch (552:13): [True: 0, False: 0]
  ------------------
  553|      0|      result = CURLE_COULDNT_CONNECT;
  554|      0|      goto out;
  555|      0|    }
  556|       |
  557|  7.21k|    ctx->sub_filter_installed = TRUE;
  ------------------
  |  |  986|  7.21k|#define TRUE true
  ------------------
  558|       |    /* after we installed the filter "below" us, we call connect
  559|       |     * on out sub-chain again.
  560|       |     */
  561|  7.21k|    goto connect_sub;
  562|  7.22k|  }
  563|  1.38k|  else {
  564|       |    /* subchain connected and we had already installed the protocol filter.
  565|       |     * This means the protocol tunnel is established, we are done. */
  566|  1.38k|    DEBUGASSERT(ctx->sub_filter_installed);
  ------------------
  |  | 1016|  1.38k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (566:5): [True: 0, False: 1.38k]
  |  Branch (566:5): [True: 1.38k, False: 0]
  ------------------
  567|  1.38k|    result = CURLE_OK;
  568|  1.38k|  }
  569|       |
  570|  1.38k|out:
  571|  1.38k|  if(!result) {
  ------------------
  |  Branch (571:6): [True: 1.38k, False: 3]
  ------------------
  572|  1.38k|    cf->connected = TRUE;
  ------------------
  |  |  986|  1.38k|#define TRUE true
  ------------------
  573|       |    *done = TRUE;
  ------------------
  |  |  986|  1.38k|#define TRUE true
  ------------------
  574|  1.38k|  }
  575|  1.38k|  return result;
  576|  8.60k|}
http_proxy.c:cf_http_proxy_query:
  581|   123k|{
  582|   123k|  struct cf_proxy_ctx *ctx = cf->ctx;
  583|   123k|  switch(query) {
  584|      0|  case CF_QUERY_HOST_PORT:
  ------------------
  |  |  177|      0|#define CF_QUERY_HOST_PORT         11  /* port       const char * */
  ------------------
  |  Branch (584:3): [True: 0, False: 123k]
  ------------------
  585|      0|    *pres1 = (int)ctx->tunnel_peer->port;
  586|      0|    *((const char **)pres2) = ctx->tunnel_peer->hostname;
  587|      0|    return CURLE_OK;
  588|      0|  case CF_QUERY_ALPN_NEGOTIATED: {
  ------------------
  |  |  181|      0|#define CF_QUERY_ALPN_NEGOTIATED   15  /* -          const char * */
  ------------------
  |  Branch (588:3): [True: 0, False: 123k]
  ------------------
  589|      0|    const char **palpn = pres2;
  590|      0|    DEBUGASSERT(palpn);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (590:5): [True: 0, False: 0]
  |  Branch (590:5): [True: 0, False: 0]
  ------------------
  591|      0|    *palpn = NULL;
  592|      0|    return CURLE_OK;
  593|      0|  }
  594|   123k|  default:
  ------------------
  |  Branch (594:3): [True: 123k, False: 0]
  ------------------
  595|   123k|    break;
  596|   123k|  }
  597|   123k|  return cf->next ?
  ------------------
  |  Branch (597:10): [True: 123k, False: 0]
  ------------------
  598|   123k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  599|   123k|    CURLE_UNKNOWN_OPTION;
  600|   123k|}
http_proxy.c:cf_https_proxy_ctx_free:
  603|  14.4k|{
  604|  14.4k|  if(ctx) {
  ------------------
  |  Branch (604:6): [True: 7.22k, False: 7.22k]
  ------------------
  605|  7.22k|    Curl_peer_unlink(&ctx->peer);
  606|  7.22k|    Curl_peer_unlink(&ctx->tunnel_peer);
  607|  7.22k|    curlx_free(ctx);
  ------------------
  |  | 1503|  7.22k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  608|  7.22k|  }
  609|  14.4k|}

Curl_is_ASCII_str:
  238|  13.0k|{
  239|  13.0k|  if(s && s->len) {
  ------------------
  |  Branch (239:6): [True: 13.0k, False: 0]
  |  Branch (239:11): [True: 13.0k, False: 0]
  ------------------
  240|  13.0k|    const unsigned char *ch = (const unsigned char *)s->str;
  241|  13.0k|    size_t i;
  242|   130k|    for(i = 0; i < s->len; ++i) {
  ------------------
  |  Branch (242:16): [True: 117k, False: 13.0k]
  ------------------
  243|   117k|      if(ch[i] & 0x80)
  ------------------
  |  Branch (243:10): [True: 0, False: 117k]
  ------------------
  244|      0|        return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  245|   117k|    }
  246|  13.0k|  }
  247|  13.0k|  return TRUE;
  ------------------
  |  |  986|  13.0k|#define TRUE true
  ------------------
  248|  13.0k|}

Curl_ipv6_scope:
   62|  9.20k|{
   63|  9.20k|  if(sa->sa_family == AF_INET6) {
  ------------------
  |  Branch (63:6): [True: 6, False: 9.19k]
  ------------------
   64|      6|    const struct sockaddr_in6 *sa6 =
   65|      6|      (const struct sockaddr_in6 *)(const void *)sa;
   66|      6|    const unsigned char *b = sa6->sin6_addr.s6_addr;
   67|      6|    unsigned short w = (unsigned short)((b[0] << 8) | b[1]);
   68|       |
   69|      6|    if((b[0] & 0xFE) == 0xFC) /* Handle ULAs */
  ------------------
  |  Branch (69:8): [True: 0, False: 6]
  ------------------
   70|      0|      return IPV6_SCOPE_UNIQUELOCAL;
  ------------------
  |  |   32|      0|#define IPV6_SCOPE_UNIQUELOCAL  3       /* Unique local */
  ------------------
   71|      6|    switch(w & 0xFFC0) {
   72|      0|    case 0xFE80:
  ------------------
  |  Branch (72:5): [True: 0, False: 6]
  ------------------
   73|      0|      return IPV6_SCOPE_LINKLOCAL;
  ------------------
  |  |   30|      0|#define IPV6_SCOPE_LINKLOCAL    1       /* Link-local scope. */
  ------------------
   74|      0|    case 0xFEC0:
  ------------------
  |  Branch (74:5): [True: 0, False: 6]
  ------------------
   75|      0|      return IPV6_SCOPE_SITELOCAL;
  ------------------
  |  |   31|      0|#define IPV6_SCOPE_SITELOCAL    2       /* Site-local scope (deprecated). */
  ------------------
   76|      6|    case 0x0000:
  ------------------
  |  Branch (76:5): [True: 6, False: 0]
  ------------------
   77|      6|      w = b[1] | b[2] | b[3] | b[4] | b[5] | b[6] | b[7] | b[8] | b[9] |
   78|      6|          b[10] | b[11] | b[12] | b[13] | b[14];
   79|      6|      if(w || b[15] != 0x01)
  ------------------
  |  Branch (79:10): [True: 0, False: 6]
  |  Branch (79:15): [True: 0, False: 6]
  ------------------
   80|      0|        break;
   81|      6|      return IPV6_SCOPE_NODELOCAL;
  ------------------
  |  |   33|      6|#define IPV6_SCOPE_NODELOCAL    4       /* Loopback. */
  ------------------
   82|      0|    default:
  ------------------
  |  Branch (82:5): [True: 0, False: 6]
  ------------------
   83|      0|      break;
   84|      6|    }
   85|      6|  }
   86|  9.19k|  return IPV6_SCOPE_GLOBAL;
  ------------------
  |  |   29|  9.19k|#define IPV6_SCOPE_GLOBAL       0       /* Global scope. */
  ------------------
   87|  9.20k|}

Curl_llist_init:
   46|   978k|{
   47|   978k|  l->_size = 0;
   48|   978k|  l->_dtor = dtor;
   49|   978k|  l->_head = NULL;
   50|   978k|  l->_tail = NULL;
   51|   978k|#ifdef DEBUGBUILD
   52|   978k|  l->_init = LLISTINIT;
  ------------------
  |  |   29|   978k|#define LLISTINIT 0x100cc001 /* random pattern */
  ------------------
   53|   978k|#endif
   54|   978k|}
llist_insert_next:
   74|  38.5k|{
   75|  38.5k|  DEBUGASSERT(list);
  ------------------
  |  | 1016|  38.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (75:3): [True: 0, False: 38.5k]
  |  Branch (75:3): [True: 38.5k, False: 0]
  ------------------
   76|  38.5k|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1016|  38.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (76:3): [True: 0, False: 38.5k]
  |  Branch (76:3): [True: 38.5k, False: 0]
  ------------------
   77|  38.5k|  DEBUGASSERT(ne);
  ------------------
  |  | 1016|  38.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (77:3): [True: 0, False: 38.5k]
  |  Branch (77:3): [True: 38.5k, False: 0]
  ------------------
   78|       |
   79|  38.5k|#ifdef DEBUGBUILD
   80|  38.5k|  ne->_init = NODEINIT;
  ------------------
  |  |   30|  38.5k|#define NODEINIT  0x12344321 /* random pattern */
  ------------------
   81|  38.5k|#endif
   82|  38.5k|  ne->_ptr = CURL_UNCONST(p);
  ------------------
  |  |  793|  38.5k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   83|  38.5k|  ne->_list = list;
   84|  38.5k|  if(list->_size == 0) {
  ------------------
  |  Branch (84:6): [True: 6.87k, False: 31.6k]
  ------------------
   85|  6.87k|    list->_head = ne;
   86|  6.87k|    list->_head->_prev = NULL;
   87|  6.87k|    list->_head->_next = NULL;
   88|  6.87k|    list->_tail = ne;
   89|  6.87k|  }
   90|  31.6k|  else {
   91|       |    /* if 'e' is NULL here, we insert the new element first in the list */
   92|  31.6k|    ne->_next = e ? e->_next : list->_head;
  ------------------
  |  Branch (92:17): [True: 31.6k, False: 0]
  ------------------
   93|  31.6k|    ne->_prev = e;
   94|  31.6k|    if(!e) {
  ------------------
  |  Branch (94:8): [True: 0, False: 31.6k]
  ------------------
   95|      0|      list->_head->_prev = ne;
   96|      0|      list->_head = ne;
   97|      0|    }
   98|  31.6k|    else if(e->_next) {
  ------------------
  |  Branch (98:13): [True: 0, False: 31.6k]
  ------------------
   99|      0|      e->_next->_prev = ne;
  100|      0|    }
  101|  31.6k|    else {
  102|  31.6k|      list->_tail = ne;
  103|  31.6k|    }
  104|  31.6k|    if(e)
  ------------------
  |  Branch (104:8): [True: 31.6k, False: 0]
  ------------------
  105|  31.6k|      e->_next = ne;
  106|  31.6k|  }
  107|       |
  108|  38.5k|  ++list->_size;
  109|  38.5k|}
Curl_llist_append:
  122|  38.5k|{
  123|  38.5k|  DEBUGASSERT(list);
  ------------------
  |  | 1016|  38.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (123:3): [True: 0, False: 38.5k]
  |  Branch (123:3): [True: 38.5k, False: 0]
  ------------------
  124|  38.5k|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1016|  38.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (124:3): [True: 0, False: 38.5k]
  |  Branch (124:3): [True: 38.5k, False: 0]
  ------------------
  125|  38.5k|  DEBUGASSERT(ne);
  ------------------
  |  | 1016|  38.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (125:3): [True: 0, False: 38.5k]
  |  Branch (125:3): [True: 38.5k, False: 0]
  ------------------
  126|  38.5k|  llist_insert_next(list, list->_tail, p, ne);
  127|  38.5k|}
Curl_node_take_elem:
  130|  8.33k|{
  131|  8.33k|  void *ptr;
  132|  8.33k|  struct Curl_llist *list;
  133|  8.33k|  if(!e)
  ------------------
  |  Branch (133:6): [True: 0, False: 8.33k]
  ------------------
  134|      0|    return NULL;
  135|       |
  136|  8.33k|  list = e->_list;
  137|  8.33k|  DEBUGASSERT(list);
  ------------------
  |  | 1016|  8.33k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (137:3): [True: 0, False: 8.33k]
  |  Branch (137:3): [True: 8.33k, False: 0]
  ------------------
  138|  8.33k|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1016|  8.33k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (138:3): [True: 0, False: 8.33k]
  |  Branch (138:3): [True: 8.33k, False: 0]
  ------------------
  139|  8.33k|  DEBUGASSERT(list->_size);
  ------------------
  |  | 1016|  8.33k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (139:3): [True: 0, False: 8.33k]
  |  Branch (139:3): [True: 8.33k, False: 0]
  ------------------
  140|  8.33k|  DEBUGASSERT(e->_init == NODEINIT);
  ------------------
  |  | 1016|  8.33k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (140:3): [True: 0, False: 8.33k]
  |  Branch (140:3): [True: 8.33k, False: 0]
  ------------------
  141|  8.33k|  if(list) {
  ------------------
  |  Branch (141:6): [True: 8.33k, False: 0]
  ------------------
  142|  8.33k|    if(e == list->_head) {
  ------------------
  |  Branch (142:8): [True: 7.32k, False: 1.01k]
  ------------------
  143|  7.32k|      list->_head = e->_next;
  144|       |
  145|  7.32k|      if(!list->_head)
  ------------------
  |  Branch (145:10): [True: 6.21k, False: 1.10k]
  ------------------
  146|  6.21k|        list->_tail = NULL;
  147|  1.10k|      else
  148|  1.10k|        e->_next->_prev = NULL;
  149|  7.32k|    }
  150|  1.01k|    else {
  151|  1.01k|      if(e->_prev)
  ------------------
  |  Branch (151:10): [True: 1.01k, False: 0]
  ------------------
  152|  1.01k|        e->_prev->_next = e->_next;
  153|       |
  154|  1.01k|      if(!e->_next)
  ------------------
  |  Branch (154:10): [True: 828, False: 183]
  ------------------
  155|    828|        list->_tail = e->_prev;
  156|    183|      else
  157|    183|        e->_next->_prev = e->_prev;
  158|  1.01k|    }
  159|  8.33k|    --list->_size;
  160|  8.33k|  }
  161|  8.33k|  ptr = e->_ptr;
  162|       |
  163|  8.33k|  e->_list = NULL;
  164|  8.33k|  e->_ptr  = NULL;
  165|  8.33k|  e->_prev = NULL;
  166|  8.33k|  e->_next = NULL;
  167|  8.33k|#ifdef DEBUGBUILD
  168|  8.33k|  e->_init = NODEREM; /* specific pattern on remove - not zero */
  ------------------
  |  |   31|  8.33k|#define NODEREM   0x54321012 /* random pattern */
  ------------------
  169|  8.33k|#endif
  170|       |
  171|  8.33k|  return ptr;
  172|  8.33k|}
Curl_node_remove:
  191|  6.10k|{
  192|       |  node_uremove(e, NULL);
  193|  6.10k|}
Curl_llist_destroy:
  196|   265k|{
  197|   265k|  if(list) {
  ------------------
  |  Branch (197:6): [True: 265k, False: 0]
  ------------------
  198|   265k|    DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1016|   265k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (198:5): [True: 0, False: 265k]
  |  Branch (198:5): [True: 265k, False: 0]
  ------------------
  199|   267k|    while(list->_size > 0)
  ------------------
  |  Branch (199:11): [True: 1.90k, False: 265k]
  ------------------
  200|  1.90k|      node_uremove(list->_tail, user);
  201|   265k|  }
  202|   265k|}
Curl_llist_head:
  207|   984k|{
  208|   984k|  DEBUGASSERT(list);
  ------------------
  |  | 1016|   984k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (208:3): [True: 0, False: 984k]
  |  Branch (208:3): [True: 984k, False: 0]
  ------------------
  209|   984k|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1016|   984k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:3): [True: 0, False: 984k]
  |  Branch (209:3): [True: 984k, False: 0]
  ------------------
  210|   984k|  return VERIFYNODE(list->_head);
  ------------------
  |  |   33|   984k|#define VERIFYNODE(x) verifynode(x)
  ------------------
  211|   984k|}
Curl_llist_count:
  229|   209k|{
  230|   209k|  DEBUGASSERT(list);
  ------------------
  |  | 1016|   209k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (230:3): [True: 0, False: 209k]
  |  Branch (230:3): [True: 209k, False: 0]
  ------------------
  231|   209k|  DEBUGASSERT(list->_init == LLISTINIT);
  ------------------
  |  | 1016|   209k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (231:3): [True: 0, False: 209k]
  |  Branch (231:3): [True: 209k, False: 0]
  ------------------
  232|   209k|  return list->_size;
  233|   209k|}
Curl_node_elem:
  237|   116k|{
  238|   116k|  DEBUGASSERT(n);
  ------------------
  |  | 1016|   116k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (238:3): [True: 0, False: 116k]
  |  Branch (238:3): [True: 116k, False: 0]
  ------------------
  239|   116k|  DEBUGASSERT(n->_init == NODEINIT);
  ------------------
  |  | 1016|   116k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (239:3): [True: 0, False: 116k]
  |  Branch (239:3): [True: 116k, False: 0]
  ------------------
  240|   116k|  return n->_ptr;
  241|   116k|}
Curl_node_next:
  246|   108k|{
  247|   108k|  DEBUGASSERT(n);
  ------------------
  |  | 1016|   108k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (247:3): [True: 0, False: 108k]
  |  Branch (247:3): [True: 108k, False: 0]
  ------------------
  248|   108k|  DEBUGASSERT(n->_init == NODEINIT);
  ------------------
  |  | 1016|   108k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (248:3): [True: 0, False: 108k]
  |  Branch (248:3): [True: 108k, False: 0]
  ------------------
  249|   108k|  return VERIFYNODE(n->_next);
  ------------------
  |  |   33|   108k|#define VERIFYNODE(x) verifynode(x)
  ------------------
  250|   108k|}
Curl_node_llist:
  269|    570|{
  270|    570|  DEBUGASSERT(n);
  ------------------
  |  | 1016|    570|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (270:3): [True: 0, False: 570]
  |  Branch (270:3): [True: 570, False: 0]
  ------------------
  271|    570|  DEBUGASSERT(!n->_list || n->_init == NODEINIT);
  ------------------
  |  | 1016|    570|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (271:3): [True: 570, False: 0]
  |  Branch (271:3): [True: 0, False: 0]
  |  Branch (271:3): [True: 150, False: 420]
  |  Branch (271:3): [True: 420, False: 0]
  ------------------
  272|    570|  return n->_list;
  273|    570|}
llist.c:node_uremove:
  175|  8.00k|{
  176|  8.00k|  struct Curl_llist *list;
  177|  8.00k|  void *ptr;
  178|  8.00k|  if(!e)
  ------------------
  |  Branch (178:6): [True: 0, False: 8.00k]
  ------------------
  179|      0|    return;
  180|       |
  181|  8.00k|  list = e->_list;
  182|  8.00k|  DEBUGASSERT(list);
  ------------------
  |  | 1016|  8.00k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (182:3): [True: 0, False: 8.00k]
  |  Branch (182:3): [True: 8.00k, False: 0]
  ------------------
  183|  8.00k|  if(list) {
  ------------------
  |  Branch (183:6): [True: 8.00k, False: 0]
  ------------------
  184|  8.00k|    ptr = Curl_node_take_elem(e);
  185|  8.00k|    if(list->_dtor)
  ------------------
  |  Branch (185:8): [True: 1.93k, False: 6.07k]
  ------------------
  186|  1.93k|      list->_dtor(user, ptr);
  187|  8.00k|  }
  188|  8.00k|}
llist.c:verifynode:
   35|  1.09M|{
   36|  1.09M|  DEBUGASSERT(!n || (n->_init == NODEINIT));
  ------------------
  |  | 1016|  1.09M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (36:3): [True: 1.09M, False: 0]
  |  Branch (36:3): [True: 0, False: 0]
  |  Branch (36:3): [True: 983k, False: 109k]
  |  Branch (36:3): [True: 109k, False: 0]
  ------------------
   37|  1.09M|  return n;
   38|  1.09M|}

curl_dbg_malloc:
  213|   387k|{
  214|   387k|  struct memdebug *mem;
  215|   387k|  size_t size;
  216|       |
  217|   387k|  DEBUGASSERT(wantedsize != 0);
  ------------------
  |  | 1016|   387k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (217:3): [True: 0, False: 387k]
  |  Branch (217:3): [True: 387k, False: 0]
  ------------------
  218|       |
  219|   387k|  if(countcheck("malloc", line, source))
  ------------------
  |  Branch (219:6): [True: 0, False: 387k]
  ------------------
  220|      0|    return NULL;
  221|       |
  222|       |  /* alloc at least 64 bytes */
  223|   387k|  size = sizeof(struct memdebug) + wantedsize;
  224|       |
  225|   387k|  mem = Curl_cmalloc(size);
  226|   387k|  if(mem) {
  ------------------
  |  Branch (226:6): [True: 387k, False: 721]
  ------------------
  227|   387k|    mem->size = wantedsize;
  228|   387k|  }
  229|       |
  230|   387k|  if(source)
  ------------------
  |  Branch (230:6): [True: 293k, False: 94.4k]
  ------------------
  231|   293k|    curl_dbg_log("MEM %s:%d malloc(%zu) = %p\n",
  232|   293k|                 source, line, wantedsize,
  233|   293k|                 mem ? (void *)mem->mem : (void *)0);
  ------------------
  |  Branch (233:18): [True: 292k, False: 512]
  ------------------
  234|       |
  235|   387k|  return mem ? mem->mem : NULL;
  ------------------
  |  Branch (235:10): [True: 387k, False: 721]
  ------------------
  236|   387k|}
curl_dbg_calloc:
  241|   627k|{
  242|   627k|  struct memdebug *mem;
  243|   627k|  size_t size, user_size;
  244|       |
  245|   627k|  DEBUGASSERT(wanted_elements != 0);
  ------------------
  |  | 1016|   627k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (245:3): [True: 0, False: 627k]
  |  Branch (245:3): [True: 627k, False: 0]
  ------------------
  246|   627k|  DEBUGASSERT(wanted_size != 0);
  ------------------
  |  | 1016|   627k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (246:3): [True: 0, False: 627k]
  |  Branch (246:3): [True: 627k, False: 0]
  ------------------
  247|       |
  248|   627k|  if(countcheck("calloc", line, source))
  ------------------
  |  Branch (248:6): [True: 0, False: 627k]
  ------------------
  249|      0|    return NULL;
  250|       |
  251|       |  /* alloc at least 64 bytes */
  252|   627k|  user_size = wanted_size * wanted_elements;
  253|   627k|  size = sizeof(struct memdebug) + user_size;
  254|       |
  255|   627k|  mem = Curl_ccalloc(1, size);
  256|   627k|  if(mem)
  ------------------
  |  Branch (256:6): [True: 626k, False: 554]
  ------------------
  257|   626k|    mem->size = user_size;
  258|       |
  259|   627k|  if(source)
  ------------------
  |  Branch (259:6): [True: 627k, False: 0]
  ------------------
  260|   627k|    curl_dbg_log("MEM %s:%d calloc(%zu,%zu) = %p\n",
  261|   627k|                 source, line, wanted_elements, wanted_size,
  262|   627k|                 mem ? (void *)mem->mem : (void *)0);
  ------------------
  |  Branch (262:18): [True: 626k, False: 554]
  ------------------
  263|       |
  264|   627k|  return mem ? mem->mem : NULL;
  ------------------
  |  Branch (264:10): [True: 626k, False: 554]
  ------------------
  265|   627k|}
curl_dbg_strdup:
  269|  94.4k|{
  270|  94.4k|  char *mem;
  271|  94.4k|  size_t len;
  272|       |
  273|  94.4k|  DEBUGASSERT(str);
  ------------------
  |  | 1016|  94.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (273:3): [True: 0, False: 94.4k]
  |  Branch (273:3): [True: 94.4k, False: 0]
  ------------------
  274|       |
  275|  94.4k|  if(countcheck("strdup", line, source))
  ------------------
  |  Branch (275:6): [True: 0, False: 94.4k]
  ------------------
  276|      0|    return NULL;
  277|       |
  278|  94.4k|  len = strlen(str) + 1;
  279|       |
  280|  94.4k|  mem = curl_dbg_malloc(len, 0, NULL); /* NULL prevents logging */
  281|  94.4k|  if(mem)
  ------------------
  |  Branch (281:6): [True: 94.2k, False: 209]
  ------------------
  282|  94.2k|    memcpy(mem, str, len);
  283|       |
  284|  94.4k|  if(source)
  ------------------
  |  Branch (284:6): [True: 94.4k, False: 0]
  ------------------
  285|  94.4k|    curl_dbg_log("MEM %s:%d strdup(%p) (%zu) = %p\n",
  286|  94.4k|                 source, line, (const void *)str, len, (const void *)mem);
  287|       |
  288|  94.4k|  return mem;
  289|  94.4k|}
curl_dbg_realloc:
  322|   168k|{
  323|   168k|  struct memdebug *mem = NULL;
  324|   168k|  bool was_locked;
  325|       |
  326|   168k|  size_t size = sizeof(struct memdebug) + wantedsize;
  327|       |
  328|   168k|  DEBUGASSERT(wantedsize != 0);
  ------------------
  |  | 1016|   168k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (328:3): [True: 0, False: 168k]
  |  Branch (328:3): [True: 168k, False: 0]
  ------------------
  329|       |
  330|   168k|  if(countcheck("realloc", line, source))
  ------------------
  |  Branch (330:6): [True: 0, False: 168k]
  ------------------
  331|      0|    return NULL;
  332|       |
  333|       |  /* need to realloc under lock, as we get out-of-order log
  334|       |   * entries otherwise, since another thread might alloc the
  335|       |   * memory released by realloc() before otherwise would log it. */
  336|   168k|  was_locked = curl_dbg_lock();
  337|       |#ifdef __INTEL_COMPILER
  338|       |#  pragma warning(push)
  339|       |#  pragma warning(disable:1684)
  340|       |   /* 1684: conversion from pointer to same-sized integral type */
  341|       |#endif
  342|       |
  343|   168k|  if(ptr)
  ------------------
  |  Branch (343:6): [True: 31.9k, False: 136k]
  ------------------
  344|  31.9k|    mem = (void *)((char *)ptr - offsetof(struct memdebug, mem));
  345|       |
  346|       |#ifdef __INTEL_COMPILER
  347|       |#  pragma warning(pop)
  348|       |#endif
  349|       |
  350|   168k|  mem = Curl_crealloc(mem, size);
  351|   168k|  if(source)
  ------------------
  |  Branch (351:6): [True: 168k, False: 0]
  ------------------
  352|   168k|    curl_dbg_log_locked("MEM %s:%d realloc(%p, %zu) = %p\n",
  353|   168k|                        source, line, (void *)ptr, wantedsize,
  354|   168k|                        mem ? (void *)mem->mem : (void *)0);
  ------------------
  |  Branch (354:25): [True: 168k, False: 124]
  ------------------
  355|       |
  356|   168k|  curl_dbg_unlock(was_locked);
  357|   168k|  if(mem) {
  ------------------
  |  Branch (357:6): [True: 168k, False: 124]
  ------------------
  358|   168k|    mem->size = wantedsize;
  359|   168k|    return mem->mem;
  360|   168k|  }
  361|       |
  362|    124|  return NULL;
  363|   168k|}
curl_dbg_free:
  366|  4.55M|{
  367|  4.55M|  if(ptr) {
  ------------------
  |  Branch (367:6): [True: 1.15M, False: 3.40M]
  ------------------
  368|  1.15M|    struct memdebug *mem;
  369|       |
  370|  1.15M|    if(source)
  ------------------
  |  Branch (370:8): [True: 1.15M, False: 0]
  ------------------
  371|  1.15M|      curl_dbg_log("MEM %s:%d free(%p)\n", source, line, (void *)ptr);
  372|       |
  373|       |#ifdef __INTEL_COMPILER
  374|       |#  pragma warning(push)
  375|       |#  pragma warning(disable:1684)
  376|       |   /* 1684: conversion from pointer to same-sized integral type */
  377|       |#endif
  378|       |
  379|  1.15M|    mem = (void *)((char *)ptr - offsetof(struct memdebug, mem));
  380|       |
  381|       |#ifdef __INTEL_COMPILER
  382|       |#  pragma warning(pop)
  383|       |#endif
  384|       |
  385|       |    /* free for real */
  386|  1.15M|    Curl_cfree(mem);
  387|  1.15M|  }
  388|  4.55M|}
curl_dbg_socket:
  392|  9.77k|{
  393|  9.77k|  curl_socket_t sockfd;
  394|       |
  395|  9.77k|  if(countcheck("socket", line, source))
  ------------------
  |  Branch (395:6): [True: 0, False: 9.77k]
  ------------------
  396|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  397|       |
  398|       |  /* !checksrc! disable BANNEDFUNC 1 */
  399|  9.77k|  sockfd = socket(domain, type, protocol);
  400|       |
  401|  9.77k|  if(source && (sockfd != CURL_SOCKET_BAD))
  ------------------
  |  |  147|  9.77k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (401:6): [True: 9.77k, False: 0]
  |  Branch (401:16): [True: 9.77k, False: 0]
  ------------------
  402|  9.77k|    curl_dbg_log("FD %s:%d socket() = %" FMT_SOCKET_T "\n",
  403|  9.77k|                 source, line, sockfd);
  404|       |
  405|  9.77k|  return sockfd;
  406|  9.77k|}
curl_dbg_mark_sclose:
  462|  18.9k|{
  463|  18.9k|  if(source)
  ------------------
  |  Branch (463:6): [True: 18.9k, False: 0]
  ------------------
  464|  18.9k|    curl_dbg_log("FD %s:%d sclose(%" FMT_SOCKET_T ")\n",
  465|  18.9k|                 source, line, sockfd);
  466|  18.9k|}
curl_dbg_sclose:
  470|  18.9k|{
  471|  18.9k|  curl_dbg_mark_sclose(sockfd, line, source);
  472|  18.9k|  return CURL_SCLOSE(sockfd);
  ------------------
  |  |  926|  18.9k|#  define CURL_SCLOSE(x)  close(x)
  ------------------
  473|  18.9k|}
curl_dbg_fopen:
  478|  58.3k|{
  479|  58.3k|  FILE *res = CURLX_FOPEN_LOW(file, mode);
  ------------------
  |  |   68|  58.3k|#define CURLX_FOPEN_LOW         fopen
  ------------------
  480|  58.3k|  if(source)
  ------------------
  |  Branch (480:6): [True: 58.3k, False: 0]
  ------------------
  481|  58.3k|    curl_dbg_log("FILE %s:%d fopen(\"%s\",\"%s\") = %p\n",
  482|  58.3k|                 source, line, file, mode, (void *)res);
  483|       |
  484|  58.3k|  return res;
  485|  58.3k|}
curl_dbg_fclose:
  511|  58.3k|{
  512|  58.3k|  int res;
  513|       |
  514|  58.3k|  DEBUGASSERT(file);
  ------------------
  |  | 1016|  58.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (514:3): [True: 0, False: 58.3k]
  |  Branch (514:3): [True: 58.3k, False: 0]
  ------------------
  515|       |
  516|  58.3k|  if(source)
  ------------------
  |  Branch (516:6): [True: 58.3k, False: 0]
  ------------------
  517|  58.3k|    curl_dbg_log("FILE %s:%d fclose(%p)\n", source, line, (void *)file);
  518|       |
  519|       |  /* !checksrc! disable BANNEDFUNC 1 */
  520|  58.3k|  res = fclose(file);
  521|       |
  522|  58.3k|  return res;
  523|  58.3k|}
curl_dbg_log:
  566|  2.31M|{
  567|  2.31M|  bool was_locked;
  568|  2.31M|  va_list ap;
  569|       |
  570|  2.31M|  if(!curl_dbg_logfile)
  ------------------
  |  Branch (570:6): [True: 2.31M, False: 0]
  ------------------
  571|  2.31M|    return;
  572|       |
  573|      0|  was_locked = curl_dbg_lock();
  574|      0|  va_start(ap, format);
  575|      0|  curl_dbg_vlog(format, ap);
  576|       |  va_end(ap);
  577|      0|  curl_dbg_unlock(was_locked);
  578|      0|}
memdebug.c:countcheck:
  188|  1.28M|{
  189|       |  /* if source is NULL, then the call is made internally and this check
  190|       |     should not be made */
  191|  1.28M|  if(memlimit && source) {
  ------------------
  |  Branch (191:6): [True: 0, False: 1.28M]
  |  Branch (191:18): [True: 0, False: 0]
  ------------------
  192|      0|    if(!memsize) {
  ------------------
  |  Branch (192:8): [True: 0, False: 0]
  ------------------
  193|       |      /* log to file */
  194|      0|      curl_dbg_log("LIMIT %s:%d %s reached memlimit\n", source, line, func);
  195|       |      /* log to stderr also */
  196|      0|      curl_mfprintf(stderr, "LIMIT %s:%d %s reached memlimit\n",
  197|      0|                    source, line, func);
  198|      0|      dump_bt();
  199|      0|      fflush(curl_dbg_logfile); /* because it might crash now */
  200|       |      /* !checksrc! disable ERRNOVAR 1 */
  201|      0|      errno = ENOMEM;
  202|      0|      return TRUE; /* RETURN ERROR! */
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  203|      0|    }
  204|      0|    else
  205|      0|      memsize--; /* countdown */
  206|      0|  }
  207|       |
  208|  1.28M|  return FALSE; /* allow this */
  ------------------
  |  |  989|  1.28M|#define FALSE false
  ------------------
  209|  1.28M|}
memdebug.c:curl_dbg_lock:
   75|   168k|{
   76|   168k|#ifdef USE_MUTEX
   77|   168k|  if(dbg_mutex_init) {
  ------------------
  |  Branch (77:6): [True: 0, False: 168k]
  ------------------
   78|      0|    Curl_mutex_acquire(&dbg_mutex);
  ------------------
  |  |   51|      0|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
   79|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
   80|      0|  }
   81|   168k|#endif
   82|   168k|  return FALSE;
  ------------------
  |  |  989|   168k|#define FALSE false
  ------------------
   83|   168k|}
memdebug.c:curl_dbg_unlock:
   86|   168k|{
   87|   168k|#ifdef USE_MUTEX
   88|   168k|  if(was_locked)
  ------------------
  |  Branch (88:6): [True: 0, False: 168k]
  ------------------
   89|      0|    Curl_mutex_release(&dbg_mutex);
  ------------------
  |  |   52|      0|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
   90|       |#else
   91|       |  (void)was_locked;
   92|       |#endif
   93|   168k|}
memdebug.c:curl_dbg_log_locked:
  553|   168k|{
  554|   168k|  va_list ap;
  555|       |
  556|   168k|  if(!curl_dbg_logfile)
  ------------------
  |  Branch (556:6): [True: 168k, False: 0]
  ------------------
  557|   168k|    return;
  558|       |
  559|   168k|  va_start(ap, format);
  560|      0|  curl_dbg_vlog(format, ap);
  561|       |  va_end(ap);
  562|      0|}

Curl_mime_cleanpart:
 1086|  48.1k|{
 1087|  48.1k|  if(part) {
  ------------------
  |  Branch (1087:6): [True: 7.66k, False: 40.4k]
  ------------------
 1088|  7.66k|    cleanup_part_content(part);
 1089|  7.66k|    curl_slist_free_all(part->curlheaders);
 1090|  7.66k|    if(part->flags & MIME_USERHEADERS_OWNER)
  ------------------
  |  |   34|  7.66k|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
  |  Branch (1090:8): [True: 1.60k, False: 6.05k]
  ------------------
 1091|  1.60k|      curl_slist_free_all(part->userheaders);
 1092|  7.66k|    curlx_safefree(part->mimetype);
  ------------------
  |  | 1359|  7.66k|  do {                      \
  |  | 1360|  7.66k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  7.66k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  7.66k|    (ptr) = NULL;           \
  |  | 1362|  7.66k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 7.66k]
  |  |  ------------------
  ------------------
 1093|  7.66k|    curlx_safefree(part->name);
  ------------------
  |  | 1359|  7.66k|  do {                      \
  |  | 1360|  7.66k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  7.66k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  7.66k|    (ptr) = NULL;           \
  |  | 1362|  7.66k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 7.66k]
  |  |  ------------------
  ------------------
 1094|       |    curlx_safefree(part->filename);
  ------------------
  |  | 1359|  7.66k|  do {                      \
  |  | 1360|  7.66k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  7.66k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  7.66k|    (ptr) = NULL;           \
  |  | 1362|  7.66k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 7.66k]
  |  |  ------------------
  ------------------
 1095|  7.66k|    Curl_mime_initpart(part);
 1096|  7.66k|  }
 1097|  48.1k|}
curl_mime_free:
 1101|  1.01k|{
 1102|  1.01k|  curl_mimepart *part;
 1103|       |
 1104|  1.01k|  if(!mime)
  ------------------
  |  Branch (1104:6): [True: 0, False: 1.01k]
  ------------------
 1105|      0|    return;
 1106|       |
 1107|  1.01k|  mime_subparts_unbind(mime);  /* Be sure it is not referenced anymore. */
 1108|       |
 1109|  10.1k|  while(mime) {
  ------------------
  |  Branch (1109:9): [True: 9.16k, False: 1.01k]
  ------------------
 1110|  9.16k|    part = mime->firstpart;
 1111|  9.16k|    if(part) {
  ------------------
  |  Branch (1111:8): [True: 6.65k, False: 2.51k]
  ------------------
 1112|  6.65k|      mime->firstpart = part->nextpart;
 1113|  6.65k|      if(part->kind == MIMEKIND_MULTIPART && part->arg &&
  ------------------
  |  Branch (1113:10): [True: 1.50k, False: 5.14k]
  |  Branch (1113:46): [True: 1.50k, False: 0]
  ------------------
 1114|  1.50k|         part->freefunc == mime_subparts_free) {
  ------------------
  |  Branch (1114:10): [True: 1.50k, False: 0]
  ------------------
 1115|  1.50k|        curl_mime *subparts = (curl_mime *)part->arg;
 1116|  1.50k|        part->freefunc = NULL;
 1117|  1.50k|        cleanup_part_content(part);
 1118|  1.50k|        subparts->parent = mime->parent;
 1119|  1.50k|        mime->parent = (curl_mimepart *)subparts;
 1120|  1.50k|      }
 1121|  6.65k|      Curl_mime_cleanpart(part);
 1122|  6.65k|      curlx_free(part);
  ------------------
  |  | 1503|  6.65k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1123|  6.65k|    }
 1124|  2.51k|    else {
 1125|  2.51k|      curl_mime *parent = (curl_mime *)mime->parent;
 1126|  2.51k|      curlx_free(mime);
  ------------------
  |  | 1503|  2.51k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1127|  2.51k|      mime = parent;
 1128|  2.51k|    }
 1129|  9.16k|  }
 1130|  1.01k|}
curl_mime_init:
 1253|  2.53k|{
 1254|  2.53k|  curl_mime *mime = curlx_malloc(sizeof(*mime));
  ------------------
  |  | 1498|  2.53k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 1255|       |
 1256|  2.53k|  if(mime) {
  ------------------
  |  Branch (1256:6): [True: 2.51k, False: 17]
  ------------------
 1257|  2.51k|    mime->parent = NULL;
 1258|  2.51k|    mime->firstpart = NULL;
 1259|  2.51k|    mime->lastpart = NULL;
 1260|       |
 1261|  2.51k|    memset(mime->boundary, '-', MIME_BOUNDARY_DASHES);
  ------------------
  |  |   28|  2.51k|#define MIME_BOUNDARY_DASHES            24  /* leading boundary dashes */
  ------------------
 1262|  2.51k|    if(Curl_rand_alnum(easy,
  ------------------
  |  Branch (1262:8): [True: 0, False: 2.51k]
  ------------------
 1263|  2.51k|                       (unsigned char *)&mime->boundary[MIME_BOUNDARY_DASHES],
  ------------------
  |  |   28|  2.51k|#define MIME_BOUNDARY_DASHES            24  /* leading boundary dashes */
  ------------------
 1264|  2.51k|                       MIME_RAND_BOUNDARY_CHARS + 1)) {
  ------------------
  |  |   29|  2.51k|#define MIME_RAND_BOUNDARY_CHARS        22  /* Nb. of random boundary chars. */
  ------------------
 1265|       |      /* failed to get random separator, bail out */
 1266|      0|      curlx_free(mime);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1267|      0|      return NULL;
 1268|      0|    }
 1269|  2.51k|    mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL);
 1270|  2.51k|  }
 1271|       |
 1272|  2.53k|  return mime;
 1273|  2.53k|}
Curl_mime_initpart:
 1277|  15.3k|{
 1278|  15.3k|  memset(part, 0, sizeof(*part));
 1279|  15.3k|  part->lastreadstatus = 1; /* Successful read status. */
 1280|       |  mimesetstate(&part->state, MIMESTATE_BEGIN, NULL);
 1281|  15.3k|}
curl_mime_addpart:
 1285|  6.68k|{
 1286|  6.68k|  curl_mimepart *part;
 1287|       |
 1288|  6.68k|  if(!mime)
  ------------------
  |  Branch (1288:6): [True: 0, False: 6.68k]
  ------------------
 1289|      0|    return NULL;
 1290|       |
 1291|  6.68k|  part = curlx_malloc(sizeof(*part));
  ------------------
  |  | 1498|  6.68k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 1292|       |
 1293|  6.68k|  if(part) {
  ------------------
  |  Branch (1293:6): [True: 6.65k, False: 32]
  ------------------
 1294|  6.65k|    Curl_mime_initpart(part);
 1295|  6.65k|    part->parent = mime;
 1296|       |
 1297|  6.65k|    if(mime->lastpart)
  ------------------
  |  Branch (1297:8): [True: 4.77k, False: 1.87k]
  ------------------
 1298|  4.77k|      mime->lastpart->nextpart = part;
 1299|  1.87k|    else
 1300|  1.87k|      mime->firstpart = part;
 1301|       |
 1302|  6.65k|    mime->lastpart = part;
 1303|  6.65k|  }
 1304|       |
 1305|  6.68k|  return part;
 1306|  6.68k|}
curl_mime_name:
 1310|    553|{
 1311|    553|  if(!part)
  ------------------
  |  Branch (1311:6): [True: 0, False: 553]
  ------------------
 1312|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1313|       |
 1314|    553|  curlx_safefree(part->name);
  ------------------
  |  | 1359|    553|  do {                      \
  |  | 1360|    553|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    553|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    553|    (ptr) = NULL;           \
  |  | 1362|    553|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 553]
  |  |  ------------------
  ------------------
 1315|       |
 1316|    553|  if(name) {
  ------------------
  |  Branch (1316:6): [True: 553, False: 0]
  ------------------
 1317|    553|    part->name = curlx_strdup(name);
  ------------------
  |  | 1497|    553|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1318|    553|    if(!part->name)
  ------------------
  |  Branch (1318:8): [True: 0, False: 553]
  ------------------
 1319|      0|      return CURLE_OUT_OF_MEMORY;
 1320|    553|  }
 1321|       |
 1322|    553|  return CURLE_OK;
 1323|    553|}
curl_mime_filename:
 1327|    658|{
 1328|    658|  if(!part)
  ------------------
  |  Branch (1328:6): [True: 0, False: 658]
  ------------------
 1329|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1330|       |
 1331|    658|  curlx_safefree(part->filename);
  ------------------
  |  | 1359|    658|  do {                      \
  |  | 1360|    658|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    658|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    658|    (ptr) = NULL;           \
  |  | 1362|    658|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 658]
  |  |  ------------------
  ------------------
 1332|       |
 1333|    658|  if(filename) {
  ------------------
  |  Branch (1333:6): [True: 658, False: 0]
  ------------------
 1334|    658|    part->filename = curlx_strdup(filename);
  ------------------
  |  | 1497|    658|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1335|    658|    if(!part->filename)
  ------------------
  |  Branch (1335:8): [True: 1, False: 657]
  ------------------
 1336|      1|      return CURLE_OUT_OF_MEMORY;
 1337|    658|  }
 1338|       |
 1339|    657|  return CURLE_OK;
 1340|    658|}
curl_mime_data:
 1344|  3.51k|{
 1345|  3.51k|  if(!part)
  ------------------
  |  Branch (1345:6): [True: 0, False: 3.51k]
  ------------------
 1346|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1347|       |
 1348|  3.51k|  cleanup_part_content(part);
 1349|       |
 1350|  3.51k|  if(data) {
  ------------------
  |  Branch (1350:6): [True: 3.51k, False: 0]
  ------------------
 1351|  3.51k|    if(datasize == CURL_ZERO_TERMINATED)
  ------------------
  |  | 2449|  3.51k|#define CURL_ZERO_TERMINATED ((size_t)-1)
  ------------------
  |  Branch (1351:8): [True: 0, False: 3.51k]
  ------------------
 1352|      0|      datasize = strlen(data);
 1353|       |
 1354|  3.51k|    part->data = curlx_memdup0(data, datasize);
 1355|  3.51k|    if(!part->data)
  ------------------
  |  Branch (1355:8): [True: 13, False: 3.50k]
  ------------------
 1356|     13|      return CURLE_OUT_OF_MEMORY;
 1357|       |
 1358|  3.50k|    part->datasize = datasize;
 1359|  3.50k|    part->readfunc = mime_mem_read;
 1360|  3.50k|    part->seekfunc = mime_mem_seek;
 1361|  3.50k|    part->freefunc = mime_mem_free;
 1362|  3.50k|    part->flags |= MIME_FAST_READ;
  ------------------
  |  |   36|  3.50k|#define MIME_FAST_READ          (1 << 2)
  ------------------
 1363|  3.50k|    part->kind = MIMEKIND_DATA;
 1364|  3.50k|  }
 1365|       |
 1366|  3.50k|  return CURLE_OK;
 1367|  3.51k|}
curl_mime_type:
 1419|    511|{
 1420|    511|  if(!part)
  ------------------
  |  Branch (1420:6): [True: 0, False: 511]
  ------------------
 1421|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1422|       |
 1423|    511|  curlx_safefree(part->mimetype);
  ------------------
  |  | 1359|    511|  do {                      \
  |  | 1360|    511|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    511|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    511|    (ptr) = NULL;           \
  |  | 1362|    511|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 511]
  |  |  ------------------
  ------------------
 1424|       |
 1425|    511|  if(mimetype) {
  ------------------
  |  Branch (1425:6): [True: 511, False: 0]
  ------------------
 1426|    511|    part->mimetype = curlx_strdup(mimetype);
  ------------------
  |  | 1497|    511|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1427|    511|    if(!part->mimetype)
  ------------------
  |  Branch (1427:8): [True: 3, False: 508]
  ------------------
 1428|      3|      return CURLE_OUT_OF_MEMORY;
 1429|    511|  }
 1430|       |
 1431|    508|  return CURLE_OK;
 1432|    511|}
curl_mime_encoder:
 1445|  1.01k|{
 1446|  1.01k|  CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT;
 1447|  1.01k|  const struct mime_encoder *mep;
 1448|       |
 1449|  1.01k|  if(!part)
  ------------------
  |  Branch (1449:6): [True: 0, False: 1.01k]
  ------------------
 1450|      0|    return result;
 1451|       |
 1452|  1.01k|  part->encoder = NULL;
 1453|       |
 1454|  1.01k|  if(!encoding)
  ------------------
  |  Branch (1454:6): [True: 0, False: 1.01k]
  ------------------
 1455|      0|    return CURLE_OK;    /* Removing current encoder. */
 1456|       |
 1457|  6.07k|  for(mep = encoders; mep->name; mep++)
  ------------------
  |  Branch (1457:23): [True: 5.06k, False: 1.01k]
  ------------------
 1458|  5.06k|    if(curl_strequal(encoding, mep->name)) {
  ------------------
  |  Branch (1458:8): [True: 1.01k, False: 4.05k]
  ------------------
 1459|  1.01k|      part->encoder = mep;
 1460|  1.01k|      result = CURLE_OK;
 1461|  1.01k|    }
 1462|       |
 1463|  1.01k|  return result;
 1464|  1.01k|}
curl_mime_headers:
 1469|  2.49k|{
 1470|  2.49k|  if(!part)
  ------------------
  |  Branch (1470:6): [True: 0, False: 2.49k]
  ------------------
 1471|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1472|       |
 1473|  2.49k|  if(part->flags & MIME_USERHEADERS_OWNER) {
  ------------------
  |  |   34|  2.49k|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
  |  Branch (1473:6): [True: 0, False: 2.49k]
  ------------------
 1474|      0|    if(part->userheaders != headers)  /* Allow setting twice the same list. */
  ------------------
  |  Branch (1474:8): [True: 0, False: 0]
  ------------------
 1475|      0|      curl_slist_free_all(part->userheaders);
 1476|      0|    part->flags &= ~(unsigned int)MIME_USERHEADERS_OWNER;
  ------------------
  |  |   34|      0|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
 1477|      0|  }
 1478|  2.49k|  part->userheaders = headers;
 1479|  2.49k|  if(headers && take_ownership)
  ------------------
  |  Branch (1479:6): [True: 1.65k, False: 841]
  |  Branch (1479:17): [True: 1.60k, False: 50]
  ------------------
 1480|  1.60k|    part->flags |= MIME_USERHEADERS_OWNER;
  ------------------
  |  |   34|  1.60k|#define MIME_USERHEADERS_OWNER  (1 << 0)
  ------------------
 1481|  2.49k|  return CURLE_OK;
 1482|  2.49k|}
curl_mime_data_cb:
 1489|    163|{
 1490|    163|  if(!part)
  ------------------
  |  Branch (1490:6): [True: 0, False: 163]
  ------------------
 1491|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1492|       |
 1493|    163|  cleanup_part_content(part);
 1494|       |
 1495|    163|  if(readfunc) {
  ------------------
  |  Branch (1495:6): [True: 163, False: 0]
  ------------------
 1496|    163|    part->readfunc = readfunc;
 1497|    163|    part->seekfunc = seekfunc;
 1498|    163|    part->freefunc = freefunc;
 1499|    163|    part->arg = arg;
 1500|    163|    part->datasize = datasize;
 1501|    163|    part->kind = MIMEKIND_CALLBACK;
 1502|    163|  }
 1503|       |
 1504|    163|  return CURLE_OK;
 1505|    163|}
Curl_mime_set_subparts:
 1510|  3.52k|{
 1511|  3.52k|  curl_mime *root;
 1512|       |
 1513|  3.52k|  if(!part)
  ------------------
  |  Branch (1513:6): [True: 0, False: 3.52k]
  ------------------
 1514|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
 1515|       |
 1516|       |  /* Accept setting twice the same subparts. */
 1517|  3.52k|  if(part->kind == MIMEKIND_MULTIPART && part->arg == subparts)
  ------------------
  |  Branch (1517:6): [True: 1.00k, False: 2.51k]
  |  Branch (1517:42): [True: 0, False: 1.00k]
  ------------------
 1518|      0|    return CURLE_OK;
 1519|       |
 1520|  3.52k|  if(!subparts)
  ------------------
  |  Branch (1520:6): [True: 1.01k, False: 2.51k]
  ------------------
 1521|  1.01k|    cleanup_part_content(part);
 1522|  2.51k|  else {
 1523|       |    /* Should not have been attached already. */
 1524|  2.51k|    if(subparts->parent)
  ------------------
  |  Branch (1524:8): [True: 0, False: 2.51k]
  ------------------
 1525|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1526|       |
 1527|       |    /* Should not be the part's root. */
 1528|  2.51k|    root = part->parent;
 1529|  2.51k|    if(root) {
  ------------------
  |  Branch (1529:8): [True: 1.50k, False: 1.00k]
  ------------------
 1530|  1.50k|      while(root->parent && root->parent->parent)
  ------------------
  |  Branch (1530:13): [True: 0, False: 1.50k]
  |  Branch (1530:29): [True: 0, False: 0]
  ------------------
 1531|      0|        root = root->parent->parent;
 1532|  1.50k|      if(subparts == root) {
  ------------------
  |  Branch (1532:10): [True: 0, False: 1.50k]
  ------------------
 1533|       |        /* cannot add as a subpart of itself. */
 1534|      0|        return CURLE_BAD_FUNCTION_ARGUMENT;
 1535|      0|      }
 1536|  1.50k|    }
 1537|       |
 1538|       |    /* If subparts have already been used as a top-level MIMEPOST,
 1539|       |       they might not be positioned at start. Rewind them now, as
 1540|       |       a future check while rewinding the parent may cause this
 1541|       |       content to be skipped. */
 1542|  2.51k|    if(mime_subparts_seek(subparts, (curl_off_t)0, SEEK_SET) !=
  ------------------
  |  Branch (1542:8): [True: 0, False: 2.51k]
  ------------------
 1543|  2.51k|       CURL_SEEKFUNC_OK)
  ------------------
  |  |  382|  2.51k|#define CURL_SEEKFUNC_OK       0
  ------------------
 1544|      0|      return CURLE_SEND_FAIL_REWIND;
 1545|       |
 1546|  2.51k|    cleanup_part_content(part);
 1547|       |
 1548|  2.51k|    subparts->parent = part;
 1549|       |    /* Subparts are processed internally: no read callback. */
 1550|  2.51k|    part->seekfunc = mime_subparts_seek;
 1551|  2.51k|    part->freefunc = take_ownership ? mime_subparts_free :
  ------------------
  |  Branch (1551:22): [True: 1.50k, False: 1.00k]
  ------------------
 1552|  2.51k|      mime_subparts_unbind;
 1553|  2.51k|    part->arg = subparts;
 1554|  2.51k|    part->datasize = -1;
 1555|  2.51k|    part->kind = MIMEKIND_MULTIPART;
 1556|  2.51k|  }
 1557|       |
 1558|  3.52k|  return CURLE_OK;
 1559|  3.52k|}
curl_mime_subparts:
 1562|  1.50k|{
 1563|       |  return Curl_mime_set_subparts(part, subparts, TRUE);
  ------------------
  |  |  986|  1.50k|#define TRUE true
  ------------------
 1564|  1.50k|}
Curl_mime_read:
 1569|    594|{
 1570|    594|  curl_mimepart *part = (curl_mimepart *)instream;
 1571|    594|  size_t ret;
 1572|    594|  bool hasread;
 1573|       |
 1574|    594|  (void)size;  /* Always 1 */
 1575|       |
 1576|       |  /* If `nitems` is <= 4, some encoders will return STOP_FILLING without
 1577|       |   * adding any data and this loops infinitely. */
 1578|    594|  do {
 1579|    594|    hasread = FALSE;
  ------------------
  |  |  989|    594|#define FALSE false
  ------------------
 1580|    594|    ret = readback_part(part, buffer, nitems, &hasread);
 1581|       |    /*
 1582|       |     * If this is not possible to get some data without calling more than
 1583|       |     * one read callback (probably because a content encoder is not able to
 1584|       |     * deliver a new bunch for the few data accumulated so far), force another
 1585|       |     * read until we get enough data or a special exit code.
 1586|       |     */
 1587|    594|  } while(ret == STOP_FILLING);
  ------------------
  |  |   50|    594|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (1587:11): [True: 0, False: 594]
  ------------------
 1588|       |
 1589|    594|  return ret;
 1590|    594|}
Curl_mime_add_header:
 1662|  4.27k|{
 1663|  4.27k|  struct curl_slist *hdr = NULL;
 1664|  4.27k|  char *s = NULL;
 1665|  4.27k|  va_list ap;
 1666|       |
 1667|  4.27k|  va_start(ap, fmt);
 1668|  4.27k|  s = curl_mvaprintf(fmt, ap);
 1669|  4.27k|  va_end(ap);
 1670|       |
 1671|  4.27k|  if(s) {
  ------------------
  |  Branch (1671:6): [True: 4.27k, False: 0]
  ------------------
 1672|  4.27k|    hdr = Curl_slist_append_nodup(*slp, s);
 1673|  4.27k|    if(hdr)
  ------------------
  |  Branch (1673:8): [True: 4.27k, False: 0]
  ------------------
 1674|  4.27k|      *slp = hdr;
 1675|      0|    else
 1676|      0|      curlx_free(s);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1677|  4.27k|  }
 1678|       |
 1679|  4.27k|  return hdr ? CURLE_OK : CURLE_OUT_OF_MEMORY;
  ------------------
  |  Branch (1679:10): [True: 4.27k, False: 0]
  ------------------
 1680|  4.27k|}
Curl_mime_contenttype:
 1692|  2.74k|{
 1693|       |  /*
 1694|       |   * If no content type was specified, we scan through a few well-known
 1695|       |   * extensions and pick the first we match!
 1696|       |   */
 1697|  2.74k|  struct ContentType {
 1698|  2.74k|    const char *extension;
 1699|  2.74k|    const char *type;
 1700|  2.74k|  };
 1701|  2.74k|  static const struct ContentType ctts[] = {
 1702|  2.74k|    { ".gif",  "image/gif" },
 1703|  2.74k|    { ".jpg",  "image/jpeg" },
 1704|  2.74k|    { ".jpeg", "image/jpeg" },
 1705|  2.74k|    { ".png",  "image/png" },
 1706|  2.74k|    { ".svg",  "image/svg+xml" },
 1707|  2.74k|    { ".txt",  "text/plain" },
 1708|  2.74k|    { ".htm",  "text/html" },
 1709|  2.74k|    { ".html", "text/html" },
 1710|  2.74k|    { ".pdf",  "application/pdf" },
 1711|  2.74k|    { ".xml",  "application/xml" }
 1712|  2.74k|  };
 1713|       |
 1714|  2.74k|  if(filename) {
  ------------------
  |  Branch (1714:6): [True: 271, False: 2.47k]
  ------------------
 1715|    271|    size_t len1 = strlen(filename);
 1716|    271|    const char *nameend = filename + len1;
 1717|    271|    unsigned int i;
 1718|       |
 1719|  2.98k|    for(i = 0; i < CURL_ARRAYSIZE(ctts); i++) {
  ------------------
  |  | 1326|  2.98k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (1719:16): [True: 2.71k, False: 271]
  ------------------
 1720|  2.71k|      size_t len2 = strlen(ctts[i].extension);
 1721|       |
 1722|  2.71k|      if(len1 >= len2 && curl_strequal(nameend - len2, ctts[i].extension))
  ------------------
  |  Branch (1722:10): [True: 918, False: 1.79k]
  |  Branch (1722:26): [True: 0, False: 918]
  ------------------
 1723|      0|        return ctts[i].type;
 1724|  2.71k|    }
 1725|    271|  }
 1726|  2.74k|  return NULL;
 1727|  2.74k|}
Curl_mime_prepare_headers:
 1921|    377|{
 1922|    377|  return mime_prepare_headers(data, part, contenttype, disposition,
 1923|    377|                              strategy, 0);
 1924|    377|}
Curl_creader_set_mime:
 2216|    376|{
 2217|    376|  struct Curl_creader *r;
 2218|    376|  struct cr_mime_ctx *ctx;
 2219|    376|  CURLcode result;
 2220|       |
 2221|    376|  result = Curl_creader_create(&r, data, &cr_mime, CURL_CR_CLIENT);
 2222|    376|  if(result)
  ------------------
  |  Branch (2222:6): [True: 0, False: 376]
  ------------------
 2223|      0|    return result;
 2224|    376|  ctx = r->ctx;
 2225|    376|  ctx->part = part;
 2226|       |  /* Make sure we will read the entire mime structure. */
 2227|    376|  result = mime_rewind(ctx->part);
 2228|    376|  if(result) {
  ------------------
  |  Branch (2228:6): [True: 0, False: 376]
  ------------------
 2229|      0|    Curl_creader_free(data, r);
 2230|      0|    return result;
 2231|      0|  }
 2232|    376|  ctx->total_len = mime_size(ctx->part);
 2233|       |
 2234|    376|  return Curl_creader_set(data, r);
 2235|    376|}
mime.c:cleanup_part_content:
 1044|  17.3k|{
 1045|  17.3k|  if(part->freefunc)
  ------------------
  |  Branch (1045:6): [True: 4.50k, False: 12.8k]
  ------------------
 1046|  4.50k|    part->freefunc(part->arg);
 1047|       |
 1048|  17.3k|  part->readfunc = NULL;
 1049|  17.3k|  part->seekfunc = NULL;
 1050|  17.3k|  part->freefunc = NULL;
 1051|  17.3k|  part->arg = (void *)part;           /* Defaults to part itself. */
 1052|  17.3k|  part->data = NULL;
 1053|  17.3k|  part->fp = NULL;
 1054|  17.3k|  part->datasize = (curl_off_t)0;     /* No size yet. */
 1055|  17.3k|  cleanup_encoder_state(&part->encstate);
 1056|  17.3k|  part->kind = MIMEKIND_NONE;
 1057|  17.3k|  part->flags &= ~(unsigned int)MIME_FAST_READ;
  ------------------
  |  |   36|  17.3k|#define MIME_FAST_READ          (1 << 2)
  ------------------
 1058|  17.3k|  part->lastreadstatus = 1; /* Successful read status. */
 1059|  17.3k|  part->state.state = MIMESTATE_BEGIN;
 1060|  17.3k|}
mime.c:cleanup_encoder_state:
  283|  21.7k|{
  284|  21.7k|  p->pos = 0;
  285|  21.7k|  p->bufbeg = 0;
  286|  21.7k|  p->bufend = 0;
  287|  21.7k|}
mime.c:mime_subparts_unbind:
 1075|  2.01k|{
 1076|  2.01k|  curl_mime *mime = (curl_mime *)ptr;
 1077|       |
 1078|  2.01k|  if(mime && mime->parent) {
  ------------------
  |  Branch (1078:6): [True: 2.01k, False: 0]
  |  Branch (1078:14): [True: 1.00k, False: 1.01k]
  ------------------
 1079|  1.00k|    mime->parent->freefunc = NULL;  /* Be sure we will not be called again. */
 1080|  1.00k|    cleanup_part_content(mime->parent);  /* Avoid dangling pointer in part. */
 1081|       |    mime->parent = NULL;
 1082|  1.00k|  }
 1083|  2.01k|}
mime.c:mimesetstate:
  189|  60.6k|{
  190|  60.6k|  state->state = tok;
  191|  60.6k|  state->ptr = ptr;
  192|  60.6k|  state->offset = 0;
  193|  60.6k|}
mime.c:mime_mem_read:
  575|  1.94k|{
  576|  1.94k|  curl_mimepart *part = (curl_mimepart *)instream;
  577|  1.94k|  size_t sz = curlx_sotouz(part->datasize - part->state.offset);
  578|  1.94k|  (void)size;  /* Always 1 */
  579|       |
  580|  1.94k|  if(!nitems)
  ------------------
  |  Branch (580:6): [True: 0, False: 1.94k]
  ------------------
  581|      0|    return STOP_FILLING;
  ------------------
  |  |   50|      0|#define STOP_FILLING ((size_t)-2)
  ------------------
  582|       |
  583|  1.94k|  if(sz > nitems)
  ------------------
  |  Branch (583:6): [True: 1.51k, False: 426]
  ------------------
  584|  1.51k|    sz = nitems;
  585|       |
  586|  1.94k|  if(sz)
  ------------------
  |  Branch (586:6): [True: 1.94k, False: 0]
  ------------------
  587|  1.94k|    memcpy(buffer, part->data + curlx_sotouz(part->state.offset), sz);
  588|       |
  589|  1.94k|  return sz;
  590|  1.94k|}
mime.c:mime_mem_free:
  613|  3.50k|{
  614|       |  curlx_safefree(((curl_mimepart *)ptr)->data);
  ------------------
  |  | 1359|  3.50k|  do {                      \
  |  | 1360|  3.50k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  3.50k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  3.50k|    (ptr) = NULL;           \
  |  | 1362|  3.50k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 3.50k]
  |  |  ------------------
  ------------------
  615|  3.50k|}
mime.c:encoder_nop_read:
  292|  1.28k|{
  293|  1.28k|  struct mime_encoder_state *st = &part->encstate;
  294|  1.28k|  size_t insize = st->bufend - st->bufbeg;
  295|       |
  296|  1.28k|  (void)ateof;
  297|       |
  298|  1.28k|  if(!size)
  ------------------
  |  Branch (298:6): [True: 247, False: 1.03k]
  ------------------
  299|    247|    return STOP_FILLING;
  ------------------
  |  |   50|    247|#define STOP_FILLING ((size_t)-2)
  ------------------
  300|       |
  301|  1.03k|  if(size > insize)
  ------------------
  |  Branch (301:6): [True: 788, False: 247]
  ------------------
  302|    788|    size = insize;
  303|       |
  304|  1.03k|  if(size)
  ------------------
  |  Branch (304:6): [True: 751, False: 284]
  ------------------
  305|    751|    memcpy(buffer, st->buf + st->bufbeg, size);
  306|       |
  307|  1.03k|  st->bufbeg += size;
  308|  1.03k|  return size;
  309|  1.28k|}
mime.c:encoder_nop_size:
  312|    323|{
  313|    323|  return part->datasize;
  314|    323|}
mime.c:encoder_7bit_read:
  319|    137|{
  320|    137|  struct mime_encoder_state *st = &part->encstate;
  321|    137|  size_t cursize = st->bufend - st->bufbeg;
  322|       |
  323|    137|  (void)ateof;
  324|       |
  325|    137|  if(!size)
  ------------------
  |  Branch (325:6): [True: 0, False: 137]
  ------------------
  326|      0|    return STOP_FILLING;
  ------------------
  |  |   50|      0|#define STOP_FILLING ((size_t)-2)
  ------------------
  327|       |
  328|    137|  if(size > cursize)
  ------------------
  |  Branch (328:6): [True: 137, False: 0]
  ------------------
  329|    137|    size = cursize;
  330|       |
  331|    194|  for(cursize = 0; cursize < size; cursize++) {
  ------------------
  |  Branch (331:20): [True: 57, False: 137]
  ------------------
  332|     57|    *buffer = st->buf[st->bufbeg];
  333|     57|    if(*buffer++ & 0x80)
  ------------------
  |  Branch (333:8): [True: 0, False: 57]
  ------------------
  334|      0|      return cursize ? cursize : READ_ERROR;
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (334:14): [True: 0, False: 0]
  ------------------
  335|     57|    st->bufbeg++;
  336|     57|  }
  337|       |
  338|    137|  return cursize;
  339|    137|}
mime.c:encoder_base64_read:
  344|  1.83k|{
  345|  1.83k|  struct mime_encoder_state *st = &part->encstate;
  346|  1.83k|  size_t cursize = 0;
  347|  1.83k|  int i;
  348|  1.83k|  char *ptr = buffer;
  349|       |
  350|  73.5k|  while(st->bufbeg < st->bufend) {
  ------------------
  |  Branch (350:9): [True: 73.4k, False: 105]
  ------------------
  351|       |    /* Line full ? */
  352|  73.4k|    if(st->pos > MAX_ENCODED_LINE_LENGTH - 4) {
  ------------------
  |  |   30|  73.4k|#define MAX_ENCODED_LINE_LENGTH         76  /* Maximum encoded line length. */
  ------------------
  |  Branch (352:8): [True: 3.77k, False: 69.7k]
  ------------------
  353|       |      /* Yes, we need 2 characters for CRLF. */
  354|  3.77k|      if(size < 2) {
  ------------------
  |  Branch (354:10): [True: 0, False: 3.77k]
  ------------------
  355|      0|        if(!cursize)
  ------------------
  |  Branch (355:12): [True: 0, False: 0]
  ------------------
  356|      0|          return STOP_FILLING;
  ------------------
  |  |   50|      0|#define STOP_FILLING ((size_t)-2)
  ------------------
  357|      0|        break;
  358|      0|      }
  359|  3.77k|      *ptr++ = '\r';
  360|  3.77k|      *ptr++ = '\n';
  361|  3.77k|      st->pos = 0;
  362|  3.77k|      cursize += 2;
  363|  3.77k|      size -= 2;
  364|  3.77k|    }
  365|       |
  366|       |    /* Be sure there is enough space and input data for a base64 group. */
  367|  73.4k|    if(size < 4) {
  ------------------
  |  Branch (367:8): [True: 14, False: 73.4k]
  ------------------
  368|     14|      if(!cursize)
  ------------------
  |  Branch (368:10): [True: 10, False: 4]
  ------------------
  369|     10|        return STOP_FILLING;
  ------------------
  |  |   50|     10|#define STOP_FILLING ((size_t)-2)
  ------------------
  370|      4|      break;
  371|     14|    }
  372|  73.4k|    if(st->bufend - st->bufbeg < 3)
  ------------------
  |  Branch (372:8): [True: 1.71k, False: 71.7k]
  ------------------
  373|  1.71k|      break;
  374|       |
  375|       |    /* Encode three bytes as four characters. */
  376|  71.7k|    i = st->buf[st->bufbeg++] & 0xFF;
  377|  71.7k|    i = (i << 8) | (st->buf[st->bufbeg++] & 0xFF);
  378|  71.7k|    i = (i << 8) | (st->buf[st->bufbeg++] & 0xFF);
  379|  71.7k|    *ptr++ = curlx_base64encdec[(i >> 18) & 0x3F];
  380|  71.7k|    *ptr++ = curlx_base64encdec[(i >> 12) & 0x3F];
  381|  71.7k|    *ptr++ = curlx_base64encdec[(i >> 6) & 0x3F];
  382|  71.7k|    *ptr++ = curlx_base64encdec[i & 0x3F];
  383|  71.7k|    cursize += 4;
  384|  71.7k|    st->pos += 4;
  385|  71.7k|    size -= 4;
  386|  71.7k|  }
  387|       |
  388|       |  /* If at eof, we have to flush the buffered data. */
  389|  1.82k|  if(ateof) {
  ------------------
  |  Branch (389:6): [True: 110, False: 1.71k]
  ------------------
  390|    110|    if(size < 4) {
  ------------------
  |  Branch (390:8): [True: 0, False: 110]
  ------------------
  391|      0|      if(!cursize)
  ------------------
  |  Branch (391:10): [True: 0, False: 0]
  ------------------
  392|      0|        return STOP_FILLING;
  ------------------
  |  |   50|      0|#define STOP_FILLING ((size_t)-2)
  ------------------
  393|      0|    }
  394|    110|    else {
  395|       |      /* Buffered data size can only be 0, 1 or 2. */
  396|    110|      ptr[2] = ptr[3] = '=';
  397|    110|      i = 0;
  398|       |
  399|       |      /* If there is buffered data */
  400|    110|      if(st->bufend != st->bufbeg) {
  ------------------
  |  Branch (400:10): [True: 7, False: 103]
  ------------------
  401|       |
  402|      7|        if(st->bufend - st->bufbeg == 2)
  ------------------
  |  Branch (402:12): [True: 4, False: 3]
  ------------------
  403|      4|          i = (st->buf[st->bufbeg + 1] & 0xFF) << 8;
  404|       |
  405|      7|        i |= (st->buf[st->bufbeg] & 0xFF) << 16;
  406|      7|        ptr[0] = curlx_base64encdec[(i >> 18) & 0x3F];
  407|      7|        ptr[1] = curlx_base64encdec[(i >> 12) & 0x3F];
  408|      7|        if(++st->bufbeg != st->bufend) {
  ------------------
  |  Branch (408:12): [True: 4, False: 3]
  ------------------
  409|      4|          ptr[2] = curlx_base64encdec[(i >> 6) & 0x3F];
  410|      4|          st->bufbeg++;
  411|      4|        }
  412|      7|        cursize += 4;
  413|      7|        st->pos += 4;
  414|      7|      }
  415|    110|    }
  416|    110|  }
  417|       |
  418|  1.82k|  return cursize;
  419|  1.82k|}
mime.c:encoder_base64_size:
  427|     96|{
  428|     96|  curl_off_t size = part->datasize;
  429|       |
  430|     96|  if(size <= 0)
  ------------------
  |  Branch (430:6): [True: 86, False: 10]
  ------------------
  431|     86|    return size;    /* Unknown size or no data. */
  432|       |
  433|       |  /* Prevent integer overflows */
  434|     10|  if(size > BASE64_MAX_INPUT_SIZE)
  ------------------
  |  |  423|     10|  (((CURL_OFF_T_MAX / (MAX_ENCODED_LINE_LENGTH + 2)) *                  \
  |  |  ------------------
  |  |  |  |  539|     10|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  |  |                 (((CURL_OFF_T_MAX / (MAX_ENCODED_LINE_LENGTH + 2)) *                  \
  |  |  ------------------
  |  |  |  |   30|     10|#define MAX_ENCODED_LINE_LENGTH         76  /* Maximum encoded line length. */
  |  |  ------------------
  |  |  424|     10|    MAX_ENCODED_LINE_LENGTH / 4) * 3 - 3)
  |  |  ------------------
  |  |  |  |   30|     10|#define MAX_ENCODED_LINE_LENGTH         76  /* Maximum encoded line length. */
  |  |  ------------------
  ------------------
  |  Branch (434:6): [True: 0, False: 10]
  ------------------
  435|      0|    return -1;
  436|       |
  437|       |  /* Compute base64 character count. */
  438|     10|  size = 4 * (1 + ((size - 1) / 3));
  439|       |
  440|       |  /* Effective character count must include CRLFs. */
  441|     10|  return size + (2 * ((size - 1) / MAX_ENCODED_LINE_LENGTH));
  ------------------
  |  |   30|     10|#define MAX_ENCODED_LINE_LENGTH         76  /* Maximum encoded line length. */
  ------------------
  442|     10|}
mime.c:encoder_qp_read:
  465|  8.66k|{
  466|  8.66k|  struct mime_encoder_state *st = &part->encstate;
  467|  8.66k|  char *ptr = buffer;
  468|  8.66k|  size_t cursize = 0;
  469|  8.66k|  int softlinebreak;
  470|  8.66k|  char buf[4];
  471|       |
  472|       |  /* On all platforms, input is supposed to be ASCII compatible: for this
  473|       |     reason, we use hexadecimal ASCII codes in this function rather than
  474|       |     character constants that can be interpreted as non-ASCII on some
  475|       |     platforms. Preserve ASCII encoding on output too. */
  476|   648k|  while(st->bufbeg < st->bufend) {
  ------------------
  |  Branch (476:9): [True: 645k, False: 2.66k]
  ------------------
  477|   645k|    size_t len = 1;
  478|   645k|    size_t consumed = 1;
  479|   645k|    int i = (unsigned char)st->buf[st->bufbeg];
  480|   645k|    buf[0] = (char)i;
  481|   645k|    buf[1] = aschex[(i >> 4) & 0xF];
  482|   645k|    buf[2] = aschex[i & 0xF];
  483|       |
  484|   645k|    switch(qp_class[st->buf[st->bufbeg] & 0xFF]) {
  485|   265k|    case QP_OK:          /* Not a special character. */
  ------------------
  |  |   60|   265k|#define QP_OK           1       /* Can be represented by itself. */
  ------------------
  |  Branch (485:5): [True: 265k, False: 380k]
  ------------------
  486|   265k|      break;
  487|  1.34k|    case QP_SP:          /* Space or tab. */
  ------------------
  |  |   61|  1.34k|#define QP_SP           2       /* Space or tab. */
  ------------------
  |  Branch (487:5): [True: 1.34k, False: 644k]
  ------------------
  488|       |      /* Spacing must be escaped if followed by CRLF. */
  489|  1.34k|      switch(qp_lookahead_eol(st, ateof, 1)) {
  490|     18|      case -1:          /* More input data needed. */
  ------------------
  |  Branch (490:7): [True: 18, False: 1.32k]
  ------------------
  491|     18|        return cursize;
  492|  1.32k|      case 0:           /* No encoding needed. */
  ------------------
  |  Branch (492:7): [True: 1.32k, False: 20]
  ------------------
  493|  1.32k|        break;
  494|      2|      default:          /* CRLF after space or tab. */
  ------------------
  |  Branch (494:7): [True: 2, False: 1.34k]
  ------------------
  495|      2|        buf[0] = '\x3D';    /* '=' */
  496|      2|        len = 3;
  497|      2|        break;
  498|  1.34k|      }
  499|  1.32k|      break;
  500|  5.03k|    case QP_CR:         /* Carriage return. */
  ------------------
  |  |   62|  5.03k|#define QP_CR           3       /* Carriage return. */
  ------------------
  |  Branch (500:5): [True: 5.03k, False: 640k]
  ------------------
  501|       |      /* If followed by a line-feed, output the CRLF pair.
  502|       |         Else escape it. */
  503|  5.03k|      switch(qp_lookahead_eol(st, ateof, 0)) {
  504|     10|      case -1:          /* Need more data. */
  ------------------
  |  Branch (504:7): [True: 10, False: 5.02k]
  ------------------
  505|     10|        return cursize;
  506|  4.75k|      case 1:           /* CRLF found. */
  ------------------
  |  Branch (506:7): [True: 4.75k, False: 277]
  ------------------
  507|  4.75k|        buf[len++] = '\x0A';    /* Append '\n'. */
  508|  4.75k|        consumed = 2;
  509|  4.75k|        break;
  510|    267|      default:          /* Not followed by LF: escape. */
  ------------------
  |  Branch (510:7): [True: 267, False: 4.76k]
  ------------------
  511|    267|        buf[0] = '\x3D';    /* '=' */
  512|    267|        len = 3;
  513|    267|        break;
  514|  5.03k|      }
  515|  5.02k|      break;
  516|   374k|    default:            /* Character must be escaped. */
  ------------------
  |  Branch (516:5): [True: 374k, False: 271k]
  ------------------
  517|   374k|      buf[0] = '\x3D';    /* '=' */
  518|   374k|      len = 3;
  519|   374k|      break;
  520|   645k|    }
  521|       |
  522|       |    /* Be sure the encoded character fits within maximum line length. */
  523|   645k|    if(buf[len - 1] != '\x0A') {    /* '\n' */
  ------------------
  |  Branch (523:8): [True: 641k, False: 4.75k]
  ------------------
  524|   641k|      softlinebreak = st->pos + len > MAX_ENCODED_LINE_LENGTH;
  ------------------
  |  |   30|   641k|#define MAX_ENCODED_LINE_LENGTH         76  /* Maximum encoded line length. */
  ------------------
  525|   641k|      if(!softlinebreak && st->pos + len == MAX_ENCODED_LINE_LENGTH) {
  ------------------
  |  |   30|   626k|#define MAX_ENCODED_LINE_LENGTH         76  /* Maximum encoded line length. */
  ------------------
  |  Branch (525:10): [True: 626k, False: 14.2k]
  |  Branch (525:28): [True: 755, False: 626k]
  ------------------
  526|       |        /* We may use the current line only if end of data or followed by
  527|       |           a CRLF. */
  528|    755|        switch(qp_lookahead_eol(st, ateof, consumed)) {
  ------------------
  |  Branch (528:16): [True: 755, False: 0]
  ------------------
  529|     16|        case -1:        /* Need more data. */
  ------------------
  |  Branch (529:9): [True: 16, False: 739]
  ------------------
  530|     16|          return cursize;
  531|    739|        case 0:         /* Not followed by a CRLF. */
  ------------------
  |  Branch (531:9): [True: 739, False: 16]
  ------------------
  532|    739|          softlinebreak = 1;
  533|    739|          break;
  534|    755|        }
  535|    755|      }
  536|   641k|      if(softlinebreak) {
  ------------------
  |  Branch (536:10): [True: 15.0k, False: 626k]
  ------------------
  537|  15.0k|        curlx_strcopy(buf, sizeof(buf), STRCONST("\x3D\x0D\x0A")); /* =\r\n */
  ------------------
  |  | 1324|  15.0k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  15.0k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  538|  15.0k|        len = 3;
  539|  15.0k|        consumed = 0;
  540|  15.0k|      }
  541|   641k|    }
  542|       |
  543|       |    /* If the output buffer would overflow, do not store. */
  544|   645k|    if(len > size) {
  ------------------
  |  Branch (544:8): [True: 5.96k, False: 639k]
  ------------------
  545|  5.96k|      if(!cursize)
  ------------------
  |  Branch (545:10): [True: 4.20k, False: 1.75k]
  ------------------
  546|  4.20k|        return STOP_FILLING;
  ------------------
  |  |   50|  4.20k|#define STOP_FILLING ((size_t)-2)
  ------------------
  547|  1.75k|      break;
  548|  5.96k|    }
  549|       |
  550|       |    /* Append to output buffer. */
  551|   639k|    memcpy(ptr, buf, len);
  552|   639k|    cursize += len;
  553|   639k|    ptr += len;
  554|   639k|    size -= len;
  555|   639k|    st->pos += len;
  556|   639k|    if(buf[len - 1] == '\x0A')    /* '\n' */
  ------------------
  |  Branch (556:8): [True: 19.5k, False: 620k]
  ------------------
  557|  19.5k|      st->pos = 0;
  558|   639k|    st->bufbeg += consumed;
  559|   639k|  }
  560|       |
  561|  4.42k|  return cursize;
  562|  8.66k|}
mime.c:qp_lookahead_eol:
  450|  7.13k|{
  451|  7.13k|  n += st->bufbeg;
  452|  7.13k|  if(n >= st->bufend && ateof)
  ------------------
  |  Branch (452:6): [True: 14, False: 7.11k]
  |  Branch (452:25): [True: 0, False: 14]
  ------------------
  453|      0|    return 1;
  454|  7.13k|  if(n + 2 > st->bufend)
  ------------------
  |  Branch (454:6): [True: 44, False: 7.08k]
  ------------------
  455|     44|    return ateof ? 0 : -1;
  ------------------
  |  Branch (455:12): [True: 0, False: 44]
  ------------------
  456|  7.08k|  if(qp_class[st->buf[n] & 0xFF] == QP_CR &&
  ------------------
  |  |   62|  14.1k|#define QP_CR           3       /* Carriage return. */
  ------------------
  |  Branch (456:6): [True: 5.02k, False: 2.05k]
  ------------------
  457|  5.02k|     qp_class[st->buf[n + 1] & 0xFF] == QP_LF)
  ------------------
  |  |   63|  5.02k|#define QP_LF           4       /* Line-feed. */
  ------------------
  |  Branch (457:6): [True: 4.75k, False: 270]
  ------------------
  458|  4.75k|    return 1;
  459|  2.32k|  return 0;
  460|  7.08k|}
mime.c:encoder_qp_size:
  565|    169|{
  566|       |  /* Determining the size can only be done by reading the data: unless the
  567|       |     data size is 0, we return it as unknown (-1). */
  568|    169|  return part->datasize ? -1 : 0;
  ------------------
  |  Branch (568:10): [True: 37, False: 132]
  ------------------
  569|    169|}
mime.c:mime_subparts_seek:
 1019|  2.51k|{
 1020|  2.51k|  curl_mime *mime = (curl_mime *)instream;
 1021|  2.51k|  curl_mimepart *part;
 1022|  2.51k|  int rc = CURL_SEEKFUNC_OK;
  ------------------
  |  |  382|  2.51k|#define CURL_SEEKFUNC_OK       0
  ------------------
 1023|       |
 1024|  2.51k|  if(whence != SEEK_SET || offset)
  ------------------
  |  Branch (1024:6): [True: 0, False: 2.51k]
  |  Branch (1024:28): [True: 0, False: 2.51k]
  ------------------
 1025|      0|    return CURL_SEEKFUNC_CANTSEEK;    /* Only support full rewind. */
  ------------------
  |  |  384|      0|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
 1026|       |
 1027|  2.51k|  if(mime->state.state == MIMESTATE_BEGIN)
  ------------------
  |  Branch (1027:6): [True: 2.51k, False: 0]
  ------------------
 1028|  2.51k|    return CURL_SEEKFUNC_OK;           /* Already rewound. */
  ------------------
  |  |  382|  2.51k|#define CURL_SEEKFUNC_OK       0
  ------------------
 1029|       |
 1030|      0|  for(part = mime->firstpart; part; part = part->nextpart) {
  ------------------
  |  Branch (1030:31): [True: 0, False: 0]
  ------------------
 1031|      0|    int res = mime_part_rewind(part);
 1032|      0|    if(res != CURL_SEEKFUNC_OK)
  ------------------
  |  |  382|      0|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (1032:8): [True: 0, False: 0]
  ------------------
 1033|      0|      rc = res;
 1034|      0|  }
 1035|       |
 1036|      0|  if(rc == CURL_SEEKFUNC_OK)
  ------------------
  |  |  382|      0|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (1036:6): [True: 0, False: 0]
  ------------------
 1037|      0|    mimesetstate(&mime->state, MIMESTATE_BEGIN, NULL);
 1038|       |
 1039|      0|  return rc;
 1040|  2.51k|}
mime.c:mime_part_rewind:
  985|    376|{
  986|    376|  int res = CURL_SEEKFUNC_OK;
  ------------------
  |  |  382|    376|#define CURL_SEEKFUNC_OK       0
  ------------------
  987|    376|  enum mimestate targetstate = MIMESTATE_BEGIN;
  988|       |
  989|    376|  if(part->flags & MIME_BODY_ONLY)
  ------------------
  |  |   35|    376|#define MIME_BODY_ONLY          (1 << 1)
  ------------------
  |  Branch (989:6): [True: 376, False: 0]
  ------------------
  990|    376|    targetstate = MIMESTATE_BODY;
  991|    376|  cleanup_encoder_state(&part->encstate);
  992|    376|  if(part->state.state > targetstate) {
  ------------------
  |  Branch (992:6): [True: 0, False: 376]
  ------------------
  993|      0|    res = CURL_SEEKFUNC_CANTSEEK;
  ------------------
  |  |  384|      0|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
  994|      0|    if(part->seekfunc) {
  ------------------
  |  Branch (994:8): [True: 0, False: 0]
  ------------------
  995|      0|      res = part->seekfunc(part->arg, (curl_off_t)0, SEEK_SET);
  996|      0|      switch(res) {
  997|      0|      case CURL_SEEKFUNC_OK:
  ------------------
  |  |  382|      0|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (997:7): [True: 0, False: 0]
  ------------------
  998|      0|      case CURL_SEEKFUNC_FAIL:
  ------------------
  |  |  383|      0|#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */
  ------------------
  |  Branch (998:7): [True: 0, False: 0]
  ------------------
  999|      0|      case CURL_SEEKFUNC_CANTSEEK:
  ------------------
  |  |  384|      0|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
  |  Branch (999:7): [True: 0, False: 0]
  ------------------
 1000|      0|        break;
 1001|      0|      case -1:    /* For fseek() error. */
  ------------------
  |  Branch (1001:7): [True: 0, False: 0]
  ------------------
 1002|      0|        res = CURL_SEEKFUNC_CANTSEEK;
  ------------------
  |  |  384|      0|#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking cannot be done, so
  ------------------
 1003|      0|        break;
 1004|      0|      default:
  ------------------
  |  Branch (1004:7): [True: 0, False: 0]
  ------------------
 1005|      0|        res = CURL_SEEKFUNC_FAIL;
  ------------------
  |  |  383|      0|#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */
  ------------------
 1006|      0|        break;
 1007|      0|      }
 1008|      0|    }
 1009|      0|  }
 1010|       |
 1011|    376|  if(res == CURL_SEEKFUNC_OK)
  ------------------
  |  |  382|    376|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (1011:6): [True: 376, False: 0]
  ------------------
 1012|    376|    mimesetstate(&part->state, targetstate, NULL);
 1013|       |
 1014|    376|  part->lastreadstatus = 1; /* Successful read status. */
 1015|    376|  return res;
 1016|    376|}
mime.c:readback_part:
  835|  11.9k|{
  836|  11.9k|  size_t cursize = 0;
  837|       |
  838|       |  /* Readback from part. */
  839|  57.0k|  while(bufsize) {
  ------------------
  |  Branch (839:9): [True: 55.4k, False: 1.57k]
  ------------------
  840|  55.4k|    size_t sz = 0;
  841|  55.4k|    struct curl_slist *hdr = (struct curl_slist *)part->state.ptr;
  842|  55.4k|    switch(part->state.state) {
  843|  3.66k|    case MIMESTATE_BEGIN:
  ------------------
  |  Branch (843:5): [True: 3.66k, False: 51.7k]
  ------------------
  844|  3.66k|      mimesetstate(&part->state,
  845|  3.66k|                   (part->flags & MIME_BODY_ONLY) ?
  ------------------
  |  |   35|  3.66k|#define MIME_BODY_ONLY          (1 << 1)
  ------------------
  |  Branch (845:20): [True: 0, False: 3.66k]
  ------------------
  846|  3.66k|                   MIMESTATE_BODY : MIMESTATE_CURLHEADERS,
  847|  3.66k|                   part->curlheaders);
  848|  3.66k|      break;
  849|  10.6k|    case MIMESTATE_USERHEADERS:
  ------------------
  |  Branch (849:5): [True: 10.6k, False: 44.7k]
  ------------------
  850|  10.6k|      if(!hdr) {
  ------------------
  |  Branch (850:10): [True: 3.66k, False: 7.01k]
  ------------------
  851|  3.66k|        mimesetstate(&part->state, MIMESTATE_EOH, NULL);
  852|  3.66k|        break;
  853|  3.66k|      }
  854|  7.01k|      if(match_header(hdr, "Content-Type", 12)) {
  ------------------
  |  Branch (854:10): [True: 0, False: 7.01k]
  ------------------
  855|      0|        mimesetstate(&part->state, MIMESTATE_USERHEADERS, hdr->next);
  856|      0|        break;
  857|      0|      }
  858|  7.01k|      FALLTHROUGH();
  ------------------
  |  |  752|  7.01k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  859|  22.3k|    case MIMESTATE_CURLHEADERS:
  ------------------
  |  Branch (859:5): [True: 15.3k, False: 40.1k]
  ------------------
  860|  22.3k|      if(!hdr)
  ------------------
  |  Branch (860:10): [True: 3.66k, False: 18.6k]
  ------------------
  861|  3.66k|        mimesetstate(&part->state, MIMESTATE_USERHEADERS, part->userheaders);
  862|  18.6k|      else {
  863|  18.6k|        sz = readback_bytes(&part->state, buffer, bufsize,
  864|  18.6k|                            hdr->data, strlen(hdr->data), STRCONST("\r\n"));
  ------------------
  |  | 1324|  18.6k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  18.6k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  865|  18.6k|        if(!sz)
  ------------------
  |  Branch (865:12): [True: 6.91k, False: 11.7k]
  ------------------
  866|  6.91k|          mimesetstate(&part->state, part->state.state, hdr->next);
  867|  18.6k|      }
  868|  22.3k|      break;
  869|  7.32k|    case MIMESTATE_EOH:
  ------------------
  |  Branch (869:5): [True: 7.32k, False: 48.1k]
  ------------------
  870|  7.32k|      sz = readback_bytes(&part->state, buffer, bufsize, STRCONST("\r\n"),
  ------------------
  |  | 1324|  7.32k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  7.32k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  871|  7.32k|                          STRCONST(""));
  ------------------
  |  | 1324|  7.32k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  7.32k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  872|  7.32k|      if(!sz)
  ------------------
  |  Branch (872:10): [True: 3.66k, False: 3.66k]
  ------------------
  873|  3.66k|        mimesetstate(&part->state, MIMESTATE_BODY, NULL);
  874|  7.32k|      break;
  875|  4.03k|    case MIMESTATE_BODY:
  ------------------
  |  Branch (875:5): [True: 4.03k, False: 51.4k]
  ------------------
  876|  4.03k|      cleanup_encoder_state(&part->encstate);
  877|  4.03k|      mimesetstate(&part->state, MIMESTATE_CONTENT, NULL);
  878|  4.03k|      break;
  879|  10.8k|    case MIMESTATE_CONTENT:
  ------------------
  |  Branch (879:5): [True: 10.8k, False: 44.6k]
  ------------------
  880|  10.8k|      if(part->encoder)
  ------------------
  |  Branch (880:10): [True: 5.51k, False: 5.32k]
  ------------------
  881|  5.51k|        sz = read_encoded_part_content(part, buffer, bufsize, hasread);
  882|  5.32k|      else
  883|  5.32k|        sz = read_part_content(part, buffer, bufsize, hasread);
  884|  10.8k|      switch(sz) {
  ------------------
  |  Branch (884:14): [True: 6.76k, False: 4.07k]
  ------------------
  885|  3.68k|      case 0:
  ------------------
  |  Branch (885:7): [True: 3.68k, False: 7.15k]
  ------------------
  886|  3.68k|        mimesetstate(&part->state, MIMESTATE_END, NULL);
  887|       |        /* Try sparing open file descriptors. */
  888|  3.68k|        if(part->kind == MIMEKIND_FILE && part->fp) {
  ------------------
  |  Branch (888:12): [True: 0, False: 3.68k]
  |  Branch (888:43): [True: 0, False: 0]
  ------------------
  889|      0|          curlx_fclose(part->fp);
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
  890|      0|          part->fp = NULL;
  891|      0|        }
  892|  3.68k|        FALLTHROUGH();
  ------------------
  |  |  752|  3.68k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  893|  3.68k|      case CURL_READFUNC_ABORT:
  ------------------
  |  |  392|  3.68k|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (893:7): [True: 0, False: 10.8k]
  ------------------
  894|  3.68k|      case CURL_READFUNC_PAUSE:
  ------------------
  |  |  395|  3.68k|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (894:7): [True: 0, False: 10.8k]
  ------------------
  895|  3.68k|      case READ_ERROR:
  ------------------
  |  |   49|  3.68k|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (895:7): [True: 0, False: 10.8k]
  ------------------
  896|  6.76k|      case STOP_FILLING:
  ------------------
  |  |   50|  6.76k|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (896:7): [True: 3.07k, False: 7.76k]
  ------------------
  897|  6.76k|        return cursize ? cursize : sz;
  ------------------
  |  Branch (897:16): [True: 5.14k, False: 1.61k]
  ------------------
  898|  10.8k|      }
  899|  4.07k|      break;
  900|  4.07k|    case MIMESTATE_END:
  ------------------
  |  Branch (900:5): [True: 3.60k, False: 51.8k]
  ------------------
  901|  3.60k|      return cursize;
  902|      0|    default:
  ------------------
  |  Branch (902:5): [True: 0, False: 55.4k]
  ------------------
  903|      0|      break;    /* Other values not in part state. */
  904|  55.4k|    }
  905|       |
  906|       |    /* Bump buffer and counters according to read size. */
  907|  45.0k|    cursize += sz;
  908|  45.0k|    buffer += sz;
  909|  45.0k|    bufsize -= sz;
  910|  45.0k|  }
  911|       |
  912|  1.57k|  return cursize;
  913|  11.9k|}
mime.c:match_header:
  245|  19.4k|{
  246|  19.4k|  char *value = NULL;
  247|       |
  248|  19.4k|  if(curl_strnequal(hdr->data, lbl, len) && hdr->data[len] == ':')
  ------------------
  |  Branch (248:6): [True: 0, False: 19.4k]
  |  Branch (248:45): [True: 0, False: 0]
  ------------------
  249|      0|    for(value = hdr->data + len + 1; *value == ' '; value++)
  ------------------
  |  Branch (249:38): [True: 0, False: 0]
  ------------------
  250|      0|      ;
  251|  19.4k|  return value;
  252|  19.4k|}
mime.c:readback_bytes:
  679|  48.6k|{
  680|  48.6k|  size_t sz;
  681|  48.6k|  size_t offset = curlx_sotouz(state->offset);
  682|       |
  683|  48.6k|  if(numbytes > offset) {
  ------------------
  |  Branch (683:6): [True: 17.9k, False: 30.6k]
  ------------------
  684|  17.9k|    sz = numbytes - offset;
  685|  17.9k|    bytes += offset;
  686|  17.9k|  }
  687|  30.6k|  else {
  688|  30.6k|    sz = offset - numbytes;
  689|  30.6k|    if(sz >= traillen)
  ------------------
  |  Branch (689:8): [True: 18.9k, False: 11.6k]
  ------------------
  690|  18.9k|      return 0;
  691|  11.6k|    bytes = trail + sz;
  692|  11.6k|    sz = traillen - sz;
  693|  11.6k|  }
  694|       |
  695|  29.6k|  if(sz > bufsize)
  ------------------
  |  Branch (695:6): [True: 157, False: 29.4k]
  ------------------
  696|    157|    sz = bufsize;
  697|       |
  698|  29.6k|  memcpy(buffer, bytes, sz);
  699|  29.6k|  state->offset += sz;
  700|  29.6k|  return sz;
  701|  48.6k|}
mime.c:read_encoded_part_content:
  775|  5.51k|{
  776|  5.51k|  struct mime_encoder_state *st = &part->encstate;
  777|  5.51k|  size_t cursize = 0;
  778|  5.51k|  size_t sz;
  779|  5.51k|  bool ateof = FALSE;
  ------------------
  |  |  989|  5.51k|#define FALSE false
  ------------------
  780|       |
  781|  15.9k|  for(;;) {
  782|  15.9k|    if(st->bufbeg < st->bufend || ateof) {
  ------------------
  |  Branch (782:8): [True: 11.2k, False: 4.73k]
  |  Branch (782:35): [True: 706, False: 4.03k]
  ------------------
  783|       |      /* Encode buffered data. */
  784|  11.9k|      sz = part->encoder->encodefunc(buffer, bufsize, ateof, part);
  785|  11.9k|      switch(sz) {
  786|  1.58k|      case 0:
  ------------------
  |  Branch (786:7): [True: 1.58k, False: 10.3k]
  ------------------
  787|  1.58k|        if(ateof)
  ------------------
  |  Branch (787:12): [True: 706, False: 881]
  ------------------
  788|    706|          return cursize;
  789|    881|        break;
  790|    881|      case READ_ERROR:
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (790:7): [True: 0, False: 11.9k]
  ------------------
  791|  4.46k|      case STOP_FILLING:
  ------------------
  |  |   50|  4.46k|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (791:7): [True: 4.46k, False: 7.45k]
  ------------------
  792|  4.46k|        return cursize ? cursize : sz;
  ------------------
  |  Branch (792:16): [True: 2.01k, False: 2.44k]
  ------------------
  793|  5.86k|      default:
  ------------------
  |  Branch (793:7): [True: 5.86k, False: 6.04k]
  ------------------
  794|  5.86k|        cursize += sz;
  795|  5.86k|        buffer += sz;
  796|  5.86k|        bufsize -= sz;
  797|  5.86k|        continue;
  798|  11.9k|      }
  799|  11.9k|    }
  800|       |
  801|       |    /* We need more data in input buffer. */
  802|  4.91k|    if(st->bufbeg) {
  ------------------
  |  Branch (802:8): [True: 3.86k, False: 1.04k]
  ------------------
  803|  3.86k|      size_t len = st->bufend - st->bufbeg;
  804|       |
  805|  3.86k|      if(len)
  ------------------
  |  Branch (805:10): [True: 867, False: 2.99k]
  ------------------
  806|    867|        memmove(st->buf, st->buf + st->bufbeg, len);
  807|  3.86k|      st->bufbeg = 0;
  808|  3.86k|      st->bufend = len;
  809|  3.86k|    }
  810|  4.91k|    if(st->bufend >= sizeof(st->buf))
  ------------------
  |  Branch (810:8): [True: 0, False: 4.91k]
  ------------------
  811|      0|      return cursize ? cursize : READ_ERROR;    /* Buffer full. */
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (811:14): [True: 0, False: 0]
  ------------------
  812|  4.91k|    sz = read_part_content(part, st->buf + st->bufend,
  813|  4.91k|                           sizeof(st->buf) - st->bufend, hasread);
  814|  4.91k|    switch(sz) {
  815|    706|    case 0:
  ------------------
  |  Branch (815:5): [True: 706, False: 4.20k]
  ------------------
  816|    706|      ateof = TRUE;
  ------------------
  |  |  986|    706|#define TRUE true
  ------------------
  817|    706|      break;
  818|      0|    case CURL_READFUNC_ABORT:
  ------------------
  |  |  392|      0|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (818:5): [True: 0, False: 4.91k]
  ------------------
  819|      0|    case CURL_READFUNC_PAUSE:
  ------------------
  |  |  395|      0|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (819:5): [True: 0, False: 4.91k]
  ------------------
  820|      0|    case READ_ERROR:
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (820:5): [True: 0, False: 4.91k]
  ------------------
  821|    346|    case STOP_FILLING:
  ------------------
  |  |   50|    346|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (821:5): [True: 346, False: 4.56k]
  ------------------
  822|    346|      return cursize ? cursize : sz;
  ------------------
  |  Branch (822:14): [True: 70, False: 276]
  ------------------
  823|  3.85k|    default:
  ------------------
  |  Branch (823:5): [True: 3.85k, False: 1.05k]
  ------------------
  824|  3.85k|      st->bufend += sz;
  825|  3.85k|      break;
  826|  4.91k|    }
  827|  4.91k|  }
  828|       |
  829|       |  /* NOTREACHED */
  830|  5.51k|}
mime.c:read_part_content:
  707|  10.2k|{
  708|  10.2k|  size_t sz = 0;
  709|       |
  710|  10.2k|  switch(part->lastreadstatus) {
  711|    122|  case 0:
  ------------------
  |  Branch (711:3): [True: 122, False: 10.1k]
  ------------------
  712|    122|  case CURL_READFUNC_ABORT:
  ------------------
  |  |  392|    122|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (712:3): [True: 0, False: 10.2k]
  ------------------
  713|    122|  case CURL_READFUNC_PAUSE:
  ------------------
  |  |  395|    122|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (713:3): [True: 0, False: 10.2k]
  ------------------
  714|    122|  case READ_ERROR:
  ------------------
  |  |   49|    122|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (714:3): [True: 0, False: 10.2k]
  ------------------
  715|    122|    return part->lastreadstatus;
  716|  10.1k|  default:
  ------------------
  |  Branch (716:3): [True: 10.1k, False: 122]
  ------------------
  717|  10.1k|    break;
  718|  10.2k|  }
  719|       |
  720|       |  /* If we can determine we are at end of part data, spare a read. */
  721|  10.1k|  if(part->datasize != (curl_off_t)-1 &&
  ------------------
  |  Branch (721:6): [True: 7.99k, False: 2.11k]
  ------------------
  722|  7.99k|     part->state.offset >= part->datasize) {
  ------------------
  |  Branch (722:6): [True: 3.56k, False: 4.42k]
  ------------------
  723|       |    /* sz is already zero. */
  724|  3.56k|  }
  725|  6.54k|  else {
  726|  6.54k|    if(part->datasize != (curl_off_t)-1)
  ------------------
  |  Branch (726:8): [True: 4.42k, False: 2.11k]
  ------------------
  727|  4.42k|      bufsize = curlx_sotouz_range(part->datasize - part->state.offset,
  728|  4.42k|                                  0, bufsize);
  729|  6.54k|    switch(part->kind) {
  730|  3.89k|    case MIMEKIND_MULTIPART:
  ------------------
  |  Branch (730:5): [True: 3.89k, False: 2.65k]
  ------------------
  731|       |      /*
  732|       |       * Cannot be processed as other kinds since read function requires
  733|       |       * an additional parameter and is highly recursive.
  734|       |       */
  735|  3.89k|      sz = mime_subparts_read(buffer, 1, bufsize, part->arg, hasread);
  736|  3.89k|      break;
  737|      0|    case MIMEKIND_FILE:
  ------------------
  |  Branch (737:5): [True: 0, False: 6.54k]
  ------------------
  738|      0|      if(part->fp && feof(part->fp))
  ------------------
  |  Branch (738:10): [True: 0, False: 0]
  |  Branch (738:22): [True: 0, False: 0]
  ------------------
  739|      0|        break;  /* At EOF. */
  740|      0|      FALLTHROUGH();
  ------------------
  |  |  752|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  741|  2.65k|    default:
  ------------------
  |  Branch (741:5): [True: 2.65k, False: 3.89k]
  ------------------
  742|  2.65k|      if(part->readfunc) {
  ------------------
  |  Branch (742:10): [True: 2.65k, False: 0]
  ------------------
  743|  2.65k|        if(!(part->flags & MIME_FAST_READ)) {
  ------------------
  |  |   36|  2.65k|#define MIME_FAST_READ          (1 << 2)
  ------------------
  |  Branch (743:12): [True: 708, False: 1.94k]
  ------------------
  744|    708|          if(*hasread)
  ------------------
  |  Branch (744:14): [True: 535, False: 173]
  ------------------
  745|    535|            return STOP_FILLING;
  ------------------
  |  |   50|    535|#define STOP_FILLING ((size_t)-2)
  ------------------
  746|    173|          *hasread = TRUE;
  ------------------
  |  |  986|    173|#define TRUE true
  ------------------
  747|    173|        }
  748|  2.11k|        sz = part->readfunc(buffer, 1, bufsize, part->arg);
  749|  2.11k|      }
  750|  2.11k|      break;
  751|  6.54k|    }
  752|  6.54k|  }
  753|       |
  754|  9.57k|  switch(sz) {
  755|    168|  case STOP_FILLING:
  ------------------
  |  |   50|    168|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (755:3): [True: 168, False: 9.41k]
  ------------------
  756|    168|    break;
  757|  3.68k|  case 0:
  ------------------
  |  Branch (757:3): [True: 3.68k, False: 5.89k]
  ------------------
  758|  3.68k|  case CURL_READFUNC_ABORT:
  ------------------
  |  |  392|  3.68k|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (758:3): [True: 0, False: 9.57k]
  ------------------
  759|  3.68k|  case CURL_READFUNC_PAUSE:
  ------------------
  |  |  395|  3.68k|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (759:3): [True: 0, False: 9.57k]
  ------------------
  760|  3.68k|  case READ_ERROR:
  ------------------
  |  |   49|  3.68k|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (760:3): [True: 0, False: 9.57k]
  ------------------
  761|  3.68k|    part->lastreadstatus = sz;
  762|  3.68k|    break;
  763|  5.72k|  default:
  ------------------
  |  Branch (763:3): [True: 5.72k, False: 3.85k]
  ------------------
  764|  5.72k|    part->state.offset += sz;
  765|  5.72k|    part->lastreadstatus = sz;
  766|  5.72k|    break;
  767|  9.57k|  }
  768|       |
  769|  9.57k|  return sz;
  770|  9.57k|}
mime.c:mime_subparts_read:
  918|  3.89k|{
  919|  3.89k|  curl_mime *mime = (curl_mime *)instream;
  920|  3.89k|  size_t cursize = 0;
  921|  3.89k|  (void)size;  /* Always 1 */
  922|       |
  923|  37.4k|  while(nitems) {
  ------------------
  |  Branch (923:9): [True: 35.1k, False: 2.27k]
  ------------------
  924|  35.1k|    size_t sz = 0;
  925|  35.1k|    curl_mimepart *part = mime->state.ptr;
  926|  35.1k|    switch(mime->state.state) {
  927|  1.07k|    case MIMESTATE_BEGIN:
  ------------------
  |  Branch (927:5): [True: 1.07k, False: 34.1k]
  ------------------
  928|  1.07k|    case MIMESTATE_BODY:
  ------------------
  |  Branch (928:5): [True: 0, False: 35.1k]
  ------------------
  929|  1.07k|      mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, mime->firstpart);
  930|       |      /* The first boundary always follows the header termination empty line,
  931|       |         so is always preceded by a CRLF. We can then spare 2 characters
  932|       |         by skipping the leading CRLF in boundary. */
  933|  1.07k|      mime->state.offset += 2;
  934|  1.07k|      break;
  935|  9.45k|    case MIMESTATE_BOUNDARY1:
  ------------------
  |  Branch (935:5): [True: 9.45k, False: 25.7k]
  ------------------
  936|  9.45k|      sz = readback_bytes(&mime->state, buffer, nitems, STRCONST("\r\n--"),
  ------------------
  |  | 1324|  9.45k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  9.45k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  937|  9.45k|                          STRCONST(""));
  ------------------
  |  | 1324|  9.45k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  9.45k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  938|  9.45k|      if(!sz)
  ------------------
  |  Branch (938:10): [True: 4.72k, False: 4.72k]
  ------------------
  939|  4.72k|        mimesetstate(&mime->state, MIMESTATE_BOUNDARY2, part);
  940|  9.45k|      break;
  941|  13.1k|    case MIMESTATE_BOUNDARY2:
  ------------------
  |  Branch (941:5): [True: 13.1k, False: 21.9k]
  ------------------
  942|  13.1k|      if(part)
  ------------------
  |  Branch (942:10): [True: 11.0k, False: 2.18k]
  ------------------
  943|  11.0k|        sz = readback_bytes(&mime->state, buffer, nitems, mime->boundary,
  944|  11.0k|                            MIME_BOUNDARY_LEN, STRCONST("\r\n"));
  ------------------
  |  |   97|  11.0k|#define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   28|  11.0k|#define MIME_BOUNDARY_DASHES            24  /* leading boundary dashes */
  |  |  ------------------
  |  |               #define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   29|  11.0k|#define MIME_RAND_BOUNDARY_CHARS        22  /* Nb. of random boundary chars. */
  |  |  ------------------
  ------------------
                                          MIME_BOUNDARY_LEN, STRCONST("\r\n"));
  ------------------
  |  | 1324|  11.0k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  11.0k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  945|  2.18k|      else
  946|  2.18k|        sz = readback_bytes(&mime->state, buffer, nitems, mime->boundary,
  947|  2.18k|                            MIME_BOUNDARY_LEN, STRCONST("--\r\n"));
  ------------------
  |  |   97|  2.18k|#define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   28|  2.18k|#define MIME_BOUNDARY_DASHES            24  /* leading boundary dashes */
  |  |  ------------------
  |  |               #define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   29|  2.18k|#define MIME_RAND_BOUNDARY_CHARS        22  /* Nb. of random boundary chars. */
  |  |  ------------------
  ------------------
                                          MIME_BOUNDARY_LEN, STRCONST("--\r\n"));
  ------------------
  |  | 1324|  2.18k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  2.18k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  948|  13.1k|      if(!sz) {
  ------------------
  |  Branch (948:10): [True: 3.70k, False: 9.48k]
  ------------------
  949|  3.70k|        mimesetstate(&mime->state, MIMESTATE_CONTENT, part);
  950|  3.70k|      }
  951|  13.1k|      break;
  952|  11.3k|    case MIMESTATE_CONTENT:
  ------------------
  |  Branch (952:5): [True: 11.3k, False: 23.7k]
  ------------------
  953|  11.3k|      if(!part) {
  ------------------
  |  Branch (953:10): [True: 41, False: 11.3k]
  ------------------
  954|     41|        mimesetstate(&mime->state, MIMESTATE_END, NULL);
  955|     41|        break;
  956|     41|      }
  957|  11.3k|      sz = readback_part(part, buffer, nitems, hasread);
  958|  11.3k|      switch(sz) {
  ------------------
  |  Branch (958:14): [True: 5.19k, False: 6.15k]
  ------------------
  959|      0|      case CURL_READFUNC_ABORT:
  ------------------
  |  |  392|      0|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (959:7): [True: 0, False: 11.3k]
  ------------------
  960|      0|      case CURL_READFUNC_PAUSE:
  ------------------
  |  |  395|      0|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (960:7): [True: 0, False: 11.3k]
  ------------------
  961|      0|      case READ_ERROR:
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (961:7): [True: 0, False: 11.3k]
  ------------------
  962|  1.53k|      case STOP_FILLING:
  ------------------
  |  |   50|  1.53k|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (962:7): [True: 1.53k, False: 9.81k]
  ------------------
  963|  1.53k|        return cursize ? cursize : sz;
  ------------------
  |  Branch (963:16): [True: 1.37k, False: 168]
  ------------------
  964|  3.65k|      case 0:
  ------------------
  |  Branch (964:7): [True: 3.65k, False: 7.69k]
  ------------------
  965|  3.65k|        mimesetstate(&mime->state, MIMESTATE_BOUNDARY1, part->nextpart);
  966|  3.65k|        break;
  967|  11.3k|      }
  968|  9.81k|      break;
  969|  9.81k|    case MIMESTATE_END:
  ------------------
  |  Branch (969:5): [True: 82, False: 35.1k]
  ------------------
  970|     82|      return cursize;
  971|      0|    default:
  ------------------
  |  Branch (971:5): [True: 0, False: 35.1k]
  ------------------
  972|      0|      break;    /* other values not used in mime state. */
  973|  35.1k|    }
  974|       |
  975|       |    /* Bump buffer and counters according to read size. */
  976|  33.5k|    cursize += sz;
  977|  33.5k|    buffer += sz;
  978|  33.5k|    nitems -= sz;
  979|  33.5k|  }
  980|       |
  981|  2.27k|  return cursize;
  982|  3.89k|}
mime.c:mime_prepare_headers:
 1809|  4.06k|{
 1810|  4.06k|  curl_mime *mime = NULL;
 1811|  4.06k|  const char *boundary = NULL;
 1812|  4.06k|  char *customct;
 1813|  4.06k|  const char *cte = NULL;
 1814|  4.06k|  CURLcode result = CURLE_OK;
 1815|       |
 1816|  4.06k|  if(++call_depth > MAX_MIME_LEVELS)
  ------------------
  |  |   47|  4.06k|#define MAX_MIME_LEVELS 40 /* avoid deep nesting */
  ------------------
  |  Branch (1816:6): [True: 0, False: 4.06k]
  ------------------
 1817|      0|    return CURLE_TOO_LARGE;
 1818|       |
 1819|       |  /* Get rid of previously prepared headers. */
 1820|  4.06k|  curl_slist_free_all(part->curlheaders);
 1821|  4.06k|  part->curlheaders = NULL;
 1822|       |
 1823|       |  /* Be sure we will not access old headers later. */
 1824|  4.06k|  if(part->state.state == MIMESTATE_CURLHEADERS)
  ------------------
  |  Branch (1824:6): [True: 0, False: 4.06k]
  ------------------
 1825|      0|    mimesetstate(&part->state, MIMESTATE_CURLHEADERS, NULL);
 1826|       |
 1827|       |  /* Check if content type is specified. */
 1828|  4.06k|  customct = part->mimetype;
 1829|  4.06k|  if(!customct)
  ------------------
  |  Branch (1829:6): [True: 3.76k, False: 302]
  ------------------
 1830|  3.76k|    customct = search_header(part->userheaders, STRCONST("Content-Type"));
  ------------------
  |  | 1324|  3.76k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  3.76k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 1831|  4.06k|  if(customct)
  ------------------
  |  Branch (1831:6): [True: 302, False: 3.76k]
  ------------------
 1832|    302|    contenttype = customct;
 1833|       |
 1834|       |  /* If content type is not specified, try to determine it. */
 1835|  4.06k|  if(!contenttype) {
  ------------------
  |  Branch (1835:6): [True: 3.38k, False: 679]
  ------------------
 1836|  3.38k|    switch(part->kind) {
 1837|    637|    case MIMEKIND_MULTIPART:
  ------------------
  |  Branch (1837:5): [True: 637, False: 2.74k]
  ------------------
 1838|    637|      contenttype = MULTIPART_CONTENTTYPE_DEFAULT;
  ------------------
  |  |   39|    637|#define MULTIPART_CONTENTTYPE_DEFAULT   "multipart/mixed"
  ------------------
 1839|    637|      break;
 1840|      0|    case MIMEKIND_FILE:
  ------------------
  |  Branch (1840:5): [True: 0, False: 3.38k]
  ------------------
 1841|      0|      contenttype = Curl_mime_contenttype(part->filename);
 1842|      0|      if(!contenttype)
  ------------------
  |  Branch (1842:10): [True: 0, False: 0]
  ------------------
 1843|      0|        contenttype = Curl_mime_contenttype(part->data);
 1844|      0|      if(!contenttype && part->filename)
  ------------------
  |  Branch (1844:10): [True: 0, False: 0]
  |  Branch (1844:26): [True: 0, False: 0]
  ------------------
 1845|      0|        contenttype = FILE_CONTENTTYPE_DEFAULT;
  ------------------
  |  |   38|      0|#define FILE_CONTENTTYPE_DEFAULT        "application/octet-stream"
  ------------------
 1846|      0|      break;
 1847|  2.74k|    default:
  ------------------
  |  Branch (1847:5): [True: 2.74k, False: 637]
  ------------------
 1848|  2.74k|      contenttype = Curl_mime_contenttype(part->filename);
 1849|  2.74k|      break;
 1850|  3.38k|    }
 1851|  3.38k|  }
 1852|       |
 1853|  4.06k|  if(part->kind == MIMEKIND_MULTIPART) {
  ------------------
  |  Branch (1853:6): [True: 1.07k, False: 2.99k]
  ------------------
 1854|  1.07k|    mime = (curl_mime *)part->arg;
 1855|  1.07k|    if(mime)
  ------------------
  |  Branch (1855:8): [True: 1.07k, False: 0]
  ------------------
 1856|  1.07k|      boundary = mime->boundary;
 1857|  1.07k|  }
 1858|  2.99k|  else if(contenttype && !customct &&
  ------------------
  |  Branch (1858:11): [True: 245, False: 2.74k]
  |  Branch (1858:26): [True: 0, False: 245]
  ------------------
 1859|      0|          content_type_match(contenttype, STRCONST("text/plain")) &&
  ------------------
  |  | 1324|      0|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1859:11): [True: 0, False: 0]
  ------------------
 1860|      0|          (strategy == MIMESTRATEGY_MAIL || !part->filename))
  ------------------
  |  Branch (1860:12): [True: 0, False: 0]
  |  Branch (1860:45): [True: 0, False: 0]
  ------------------
 1861|      0|    contenttype = NULL;
 1862|       |
 1863|       |  /* Issue content-disposition header only if not already set by caller. */
 1864|  4.06k|  if(!search_header(part->userheaders, STRCONST("Content-Disposition"))) {
  ------------------
  |  | 1324|  4.06k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  4.06k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1864:6): [True: 4.06k, False: 0]
  ------------------
 1865|  4.06k|    result = add_content_disposition(data, part, disposition,
 1866|  4.06k|                                     contenttype, strategy);
 1867|  4.06k|    if(result)
  ------------------
  |  Branch (1867:8): [True: 1, False: 4.06k]
  ------------------
 1868|      1|      return result;
 1869|  4.06k|  }
 1870|       |
 1871|       |  /* Issue Content-Type header. */
 1872|  4.06k|  if(contenttype) {
  ------------------
  |  Branch (1872:6): [True: 1.31k, False: 2.74k]
  ------------------
 1873|  1.31k|    result = add_content_type(&part->curlheaders, contenttype, boundary);
 1874|  1.31k|    if(result)
  ------------------
  |  Branch (1874:8): [True: 0, False: 1.31k]
  ------------------
 1875|      0|      return result;
 1876|  1.31k|  }
 1877|       |
 1878|       |  /* Content-Transfer-Encoding header. */
 1879|  4.06k|  if(!search_header(part->userheaders,
  ------------------
  |  Branch (1879:6): [True: 4.06k, False: 0]
  ------------------
 1880|  4.06k|                    STRCONST("Content-Transfer-Encoding"))) {
  ------------------
  |  | 1324|  4.06k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  4.06k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 1881|  4.06k|    if(part->encoder)
  ------------------
  |  Branch (1881:8): [True: 588, False: 3.47k]
  ------------------
 1882|    588|      cte = part->encoder->name;
 1883|  3.47k|    else if(contenttype && strategy == MIMESTRATEGY_MAIL &&
  ------------------
  |  Branch (1883:13): [True: 1.20k, False: 2.27k]
  |  Branch (1883:28): [True: 0, False: 1.20k]
  ------------------
 1884|      0|            part->kind != MIMEKIND_MULTIPART)
  ------------------
  |  Branch (1884:13): [True: 0, False: 0]
  ------------------
 1885|      0|      cte = "8bit";
 1886|  4.06k|    if(cte) {
  ------------------
  |  Branch (1886:8): [True: 588, False: 3.47k]
  ------------------
 1887|    588|      result = Curl_mime_add_header(&part->curlheaders,
 1888|    588|                                    "Content-Transfer-Encoding: %s", cte);
 1889|    588|      if(result)
  ------------------
  |  Branch (1889:10): [True: 0, False: 588]
  ------------------
 1890|      0|        return result;
 1891|    588|    }
 1892|  4.06k|  }
 1893|       |
 1894|       |  /* If we were reading curl-generated headers, restart with new ones (this
 1895|       |     should not occur). */
 1896|  4.06k|  if(part->state.state == MIMESTATE_CURLHEADERS)
  ------------------
  |  Branch (1896:6): [True: 0, False: 4.06k]
  ------------------
 1897|      0|    mimesetstate(&part->state, MIMESTATE_CURLHEADERS, part->curlheaders);
 1898|       |
 1899|       |  /* Process subparts. */
 1900|  4.06k|  if(part->kind == MIMEKIND_MULTIPART && mime) {
  ------------------
  |  Branch (1900:6): [True: 1.07k, False: 2.99k]
  |  Branch (1900:42): [True: 1.07k, False: 0]
  ------------------
 1901|  1.07k|    curl_mimepart *subpart;
 1902|       |
 1903|  1.07k|    disposition = NULL;
 1904|  1.07k|    if(content_type_match(contenttype, STRCONST("multipart/form-data")))
  ------------------
  |  | 1324|  1.07k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.07k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (1904:8): [True: 377, False: 694]
  ------------------
 1905|    377|      disposition = "form-data";
 1906|  4.75k|    for(subpart = mime->firstpart; subpart; subpart = subpart->nextpart) {
  ------------------
  |  Branch (1906:36): [True: 3.68k, False: 1.07k]
  ------------------
 1907|  3.68k|      result = mime_prepare_headers(data, subpart, NULL,
 1908|  3.68k|                                    disposition, strategy, call_depth);
 1909|  3.68k|      if(result)
  ------------------
  |  Branch (1909:10): [True: 1, False: 3.68k]
  ------------------
 1910|      1|        return result;
 1911|  3.68k|    }
 1912|  1.07k|  }
 1913|  4.06k|  return result;
 1914|  4.06k|}
mime.c:search_header:
  257|  11.8k|{
  258|  11.8k|  char *value = NULL;
  259|       |
  260|  21.2k|  for(; !value && hdrlist; hdrlist = hdrlist->next)
  ------------------
  |  Branch (260:9): [True: 21.2k, False: 0]
  |  Branch (260:19): [True: 9.37k, False: 11.8k]
  ------------------
  261|  9.37k|    value = match_header(hdrlist, hdr, len);
  262|       |
  263|  11.8k|  return value;
  264|  11.8k|}
mime.c:content_type_match:
 1731|  1.07k|{
 1732|  1.07k|  if(contenttype && curl_strnequal(contenttype, target, len))
  ------------------
  |  Branch (1732:6): [True: 1.07k, False: 0]
  |  Branch (1732:21): [True: 377, False: 694]
  ------------------
 1733|    377|    switch(contenttype[len]) {
  ------------------
  |  Branch (1733:12): [True: 377, False: 0]
  ------------------
 1734|    377|    case '\0':
  ------------------
  |  Branch (1734:5): [True: 377, False: 0]
  ------------------
 1735|    377|    case '\t':
  ------------------
  |  Branch (1735:5): [True: 0, False: 377]
  ------------------
 1736|    377|    case '\r':
  ------------------
  |  Branch (1736:5): [True: 0, False: 377]
  ------------------
 1737|    377|    case '\n':
  ------------------
  |  Branch (1737:5): [True: 0, False: 377]
  ------------------
 1738|    377|    case ' ':
  ------------------
  |  Branch (1738:5): [True: 0, False: 377]
  ------------------
 1739|    377|    case ';':
  ------------------
  |  Branch (1739:5): [True: 0, False: 377]
  ------------------
 1740|    377|      return TRUE;
  ------------------
  |  |  986|    377|#define TRUE true
  ------------------
 1741|    377|    }
 1742|    694|  return FALSE;
  ------------------
  |  |  989|    694|#define FALSE false
  ------------------
 1743|  1.07k|}
mime.c:add_content_disposition:
 1750|  4.06k|{
 1751|  4.06k|  if(!disposition &&
  ------------------
  |  Branch (1751:6): [True: 2.07k, False: 1.99k]
  ------------------
 1752|  2.07k|     (part->filename || part->name ||
  ------------------
  |  Branch (1752:7): [True: 222, False: 1.85k]
  |  Branch (1752:25): [True: 160, False: 1.69k]
  ------------------
 1753|  1.69k|      (contenttype && !curl_strnequal(contenttype, "multipart/", 10))))
  ------------------
  |  Branch (1753:8): [True: 467, False: 1.22k]
  |  Branch (1753:23): [True: 90, False: 377]
  ------------------
 1754|    472|    disposition = DISPOSITION_DEFAULT;
  ------------------
  |  |   40|    472|#define DISPOSITION_DEFAULT             "attachment"
  ------------------
 1755|       |
 1756|  4.06k|  if(disposition && curl_strequal(disposition, "attachment") &&
  ------------------
  |  Branch (1756:6): [True: 2.46k, False: 1.60k]
  |  Branch (1756:21): [True: 472, False: 1.99k]
  ------------------
 1757|    472|     !part->name && !part->filename)
  ------------------
  |  Branch (1757:6): [True: 291, False: 181]
  |  Branch (1757:21): [True: 90, False: 201]
  ------------------
 1758|     90|    disposition = NULL;
 1759|       |
 1760|  4.06k|  if(disposition) {
  ------------------
  |  Branch (1760:6): [True: 2.37k, False: 1.69k]
  ------------------
 1761|  2.37k|    CURLcode result = CURLE_OK;
 1762|  2.37k|    char *name = NULL;
 1763|  2.37k|    char *filename = NULL;
 1764|       |    /* The mail (and legacy mime_formescape) strategy quotes the name and
 1765|       |       filename with a backslash and has no in-band way to represent a CR or
 1766|       |       LF, so one embedded in the value would split the generated header. The
 1767|       |       form strategy percent-encodes CR/LF (see escape_string) and is safe. */
 1768|  2.37k|    bool backslash = (strategy == MIMESTRATEGY_MAIL) ||
  ------------------
  |  Branch (1768:22): [True: 0, False: 2.37k]
  ------------------
 1769|  2.37k|                     (data && data->set.mime_formescape);
  ------------------
  |  Branch (1769:23): [True: 2.37k, False: 0]
  |  Branch (1769:31): [True: 0, False: 2.37k]
  ------------------
 1770|  2.37k|    if(backslash &&
  ------------------
  |  Branch (1770:8): [True: 0, False: 2.37k]
  ------------------
 1771|      0|       ((part->name && part->name[strcspn(part->name, "\r\n")]) ||
  ------------------
  |  Branch (1771:10): [True: 0, False: 0]
  |  Branch (1771:24): [True: 0, False: 0]
  ------------------
 1772|      0|        (part->filename && part->filename[strcspn(part->filename, "\r\n")])))
  ------------------
  |  Branch (1772:10): [True: 0, False: 0]
  |  Branch (1772:28): [True: 0, False: 0]
  ------------------
 1773|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1774|       |
 1775|  2.37k|    if(part->name) {
  ------------------
  |  Branch (1775:8): [True: 376, False: 1.99k]
  ------------------
 1776|    376|      name = escape_string(data, part->name, strategy);
 1777|    376|      if(!name)
  ------------------
  |  Branch (1777:10): [True: 0, False: 376]
  ------------------
 1778|      0|        return CURLE_OUT_OF_MEMORY;
 1779|    376|    }
 1780|  2.37k|    if(part->filename) {
  ------------------
  |  Branch (1780:8): [True: 411, False: 1.96k]
  ------------------
 1781|    411|      filename = escape_string(data, part->filename, strategy);
 1782|    411|      if(!filename)
  ------------------
  |  Branch (1782:10): [True: 1, False: 410]
  ------------------
 1783|      1|        result = CURLE_OUT_OF_MEMORY;
 1784|    411|    }
 1785|  2.37k|    if(!result)
  ------------------
  |  Branch (1785:8): [True: 2.37k, False: 1]
  ------------------
 1786|  2.37k|      result = Curl_mime_add_header(&part->curlheaders,
 1787|  2.37k|                                    "Content-Disposition: %s%s%s%s%s%s%s",
 1788|  2.37k|                                    disposition,
 1789|  2.37k|                                    name ? "; name=\"" : "",
  ------------------
  |  Branch (1789:37): [True: 376, False: 1.99k]
  ------------------
 1790|  2.37k|                                    name ? name : "",
  ------------------
  |  Branch (1790:37): [True: 376, False: 1.99k]
  ------------------
 1791|  2.37k|                                    name ? "\"" : "",
  ------------------
  |  Branch (1791:37): [True: 376, False: 1.99k]
  ------------------
 1792|  2.37k|                                    filename ? "; filename=\"" : "",
  ------------------
  |  Branch (1792:37): [True: 410, False: 1.96k]
  ------------------
 1793|  2.37k|                                    filename ? filename : "",
  ------------------
  |  Branch (1793:37): [True: 410, False: 1.96k]
  ------------------
 1794|  2.37k|                                    filename ? "\"" : "");
  ------------------
  |  Branch (1794:37): [True: 410, False: 1.96k]
  ------------------
 1795|  2.37k|    curlx_safefree(name);
  ------------------
  |  | 1359|  2.37k|  do {                      \
  |  | 1360|  2.37k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  2.37k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  2.37k|    (ptr) = NULL;           \
  |  | 1362|  2.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 2.37k]
  |  |  ------------------
  ------------------
 1796|  2.37k|    curlx_safefree(filename);
  ------------------
  |  | 1359|  2.37k|  do {                      \
  |  | 1360|  2.37k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  2.37k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  2.37k|    (ptr) = NULL;           \
  |  | 1362|  2.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 2.37k]
  |  |  ------------------
  ------------------
 1797|  2.37k|    if(result)
  ------------------
  |  Branch (1797:8): [True: 1, False: 2.37k]
  ------------------
 1798|      1|      return result;
 1799|  2.37k|  }
 1800|  4.06k|  return CURLE_OK;
 1801|  4.06k|}
mime.c:escape_string:
  198|    787|{
  199|    787|  CURLcode result;
  200|    787|  struct dynbuf db;
  201|    787|  const char * const *table;
  202|    787|  const char * const *p;
  203|       |  /* replace first character by rest of string. */
  204|    787|  static const char * const mimetable[] = {
  205|    787|    "\\\\\\",
  206|    787|    "\"\\\"",
  207|    787|    NULL
  208|    787|  };
  209|       |  /* WHATWG HTML living standard 4.10.21.8 2 specifies:
  210|       |     For field names and filenames for file fields, the result of the
  211|       |     encoding in the previous bullet point must be escaped by replacing
  212|       |     any 0x0A (LF) bytes with the byte sequence `%0A`, 0x0D (CR) with `%0D`
  213|       |     and 0x22 (") with `%22`.
  214|       |     The user agent must not perform any other escapes. */
  215|    787|  static const char * const formtable[] = {
  216|    787|    "\"%22",
  217|    787|    "\r%0D",
  218|    787|    "\n%0A",
  219|    787|    NULL
  220|    787|  };
  221|       |
  222|    787|  table = formtable;
  223|       |  /* data can be NULL when this function is called indirectly from
  224|       |     curl_formget(). */
  225|    787|  if(strategy == MIMESTRATEGY_MAIL || (data && data->set.mime_formescape))
  ------------------
  |  Branch (225:6): [True: 0, False: 787]
  |  Branch (225:40): [True: 787, False: 0]
  |  Branch (225:48): [True: 0, False: 787]
  ------------------
  226|      0|    table = mimetable;
  227|       |
  228|    787|  curlx_dyn_init(&db, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|    787|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  229|       |
  230|  55.9k|  for(result = curlx_dyn_addn(&db, STRCONST("")); !result && *src; src++) {
  ------------------
  |  | 1324|    787|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|    787|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (230:51): [True: 55.9k, False: 1]
  |  Branch (230:62): [True: 55.2k, False: 786]
  ------------------
  231|   219k|    for(p = table; *p && **p != *src; p++)
  ------------------
  |  Branch (231:20): [True: 165k, False: 54.5k]
  |  Branch (231:26): [True: 164k, False: 620]
  ------------------
  232|   164k|      ;
  233|       |
  234|  55.2k|    if(*p)
  ------------------
  |  Branch (234:8): [True: 620, False: 54.5k]
  ------------------
  235|    620|      result = curlx_dyn_add(&db, *p + 1);
  236|  54.5k|    else
  237|  54.5k|      result = curlx_dyn_addn(&db, src, 1);
  238|  55.2k|  }
  239|       |
  240|    787|  return curlx_dyn_ptr(&db);
  241|    787|}
mime.c:add_content_type:
 1685|  1.31k|{
 1686|  1.31k|  return Curl_mime_add_header(slp, "Content-Type: %s%s%s", type,
 1687|  1.31k|                              boundary ? "; boundary=" : "",
  ------------------
  |  Branch (1687:31): [True: 1.07k, False: 245]
  ------------------
 1688|  1.31k|                              boundary ? boundary : "");
  ------------------
  |  Branch (1688:31): [True: 1.07k, False: 245]
  ------------------
 1689|  1.31k|}
mime.c:cr_mime_init:
 1958|    376|{
 1959|    376|  struct cr_mime_ctx *ctx = reader->ctx;
 1960|    376|  (void)data;
 1961|    376|  ctx->total_len = -1;
 1962|    376|  ctx->read_len = 0;
 1963|    376|  Curl_bufq_init2(&ctx->tmpbuf, 1024, 1, BUFQ_OPT_NO_SPARES);
  ------------------
  |  |  115|    376|#define BUFQ_OPT_NO_SPARES   (1 << 1)
  ------------------
 1964|    376|  return CURLE_OK;
 1965|    376|}
mime.c:cr_mime_read:
 1980|  1.10k|{
 1981|  1.10k|  struct cr_mime_ctx *ctx = reader->ctx;
 1982|  1.10k|  CURLcode result = CURLE_OK;
 1983|  1.10k|  size_t nread;
 1984|  1.10k|  char tmp[256];
 1985|       |
 1986|       |  /* Once we have errored, we will return the same error forever */
 1987|  1.10k|  if(ctx->errored) {
  ------------------
  |  Branch (1987:6): [True: 510, False: 599]
  ------------------
 1988|    510|    CURL_TRC_READ(data, "cr_mime_read(len=%zu) is errored -> %d, eos=0",
  ------------------
  |  |  163|    510|  do {                                                    \
  |  |  164|    510|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|    510|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.02k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 510, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 510, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.02k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 510, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    510|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|    510|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    510|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 510]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    510|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    510|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 510]
  |  |  ------------------
  ------------------
 1989|    510|                  blen, (int)ctx->error_result);
 1990|    510|    *pnread = 0;
 1991|    510|    *peos = FALSE;
  ------------------
  |  |  989|    510|#define FALSE false
  ------------------
 1992|    510|    return ctx->error_result;
 1993|    510|  }
 1994|    599|  if(ctx->seen_eos) {
  ------------------
  |  Branch (1994:6): [True: 0, False: 599]
  ------------------
 1995|      0|    CURL_TRC_READ(data, "cr_mime_read(len=%zu) seen eos -> 0, eos=1", blen);
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1996|      0|    *pnread = 0;
 1997|      0|    *peos = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1998|      0|    return CURLE_OK;
 1999|      0|  }
 2000|       |  /* respect length limitations */
 2001|    599|  if(ctx->total_len >= 0) {
  ------------------
  |  Branch (2001:6): [True: 527, False: 72]
  ------------------
 2002|    527|    curl_off_t remain = ctx->total_len - ctx->read_len;
 2003|    527|    if(remain <= 0)
  ------------------
  |  Branch (2003:8): [True: 0, False: 527]
  ------------------
 2004|      0|      blen = 0;
 2005|    527|    else if(remain < (curl_off_t)blen)
  ------------------
  |  Branch (2005:13): [True: 363, False: 164]
  ------------------
 2006|    363|      blen = (size_t)remain;
 2007|    527|  }
 2008|       |
 2009|    599|  if(!Curl_bufq_is_empty(&ctx->tmpbuf)) {
  ------------------
  |  Branch (2009:6): [True: 5, False: 594]
  ------------------
 2010|      5|    result = Curl_bufq_read(&ctx->tmpbuf, (unsigned char *)buf, blen, &nread);
 2011|      5|    if(result) {
  ------------------
  |  Branch (2011:8): [True: 0, False: 5]
  ------------------
 2012|      0|      ctx->errored = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2013|      0|      ctx->error_result = result;
 2014|      0|      return result;
 2015|      0|    }
 2016|      5|  }
 2017|    594|  else if(blen <= 4) {
  ------------------
  |  Branch (2017:11): [True: 6, False: 588]
  ------------------
 2018|       |    /* Curl_mime_read() may go into an infinite loop when reading
 2019|       |     * via a base64 encoder, as it stalls when the read buffer is too small
 2020|       |     * to contain a complete 3-byte encoding. Read into a larger buffer
 2021|       |     * and use that until empty. */
 2022|      6|    CURL_TRC_READ(data, "cr_mime_read(len=%zu), small read, using tmp", blen);
  ------------------
  |  |  163|      6|  do {                                                    \
  |  |  164|      6|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|      6|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     12|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 6, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 5, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     12|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 5, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      5|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      6|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      5|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      6|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      6|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 6]
  |  |  ------------------
  ------------------
 2023|      6|    nread = Curl_mime_read(tmp, 1, sizeof(tmp), ctx->part);
 2024|      6|    if(nread <= sizeof(tmp)) {
  ------------------
  |  Branch (2024:8): [True: 6, False: 0]
  ------------------
 2025|      6|      size_t n;
 2026|      6|      result = Curl_bufq_write(&ctx->tmpbuf, (unsigned char *)tmp, nread, &n);
 2027|      6|      if(result) {
  ------------------
  |  Branch (2027:10): [True: 0, False: 6]
  ------------------
 2028|      0|        ctx->errored = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2029|      0|        ctx->error_result = result;
 2030|      0|        return result;
 2031|      0|      }
 2032|       |      /* stored it, read again */
 2033|      6|      result = Curl_bufq_cread(&ctx->tmpbuf, buf, blen, &nread);
 2034|      6|      if(result) {
  ------------------
  |  Branch (2034:10): [True: 1, False: 5]
  ------------------
 2035|      1|        ctx->errored = TRUE;
  ------------------
  |  |  986|      1|#define TRUE true
  ------------------
 2036|      1|        ctx->error_result = result;
 2037|      1|        return result;
 2038|      1|      }
 2039|      6|    }
 2040|      6|  }
 2041|    588|  else
 2042|    588|    nread = Curl_mime_read(buf, 1, blen, ctx->part);
 2043|       |
 2044|    598|  CURL_TRC_READ(data, "cr_mime_read(len=%zu), mime_read() -> %zu",
  ------------------
  |  |  163|    598|  do {                                                    \
  |  |  164|    598|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|    598|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.19k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 598, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 53, False: 545]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.19k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 53, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     53|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|    598|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     53|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 53]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    598|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    598|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 598]
  |  |  ------------------
  ------------------
 2045|    598|                blen, nread);
 2046|       |
 2047|    598|  switch(nread) {
 2048|     29|  case 0:
  ------------------
  |  Branch (2048:3): [True: 29, False: 569]
  ------------------
 2049|     29|    if((ctx->total_len >= 0) && (ctx->read_len < ctx->total_len)) {
  ------------------
  |  Branch (2049:8): [True: 8, False: 21]
  |  Branch (2049:33): [True: 8, False: 0]
  ------------------
 2050|      8|      failf(data, "client mime read EOF fail, "
  ------------------
  |  |   62|      8|#define failf Curl_failf
  ------------------
 2051|      8|            "only %" FMT_OFF_T "/%" FMT_OFF_T
 2052|      8|            " of needed bytes read", ctx->read_len, ctx->total_len);
 2053|      8|      return CURLE_READ_ERROR;
 2054|      8|    }
 2055|     21|    *pnread = 0;
 2056|     21|    *peos = TRUE;
  ------------------
  |  |  986|     21|#define TRUE true
  ------------------
 2057|     21|    ctx->seen_eos = TRUE;
  ------------------
  |  |  986|     21|#define TRUE true
  ------------------
 2058|     21|    break;
 2059|       |
 2060|      0|  case CURL_READFUNC_ABORT:
  ------------------
  |  |  392|      0|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (2060:3): [True: 0, False: 598]
  ------------------
 2061|      0|    failf(data, "operation aborted by callback");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2062|      0|    *pnread = 0;
 2063|      0|    *peos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2064|      0|    ctx->errored = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2065|      0|    ctx->error_result = CURLE_ABORTED_BY_CALLBACK;
 2066|      0|    result = CURLE_ABORTED_BY_CALLBACK;
 2067|      0|    break;
 2068|       |
 2069|      0|  case CURL_READFUNC_PAUSE:
  ------------------
  |  |  395|      0|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (2069:3): [True: 0, False: 598]
  ------------------
 2070|       |    /* CURL_READFUNC_PAUSE pauses read callbacks that feed socket writes */
 2071|      0|    CURL_TRC_READ(data, "cr_mime_read(len=%zu), paused by callback", blen);
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2072|      0|    *pnread = 0;
 2073|      0|    *peos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2074|      0|    result = Curl_xfer_pause_send(data, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2075|      0|    break; /* nothing was read */
 2076|       |
 2077|      0|  case STOP_FILLING:
  ------------------
  |  |   50|      0|#define STOP_FILLING ((size_t)-2)
  ------------------
  |  Branch (2077:3): [True: 0, False: 598]
  ------------------
 2078|      0|  case READ_ERROR:
  ------------------
  |  |   49|      0|#define READ_ERROR   ((size_t)-1)
  ------------------
  |  Branch (2078:3): [True: 0, False: 598]
  ------------------
 2079|      0|    failf(data, "read error getting mime data");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2080|      0|    *pnread = 0;
 2081|      0|    *peos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2082|      0|    ctx->errored = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2083|      0|    ctx->error_result = CURLE_READ_ERROR;
 2084|      0|    result = CURLE_READ_ERROR;
 2085|      0|    break;
 2086|       |
 2087|    569|  default:
  ------------------
  |  Branch (2087:3): [True: 569, False: 29]
  ------------------
 2088|    569|    if(nread > blen) {
  ------------------
  |  Branch (2088:8): [True: 0, False: 569]
  ------------------
 2089|       |      /* the read function returned a too large value */
 2090|      0|      failf(data, "read function returned funny value");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2091|      0|      *pnread = 0;
 2092|      0|      *peos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2093|      0|      ctx->errored = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2094|      0|      ctx->error_result = CURLE_READ_ERROR;
 2095|      0|      return CURLE_READ_ERROR;
 2096|      0|    }
 2097|    569|    ctx->read_len += nread;
 2098|    569|    if(ctx->total_len >= 0)
  ------------------
  |  Branch (2098:8): [True: 518, False: 51]
  ------------------
 2099|    518|      ctx->seen_eos = (ctx->read_len >= ctx->total_len);
 2100|    569|    *pnread = nread;
 2101|    569|    *peos = (bool)ctx->seen_eos;
 2102|    569|    break;
 2103|    598|  }
 2104|       |
 2105|    590|  CURL_TRC_READ(data, "cr_mime_read(len=%zu, total=%" FMT_OFF_T
  ------------------
  |  |  163|    590|  do {                                                    \
  |  |  164|    590|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|    590|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.18k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 590, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 52, False: 538]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.18k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 52, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     52|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|    590|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     52|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 52]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|    590|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|    590|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 590]
  |  |  ------------------
  ------------------
 2106|    590|                ", read=%" FMT_OFF_T ") -> %d, %zu, %d", blen,
 2107|    590|                ctx->total_len, ctx->read_len, (int)result, *pnread, *peos);
 2108|    590|  return result;
 2109|    598|}
mime.c:cr_mime_close:
 1969|    376|{
 1970|    376|  struct cr_mime_ctx *ctx = reader->ctx;
 1971|    376|  (void)data;
 1972|    376|  Curl_bufq_free(&ctx->tmpbuf);
 1973|    376|}
mime.c:cr_mime_total_length:
 2121|  1.88k|{
 2122|  1.88k|  struct cr_mime_ctx *ctx = reader->ctx;
 2123|  1.88k|  (void)data;
 2124|  1.88k|  return ctx->total_len;
 2125|  1.88k|}
mime.c:mime_rewind:
 1594|    376|{
 1595|    376|  return mime_part_rewind(part) == CURL_SEEKFUNC_OK ?
  ------------------
  |  |  382|    376|#define CURL_SEEKFUNC_OK       0
  ------------------
  |  Branch (1595:10): [True: 376, False: 0]
  ------------------
 1596|    376|         CURLE_OK : CURLE_SEND_FAIL_REWIND;
 1597|    376|}
mime.c:mime_size:
 1639|  4.06k|{
 1640|  4.06k|  curl_off_t size;
 1641|       |
 1642|  4.06k|  if(part->kind == MIMEKIND_MULTIPART)
  ------------------
  |  Branch (1642:6): [True: 1.07k, False: 2.99k]
  ------------------
 1643|  1.07k|    part->datasize = multipart_size(part->arg);
 1644|       |
 1645|  4.06k|  size = part->datasize;
 1646|       |
 1647|  4.06k|  if(part->encoder)
  ------------------
  |  Branch (1647:6): [True: 588, False: 3.47k]
  ------------------
 1648|    588|    size = part->encoder->sizefunc(part);
 1649|       |
 1650|  4.06k|  if(size >= 0 && !(part->flags & MIME_BODY_ONLY)) {
  ------------------
  |  |   35|  3.99k|#define MIME_BODY_ONLY          (1 << 1)
  ------------------
  |  Branch (1650:6): [True: 3.99k, False: 65]
  |  Branch (1650:19): [True: 3.64k, False: 354]
  ------------------
 1651|       |    /* Compute total part size. */
 1652|  3.64k|    size += slist_size(part->curlheaders, 2, NULL, 0);
 1653|  3.64k|    size += slist_size(part->userheaders, 2, STRCONST("Content-Type"));
  ------------------
  |  | 1324|  3.64k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  3.64k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
 1654|  3.64k|    size += 2;    /* CRLF after headers. */
 1655|  3.64k|  }
 1656|  4.06k|  return size;
 1657|  4.06k|}
mime.c:multipart_size:
 1613|  1.07k|{
 1614|  1.07k|  curl_off_t size;
 1615|  1.07k|  curl_off_t boundarysize;
 1616|  1.07k|  curl_mimepart *part;
 1617|       |
 1618|  1.07k|  if(!mime)
  ------------------
  |  Branch (1618:6): [True: 0, False: 1.07k]
  ------------------
 1619|      0|    return 0;           /* Not present -> empty. */
 1620|       |
 1621|  1.07k|  boundarysize = 4 + MIME_BOUNDARY_LEN + 2;
  ------------------
  |  |   97|  1.07k|#define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   28|  1.07k|#define MIME_BOUNDARY_DASHES            24  /* leading boundary dashes */
  |  |  ------------------
  |  |               #define MIME_BOUNDARY_LEN (MIME_BOUNDARY_DASHES + MIME_RAND_BOUNDARY_CHARS)
  |  |  ------------------
  |  |  |  |   29|  1.07k|#define MIME_RAND_BOUNDARY_CHARS        22  /* Nb. of random boundary chars. */
  |  |  ------------------
  ------------------
 1622|  1.07k|  size = boundarysize;  /* Final boundary - CRLF after headers. */
 1623|       |
 1624|  4.75k|  for(part = mime->firstpart; part; part = part->nextpart) {
  ------------------
  |  Branch (1624:31): [True: 3.68k, False: 1.07k]
  ------------------
 1625|  3.68k|    curl_off_t sz = mime_size(part);
 1626|       |
 1627|  3.68k|    if(sz < 0)
  ------------------
  |  Branch (1627:8): [True: 43, False: 3.64k]
  ------------------
 1628|     43|      size = sz;
 1629|       |
 1630|  3.68k|    if(size >= 0)
  ------------------
  |  Branch (1630:8): [True: 3.54k, False: 136]
  ------------------
 1631|  3.54k|      size += boundarysize + sz;
 1632|  3.68k|  }
 1633|       |
 1634|  1.07k|  return size;
 1635|  1.07k|}
mime.c:slist_size:
 1602|  7.28k|{
 1603|  7.28k|  size_t size = 0;
 1604|       |
 1605|  14.1k|  for(; s; s = s->next)
  ------------------
  |  Branch (1605:9): [True: 6.83k, False: 7.28k]
  ------------------
 1606|  6.83k|    if(!skip || !match_header(s, skip, skiplen))
  ------------------
  |  Branch (1606:8): [True: 3.79k, False: 3.03k]
  |  Branch (1606:17): [True: 3.03k, False: 0]
  ------------------
 1607|  6.83k|      size += strlen(s->data) + overhead;
 1608|  7.28k|  return size;
 1609|  7.28k|}

curl_mvsnprintf:
 1251|  1.89M|{
 1252|  1.89M|  int retcode;
 1253|  1.89M|  struct nsprintf info;
 1254|       |
 1255|  1.89M|  info.buffer = buffer;
 1256|  1.89M|  info.length = 0;
 1257|  1.89M|  info.max = maxlength;
 1258|       |
 1259|  1.89M|  retcode = formatf(&info, addbyter, addrun, NULL, format, args);
 1260|  1.89M|  if(info.max) {
  ------------------
  |  Branch (1260:6): [True: 1.89M, False: 0]
  ------------------
 1261|       |    /* we null-terminate this */
 1262|  1.89M|    if(info.max == info.length) {
  ------------------
  |  Branch (1262:8): [True: 42, False: 1.89M]
  ------------------
 1263|       |      /* we are at maximum, scrap the last letter */
 1264|     42|      info.buffer[-1] = 0;
 1265|     42|      DEBUGASSERT(retcode);
  ------------------
  |  | 1016|     42|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1265:7): [True: 0, False: 42]
  |  Branch (1265:7): [True: 42, False: 0]
  ------------------
 1266|     42|      retcode--; /* do not count the NUL byte */
 1267|     42|    }
 1268|  1.89M|    else
 1269|  1.89M|      info.buffer[0] = 0;
 1270|  1.89M|  }
 1271|  1.89M|  return retcode;
 1272|  1.89M|}
curl_msnprintf:
 1275|  1.39M|{
 1276|  1.39M|  int retcode;
 1277|  1.39M|  va_list args; /* argument pointer */
 1278|  1.39M|  va_start(args, format);
 1279|  1.39M|  retcode = curl_mvsnprintf(buffer, maxlength, format, args);
 1280|       |  va_end(args);
 1281|  1.39M|  return retcode;
 1282|  1.39M|}
curlx_dyn_vprintf:
 1380|   142k|{
 1381|   142k|  struct asprintf info;
 1382|   142k|  info.b = dyn;
 1383|   142k|  info.merr = MERR_OK;
  ------------------
  |  |   27|   142k|#define MERR_OK        0
  ------------------
 1384|   142k|  info.nstage = 0;
 1385|       |
 1386|   142k|  (void)formatf(&info, alloc_addbyter, alloc_addrun, alloc_flush,
 1387|   142k|                format, args);
 1388|   142k|  if(!info.merr)
  ------------------
  |  Branch (1388:6): [True: 142k, False: 0]
  ------------------
 1389|   142k|    (void)alloc_flush(&info);
 1390|   142k|  if(info.merr) {
  ------------------
  |  Branch (1390:6): [True: 14, False: 142k]
  ------------------
 1391|     14|    curlx_dyn_free(info.b);
 1392|     14|    return info.merr;
 1393|     14|  }
 1394|   142k|  return 0;
 1395|   142k|}
curl_mvaprintf:
 1398|  48.9k|{
 1399|  48.9k|  struct asprintf info;
 1400|  48.9k|  struct dynbuf dyn;
 1401|  48.9k|  info.b = &dyn;
 1402|  48.9k|  curlx_dyn_init(info.b, DYN_APRINTF);
  ------------------
  |  |   70|  48.9k|#define DYN_APRINTF         8000000
  ------------------
 1403|  48.9k|  info.merr = MERR_OK;
  ------------------
  |  |   27|  48.9k|#define MERR_OK        0
  ------------------
 1404|  48.9k|  info.nstage = 0;
 1405|       |
 1406|  48.9k|  (void)formatf(&info, alloc_addbyter, alloc_addrun, alloc_flush,
 1407|  48.9k|                format, args);
 1408|  48.9k|  if(!info.merr)
  ------------------
  |  Branch (1408:6): [True: 48.9k, False: 1]
  ------------------
 1409|  48.9k|    (void)alloc_flush(&info);
 1410|  48.9k|  if(info.merr) {
  ------------------
  |  Branch (1410:6): [True: 32, False: 48.9k]
  ------------------
 1411|     32|    curlx_dyn_free(info.b);
 1412|     32|    return NULL;
 1413|     32|  }
 1414|  48.9k|  if(curlx_dyn_len(info.b))
  ------------------
  |  Branch (1414:6): [True: 48.9k, False: 0]
  ------------------
 1415|  48.9k|    return curlx_dyn_ptr(info.b);
 1416|      0|  return curlx_strdup("");
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1417|  48.9k|}
curl_maprintf:
 1420|  44.7k|{
 1421|  44.7k|  va_list args;
 1422|  44.7k|  char *s;
 1423|  44.7k|  va_start(args, format);
 1424|  44.7k|  s = curl_mvaprintf(format, args);
 1425|       |  va_end(args);
 1426|  44.7k|  return s;
 1427|  44.7k|}
curl_mvfprintf:
 1479|  1.23k|{
 1480|  1.23k|  struct ioprintf info;
 1481|  1.23k|  int n;
 1482|  1.23k|  info.fd = fd;
 1483|  1.23k|  info.error = FALSE;
  ------------------
  |  |  989|  1.23k|#define FALSE false
  ------------------
 1484|  1.23k|  n = formatf(&info, fputc_wrapper, fwrite_wrapper, NULL, format, args);
 1485|  1.23k|  if(info.error)
  ------------------
  |  Branch (1485:6): [True: 0, False: 1.23k]
  ------------------
 1486|      0|    return -1;
 1487|  1.23k|  return n;
 1488|  1.23k|}
curl_mfprintf:
 1491|  1.23k|{
 1492|  1.23k|  va_list args; /* argument pointer */
 1493|  1.23k|  int n;
 1494|  1.23k|  va_start(args, format);
 1495|  1.23k|  n = curl_mvfprintf(fd, format, args);
 1496|       |  va_end(args);
 1497|  1.23k|  return n;
 1498|  1.23k|}
mprintf.c:formatf:
 1101|  2.08M|{
 1102|  2.08M|  int done = 0;   /* number of characters written */
 1103|  2.08M|  int i;
 1104|  2.08M|  int ocount = 0; /* number of output segments */
 1105|  2.08M|  int icount = 0; /* number of input arguments */
 1106|       |
 1107|  2.08M|  struct outsegment output[MAX_SEGMENTS];
 1108|  2.08M|  struct va_input input[MAX_PARAMETERS];
 1109|  2.08M|  char work[BUFFSIZE + 2];
 1110|       |
 1111|       |  /* Parse the format string */
 1112|  2.08M|  if(parsefmt(format, output, input, &ocount, &icount, ap_save))
  ------------------
  |  Branch (1112:6): [True: 0, False: 2.08M]
  ------------------
 1113|      0|    return 0;
 1114|       |
 1115|  7.60M|  for(i = 0; i < ocount; i++) {
  ------------------
  |  Branch (1115:14): [True: 5.51M, False: 2.08M]
  ------------------
 1116|  5.51M|    struct outsegment *optr = &output[i];
 1117|  5.51M|    struct va_input *iptr = &input[optr->input];
 1118|  5.51M|    struct mproperty p;
 1119|  5.51M|    size_t outlen = optr->outlen;
 1120|       |
 1121|  5.51M|    if(outlen) {
  ------------------
  |  Branch (1121:8): [True: 4.60M, False: 910k]
  ------------------
 1122|  4.60M|      if(stream_zrun(userp, stream, streamn, optr->start, outlen, &done))
  ------------------
  |  Branch (1122:10): [True: 2, False: 4.60M]
  ------------------
 1123|      2|        return done;
 1124|  4.60M|      if(optr->flags & FLAGS_SUBSTR)
  ------------------
  |  Branch (1124:10): [True: 1.41M, False: 3.18M]
  ------------------
 1125|       |        /* this is a substring */
 1126|  1.41M|        continue;
 1127|  4.60M|    }
 1128|       |
 1129|  4.09M|    p.flags = optr->flags;
 1130|       |
 1131|       |    /* pick up the specified width */
 1132|  4.09M|    if(p.flags & FLAGS_WIDTHPARAM) {
  ------------------
  |  Branch (1132:8): [True: 0, False: 4.09M]
  ------------------
 1133|      0|      p.width = (int)input[optr->width].val.nums;
 1134|      0|      if(p.width < 0) {
  ------------------
  |  Branch (1134:10): [True: 0, False: 0]
  ------------------
 1135|       |        /* "A negative field width is taken as a '-' flag followed by a
 1136|       |           positive field width." */
 1137|      0|        if(p.width == INT_MIN)
  ------------------
  |  Branch (1137:12): [True: 0, False: 0]
  ------------------
 1138|      0|          p.width = INT_MAX;
 1139|      0|        else
 1140|      0|          p.width = -p.width;
 1141|      0|        p.flags |= FLAGS_LEFT;
 1142|      0|        p.flags &= ~(unsigned int)FLAGS_PAD_NIL;
 1143|      0|      }
 1144|      0|    }
 1145|  4.09M|    else
 1146|  4.09M|      p.width = optr->width;
 1147|       |
 1148|       |    /* pick up the specified precision */
 1149|  4.09M|    if(p.flags & FLAGS_PRECPARAM) {
  ------------------
  |  Branch (1149:8): [True: 20.9k, False: 4.07M]
  ------------------
 1150|  20.9k|      p.prec = (int)input[optr->precision].val.nums;
 1151|  20.9k|      if(p.prec < 0)
  ------------------
  |  Branch (1151:10): [True: 0, False: 20.9k]
  ------------------
 1152|       |        /* "A negative precision is taken as if the precision were
 1153|       |           omitted." */
 1154|      0|        p.prec = -1;
 1155|  20.9k|    }
 1156|  4.07M|    else if(p.flags & FLAGS_PREC)
  ------------------
  |  Branch (1156:13): [True: 0, False: 4.07M]
  ------------------
 1157|      0|      p.prec = optr->precision;
 1158|  4.07M|    else
 1159|  4.07M|      p.prec = -1;
 1160|       |
 1161|  4.09M|    switch(iptr->type) {
 1162|   235k|    case MTYPE_INTU:
  ------------------
  |  Branch (1162:5): [True: 235k, False: 3.86M]
  ------------------
 1163|   845k|    case MTYPE_LONGU:
  ------------------
  |  Branch (1163:5): [True: 610k, False: 3.48M]
  ------------------
 1164|   845k|    case MTYPE_LONGLONGU:
  ------------------
  |  Branch (1164:5): [True: 0, False: 4.09M]
  ------------------
 1165|   845k|      p.flags |= FLAGS_UNSIGNED;
 1166|   845k|      if(out_number(userp, stream, streamn, &p, iptr->val.numu, 0, work,
  ------------------
  |  Branch (1166:10): [True: 0, False: 845k]
  ------------------
 1167|   845k|                    &done))
 1168|      0|        return done;
 1169|   845k|      break;
 1170|       |
 1171|   845k|    case MTYPE_INT:
  ------------------
  |  Branch (1171:5): [True: 520k, False: 3.57M]
  ------------------
 1172|  1.54M|    case MTYPE_LONG:
  ------------------
  |  Branch (1172:5): [True: 1.02M, False: 3.07M]
  ------------------
 1173|  1.54M|    case MTYPE_LONGLONG:
  ------------------
  |  Branch (1173:5): [True: 0, False: 4.09M]
  ------------------
 1174|  1.54M|      if(out_number(userp, stream, streamn, &p, iptr->val.numu,
  ------------------
  |  Branch (1174:10): [True: 0, False: 1.54M]
  ------------------
 1175|  1.54M|                    iptr->val.nums, work, &done))
 1176|      0|        return done;
 1177|  1.54M|      break;
 1178|       |
 1179|  1.70M|    case MTYPE_STRING:
  ------------------
  |  Branch (1179:5): [True: 1.70M, False: 2.38M]
  ------------------
 1180|  1.70M|      if(out_string(userp, stream, streamn, &p, iptr->val.str, &done))
  ------------------
  |  Branch (1180:10): [True: 41, False: 1.70M]
  ------------------
 1181|     41|        return done;
 1182|  1.70M|      break;
 1183|       |
 1184|  1.70M|    case MTYPE_PTR:
  ------------------
  |  Branch (1184:5): [True: 0, False: 4.09M]
  ------------------
 1185|      0|      if(out_pointer(userp, stream, streamn, &p, iptr->val.ptr, work,
  ------------------
  |  Branch (1185:10): [True: 0, False: 0]
  ------------------
 1186|      0|                     &done))
 1187|      0|        return done;
 1188|      0|      break;
 1189|       |
 1190|      0|    case MTYPE_DOUBLE:
  ------------------
  |  Branch (1190:5): [True: 0, False: 4.09M]
  ------------------
 1191|      0|    case MTYPE_LONGDOUBLE:
  ------------------
  |  Branch (1191:5): [True: 0, False: 4.09M]
  ------------------
 1192|      0|      if(out_double(userp, stream, streamn, &p, iptr->val.dnum, work,
  ------------------
  |  Branch (1192:10): [True: 0, False: 0]
  ------------------
 1193|      0|                    &done))
 1194|      0|        return done;
 1195|      0|      break;
 1196|       |
 1197|      0|    case MTYPE_INTPTR:
  ------------------
  |  Branch (1197:5): [True: 0, False: 4.09M]
  ------------------
 1198|       |      /* %n is observable by the caller, so commit what is pending first and
 1199|       |         perform it only if that succeeded, as a sink that never holds output
 1200|       |         would. */
 1201|      0|      if(flush && flush(userp))
  ------------------
  |  Branch (1201:10): [True: 0, False: 0]
  |  Branch (1201:19): [True: 0, False: 0]
  ------------------
 1202|      0|        return done;
 1203|       |      /* Answer the count of characters written. */
 1204|      0|      if(p.flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (1204:10): [True: 0, False: 0]
  ------------------
 1205|      0|        *(int64_t *)iptr->val.ptr = (int64_t)done;
 1206|      0|      else if(p.flags & FLAGS_LONG)
  ------------------
  |  Branch (1206:15): [True: 0, False: 0]
  ------------------
 1207|      0|        *(long *)iptr->val.ptr = (long)done;
 1208|      0|      else if(!(p.flags & FLAGS_SHORT))
  ------------------
  |  Branch (1208:15): [True: 0, False: 0]
  ------------------
 1209|      0|        *(int *)iptr->val.ptr = done;
 1210|      0|      else
 1211|      0|        *(short *)iptr->val.ptr = (short)done;
 1212|      0|      break;
 1213|       |
 1214|      0|    default:
  ------------------
  |  Branch (1214:5): [True: 0, False: 4.09M]
  ------------------
 1215|      0|      break;
 1216|  4.09M|    }
 1217|  4.09M|  }
 1218|  2.08M|  return done;
 1219|  2.08M|}
mprintf.c:parsefmt:
  451|  2.08M|{
  452|  2.08M|  const char *fmt = format;
  453|  2.08M|  int param_num = 0;
  454|  2.08M|  int max_param = -1;
  455|  2.08M|  int i;
  456|  2.08M|  int ocount = 0;
  457|  2.08M|  unsigned char usedinput[MAX_PARAMETERS / 8];
  458|  2.08M|  size_t outlen = 0;
  459|  2.08M|  struct outsegment *optr;
  460|  2.08M|  int use_dollar = DOLLAR_UNKNOWN;
  461|  2.08M|  const char *start = fmt;
  462|       |
  463|       |  /* clear, set a bit for each used input */
  464|  2.08M|  memset(usedinput, 0, sizeof(usedinput));
  465|       |
  466|  21.1M|  while(*fmt) {
  ------------------
  |  Branch (466:9): [True: 19.1M, False: 2.08M]
  ------------------
  467|  19.1M|    if(*fmt == '%') {
  ------------------
  |  Branch (467:8): [True: 4.09M, False: 15.0M]
  ------------------
  468|  4.09M|      struct va_input *iptr;
  469|  4.09M|      FormatType type;
  470|  4.09M|      unsigned int flags = 0;
  471|  4.09M|      int width = 0;
  472|  4.09M|      int precision = 0;
  473|  4.09M|      int param = -1;
  474|  4.09M|      int rc;
  475|  4.09M|      fmt++;
  476|  4.09M|      outlen = (size_t)(fmt - start - 1);
  477|  4.09M|      if(*fmt == '%') {
  ------------------
  |  Branch (477:10): [True: 0, False: 4.09M]
  ------------------
  478|       |        /* this means a %% that should be output only as %. Create an output
  479|       |           segment. */
  480|      0|        if(outlen) {
  ------------------
  |  Branch (480:12): [True: 0, False: 0]
  ------------------
  481|      0|          optr = &out[ocount++];
  482|      0|          if(ocount > MAX_SEGMENTS)
  ------------------
  |  |   34|      0|#define MAX_SEGMENTS   128 /* number of output segments */
  ------------------
  |  Branch (482:14): [True: 0, False: 0]
  ------------------
  483|      0|            return PFMT_MANYSEGS;
  ------------------
  |  |  183|      0|#define PFMT_MANYSEGS   11 /* maxed out output segments */
  ------------------
  484|      0|          optr->input = 0;
  485|      0|          optr->flags = FLAGS_SUBSTR;
  486|      0|          optr->start = start;
  487|      0|          optr->outlen = outlen;
  488|      0|        }
  489|      0|        start = fmt;
  490|      0|        fmt++;
  491|      0|        continue; /* while */
  492|      0|      }
  493|       |
  494|  4.09M|      if(use_dollar != DOLLAR_NOPE) {
  ------------------
  |  Branch (494:10): [True: 2.05M, False: 2.04M]
  ------------------
  495|  2.05M|        param = dollarstring(fmt, &fmt);
  496|  2.05M|        if(param < 0) {
  ------------------
  |  Branch (496:12): [True: 2.05M, False: 0]
  ------------------
  497|  2.05M|          if(use_dollar == DOLLAR_USE)
  ------------------
  |  Branch (497:14): [True: 0, False: 2.05M]
  ------------------
  498|       |            /* illegal combo */
  499|      0|            return PFMT_DOLLAR;
  ------------------
  |  |  173|      0|#define PFMT_DOLLAR      1 /* bad dollar for main param */
  ------------------
  500|       |
  501|       |          /* we got no positional, get the next arg */
  502|  2.05M|          param = -1;
  503|  2.05M|          use_dollar = DOLLAR_NOPE;
  504|  2.05M|        }
  505|      0|        else
  506|      0|          use_dollar = DOLLAR_USE;
  507|  2.05M|      }
  508|       |
  509|  4.09M|      rc = parse_flags(&fmt, &flags, use_dollar, &precision, &width);
  510|  4.09M|      if(rc)
  ------------------
  |  Branch (510:10): [True: 0, False: 4.09M]
  ------------------
  511|      0|        return rc;
  512|       |
  513|  4.09M|      if(parse_conversion(*fmt, &flags, &type))
  ------------------
  |  Branch (513:10): [True: 0, False: 4.09M]
  ------------------
  514|      0|        continue;
  515|       |
  516|  4.09M|      if(flags & FLAGS_WIDTHPARAM) {
  ------------------
  |  Branch (516:10): [True: 0, False: 4.09M]
  ------------------
  517|      0|        if(width < 0)
  ------------------
  |  Branch (517:12): [True: 0, False: 0]
  ------------------
  518|      0|          width = param_num++;
  519|      0|        else {
  520|       |          /* if this identifies a parameter already used, this is illegal */
  521|      0|          if(is_arg_used(usedinput, width))
  ------------------
  |  |  161|      0|#define is_arg_used(x, y)   ((x)[(y) / 8] & (1 << ((y) & 7)))
  |  |  ------------------
  |  |  |  Branch (161:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  522|      0|            return PFMT_WIDTHARG;
  ------------------
  |  |  181|      0|#define PFMT_WIDTHARG    9 /* attempted to use same arg twice, for width */
  ------------------
  523|      0|        }
  524|      0|        if(width >= MAX_PARAMETERS)
  ------------------
  |  |   33|      0|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (524:12): [True: 0, False: 0]
  ------------------
  525|      0|          return PFMT_MANYARGS;
  ------------------
  |  |  176|      0|#define PFMT_MANYARGS    4 /* too many input arguments used */
  ------------------
  526|      0|        if(width >= max_param)
  ------------------
  |  Branch (526:12): [True: 0, False: 0]
  ------------------
  527|      0|          max_param = width;
  528|       |
  529|      0|        in[width].type = MTYPE_WIDTH;
  530|       |        /* mark as used */
  531|      0|        mark_arg_used(usedinput, width);
  ------------------
  |  |  162|      0|#define mark_arg_used(x, y) ((x)[(y) / 8] |= (unsigned char)(1 << ((y) & 7)))
  ------------------
  532|      0|      }
  533|       |
  534|  4.09M|      if(flags & FLAGS_PRECPARAM) {
  ------------------
  |  Branch (534:10): [True: 20.9k, False: 4.07M]
  ------------------
  535|  20.9k|        if(precision < 0)
  ------------------
  |  Branch (535:12): [True: 20.9k, False: 0]
  ------------------
  536|  20.9k|          precision = param_num++;
  537|      0|        else {
  538|       |          /* if this identifies a parameter already used, this is illegal */
  539|      0|          if(is_arg_used(usedinput, precision))
  ------------------
  |  |  161|      0|#define is_arg_used(x, y)   ((x)[(y) / 8] & (1 << ((y) & 7)))
  |  |  ------------------
  |  |  |  Branch (161:29): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  540|      0|            return PFMT_PRECARG;
  ------------------
  |  |  182|      0|#define PFMT_PRECARG    10 /* attempted to use same arg twice, for prec */
  ------------------
  541|      0|        }
  542|  20.9k|        if(precision >= MAX_PARAMETERS)
  ------------------
  |  |   33|  20.9k|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (542:12): [True: 0, False: 20.9k]
  ------------------
  543|      0|          return PFMT_MANYARGS;
  ------------------
  |  |  176|      0|#define PFMT_MANYARGS    4 /* too many input arguments used */
  ------------------
  544|  20.9k|        if(precision >= max_param)
  ------------------
  |  Branch (544:12): [True: 20.9k, False: 0]
  ------------------
  545|  20.9k|          max_param = precision;
  546|       |
  547|  20.9k|        in[precision].type = MTYPE_PRECISION;
  548|  20.9k|        mark_arg_used(usedinput, precision);
  ------------------
  |  |  162|  20.9k|#define mark_arg_used(x, y) ((x)[(y) / 8] |= (unsigned char)(1 << ((y) & 7)))
  ------------------
  549|  20.9k|      }
  550|       |
  551|       |      /* Handle the specifier */
  552|  4.09M|      if(param < 0)
  ------------------
  |  Branch (552:10): [True: 4.09M, False: 1]
  ------------------
  553|  4.09M|        param = param_num++;
  554|  4.09M|      if(param >= MAX_PARAMETERS)
  ------------------
  |  |   33|  4.09M|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (554:10): [True: 0, False: 4.09M]
  ------------------
  555|      0|        return PFMT_MANYARGS;
  ------------------
  |  |  176|      0|#define PFMT_MANYARGS    4 /* too many input arguments used */
  ------------------
  556|  4.09M|      if(param >= max_param)
  ------------------
  |  Branch (556:10): [True: 4.09M, False: 1]
  ------------------
  557|  4.09M|        max_param = param;
  558|       |
  559|  4.09M|      iptr = &in[param];
  560|  4.09M|      iptr->type = type;
  561|       |
  562|       |      /* mark this input as used */
  563|  4.09M|      mark_arg_used(usedinput, param);
  ------------------
  |  |  162|  4.09M|#define mark_arg_used(x, y) ((x)[(y) / 8] |= (unsigned char)(1 << ((y) & 7)))
  ------------------
  564|       |
  565|  4.09M|      fmt++;
  566|  4.09M|      optr = &out[ocount++];
  567|  4.09M|      if(ocount > MAX_SEGMENTS)
  ------------------
  |  |   34|  4.09M|#define MAX_SEGMENTS   128 /* number of output segments */
  ------------------
  |  Branch (567:10): [True: 0, False: 4.09M]
  ------------------
  568|      0|        return PFMT_MANYSEGS;
  ------------------
  |  |  183|      0|#define PFMT_MANYSEGS   11 /* maxed out output segments */
  ------------------
  569|  4.09M|      optr->input = (unsigned int)param;
  570|  4.09M|      optr->flags = flags;
  571|  4.09M|      optr->width = width;
  572|  4.09M|      optr->precision = precision;
  573|  4.09M|      optr->start = start;
  574|  4.09M|      optr->outlen = outlen;
  575|  4.09M|      start = fmt;
  576|  4.09M|    }
  577|  15.0M|    else
  578|  15.0M|      fmt++;
  579|  19.1M|  }
  580|       |
  581|       |  /* is there a trailing piece */
  582|  2.08M|  outlen = (size_t)(fmt - start);
  583|  2.08M|  if(outlen) {
  ------------------
  |  Branch (583:6): [True: 1.41M, False: 667k]
  ------------------
  584|  1.41M|    optr = &out[ocount++];
  585|  1.41M|    if(ocount > MAX_SEGMENTS)
  ------------------
  |  |   34|  1.41M|#define MAX_SEGMENTS   128 /* number of output segments */
  ------------------
  |  Branch (585:8): [True: 0, False: 1.41M]
  ------------------
  586|      0|      return PFMT_MANYSEGS;
  ------------------
  |  |  183|      0|#define PFMT_MANYSEGS   11 /* maxed out output segments */
  ------------------
  587|  1.41M|    optr->input = 0;
  588|  1.41M|    optr->flags = FLAGS_SUBSTR;
  589|  1.41M|    optr->start = start;
  590|  1.41M|    optr->outlen = outlen;
  591|  1.41M|  }
  592|       |
  593|       |  /* Read the arg list parameters into our data list */
  594|  6.20M|  for(i = 0; i < max_param + 1; i++) {
  ------------------
  |  Branch (594:14): [True: 4.11M, False: 2.08M]
  ------------------
  595|  4.11M|    struct va_input *iptr = &in[i];
  596|  4.11M|    if(!is_arg_used(usedinput, i))
  ------------------
  |  |  161|  4.11M|#define is_arg_used(x, y)   ((x)[(y) / 8] & (1 << ((y) & 7)))
  ------------------
  |  Branch (596:8): [True: 0, False: 4.11M]
  ------------------
  597|       |      /* bad input */
  598|      0|      return PFMT_INPUTGAP;
  ------------------
  |  |  180|      0|#define PFMT_INPUTGAP    8 /* gap in arguments */
  ------------------
  599|       |
  600|       |    /* based on the type, read the correct argument */
  601|  4.11M|    switch(iptr->type) {
  602|  1.70M|    case MTYPE_STRING:
  ------------------
  |  Branch (602:5): [True: 1.70M, False: 2.41M]
  ------------------
  603|  1.70M|      iptr->val.str = va_arg(arglist, const char *);
  604|  1.70M|      break;
  605|       |
  606|      0|    case MTYPE_INTPTR:
  ------------------
  |  Branch (606:5): [True: 0, False: 4.11M]
  ------------------
  607|      0|    case MTYPE_PTR:
  ------------------
  |  Branch (607:5): [True: 0, False: 4.11M]
  ------------------
  608|      0|      iptr->val.ptr = va_arg(arglist, void *);
  609|      0|      break;
  610|       |
  611|      0|    case MTYPE_LONGLONGU:
  ------------------
  |  Branch (611:5): [True: 0, False: 4.11M]
  ------------------
  612|      0|      iptr->val.numu = va_arg(arglist, uint64_t);
  613|      0|      break;
  614|       |
  615|      0|    case MTYPE_LONGLONG:
  ------------------
  |  Branch (615:5): [True: 0, False: 4.11M]
  ------------------
  616|      0|      iptr->val.nums = va_arg(arglist, int64_t);
  617|      0|      break;
  618|       |
  619|   610k|    case MTYPE_LONGU:
  ------------------
  |  Branch (619:5): [True: 610k, False: 3.50M]
  ------------------
  620|   610k|      iptr->val.numu = va_arg(arglist, unsigned long);
  621|   610k|      break;
  622|       |
  623|  1.02M|    case MTYPE_LONG:
  ------------------
  |  Branch (623:5): [True: 1.02M, False: 3.09M]
  ------------------
  624|  1.02M|      iptr->val.nums = va_arg(arglist, long);
  625|  1.02M|      break;
  626|       |
  627|   235k|    case MTYPE_INTU:
  ------------------
  |  Branch (627:5): [True: 235k, False: 3.88M]
  ------------------
  628|   235k|      iptr->val.numu = va_arg(arglist, unsigned int);
  629|   235k|      break;
  630|       |
  631|   520k|    case MTYPE_INT:
  ------------------
  |  Branch (631:5): [True: 520k, False: 3.59M]
  ------------------
  632|   520k|    case MTYPE_WIDTH:
  ------------------
  |  Branch (632:5): [True: 0, False: 4.11M]
  ------------------
  633|   540k|    case MTYPE_PRECISION:
  ------------------
  |  Branch (633:5): [True: 20.9k, False: 4.09M]
  ------------------
  634|   540k|      iptr->val.nums = va_arg(arglist, int);
  635|   540k|      break;
  636|       |
  637|      0|    case MTYPE_DOUBLE:
  ------------------
  |  Branch (637:5): [True: 0, False: 4.11M]
  ------------------
  638|      0|      iptr->val.dnum = va_arg(arglist, double);
  639|      0|      break;
  640|       |
  641|      0|    case MTYPE_LONGDOUBLE:
  ------------------
  |  Branch (641:5): [True: 0, False: 4.11M]
  ------------------
  642|      0|      iptr->val.dnum = (double)va_arg(arglist, long double);
  643|      0|      break;
  644|       |
  645|      0|    default:
  ------------------
  |  Branch (645:5): [True: 0, False: 4.11M]
  ------------------
  646|      0|      DEBUGASSERT(NULL); /* unexpected */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (646:7): [True: 0, False: 0]
  |  Branch (646:7): [True: 0, False: 0]
  ------------------
  647|      0|      break;
  648|  4.11M|    }
  649|  4.11M|  }
  650|  2.08M|  *ipieces = max_param + 1;
  651|  2.08M|  *opieces = ocount;
  652|       |
  653|  2.08M|  return PFMT_OK;
  ------------------
  |  |  172|  2.08M|#define PFMT_OK          0
  ------------------
  654|  2.08M|}
mprintf.c:dollarstring:
  152|  2.05M|{
  153|  2.05M|  curl_off_t num;
  154|  2.05M|  if(curlx_str_number(&p, &num, MAX_PARAMETERS) ||
  ------------------
  |  |   33|  2.05M|#define MAX_PARAMETERS 128 /* number of input arguments */
  ------------------
  |  Branch (154:6): [True: 1.94M, False: 106k]
  ------------------
  155|   106k|     curlx_str_single(&p, '$') || !num)
  ------------------
  |  Branch (155:6): [True: 106k, False: 0]
  |  Branch (155:35): [True: 0, False: 0]
  ------------------
  156|  2.05M|    return -1;
  157|      0|  *end = p;
  158|      0|  return (int)num - 1;
  159|  2.05M|}
mprintf.c:parse_flags:
  187|  4.09M|{
  188|  4.09M|  const char *fmt = *fmtp;
  189|  4.09M|  bool loopit = TRUE;
  ------------------
  |  |  986|  4.09M|#define TRUE true
  ------------------
  190|  4.09M|  unsigned int flags = 0;
  191|  4.09M|  int width = 0;
  192|  4.09M|  int precision = 0;
  193|       |
  194|       |  /* Handle the flags */
  195|  5.85M|  do {
  196|  5.85M|    switch(*fmt++) {
  197|      0|    case ' ':
  ------------------
  |  Branch (197:5): [True: 0, False: 5.85M]
  ------------------
  198|      0|      flags |= FLAGS_SPACE;
  199|      0|      break;
  200|      0|    case '+':
  ------------------
  |  Branch (200:5): [True: 0, False: 5.85M]
  ------------------
  201|      0|      flags |= FLAGS_SHOWSIGN;
  202|      0|      break;
  203|      0|    case '-':
  ------------------
  |  Branch (203:5): [True: 0, False: 5.85M]
  ------------------
  204|      0|      flags |= FLAGS_LEFT;
  205|      0|      flags &= ~(unsigned int)FLAGS_PAD_NIL;
  206|      0|      break;
  207|      0|    case '#':
  ------------------
  |  Branch (207:5): [True: 0, False: 5.85M]
  ------------------
  208|      0|      flags |= FLAGS_ALT;
  209|      0|      break;
  210|  20.9k|    case '.':
  ------------------
  |  Branch (210:5): [True: 20.9k, False: 5.83M]
  ------------------
  211|  20.9k|      if('*' == *fmt) {
  ------------------
  |  Branch (211:10): [True: 20.9k, False: 0]
  ------------------
  212|       |        /* The precision is picked from a specified parameter */
  213|  20.9k|        flags |= FLAGS_PRECPARAM;
  214|  20.9k|        fmt++;
  215|       |
  216|  20.9k|        if(use_dollar == DOLLAR_USE) {
  ------------------
  |  Branch (216:12): [True: 0, False: 20.9k]
  ------------------
  217|      0|          precision = dollarstring(fmt, &fmt);
  218|      0|          if(precision < 0)
  ------------------
  |  Branch (218:14): [True: 0, False: 0]
  ------------------
  219|       |            /* illegal combo */
  220|      0|            return PFMT_DOLLARPREC;
  ------------------
  |  |  175|      0|#define PFMT_DOLLARPREC  3 /* bad dollar use for precision */
  ------------------
  221|      0|        }
  222|  20.9k|        else
  223|       |          /* get it from the next argument */
  224|  20.9k|          precision = -1;
  225|  20.9k|      }
  226|      0|      else {
  227|      0|        bool is_neg;
  228|      0|        curl_off_t num;
  229|      0|        flags |= FLAGS_PREC;
  230|      0|        is_neg = ('-' == *fmt);
  231|      0|        if(is_neg)
  ------------------
  |  Branch (231:12): [True: 0, False: 0]
  ------------------
  232|      0|          fmt++;
  233|      0|        if(curlx_str_number(&fmt, &num, INT_MAX))
  ------------------
  |  Branch (233:12): [True: 0, False: 0]
  ------------------
  234|      0|          return PFMT_PREC;
  ------------------
  |  |  177|      0|#define PFMT_PREC        5 /* precision overflow */
  ------------------
  235|      0|        precision = (int)num;
  236|      0|        if(is_neg)
  ------------------
  |  Branch (236:12): [True: 0, False: 0]
  ------------------
  237|      0|          precision = -precision;
  238|      0|      }
  239|  20.9k|      if((flags & (FLAGS_PREC | FLAGS_PRECPARAM)) ==
  ------------------
  |  Branch (239:10): [True: 0, False: 20.9k]
  ------------------
  240|  20.9k|         (FLAGS_PREC | FLAGS_PRECPARAM))
  241|       |        /* it is not permitted to use both kinds of precision for the same
  242|       |           argument */
  243|      0|        return PFMT_PRECMIX;
  ------------------
  |  |  178|      0|#define PFMT_PRECMIX     6 /* bad mix of precision specifiers */
  ------------------
  244|  20.9k|      break;
  245|  20.9k|    case 'h':
  ------------------
  |  Branch (245:5): [True: 0, False: 5.85M]
  ------------------
  246|      0|      flags |= FLAGS_SHORT;
  247|      0|      break;
  248|       |#ifdef _WIN32
  249|       |    case 'I':
  250|       |      /* Non-ANSI integer extensions I32 I64 */
  251|       |      if((fmt[0] == '3') && (fmt[1] == '2')) {
  252|       |        flags |= FLAGS_LONG;
  253|       |        fmt += 2;
  254|       |      }
  255|       |      else if((fmt[0] == '6') && (fmt[1] == '4')) {
  256|       |        flags |= FLAGS_LONGLONG;
  257|       |        fmt += 2;
  258|       |      }
  259|       |      else {
  260|       |#if SIZEOF_SIZE_T > SIZEOF_LONG
  261|       |        flags |= FLAGS_LONGLONG;
  262|       |#else
  263|       |        flags |= FLAGS_LONG;
  264|       |#endif
  265|       |      }
  266|       |      break;
  267|       |#endif /* _WIN32 */
  268|  1.02M|    case 'l':
  ------------------
  |  Branch (268:5): [True: 1.02M, False: 4.83M]
  ------------------
  269|  1.02M|      if(flags & FLAGS_LONG)
  ------------------
  |  Branch (269:10): [True: 0, False: 1.02M]
  ------------------
  270|      0|        flags |= FLAGS_LONGLONG;
  271|  1.02M|      else
  272|  1.02M|        flags |= FLAGS_LONG;
  273|  1.02M|      break;
  274|      0|    case 'L':
  ------------------
  |  Branch (274:5): [True: 0, False: 5.85M]
  ------------------
  275|      0|      flags |= FLAGS_LONGDOUBLE;
  276|      0|      break;
  277|      0|    case 'q':
  ------------------
  |  Branch (277:5): [True: 0, False: 5.85M]
  ------------------
  278|      0|      flags |= FLAGS_LONGLONG;
  279|      0|      break;
  280|   609k|    case 'z':
  ------------------
  |  Branch (280:5): [True: 609k, False: 5.24M]
  ------------------
  281|       |      /* the code below generates a warning if -Wunreachable-code is
  282|       |         used */
  283|       |#if SIZEOF_SIZE_T > SIZEOF_LONG
  284|       |      flags |= FLAGS_LONGLONG;
  285|       |#else
  286|   609k|      flags |= FLAGS_LONG;
  287|   609k|#endif
  288|   609k|      break;
  289|      0|    case 'O':
  ------------------
  |  Branch (289:5): [True: 0, False: 5.85M]
  ------------------
  290|       |#if SIZEOF_CURL_OFF_T > SIZEOF_LONG
  291|       |      flags |= FLAGS_LONGLONG;
  292|       |#else
  293|      0|      flags |= FLAGS_LONG;
  294|      0|#endif
  295|      0|      break;
  296|   106k|    case '0':
  ------------------
  |  Branch (296:5): [True: 106k, False: 5.75M]
  ------------------
  297|   106k|      if(!(flags & FLAGS_LEFT))
  ------------------
  |  Branch (297:10): [True: 106k, False: 0]
  ------------------
  298|   106k|        flags |= FLAGS_PAD_NIL;
  299|   106k|      FALLTHROUGH();
  ------------------
  |  |  752|   106k|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  300|   106k|    case '1':
  ------------------
  |  Branch (300:5): [True: 0, False: 5.85M]
  ------------------
  301|   106k|    case '2':
  ------------------
  |  Branch (301:5): [True: 0, False: 5.85M]
  ------------------
  302|   106k|    case '3':
  ------------------
  |  Branch (302:5): [True: 0, False: 5.85M]
  ------------------
  303|   106k|    case '4':
  ------------------
  |  Branch (303:5): [True: 0, False: 5.85M]
  ------------------
  304|   106k|    case '5':
  ------------------
  |  Branch (304:5): [True: 0, False: 5.85M]
  ------------------
  305|   106k|    case '6':
  ------------------
  |  Branch (305:5): [True: 0, False: 5.85M]
  ------------------
  306|   106k|    case '7':
  ------------------
  |  Branch (306:5): [True: 0, False: 5.85M]
  ------------------
  307|   106k|    case '8':
  ------------------
  |  Branch (307:5): [True: 0, False: 5.85M]
  ------------------
  308|   106k|    case '9': {
  ------------------
  |  Branch (308:5): [True: 0, False: 5.85M]
  ------------------
  309|   106k|      curl_off_t num;
  310|   106k|      if(flags & FLAGS_WIDTHPARAM)
  ------------------
  |  Branch (310:10): [True: 0, False: 106k]
  ------------------
  311|       |        /* a width cannot be both '*' and a number */
  312|      0|        return PFMT_WIDTH;
  ------------------
  |  |  179|      0|#define PFMT_WIDTH       7 /* width overflow */
  ------------------
  313|   106k|      flags |= FLAGS_WIDTH;
  314|   106k|      fmt--;
  315|   106k|      if(curlx_str_number(&fmt, &num, INT_MAX))
  ------------------
  |  Branch (315:10): [True: 0, False: 106k]
  ------------------
  316|      0|        return PFMT_WIDTH;
  ------------------
  |  |  179|      0|#define PFMT_WIDTH       7 /* width overflow */
  ------------------
  317|   106k|      width = (int)num;
  318|   106k|      break;
  319|   106k|    }
  320|      0|    case '*':  /* read width from argument list */
  ------------------
  |  Branch (320:5): [True: 0, False: 5.85M]
  ------------------
  321|      0|      flags |= FLAGS_WIDTHPARAM;
  322|      0|      if(use_dollar == DOLLAR_USE) {
  ------------------
  |  Branch (322:10): [True: 0, False: 0]
  ------------------
  323|      0|        width = dollarstring(fmt, &fmt);
  324|      0|        if(width < 0)
  ------------------
  |  Branch (324:12): [True: 0, False: 0]
  ------------------
  325|       |          /* illegal combo */
  326|      0|          return PFMT_DOLLARWIDTH;
  ------------------
  |  |  174|      0|#define PFMT_DOLLARWIDTH 2 /* bad dollar use for width */
  ------------------
  327|      0|      }
  328|      0|      else
  329|       |        /* pick from the next argument */
  330|      0|        width = -1;
  331|      0|      break;
  332|  4.09M|    default:
  ------------------
  |  Branch (332:5): [True: 4.09M, False: 1.76M]
  ------------------
  333|  4.09M|      loopit = FALSE;
  ------------------
  |  |  989|  4.09M|#define FALSE false
  ------------------
  334|  4.09M|      fmt--;
  335|  4.09M|      break;
  336|  5.85M|    } /* switch */
  337|  5.85M|  } while(loopit); /* do */
  ------------------
  |  Branch (337:11): [True: 1.76M, False: 4.09M]
  ------------------
  338|  4.09M|  *flagsp = flags;
  339|  4.09M|  *precp = precision;
  340|  4.09M|  *widthp = width;
  341|  4.09M|  *fmtp = fmt;
  342|  4.09M|  return PFMT_OK;
  ------------------
  |  |  172|  4.09M|#define PFMT_OK          0
  ------------------
  343|  4.09M|}
mprintf.c:parse_conversion:
  347|  4.09M|{
  348|  4.09M|  unsigned int flags = *flagp;
  349|  4.09M|  FormatType type;
  350|  4.09M|  switch(f) {
  351|      0|  case 'S':
  ------------------
  |  Branch (351:3): [True: 0, False: 4.09M]
  ------------------
  352|      0|    flags |= FLAGS_ALT;
  353|      0|    type = MTYPE_STRING;
  354|      0|    break;
  355|  1.70M|  case 's':
  ------------------
  |  Branch (355:3): [True: 1.70M, False: 2.38M]
  ------------------
  356|  1.70M|    type = MTYPE_STRING;
  357|  1.70M|    break;
  358|      0|  case 'n':
  ------------------
  |  Branch (358:3): [True: 0, False: 4.09M]
  ------------------
  359|      0|    type = MTYPE_INTPTR;
  360|      0|    break;
  361|      0|  case 'p':
  ------------------
  |  Branch (361:3): [True: 0, False: 4.09M]
  ------------------
  362|      0|    type = MTYPE_PTR;
  363|      0|    break;
  364|  1.54M|  case 'd':
  ------------------
  |  Branch (364:3): [True: 1.54M, False: 2.55M]
  ------------------
  365|  1.54M|  case 'i':
  ------------------
  |  Branch (365:3): [True: 0, False: 4.09M]
  ------------------
  366|  1.54M|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (366:8): [True: 0, False: 1.54M]
  ------------------
  367|      0|      type = MTYPE_LONGLONG;
  368|  1.54M|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (368:13): [True: 1.02M, False: 520k]
  ------------------
  369|  1.02M|      type = MTYPE_LONG;
  370|   520k|    else
  371|   520k|      type = MTYPE_INT;
  372|  1.54M|    break;
  373|   680k|  case 'u':
  ------------------
  |  Branch (373:3): [True: 680k, False: 3.41M]
  ------------------
  374|   680k|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (374:8): [True: 0, False: 680k]
  ------------------
  375|      0|      type = MTYPE_LONGLONGU;
  376|   680k|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (376:13): [True: 609k, False: 70.2k]
  ------------------
  377|   609k|      type = MTYPE_LONGU;
  378|  70.2k|    else
  379|  70.2k|      type = MTYPE_INTU;
  380|   680k|    flags |= FLAGS_UNSIGNED;
  381|   680k|    break;
  382|      0|  case 'o':
  ------------------
  |  Branch (382:3): [True: 0, False: 4.09M]
  ------------------
  383|      0|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (383:8): [True: 0, False: 0]
  ------------------
  384|      0|      type = MTYPE_LONGLONGU;
  385|      0|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (385:13): [True: 0, False: 0]
  ------------------
  386|      0|      type = MTYPE_LONGU;
  387|      0|    else
  388|      0|      type = MTYPE_INTU;
  389|      0|    flags |= FLAGS_OCTAL | FLAGS_UNSIGNED;
  390|      0|    break;
  391|   165k|  case 'x':
  ------------------
  |  Branch (391:3): [True: 165k, False: 3.93M]
  ------------------
  392|   165k|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (392:8): [True: 0, False: 165k]
  ------------------
  393|      0|      type = MTYPE_LONGLONGU;
  394|   165k|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (394:13): [True: 169, False: 165k]
  ------------------
  395|    169|      type = MTYPE_LONGU;
  396|   165k|    else
  397|   165k|      type = MTYPE_INTU;
  398|   165k|    flags |= FLAGS_HEX | FLAGS_UNSIGNED;
  399|   165k|    break;
  400|      0|  case 'X':
  ------------------
  |  Branch (400:3): [True: 0, False: 4.09M]
  ------------------
  401|      0|    if(flags & FLAGS_LONGLONG)
  ------------------
  |  Branch (401:8): [True: 0, False: 0]
  ------------------
  402|      0|      type = MTYPE_LONGLONGU;
  403|      0|    else if(flags & FLAGS_LONG)
  ------------------
  |  Branch (403:13): [True: 0, False: 0]
  ------------------
  404|      0|      type = MTYPE_LONGU;
  405|      0|    else
  406|      0|      type = MTYPE_INTU;
  407|      0|    flags |= FLAGS_HEX | FLAGS_UPPER | FLAGS_UNSIGNED;
  408|      0|    break;
  409|      9|  case 'c':
  ------------------
  |  Branch (409:3): [True: 9, False: 4.09M]
  ------------------
  410|      9|    type = MTYPE_INT;
  411|      9|    flags |= FLAGS_CHAR;
  412|      9|    break;
  413|      0|  case 'f':
  ------------------
  |  Branch (413:3): [True: 0, False: 4.09M]
  ------------------
  414|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (414:12): [True: 0, False: 0]
  ------------------
  415|      0|    break;
  416|      0|  case 'F':
  ------------------
  |  Branch (416:3): [True: 0, False: 4.09M]
  ------------------
  417|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (417:12): [True: 0, False: 0]
  ------------------
  418|      0|    flags |= FLAGS_UPPER;
  419|      0|    break;
  420|      0|  case 'e':
  ------------------
  |  Branch (420:3): [True: 0, False: 4.09M]
  ------------------
  421|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (421:12): [True: 0, False: 0]
  ------------------
  422|      0|    flags |= FLAGS_FLOATE;
  423|      0|    break;
  424|      0|  case 'E':
  ------------------
  |  Branch (424:3): [True: 0, False: 4.09M]
  ------------------
  425|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (425:12): [True: 0, False: 0]
  ------------------
  426|      0|    flags |= FLAGS_FLOATE | FLAGS_UPPER;
  427|      0|    break;
  428|      0|  case 'g':
  ------------------
  |  Branch (428:3): [True: 0, False: 4.09M]
  ------------------
  429|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (429:12): [True: 0, False: 0]
  ------------------
  430|      0|    flags |= FLAGS_FLOATG;
  431|      0|    break;
  432|      0|  case 'G':
  ------------------
  |  Branch (432:3): [True: 0, False: 4.09M]
  ------------------
  433|      0|    type = flags & FLAGS_LONGDOUBLE ? MTYPE_LONGDOUBLE : MTYPE_DOUBLE;
  ------------------
  |  Branch (433:12): [True: 0, False: 0]
  ------------------
  434|      0|    flags |= FLAGS_FLOATG | FLAGS_UPPER;
  435|      0|    break;
  436|      0|  default:
  ------------------
  |  Branch (436:3): [True: 0, False: 4.09M]
  ------------------
  437|       |    /* invalid instruction, disregard and continue */
  438|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  439|  4.09M|  } /* switch */
  440|       |
  441|  4.09M|  *flagp |= flags;
  442|  4.09M|  *typep = type;
  443|       |  return FALSE;
  ------------------
  |  |  989|  4.09M|#define FALSE false
  ------------------
  444|  4.09M|}
mprintf.c:stream_zrun:
  732|  4.62M|{
  733|  4.62M|  size_t n = 0;
  734|  20.1M|  while(n < len && str[n])
  ------------------
  |  Branch (734:9): [True: 15.5M, False: 4.62M]
  |  Branch (734:20): [True: 15.5M, False: 2]
  ------------------
  735|  15.5M|    n++;
  736|  4.62M|  return stream_run(userp, stream, streamn,
  737|  4.62M|                    (const unsigned char *)str, n, donep);
  738|  4.62M|}
mprintf.c:stream_run:
  678|  10.1M|{
  679|  10.1M|  if(!len)
  ------------------
  |  Branch (679:6): [True: 1.96M, False: 8.19M]
  ------------------
  680|  1.96M|    return FALSE;
  ------------------
  |  |  989|  1.96M|#define FALSE false
  ------------------
  681|  8.19M|  if(streamn) {
  ------------------
  |  Branch (681:6): [True: 8.19M, False: 0]
  ------------------
  682|  8.19M|    size_t n = streamn(buf, len, userp);
  683|  8.19M|    *donep += (int)n;
  684|  8.19M|    return n != len;
  685|  8.19M|  }
  686|      0|  while(len--) {
  ------------------
  |  Branch (686:9): [True: 0, False: 0]
  ------------------
  687|      0|    if(stream(*buf++, userp))
  ------------------
  |  Branch (687:8): [True: 0, False: 0]
  ------------------
  688|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  689|      0|    (*donep)++;
  690|      0|  }
  691|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  692|      0|}
mprintf.c:out_number:
  836|  2.38M|{
  837|  2.38M|  const unsigned char *digits = Curl_ldigits;
  838|  2.38M|  int flags = p->flags;
  839|  2.38M|  int width = p->width;
  840|  2.38M|  int prec = p->prec;
  841|  2.38M|  bool is_alt = flags & FLAGS_ALT;
  842|  2.38M|  bool is_neg = FALSE;
  ------------------
  |  |  989|  2.38M|#define FALSE false
  ------------------
  843|  2.38M|  int base = 10;
  844|       |
  845|       |  /* 'workend' points to the final buffer byte position, but with an extra
  846|       |     byte as margin to avoid the (FALSE?) warning Coverity gives us
  847|       |     otherwise */
  848|  2.38M|  char *workend = &work[BUFFSIZE - 2];
  ------------------
  |  |   31|  2.38M|#define BUFFSIZE 326 /* buffer for long-to-str and float-to-str calcs, should
  ------------------
  849|  2.38M|  char *w;
  850|       |
  851|  2.38M|  if(flags & FLAGS_CHAR) {
  ------------------
  |  Branch (851:6): [True: 9, False: 2.38M]
  ------------------
  852|       |    /* Character. */
  853|      9|    if(!(flags & FLAGS_LEFT)) {
  ------------------
  |  Branch (853:8): [True: 9, False: 0]
  ------------------
  854|      9|      if(stream_pad(userp, stream, streamn, ' ', width - 1, donep))
  ------------------
  |  Branch (854:10): [True: 0, False: 9]
  ------------------
  855|      0|        return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  856|      9|      width = 1;
  857|      9|    }
  858|      9|    OUTCHAR((char)num);
  ------------------
  |  |   43|      9|  do {                                    \
  |  |   44|      9|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 9]
  |  |  ------------------
  |  |   45|      9|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      9|    (*donep)++;                           \
  |  |   47|      9|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 9]
  |  |  ------------------
  ------------------
  859|      9|    if(flags & FLAGS_LEFT) {
  ------------------
  |  Branch (859:8): [True: 0, False: 9]
  ------------------
  860|      0|      if(stream_pad(userp, stream, streamn, ' ', width - 1, donep))
  ------------------
  |  Branch (860:10): [True: 0, False: 0]
  ------------------
  861|      0|        return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  862|      0|    }
  863|      9|    return FALSE;
  ------------------
  |  |  989|      9|#define FALSE false
  ------------------
  864|      9|  }
  865|  2.38M|  if(flags & FLAGS_OCTAL)
  ------------------
  |  Branch (865:6): [True: 0, False: 2.38M]
  ------------------
  866|       |    /* Octal unsigned integer */
  867|      0|    base = 8;
  868|       |
  869|  2.38M|  else if(flags & FLAGS_HEX) {
  ------------------
  |  Branch (869:11): [True: 165k, False: 2.22M]
  ------------------
  870|       |    /* Hexadecimal unsigned integer */
  871|   165k|    digits = (flags & FLAGS_UPPER) ? Curl_udigits : Curl_ldigits;
  ------------------
  |  Branch (871:14): [True: 0, False: 165k]
  ------------------
  872|   165k|    base = 16;
  873|   165k|  }
  874|  2.22M|  else if(flags & FLAGS_UNSIGNED)
  ------------------
  |  Branch (874:11): [True: 680k, False: 1.54M]
  ------------------
  875|       |    /* Decimal unsigned integer */
  876|   680k|    ;
  877|       |
  878|  1.54M|  else {
  879|       |    /* Decimal integer. */
  880|  1.54M|    is_neg = (nums < 0);
  881|  1.54M|    if(is_neg) {
  ------------------
  |  Branch (881:8): [True: 9, False: 1.54M]
  ------------------
  882|       |      /* signed_num might fail to hold absolute negative minimum by 1 */
  883|      9|      int64_t signed_num; /* Used to convert negative in positive. */
  884|      9|      signed_num = nums + (int64_t)1;
  885|      9|      signed_num = -signed_num;
  886|      9|      num = (uint64_t)signed_num;
  887|      9|      num += (uint64_t)1;
  888|      9|    }
  889|  1.54M|  }
  890|       |
  891|       |  /* Supply a default precision if none was given. */
  892|  2.38M|  if(prec == -1)
  ------------------
  |  Branch (892:6): [True: 2.38M, False: 0]
  ------------------
  893|  2.38M|    prec = 1;
  894|       |
  895|       |  /* Put the number in WORK. */
  896|  2.38M|  w = workend;
  897|  2.38M|  DEBUGASSERT(base <= 16);
  ------------------
  |  | 1016|  2.38M|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (897:3): [True: 0, False: 2.38M]
  |  Branch (897:3): [True: 2.38M, False: 0]
  ------------------
  898|  2.38M|  switch(base) {
  899|  2.22M|  case 10:
  ------------------
  |  Branch (899:3): [True: 2.22M, False: 165k]
  ------------------
  900|  3.40M|    while(num > 0) {
  ------------------
  |  Branch (900:11): [True: 1.18M, False: 2.22M]
  ------------------
  901|  1.18M|      *w-- = (char)('0' + (num % 10));
  902|  1.18M|      num /= 10;
  903|  1.18M|    }
  904|  2.22M|    break;
  905|   165k|  default:
  ------------------
  |  Branch (905:3): [True: 165k, False: 2.22M]
  ------------------
  906|   462k|    while(num > 0) {
  ------------------
  |  Branch (906:11): [True: 296k, False: 165k]
  ------------------
  907|   296k|      *w-- = digits[num % base];
  908|   296k|      num /= base;
  909|   296k|    }
  910|   165k|    break;
  911|  2.38M|  }
  912|  2.38M|  width -= (int)(workend - w);
  913|  2.38M|  prec -= (int)(workend - w);
  914|       |
  915|  2.38M|  if(is_alt && base == 8 && prec <= 0) {
  ------------------
  |  Branch (915:6): [True: 0, False: 2.38M]
  |  Branch (915:16): [True: 0, False: 0]
  |  Branch (915:29): [True: 0, False: 0]
  ------------------
  916|      0|    *w-- = '0';
  917|      0|    --width;
  918|      0|  }
  919|       |
  920|  2.38M|  if(prec > 0)
  ------------------
  |  Branch (920:6): [True: 1.45M, False: 933k]
  ------------------
  921|       |    /* the precision zeros are output right before the digits */
  922|  1.45M|    width -= prec;
  923|       |
  924|  2.38M|  if(is_alt && base == 16)
  ------------------
  |  Branch (924:6): [True: 0, False: 2.38M]
  |  Branch (924:16): [True: 0, False: 0]
  ------------------
  925|      0|    width -= 2;
  926|       |
  927|  2.38M|  if(is_neg || (flags & FLAGS_SHOWSIGN) || (flags & FLAGS_SPACE))
  ------------------
  |  Branch (927:6): [True: 9, False: 2.38M]
  |  Branch (927:16): [True: 0, False: 2.38M]
  |  Branch (927:44): [True: 0, False: 2.38M]
  ------------------
  928|      9|    --width;
  929|       |
  930|  2.38M|  if(!(flags & FLAGS_LEFT) && !(flags & FLAGS_PAD_NIL)) {
  ------------------
  |  Branch (930:6): [True: 2.38M, False: 0]
  |  Branch (930:31): [True: 2.28M, False: 106k]
  ------------------
  931|  2.28M|    if(stream_pad(userp, stream, streamn, ' ', width, donep))
  ------------------
  |  Branch (931:8): [True: 0, False: 2.28M]
  ------------------
  932|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  933|  2.28M|    width = 0;
  934|  2.28M|  }
  935|       |
  936|  2.38M|  if(is_neg)
  ------------------
  |  Branch (936:6): [True: 9, False: 2.38M]
  ------------------
  937|      9|    OUTCHAR('-');
  ------------------
  |  |   43|      9|  do {                                    \
  |  |   44|      9|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 9]
  |  |  ------------------
  |  |   45|      9|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      9|    (*donep)++;                           \
  |  |   47|      9|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 9]
  |  |  ------------------
  ------------------
  938|  2.38M|  else if(flags & FLAGS_SHOWSIGN)
  ------------------
  |  Branch (938:11): [True: 0, False: 2.38M]
  ------------------
  939|      0|    OUTCHAR('+');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  940|  2.38M|  else if(flags & FLAGS_SPACE)
  ------------------
  |  Branch (940:11): [True: 0, False: 2.38M]
  ------------------
  941|      0|    OUTCHAR(' ');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  942|       |
  943|  2.38M|  if(is_alt && base == 16) {
  ------------------
  |  Branch (943:6): [True: 0, False: 2.38M]
  |  Branch (943:16): [True: 0, False: 0]
  ------------------
  944|      0|    OUTCHAR('0');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  945|      0|    if(flags & FLAGS_UPPER)
  ------------------
  |  Branch (945:8): [True: 0, False: 0]
  ------------------
  946|      0|      OUTCHAR('X');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  947|      0|    else
  948|      0|      OUTCHAR('x');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  949|      0|  }
  950|       |
  951|  2.38M|  if(!(flags & FLAGS_LEFT) && (flags & FLAGS_PAD_NIL)) {
  ------------------
  |  Branch (951:6): [True: 2.38M, False: 0]
  |  Branch (951:31): [True: 106k, False: 2.28M]
  ------------------
  952|   106k|    if(stream_pad(userp, stream, streamn, '0', width, donep))
  ------------------
  |  Branch (952:8): [True: 0, False: 106k]
  ------------------
  953|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  954|   106k|    width = 0;
  955|   106k|  }
  956|       |
  957|       |  /* Write the precision zeros and the number. */
  958|  2.38M|  if(stream_pad(userp, stream, streamn, '0', prec, donep) ||
  ------------------
  |  Branch (958:6): [True: 0, False: 2.38M]
  ------------------
  959|  2.38M|     stream_run(userp, stream, streamn, (const unsigned char *)w + 1,
  ------------------
  |  Branch (959:6): [True: 0, False: 2.38M]
  ------------------
  960|  2.38M|                (size_t)(workend - w), donep))
  961|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  962|       |
  963|  2.38M|  if(flags & FLAGS_LEFT) {
  ------------------
  |  Branch (963:6): [True: 0, False: 2.38M]
  ------------------
  964|      0|    if(stream_pad(userp, stream, streamn, ' ', width, donep))
  ------------------
  |  Branch (964:8): [True: 0, False: 0]
  ------------------
  965|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  966|      0|  }
  967|       |
  968|  2.38M|  return FALSE;
  ------------------
  |  |  989|  2.38M|#define FALSE false
  ------------------
  969|  2.38M|}
mprintf.c:stream_pad:
  706|  6.48M|{
  707|  6.48M|  const unsigned char *src;
  708|  6.48M|  if(num <= 0)
  ------------------
  |  Branch (708:6): [True: 5.02M, False: 1.45M]
  ------------------
  709|  5.02M|    return FALSE;
  ------------------
  |  |  989|  5.02M|#define FALSE false
  ------------------
  710|  1.45M|  if(pad == '0')
  ------------------
  |  Branch (710:6): [True: 1.45M, False: 2]
  ------------------
  711|  1.45M|    src = (const unsigned char *)pad_zeros;
  712|      2|  else
  713|      2|    src = (const unsigned char *)pad_spaces;
  714|  1.45M|  while(num > PAD_RUN) {
  ------------------
  |  |  699|  1.45M|#define PAD_RUN 16 /* strlen() of both of the above */
  ------------------
  |  Branch (714:9): [True: 0, False: 1.45M]
  ------------------
  715|      0|    if(stream_run(userp, stream, streamn, src, PAD_RUN, donep))
  ------------------
  |  |  699|      0|#define PAD_RUN 16 /* strlen() of both of the above */
  ------------------
  |  Branch (715:8): [True: 0, False: 0]
  ------------------
  716|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  717|      0|    num -= PAD_RUN;
  ------------------
  |  |  699|      0|#define PAD_RUN 16 /* strlen() of both of the above */
  ------------------
  718|      0|  }
  719|  1.45M|  return stream_run(userp, stream, streamn, src, (size_t)num, donep);
  720|  1.45M|}
mprintf.c:out_string:
  979|  1.70M|{
  980|  1.70M|  int flags = p->flags;
  981|  1.70M|  int width = p->width;
  982|  1.70M|  int prec = p->prec;
  983|  1.70M|  size_t len;
  984|       |
  985|  1.70M|  if(!str) {
  ------------------
  |  Branch (985:6): [True: 0, False: 1.70M]
  ------------------
  986|       |    /* Write null string if there is space. */
  987|      0|    if(prec == -1 || prec >= (int)CURL_CSTRLEN(nilstr)) {
  ------------------
  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
  |  Branch (987:8): [True: 0, False: 0]
  |  Branch (987:22): [True: 0, False: 0]
  ------------------
  988|      0|      str = nilstr;
  989|      0|      len = CURL_CSTRLEN(nilstr);
  ------------------
  |  | 1319|      0|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
  990|       |      /* Disable quotes around (nil) */
  991|      0|      flags &= ~(unsigned int)FLAGS_ALT;
  992|      0|    }
  993|      0|    else {
  994|      0|      str = "";
  995|      0|      len = 0;
  996|      0|    }
  997|      0|  }
  998|  1.70M|  else if(prec != -1)
  ------------------
  |  Branch (998:11): [True: 20.9k, False: 1.68M]
  ------------------
  999|  20.9k|    len = (size_t)prec;
 1000|  1.68M|  else if(*str == '\0')
  ------------------
  |  Branch (1000:11): [True: 513k, False: 1.17M]
  ------------------
 1001|   513k|    len = 0;
 1002|  1.17M|  else
 1003|  1.17M|    len = strlen(str);
 1004|       |
 1005|  1.70M|  width -= (len > INT_MAX) ? INT_MAX : (int)len;
  ------------------
  |  Branch (1005:12): [True: 0, False: 1.70M]
  ------------------
 1006|       |
 1007|  1.70M|  if(flags & FLAGS_ALT)
  ------------------
  |  Branch (1007:6): [True: 0, False: 1.70M]
  ------------------
 1008|      0|    OUTCHAR('"');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1009|       |
 1010|  1.70M|  if(!(flags & FLAGS_LEFT)) {
  ------------------
  |  Branch (1010:6): [True: 1.70M, False: 0]
  ------------------
 1011|  1.70M|    if(stream_pad(userp, stream, streamn, ' ', width, donep))
  ------------------
  |  Branch (1011:8): [True: 0, False: 1.70M]
  ------------------
 1012|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1013|  1.70M|    width = 0;
 1014|  1.70M|  }
 1015|       |
 1016|       |  /* With no precision, len is already the exact length; emit it without
 1017|       |     scanning again. With precision, scan up to len but stop at NUL, since
 1018|       |     the string may be shorter or the buffer may not be null-terminated. */
 1019|  1.70M|  if(prec == -1) {
  ------------------
  |  Branch (1019:6): [True: 1.68M, False: 20.9k]
  ------------------
 1020|  1.68M|    if(stream_run(userp, stream, streamn,
  ------------------
  |  Branch (1020:8): [True: 34, False: 1.68M]
  ------------------
 1021|  1.68M|                  (const unsigned char *)str, len, donep))
 1022|     34|      return TRUE;
  ------------------
  |  |  986|     34|#define TRUE true
  ------------------
 1023|  1.68M|  }
 1024|  20.9k|  else if(stream_zrun(userp, stream, streamn, str, len, donep))
  ------------------
  |  Branch (1024:11): [True: 7, False: 20.9k]
  ------------------
 1025|      7|    return TRUE;
  ------------------
  |  |  986|      7|#define TRUE true
  ------------------
 1026|  1.70M|  if(flags & FLAGS_LEFT) {
  ------------------
  |  Branch (1026:6): [True: 0, False: 1.70M]
  ------------------
 1027|      0|    if(stream_pad(userp, stream, streamn, ' ', width, donep))
  ------------------
  |  Branch (1027:8): [True: 0, False: 0]
  ------------------
 1028|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1029|      0|  }
 1030|       |
 1031|  1.70M|  if(flags & FLAGS_ALT)
  ------------------
  |  Branch (1031:6): [True: 0, False: 1.70M]
  ------------------
 1032|      0|    OUTCHAR('"');
  ------------------
  |  |   43|      0|  do {                                    \
  |  |   44|      0|    if(stream((unsigned char)(x), userp)) \
  |  |  ------------------
  |  |  |  Branch (44:8): [True: 0, False: 0]
  |  |  ------------------
  |  |   45|      0|      return TRUE;                        \
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  |  |   46|      0|    (*donep)++;                           \
  |  |   47|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (47:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1033|       |
 1034|  1.70M|  return FALSE;
  ------------------
  |  |  989|  1.70M|#define FALSE false
  ------------------
 1035|  1.70M|}
mprintf.c:addbyter:
 1223|     16|{
 1224|     16|  struct nsprintf *infop = f;
 1225|     16|  if(infop->length < infop->max) {
  ------------------
  |  Branch (1225:6): [True: 16, False: 0]
  ------------------
 1226|       |    /* only do this if we have not reached max length yet */
 1227|     16|    *infop->buffer++ = (char)outc; /* store */
 1228|     16|    infop->length++; /* we are now one byte larger */
 1229|     16|    return 0;     /* fputc() returns like this on success */
 1230|     16|  }
 1231|      0|  return 1;
 1232|     16|}
mprintf.c:addrun:
 1236|  7.70M|{
 1237|  7.70M|  struct nsprintf *infop = f;
 1238|  7.70M|  size_t fit = infop->max - infop->length;
 1239|  7.70M|  if(len > fit)
  ------------------
  |  Branch (1239:6): [True: 42, False: 7.70M]
  ------------------
 1240|     42|    len = fit;
 1241|  7.70M|  if(len) {
  ------------------
  |  Branch (1241:6): [True: 7.70M, False: 2]
  ------------------
 1242|  7.70M|    memcpy(infop->buffer, buf, len);
 1243|  7.70M|    infop->buffer += len;
 1244|  7.70M|    infop->length += len;
 1245|  7.70M|  }
 1246|  7.70M|  return len;
 1247|  7.70M|}
mprintf.c:alloc_addbyter:
 1322|      2|{
 1323|      2|  struct asprintf *infop = f;
 1324|      2|  if(infop->nstage == sizeof(infop->stage) && alloc_flush(infop))
  ------------------
  |  Branch (1324:6): [True: 0, False: 2]
  |  Branch (1324:47): [True: 0, False: 0]
  ------------------
 1325|      0|    return 1; /* fail */
 1326|      2|  if(!alloc_fits(infop, 1)) {
  ------------------
  |  Branch (1326:6): [True: 0, False: 2]
  ------------------
 1327|       |    /* Does not fit the dynbuf size limit. Flush and append this byte on
 1328|       |       its own, so the limit is reported at exactly this byte and formatting
 1329|       |       stops where it would without staging. %n depends on that. */
 1330|      0|    if(alloc_flush(infop))
  ------------------
  |  Branch (1330:8): [True: 0, False: 0]
  ------------------
 1331|      0|      return 1;
 1332|      0|    return alloc_addn(infop, &outc, 1);
 1333|      0|  }
 1334|      2|  infop->stage[infop->nstage++] = outc;
 1335|      2|  return 0;
 1336|      2|}
mprintf.c:alloc_fits:
 1316|   488k|{
 1317|   488k|  return (infop->b->leng + infop->nstage + more + 1) <= infop->b->toobig;
 1318|   488k|}
mprintf.c:alloc_addrun:
 1340|   485k|{
 1341|   485k|  struct asprintf *infop = f;
 1342|   485k|  size_t accepted = 0;
 1343|   974k|  while(accepted < len) {
  ------------------
  |  Branch (1343:9): [True: 488k, False: 485k]
  ------------------
 1344|   488k|    size_t room = sizeof(infop->stage) - infop->nstage;
 1345|   488k|    size_t n;
 1346|   488k|    if(!room) {
  ------------------
  |  Branch (1346:8): [True: 3.53k, False: 485k]
  ------------------
 1347|  3.53k|      if(alloc_flush(infop))
  ------------------
  |  Branch (1347:10): [True: 1, False: 3.52k]
  ------------------
 1348|      1|        return accepted; /* accepted < len aborts formatting */
 1349|  3.52k|      room = sizeof(infop->stage);
 1350|  3.52k|    }
 1351|   488k|    n = len - accepted;
 1352|   488k|    if(n > room)
  ------------------
  |  Branch (1352:8): [True: 3.52k, False: 485k]
  ------------------
 1353|  3.52k|      n = room;
 1354|   488k|    if(!alloc_fits(infop, n)) {
  ------------------
  |  Branch (1354:8): [True: 0, False: 488k]
  ------------------
 1355|       |      /* Run does not fit the dynbuf size limit. Stage what does, then
 1356|       |         append the first byte that does not on its own, so the limit is
 1357|       |         reported at exactly that byte. */
 1358|      0|      size_t fits = infop->b->toobig - infop->b->leng - infop->nstage - 1;
 1359|      0|      if(fits) {
  ------------------
  |  Branch (1359:10): [True: 0, False: 0]
  ------------------
 1360|      0|        memcpy(&infop->stage[infop->nstage], buf + accepted, fits);
 1361|      0|        infop->nstage += fits;
 1362|      0|        accepted += fits;
 1363|      0|      }
 1364|      0|      if(alloc_flush(infop))
  ------------------
  |  Branch (1364:10): [True: 0, False: 0]
  ------------------
 1365|      0|        return accepted;
 1366|      0|      if(alloc_addn(infop, buf + accepted, 1))
  ------------------
  |  Branch (1366:10): [True: 0, False: 0]
  ------------------
 1367|      0|        return accepted; /* accepted < len aborts formatting */
 1368|      0|      accepted++;
 1369|      0|      continue;
 1370|      0|    }
 1371|   488k|    memcpy(&infop->stage[infop->nstage], buf + accepted, n);
 1372|   488k|    infop->nstage += n;
 1373|   488k|    accepted += n;
 1374|   488k|  }
 1375|   485k|  return accepted;
 1376|   485k|}
mprintf.c:alloc_flush:
 1287|   195k|{
 1288|   195k|  struct asprintf *infop = f;
 1289|   195k|  if(infop->nstage) {
  ------------------
  |  Branch (1289:6): [True: 195k, False: 8]
  ------------------
 1290|   195k|    CURLcode result = curlx_dyn_addn(infop->b, infop->stage, infop->nstage);
 1291|   195k|    infop->nstage = 0;
 1292|   195k|    if(result) {
  ------------------
  |  Branch (1292:8): [True: 46, False: 195k]
  ------------------
 1293|     46|      infop->merr = result == CURLE_TOO_LARGE ? MERR_TOO_LARGE : MERR_MEM;
  ------------------
  |  |   29|      0|#define MERR_TOO_LARGE 2
  ------------------
                    infop->merr = result == CURLE_TOO_LARGE ? MERR_TOO_LARGE : MERR_MEM;
  ------------------
  |  |   28|     92|#define MERR_MEM       1
  ------------------
  |  Branch (1293:21): [True: 0, False: 46]
  ------------------
 1294|     46|      return 1; /* fail */
 1295|     46|    }
 1296|   195k|  }
 1297|   195k|  return 0;
 1298|   195k|}
mprintf.c:fwrite_wrapper:
 1469|  2.31k|{
 1470|  2.31k|  struct ioprintf *i = f;
 1471|  2.31k|  size_t n;
 1472|  2.31k|  FILE *s = i->fd;
 1473|  2.31k|  n = fwrite(buf, 1, len, s);
 1474|  2.31k|  i->error = (n != len);
 1475|  2.31k|  return n;
 1476|  2.31k|}

Curl_multi_handle:
  229|  9.91k|{
  230|  9.91k|  struct curltime created;
  231|  9.91k|  struct Curl_multi *multi = curlx_calloc(1, sizeof(struct Curl_multi));
  ------------------
  |  | 1500|  9.91k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  232|       |
  233|  9.91k|  if(!multi)
  ------------------
  |  Branch (233:6): [True: 60, False: 9.85k]
  ------------------
  234|     60|    return NULL;
  235|       |
  236|  9.85k|  multi->magic = CURLMULTI_MAGIC_NUMBER;
  ------------------
  |  |   41|  9.85k|#define CURLMULTI_MAGIC_NUMBER 0x000bab1e
  ------------------
  237|       |
  238|       |  /* Initialisation order is important here!
  239|       |   * easy_init() does a lazy check on curl_global_init() which sets
  240|       |   * up platform specific things we need. For example calling curlx_pnow()
  241|       |   * before this is not safe. */
  242|  9.85k|  multi->admin = curl_easy_init();
  243|  9.85k|  if(!multi->admin) {
  ------------------
  |  Branch (243:6): [True: 27, False: 9.82k]
  ------------------
  244|     27|    curlx_free(multi);
  ------------------
  |  | 1503|     27|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  245|     27|    return NULL;
  246|     27|  }
  247|  9.82k|  multi->admin->multi = multi;
  248|  9.82k|  multi->admin->state.internal = TRUE;
  ------------------
  |  |  986|  9.82k|#define TRUE true
  ------------------
  249|       |
  250|       |  /* Now we can use curlx_* things safely */
  251|  9.82k|  curlx_pnow(&created);
  252|  9.82k|  Curl_timeouts_init(&multi->timeouts, &created);
  253|  9.82k|  multi_timeouts_init(multi->admin);
  254|       |
  255|  9.82k|  Curl_dnscache_init(&multi->dnscache, dnssize);
  256|  9.82k|  Curl_mntfy_init(multi);
  257|  9.82k|  Curl_multi_ev_init(multi, ev_hashsize);
  258|  9.82k|  Curl_uint32_tbl_init(&multi->xfers);
  259|  9.82k|  Curl_uint32_bset_init(&multi->process);
  260|  9.82k|  Curl_uint32_bset_init(&multi->dirty);
  261|  9.82k|  Curl_uint32_bset_init(&multi->pending);
  262|  9.82k|  Curl_uint32_bset_init(&multi->msgsent);
  263|  9.82k|  Curl_hash_init(&multi->proto_hash, 23, CURL_HASH_TYPE_BYTES, ph_freeentry);
  264|  9.82k|  Curl_cshutdn_init(&multi->cshutdn);
  265|       |
  266|  9.82k|  multi->multiplexing = TRUE;
  ------------------
  |  |  986|  9.82k|#define TRUE true
  ------------------
  267|  9.82k|  multi->max_concurrent_streams = 100;
  268|  9.82k|#ifdef ENABLE_WAKEUP
  269|  9.82k|  multi->wakeup_pair[0] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  9.82k|#define CURL_SOCKET_BAD (-1)
  ------------------
  270|  9.82k|  multi->wakeup_pair[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  9.82k|#define CURL_SOCKET_BAD (-1)
  ------------------
  271|  9.82k|#endif
  272|  9.82k|#ifdef ENABLE_INTERNAL_WAKEUP
  273|  9.82k|  multi->wakeup_internal[0] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  9.82k|#define CURL_SOCKET_BAD (-1)
  ------------------
  274|  9.82k|  multi->wakeup_internal[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  9.82k|#define CURL_SOCKET_BAD (-1)
  ------------------
  275|  9.82k|#endif
  276|       |
  277|  9.82k|  if(Curl_uint32_bset_resize(&multi->process, xfer_table_size) ||
  ------------------
  |  Branch (277:6): [True: 13, False: 9.81k]
  ------------------
  278|  9.81k|     Curl_uint32_bset_resize(&multi->pending, xfer_table_size) ||
  ------------------
  |  Branch (278:6): [True: 13, False: 9.80k]
  ------------------
  279|  9.80k|     Curl_uint32_bset_resize(&multi->dirty, xfer_table_size) ||
  ------------------
  |  Branch (279:6): [True: 11, False: 9.79k]
  ------------------
  280|  9.79k|     Curl_uint32_bset_resize(&multi->msgsent, xfer_table_size) ||
  ------------------
  |  Branch (280:6): [True: 4, False: 9.78k]
  ------------------
  281|  9.78k|     Curl_uint32_tbl_resize(&multi->xfers, xfer_table_size))
  ------------------
  |  Branch (281:6): [True: 6, False: 9.78k]
  ------------------
  282|     47|    goto error;
  283|       |
  284|  9.78k|#ifdef DEBUGBUILD
  285|  9.78k|  {
  286|  9.78k|    const char *p;
  287|  9.78k|    if(getenv("CURL_DEBUG"))
  ------------------
  |  Branch (287:8): [True: 0, False: 9.78k]
  ------------------
  288|      0|      multi->admin->set.verbose = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  289|  9.78k|    p = getenv("CURL_DBG_MAX_TOTAL_CONNECTIONS");
  290|  9.78k|    if(p) {
  ------------------
  |  Branch (290:8): [True: 0, False: 9.78k]
  ------------------
  291|      0|      curl_off_t l;
  292|      0|      if(!curlx_str_number(&p, &l, UINT32_MAX)) {
  ------------------
  |  Branch (292:10): [True: 0, False: 0]
  ------------------
  293|      0|        multi->max_total_connections = (uint32_t)l;
  294|      0|      }
  295|      0|    }
  296|  9.78k|  }
  297|  9.78k|#endif
  298|  9.78k|  Curl_uint32_tbl_add(&multi->xfers, multi->admin, &multi->admin->mid);
  299|  9.78k|  Curl_uint32_bset_add(&multi->process, multi->admin->mid);
  300|       |
  301|  9.78k|  Curl_cpool_init(&multi->cpool, NULL, chashsize);
  302|       |
  303|  9.78k|#ifdef USE_SSL
  304|  9.78k|  if(Curl_ssl_scache_create(sesssize, 2, &multi->ssl_scache))
  ------------------
  |  Branch (304:6): [True: 5, False: 9.77k]
  ------------------
  305|      5|    goto error;
  306|       |#else
  307|       |  (void)sesssize;
  308|       |#endif
  309|       |
  310|       |#ifdef USE_WINSOCK
  311|       |  multi->wsa_event = WSACreateEvent();
  312|       |  if(multi->wsa_event == WSA_INVALID_EVENT)
  313|       |    goto error;
  314|       |#endif
  315|  9.77k|#ifdef ENABLE_WAKEUP
  316|       |  /* When enabled, rely on this to work. We ignore this in previous
  317|       |   * versions, but that seems an unnecessary complication. */
  318|  9.77k|  if(Curl_wakeup_init(multi->wakeup_pair, TRUE) < 0)
  ------------------
  |  |  986|  9.77k|#define TRUE true
  ------------------
  |  Branch (318:6): [True: 0, False: 9.77k]
  ------------------
  319|      0|    goto error;
  320|  9.77k|#endif
  321|  9.77k|#ifdef ENABLE_INTERNAL_WAKEUP
  322|  9.77k|  if(Curl_wakeup_init(multi->wakeup_internal, TRUE) < 0)
  ------------------
  |  |  986|  9.77k|#define TRUE true
  ------------------
  |  Branch (322:6): [True: 0, False: 9.77k]
  ------------------
  323|      0|    goto error;
  324|  9.77k|#endif
  325|       |
  326|  9.77k|  if(Curl_probeipv6(multi))
  ------------------
  |  Branch (326:6): [True: 0, False: 9.77k]
  ------------------
  327|      0|    goto error;
  328|       |
  329|  9.77k|#ifdef USE_RESOLV_THREADED
  330|  9.77k|  if(xfer_table_size < CURL_XFER_TABLE_SIZE) { /* easy multi */
  ------------------
  |  |   53|  9.77k|#define CURL_XFER_TABLE_SIZE 128
  ------------------
  |  Branch (330:6): [True: 0, False: 9.77k]
  ------------------
  331|      0|    if(Curl_async_thrdd_multi_init(multi, 0, 2, 10))
  ------------------
  |  Branch (331:8): [True: 0, False: 0]
  ------------------
  332|      0|      goto error;
  333|      0|  }
  334|  9.77k|  else { /* real multi handle */
  335|  9.77k|    if(Curl_async_thrdd_multi_init(multi, 0, 20, 2000))
  ------------------
  |  Branch (335:8): [True: 16, False: 9.76k]
  ------------------
  336|     16|      goto error;
  337|  9.77k|  }
  338|  9.76k|#endif
  339|       |
  340|  9.76k|  return multi;
  341|       |
  342|     68|error:
  343|       |
  344|     68|#ifdef USE_RESOLV_THREADED
  345|     68|  Curl_async_thrdd_multi_destroy(multi, TRUE);
  ------------------
  |  |  986|     68|#define TRUE true
  ------------------
  346|     68|#endif
  347|     68|  Curl_multi_ev_cleanup(multi);
  348|     68|  Curl_hash_destroy(&multi->proto_hash);
  349|     68|  Curl_dnscache_destroy(&multi->dnscache);
  350|     68|  Curl_cpool_destroy(&multi->cpool, multi->admin);
  351|     68|  Curl_cshutdn_destroy(&multi->cshutdn, multi->admin);
  352|     68|#ifdef USE_SSL
  353|     68|  Curl_ssl_scache_destroy(multi->ssl_scache);
  354|     68|#endif
  355|     68|  if(multi->admin) {
  ------------------
  |  Branch (355:6): [True: 68, False: 0]
  ------------------
  356|     68|    Curl_multi_ev_xfer_done(multi, multi->admin);
  357|     68|    multi->admin->multi = NULL;
  358|     68|    Curl_close(&multi->admin);
  359|     68|  }
  360|     68|  Curl_mntfy_cleanup(multi);
  361|       |
  362|     68|  Curl_uint32_bset_destroy(&multi->process);
  363|     68|  Curl_uint32_bset_destroy(&multi->dirty);
  364|     68|  Curl_uint32_bset_destroy(&multi->pending);
  365|     68|  Curl_uint32_bset_destroy(&multi->msgsent);
  366|     68|  Curl_uint32_tbl_destroy(&multi->xfers);
  367|     68|#ifdef ENABLE_WAKEUP
  368|     68|  Curl_wakeup_destroy(multi->wakeup_pair);
  369|     68|#endif
  370|     68|#ifdef ENABLE_INTERNAL_WAKEUP
  371|     68|  Curl_wakeup_destroy(multi->wakeup_internal);
  372|     68|#endif
  373|       |
  374|     68|  curlx_free(multi);
  ------------------
  |  | 1503|     68|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  375|       |  return NULL;
  376|  9.77k|}
curl_multi_init:
  379|  9.91k|{
  380|  9.91k|  return Curl_multi_handle(CURL_XFER_TABLE_SIZE,
  ------------------
  |  |   53|  9.91k|#define CURL_XFER_TABLE_SIZE 128
  ------------------
  381|  9.91k|                           CURL_SOCKET_HASH_TABLE_SIZE,
  ------------------
  |  |   59|  9.91k|#define CURL_SOCKET_HASH_TABLE_SIZE 911
  ------------------
  382|  9.91k|                           CURL_CONNECTION_HASH_SIZE,
  ------------------
  |  |   63|  9.91k|#define CURL_CONNECTION_HASH_SIZE 97
  ------------------
  383|  9.91k|                           CURL_DNS_HASH_SIZE,
  ------------------
  |  |   67|  9.91k|#define CURL_DNS_HASH_SIZE 71
  ------------------
  384|  9.91k|                           CURL_TLS_SESSION_SIZE);
  ------------------
  |  |   71|  9.91k|#define CURL_TLS_SESSION_SIZE 25
  ------------------
  385|  9.91k|}
Curl_is_connecting:
  402|   352k|{
  403|   352k|  return (data->mstate < MSTATE_DO) || data->state.still_connecting;
  ------------------
  |  Branch (403:10): [True: 328k, False: 23.9k]
  |  Branch (403:40): [True: 0, False: 23.9k]
  ------------------
  404|   352k|}
Curl_multi_add_handle:
  473|  9.76k|{
  474|  9.76k|  CURLMcode mresult;
  475|       |
  476|       |  /* Prevent users from adding same easy handle more than once and prevent
  477|       |     adding to more than one multi stack */
  478|  9.76k|  if(data->multi)
  ------------------
  |  Branch (478:6): [True: 0, False: 9.76k]
  ------------------
  479|      0|    return CURLM_ADDED_ALREADY;
  480|       |
  481|  9.76k|  if(multi->dead) {
  ------------------
  |  Branch (481:6): [True: 0, False: 9.76k]
  ------------------
  482|       |    /* a "dead" handle cannot get added transfers while any existing easy
  483|       |       handles are still alive - but if there are none alive anymore, it is
  484|       |       fine to start over and unmark the "deadness" of this handle.
  485|       |       This means only the admin handle MUST be present. */
  486|      0|    if((Curl_uint32_tbl_count(&multi->xfers) != 1) ||
  ------------------
  |  Branch (486:8): [True: 0, False: 0]
  ------------------
  487|      0|       !Curl_uint32_tbl_contains(&multi->xfers, 0))
  ------------------
  |  Branch (487:8): [True: 0, False: 0]
  ------------------
  488|      0|      return CURLM_ABORTED_BY_CALLBACK;
  489|      0|    multi->dead = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  490|      0|    Curl_uint32_bset_clear(&multi->process);
  491|      0|    Curl_uint32_bset_clear(&multi->dirty);
  492|      0|    Curl_uint32_bset_clear(&multi->pending);
  493|      0|    Curl_uint32_bset_clear(&multi->msgsent);
  494|      0|  }
  495|       |
  496|       |  /* if the handle has a connection still attached (it is/was a connect-only
  497|       |     handle used with curl_easy_send/recv) then disconnect now */
  498|  9.76k|  if(data->conn) {
  ------------------
  |  Branch (498:6): [True: 0, False: 9.76k]
  ------------------
  499|      0|    struct connectdata *conn = data->conn;
  500|      0|    Curl_detach_connection(data);
  501|      0|    Curl_conn_close(data, conn, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  502|      0|  }
  503|       |
  504|  9.76k|  if(data->multi_easy) {
  ------------------
  |  Branch (504:6): [True: 0, False: 9.76k]
  ------------------
  505|       |    /* if this easy handle was previously used for curl_easy_perform(), there
  506|       |       is a private multi handle here that we can kill */
  507|      0|    curl_multi_cleanup(data->multi_easy);
  508|      0|    data->multi_easy = NULL;
  509|      0|  }
  510|       |
  511|       |  /* Insert the easy into the multi->xfers table, assigning it a `mid`. */
  512|  9.76k|  if(multi_xfers_add(multi, data))
  ------------------
  |  Branch (512:6): [True: 0, False: 9.76k]
  ------------------
  513|      0|    return CURLM_OUT_OF_MEMORY;
  514|       |
  515|       |  /* Initialize timeouts for this handle */
  516|  9.76k|  multi_timeouts_init(data);
  517|       |
  518|       |  /*
  519|       |   * No failure allowed in this function beyond this point. No modification
  520|       |   * of easy nor multi handle allowed before this except for potential
  521|       |   * multi's connection pool growing which will not be undone in this
  522|       |   * function no matter what.
  523|       |   */
  524|  9.76k|  if(data->set.errorbuffer)
  ------------------
  |  Branch (524:6): [True: 0, False: 9.76k]
  ------------------
  525|      0|    data->set.errorbuffer[0] = 0;
  526|       |
  527|  9.76k|  data->state.os_errno = 0;
  528|       |
  529|       |  /* make the Curl_easy refer back to this multi handle - before
  530|       |     Curl_expire() is called. */
  531|  9.76k|  data->multi = multi;
  532|       |
  533|       |  /* set the easy handle */
  534|  9.76k|  multistate(data, MSTATE_INIT);
  ------------------
  |  |  196|  9.76k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
  535|       |  /* not yet passed INIT state */
  536|  9.76k|  data->state.really_alive = FALSE;
  ------------------
  |  |  989|  9.76k|#define FALSE false
  ------------------
  537|       |
  538|       |#ifdef USE_LIBPSL
  539|       |  /* Do the same for PSL. */
  540|       |  if(data->share && (data->share->specifier & (1 << CURL_LOCK_DATA_PSL)))
  541|       |    data->psl = &data->share->psl;
  542|       |  else
  543|       |    data->psl = &multi->psl;
  544|       |#endif
  545|       |
  546|       |  /* add the easy handle to the process set */
  547|  9.76k|  Curl_uint32_bset_add(&multi->process, data->mid);
  548|  9.76k|  ++multi->xfers_alive;
  549|  9.76k|  ++multi->xfers_total_ever;
  550|       |
  551|  9.76k|  Curl_cpool_xfer_init(data);
  552|  9.76k|  multi_warn_debug(multi, data);
  553|       |
  554|       |  /* Make sure the new handle will run */
  555|  9.76k|  Curl_multi_mark_dirty(data);
  556|       |
  557|       |  /* Necessary in event based processing, where dirty handles trigger
  558|       |   * a timeout callback invocation. */
  559|  9.76k|  mresult = Curl_update_timer(multi);
  560|  9.76k|  if(mresult) {
  ------------------
  |  Branch (560:6): [True: 0, False: 9.76k]
  ------------------
  561|       |    /* undo the additions above */
  562|      0|    Curl_uint32_bset_remove(&multi->process, data->mid);
  563|      0|    Curl_uint32_bset_remove(&multi->dirty, data->mid);
  564|      0|    --multi->xfers_alive;
  565|      0|    data->multi = NULL; /* not anymore */
  566|      0|    Curl_uint32_tbl_remove(&multi->xfers, data->mid);
  567|      0|    data->mid = UINT32_MAX;
  568|      0|    return mresult;
  569|      0|  }
  570|       |
  571|       |  /* The admin handle only ever has default timeouts set. To improve the
  572|       |     state somewhat we clone the timeouts from each added handle so that the
  573|       |     admin handle always has the same timeouts as the most recently added
  574|       |     easy handle. */
  575|  9.76k|  multi->admin->set.timeout = data->set.timeout;
  576|  9.76k|  multi->admin->set.server_response_timeout =
  577|  9.76k|    data->set.server_response_timeout;
  578|  9.76k|  multi->admin->set.no_signal = data->set.no_signal;
  579|       |
  580|  9.76k|  CURL_TRC_M(data, "added to multi, mid=%u, running=%u, total=%u",
  ------------------
  |  |  148|  9.76k|  do {                                   \
  |  |  149|  9.76k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.76k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.76k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  19.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.76k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 965, False: 8.79k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  19.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 965, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    965|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.76k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    965|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 191, False: 774]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.76k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
  581|  9.76k|             data->mid, multi_xfers_running(multi),
  582|  9.76k|             Curl_uint32_tbl_count(&multi->xfers));
  583|  9.76k|  return CURLM_OK;
  584|  9.76k|}
curl_multi_add_handle:
  587|  9.76k|{
  588|  9.76k|  struct Curl_mapi_guard guard;
  589|  9.76k|  CURLMcode mresult;
  590|       |
  591|  9.76k|  if(CURL_MAPI_ENTER(&guard, m, multi_add_handle, &mresult)) {
  ------------------
  |  |  190|  9.76k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 9.76k, False: 0]
  |  |  |  Branch (190:50): [True: 9.76k, False: 0]
  |  |  ------------------
  ------------------
  592|  9.76k|    struct Curl_easy *data = curl;
  593|       |    /* Verify that we got a somewhat good easy handle too */
  594|  9.76k|    if(!GOOD_EASY_HANDLE(data) || data->state.internal)
  ------------------
  |  |   34|  19.5k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|  9.76k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|  9.76k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:5): [True: 9.76k, False: 0]
  |  |  |  Branch (34:12): [True: 9.76k, False: 0]
  |  |  ------------------
  |  |   35|  19.5k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (594:8): [True: 0, False: 9.76k]
  |  Branch (594:9): [True: 0, False: 0]
  |  Branch (594:9): [True: 0, False: 0]
  |  Branch (594:35): [True: 0, False: 9.76k]
  ------------------
  595|      0|      mresult = CURLM_BAD_EASY_HANDLE;
  596|  9.76k|    else
  597|  9.76k|      mresult = Curl_multi_add_handle(m, data);
  598|  9.76k|  }
  599|  9.76k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  9.76k|  Curl_mapi_leave(g)
  ------------------
  600|  9.76k|  return mresult;
  601|  9.76k|}
Curl_multi_remove_handle:
  769|  9.76k|{
  770|  9.76k|  CURLMcode mresult;
  771|  9.76k|  uint32_t mid;
  772|       |
  773|       |  /* Prevent users from trying to remove same easy handle more than once */
  774|  9.76k|  if(!data->multi)
  ------------------
  |  Branch (774:6): [True: 0, False: 9.76k]
  ------------------
  775|      0|    return CURLM_OK; /* it is already removed so let's say it is fine! */
  776|       |
  777|       |  /* Prevent users from trying to remove an easy handle from the wrong multi */
  778|  9.76k|  if(data->multi != multi)
  ------------------
  |  Branch (778:6): [True: 0, False: 9.76k]
  ------------------
  779|      0|    return CURLM_BAD_EASY_HANDLE;
  780|       |
  781|  9.76k|  if(data->mid == UINT32_MAX) {
  ------------------
  |  Branch (781:6): [True: 0, False: 9.76k]
  ------------------
  782|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (782:5): [Folded, False: 0]
  |  Branch (782:5): [Folded, False: 0]
  ------------------
  783|      0|    return CURLM_INTERNAL_ERROR;
  784|      0|  }
  785|  9.76k|  if(Curl_uint32_tbl_get(&multi->xfers, data->mid) != data) {
  ------------------
  |  Branch (785:6): [True: 0, False: 9.76k]
  ------------------
  786|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (786:5): [Folded, False: 0]
  |  Branch (786:5): [Folded, False: 0]
  ------------------
  787|      0|    return CURLM_INTERNAL_ERROR;
  788|      0|  }
  789|       |
  790|  9.76k|  if(data->conn) {
  ------------------
  |  Branch (790:6): [True: 1.69k, False: 8.06k]
  ------------------
  791|  1.69k|    bool premature = (data->mstate < MSTATE_COMPLETED);
  792|       |
  793|       |    /* If the 'state' is not INIT or COMPLETED, we might need to do something
  794|       |       nice to put the easy_handle in a good known state when this returns. */
  795|  1.69k|    if(premature && (data->mstate > MSTATE_DO))
  ------------------
  |  Branch (795:8): [True: 1.69k, False: 0]
  |  Branch (795:21): [True: 806, False: 887]
  ------------------
  796|    806|      streamclose(data->conn);
  ------------------
  |  |   71|    806|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|    806|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
  797|       |
  798|       |    /* multi_done() clears the association between the easy handle and the
  799|       |       connection.
  800|       |       Note that this ignores the return code because there is
  801|       |       nothing really useful to do with it anyway! */
  802|  1.69k|    (void)multi_done(data, (CURLcode)data->done, premature);
  803|  1.69k|  }
  804|       |
  805|       |  /* The timer must be shut down before data->multi is set to NULL, else
  806|       |     data's splaynode would remain in the splay tree after curl_easy_cleanup is
  807|       |     called. Do it after multi_done() in case that sets another time! */
  808|  9.76k|  Curl_expire_clear_all(data);
  809|       |
  810|       |  /* In MSGSENT, it was deducted from `multi->xfers_alive` already. */
  811|  9.76k|  if(data->mstate != MSTATE_MSGSENT)
  ------------------
  |  Branch (811:6): [True: 1.70k, False: 8.05k]
  ------------------
  812|  1.70k|    --multi->xfers_alive;
  813|       |
  814|  9.76k|  if(data->state.really_alive) {
  ------------------
  |  Branch (814:6): [True: 1.70k, False: 8.05k]
  ------------------
  815|  1.70k|    data->state.really_alive = FALSE;
  ------------------
  |  |  989|  1.70k|#define FALSE false
  ------------------
  816|  1.70k|    --multi->xfers_really_alive;
  817|  1.70k|    if(!multi->xfers_really_alive)
  ------------------
  |  Branch (817:8): [True: 1.70k, False: 0]
  ------------------
  818|  1.70k|      (void)multi_assess_wakeup(multi);
  819|  1.70k|  }
  820|       |
  821|  9.76k|  Curl_wildcard_dtor(&data->wildcard);
  822|       |
  823|  9.76k|  data->mstate = MSTATE_COMPLETED;
  824|       |
  825|       |  /* Remove the association between the connection and the handle */
  826|  9.76k|  Curl_detach_connection(data);
  827|       |
  828|       |  /* Tell event handling that this transfer is definitely going away */
  829|  9.76k|  Curl_multi_ev_xfer_done(multi, data);
  830|       |  /* Remove it from any outstanding notifications */
  831|  9.76k|  Curl_mntfy_remove(data);
  832|       |
  833|  9.76k|  if(data->set.connect_only) {
  ------------------
  |  Branch (833:6): [True: 0, False: 9.76k]
  ------------------
  834|      0|    if(data->multi_easy) {
  ------------------
  |  Branch (834:8): [True: 0, False: 0]
  ------------------
  835|      0|      if(data->state.last_conn_id != -1) {
  ------------------
  |  Branch (835:10): [True: 0, False: 0]
  ------------------
  836|       |        /* Mark any connect-only connection for closure */
  837|      0|        struct connectdata *conn;
  838|      0|        (void)Curl_getconnectinfo(data, &conn);
  839|      0|        if(conn && conn->bits.connect_only)
  ------------------
  |  Branch (839:12): [True: 0, False: 0]
  |  Branch (839:20): [True: 0, False: 0]
  ------------------
  840|      0|          connclose(conn);
  ------------------
  |  |   72|      0|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   66|      0|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
  841|      0|      }
  842|      0|    }
  843|      0|    else {
  844|       |      /* This removes a handle that was part the multi interface that used
  845|       |         CONNECT_ONLY, that connection is now left alive but since this handle
  846|       |         has bits.close set nothing can use that connection anymore and it is
  847|       |         forbidden from reuse. This easy handle cannot find the connection
  848|       |         anymore once removed from the multi handle
  849|       |
  850|       |         Better close the connection here, at once. */
  851|      0|      struct connectdata *conn;
  852|      0|      (void)Curl_getconnectinfo(data, &conn);
  853|      0|      if(conn)
  ------------------
  |  Branch (853:10): [True: 0, False: 0]
  ------------------
  854|      0|        Curl_conn_close(data, conn, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  855|      0|    }
  856|      0|  }
  857|       |
  858|       |#ifdef USE_LIBPSL
  859|       |  /* Remove the PSL association. */
  860|       |  if(data->psl == &multi->psl)
  861|       |    data->psl = NULL;
  862|       |#endif
  863|       |
  864|       |  /* clear the association to this multi handle */
  865|  9.76k|  mid = data->mid;
  866|  9.76k|  DEBUGASSERT(Curl_uint32_tbl_contains(&multi->xfers, mid));
  ------------------
  |  | 1016|  9.76k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (866:3): [True: 0, False: 9.76k]
  |  Branch (866:3): [True: 9.76k, False: 0]
  ------------------
  867|  9.76k|  Curl_uint32_tbl_remove(&multi->xfers, mid);
  868|  9.76k|  Curl_uint32_bset_remove(&multi->process, mid);
  869|  9.76k|  Curl_uint32_bset_remove(&multi->dirty, mid);
  870|  9.76k|  Curl_uint32_bset_remove(&multi->pending, mid);
  871|  9.76k|  Curl_uint32_bset_remove(&multi->msgsent, mid);
  872|  9.76k|  data->multi = NULL;
  873|  9.76k|  data->mid = UINT32_MAX;
  874|  9.76k|  data->master_mid = UINT32_MAX;
  875|       |
  876|       |  /* A pending transfer *might* be able to run now. */
  877|  9.76k|  multi_schedule_pending(multi);
  878|  9.76k|  mresult = Curl_update_timer(multi);
  879|  9.76k|  if(mresult)
  ------------------
  |  Branch (879:6): [True: 0, False: 9.76k]
  ------------------
  880|      0|    return mresult;
  881|       |
  882|  9.76k|  mresult = multi_assess_wakeup(multi);
  883|  9.76k|  if(mresult) {
  ------------------
  |  Branch (883:6): [True: 0, False: 9.76k]
  ------------------
  884|      0|    failf(data, "error enabling wakeup listening: %d", mresult);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  885|      0|    return mresult;
  886|      0|  }
  887|       |
  888|  9.76k|  CURL_TRC_M(data, "removed from multi, mid=%u, running=%u, total=%u",
  ------------------
  |  |  148|  9.76k|  do {                                   \
  |  |  149|  9.76k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.76k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.76k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  19.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.76k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 965, False: 8.79k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  19.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 965, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    965|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.76k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    965|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 191, False: 774]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.76k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
  889|  9.76k|             mid, multi_xfers_running(multi),
  890|  9.76k|             Curl_uint32_tbl_count(&multi->xfers));
  891|  9.76k|  return CURLM_OK;
  892|  9.76k|}
curl_multi_remove_handle:
  895|  9.76k|{
  896|  9.76k|  struct Curl_mapi_guard guard;
  897|  9.76k|  CURLMcode mresult;
  898|       |
  899|  9.76k|  if(CURL_MAPI_ENTER(&guard, m, multi_remove_handle, &mresult)) {
  ------------------
  |  |  190|  9.76k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 9.76k, False: 0]
  |  |  |  Branch (190:50): [True: 9.76k, False: 0]
  |  |  ------------------
  ------------------
  900|  9.76k|    struct Curl_easy *data = curl;
  901|  9.76k|    if(!GOOD_EASY_HANDLE(data) || data->state.internal)
  ------------------
  |  |   34|  19.5k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|  9.76k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|  9.76k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:5): [True: 9.76k, False: 0]
  |  |  |  Branch (34:12): [True: 9.76k, False: 0]
  |  |  ------------------
  |  |   35|  19.5k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (901:8): [True: 0, False: 9.76k]
  |  Branch (901:9): [True: 0, False: 0]
  |  Branch (901:9): [True: 0, False: 0]
  |  Branch (901:35): [True: 0, False: 9.76k]
  ------------------
  902|      0|      mresult = CURLM_BAD_EASY_HANDLE;
  903|  9.76k|    else
  904|  9.76k|      mresult = Curl_multi_remove_handle(m, data);
  905|  9.76k|  }
  906|  9.76k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  9.76k|  Curl_mapi_leave(g)
  ------------------
  907|  9.76k|  return mresult;
  908|  9.76k|}
Curl_multiplex_wanted:
  912|  9.40k|{
  913|  9.40k|  return multi && multi->multiplexing;
  ------------------
  |  Branch (913:10): [True: 9.40k, False: 0]
  |  Branch (913:19): [True: 9.40k, False: 0]
  ------------------
  914|  9.40k|}
Curl_detach_connection:
  923|  57.9k|{
  924|  57.9k|  struct connectdata *conn = data->conn;
  925|  57.9k|  if(conn) {
  ------------------
  |  Branch (925:6): [True: 20.3k, False: 37.5k]
  ------------------
  926|       |    /* this should never happen, prevent underflow */
  927|  20.3k|    DEBUGASSERT(conn->attached_xfers);
  ------------------
  |  | 1016|  20.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (927:5): [True: 0, False: 20.3k]
  |  Branch (927:5): [True: 20.3k, False: 0]
  ------------------
  928|  20.3k|    if(conn->attached_xfers) {
  ------------------
  |  Branch (928:8): [True: 20.3k, False: 0]
  ------------------
  929|  20.3k|      conn->attached_xfers--;
  930|  20.3k|      if(!conn->attached_xfers)
  ------------------
  |  Branch (930:10): [True: 20.3k, False: 0]
  ------------------
  931|  20.3k|        conn->attached_multi = NULL;
  932|  20.3k|    }
  933|  20.3k|  }
  934|  57.9k|  data->conn = NULL;
  935|  57.9k|}
Curl_attach_connection:
  947|  20.3k|{
  948|  20.3k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  20.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (948:3): [True: 0, False: 20.3k]
  |  Branch (948:3): [True: 20.3k, False: 0]
  ------------------
  949|  20.3k|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1016|  20.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (949:3): [True: 0, False: 20.3k]
  |  Branch (949:3): [True: 20.3k, False: 0]
  ------------------
  950|  20.3k|  DEBUGASSERT(conn);
  ------------------
  |  | 1016|  20.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (950:3): [True: 0, False: 20.3k]
  |  Branch (950:3): [True: 20.3k, False: 0]
  ------------------
  951|  20.3k|  DEBUGASSERT(conn->attached_xfers < UINT32_MAX);
  ------------------
  |  | 1016|  20.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (951:3): [True: 0, False: 20.3k]
  |  Branch (951:3): [True: 20.3k, False: 0]
  ------------------
  952|  20.3k|  data->conn = conn;
  953|  20.3k|  if(matched) {
  ------------------
  |  Branch (953:6): [True: 9.39k, False: 10.9k]
  ------------------
  954|  9.39k|    data->state.last_conn_id = conn->connection_id;
  955|  9.39k|    data->state.last_cpid = conn->cpid;
  956|  9.39k|  }
  957|  10.9k|  else
  958|  20.3k|    DEBUGASSERT(!data->mid); /* admin handle */
  ------------------
  |  | 1016|  20.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (958:5): [True: 0, False: 10.9k]
  |  Branch (958:5): [True: 10.9k, False: 0]
  ------------------
  959|  20.3k|  conn->attached_xfers++;
  960|       |  /* all attached transfers must be from the same multi */
  961|  20.3k|  if(!conn->attached_multi)
  ------------------
  |  Branch (961:6): [True: 20.3k, False: 0]
  ------------------
  962|  20.3k|    conn->attached_multi = data->multi;
  963|  20.3k|  DEBUGASSERT(conn->attached_multi == data->multi);
  ------------------
  |  | 1016|  20.3k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (963:3): [True: 0, False: 20.3k]
  |  Branch (963:3): [True: 20.3k, False: 0]
  ------------------
  964|       |
  965|  20.3k|  if(conn->scheme && conn->scheme->run->attach)
  ------------------
  |  Branch (965:6): [True: 20.3k, False: 0]
  |  Branch (965:22): [True: 0, False: 20.3k]
  ------------------
  966|      0|    conn->scheme->run->attach(data, conn);
  967|  20.3k|}
Curl_multi_pollset:
 1161|   138k|{
 1162|   138k|  CURLcode result = CURLE_OK;
 1163|       |
 1164|   138k|  Curl_pollset_reset(ps);
 1165|   138k|#ifdef ENABLE_INTERNAL_WAKEUP
 1166|       |  /* The admin handle always listens on the wakeup socket when there
 1167|       |   * are transfers alive. */
 1168|   138k|  if(data->multi && (data == data->multi->admin) &&
  ------------------
  |  Branch (1168:6): [True: 138k, False: 0]
  |  Branch (1168:21): [True: 66.7k, False: 71.4k]
  ------------------
 1169|  66.7k|     data->multi->xfers_really_alive) {
  ------------------
  |  Branch (1169:6): [True: 58.7k, False: 8.02k]
  ------------------
 1170|  58.7k|    CURL_TRC_M(data, "adding wakeup, %u xfers really alive",
  ------------------
  |  |  148|  58.7k|  do {                                   \
  |  |  149|  58.7k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  58.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  58.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|   117k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 58.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 58.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|   117k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  58.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  58.7k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  58.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 58.7k]
  |  |  ------------------
  ------------------
 1171|  58.7k|               data->multi->xfers_really_alive);
 1172|  58.7k|    result = Curl_pollset_add_in(data, ps, data->multi->wakeup_internal[0]);
  ------------------
  |  |  152|  58.7k|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0)
  |  |  ------------------
  |  |  |  |  283|  58.7k|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1173|  58.7k|  }
 1174|   138k|#endif
 1175|       |  /* If the transfer has no connection, this is fine. Happens when
 1176|       |     called via curl_multi_remove_handle() => Curl_multi_ev_assess() =>
 1177|       |     Curl_multi_pollset(). */
 1178|   138k|  if(!result && data->conn) {
  ------------------
  |  Branch (1178:6): [True: 138k, False: 0]
  |  Branch (1178:17): [True: 67.8k, False: 70.3k]
  ------------------
 1179|  67.8k|    switch(data->mstate) {
 1180|      0|    case MSTATE_INIT:
  ------------------
  |  Branch (1180:5): [True: 0, False: 67.8k]
  ------------------
 1181|      0|    case MSTATE_PENDING:
  ------------------
  |  Branch (1181:5): [True: 0, False: 67.8k]
  ------------------
 1182|      0|    case MSTATE_SETUP:
  ------------------
  |  Branch (1182:5): [True: 0, False: 67.8k]
  ------------------
 1183|      0|    case MSTATE_CONNECT:
  ------------------
  |  Branch (1183:5): [True: 0, False: 67.8k]
  ------------------
 1184|       |      /* nothing to poll for yet */
 1185|      0|      break;
 1186|       |
 1187|  59.3k|    case MSTATE_CONNECTING:
  ------------------
  |  Branch (1187:5): [True: 59.3k, False: 8.50k]
  ------------------
 1188|  59.3k|      result = mstate_connecting_pollset(data, ps);
 1189|  59.3k|      break;
 1190|       |
 1191|      0|    case MSTATE_PROTOCONNECT:
  ------------------
  |  Branch (1191:5): [True: 0, False: 67.8k]
  ------------------
 1192|      0|    case MSTATE_PROTOCONNECTING:
  ------------------
  |  Branch (1192:5): [True: 0, False: 67.8k]
  ------------------
 1193|      0|      result = mstate_protocol_pollset(data, ps);
 1194|      0|      break;
 1195|       |
 1196|      0|    case MSTATE_DO:
  ------------------
  |  Branch (1196:5): [True: 0, False: 67.8k]
  ------------------
 1197|      0|    case MSTATE_DOING:
  ------------------
  |  Branch (1197:5): [True: 0, False: 67.8k]
  ------------------
 1198|      0|      result = mstate_do_pollset(data, ps);
 1199|      0|      break;
 1200|       |
 1201|      0|    case MSTATE_DOING_MORE:
  ------------------
  |  Branch (1201:5): [True: 0, False: 67.8k]
  ------------------
 1202|      0|      result = mstate_domore_pollset(data, ps);
 1203|      0|      break;
 1204|       |
 1205|      0|    case MSTATE_DID: /* same as PERFORMING in regard to polling */
  ------------------
  |  Branch (1205:5): [True: 0, False: 67.8k]
  ------------------
 1206|  8.50k|    case MSTATE_PERFORMING:
  ------------------
  |  Branch (1206:5): [True: 8.50k, False: 59.3k]
  ------------------
 1207|  8.50k|      result = mstate_perform_pollset(data, ps);
 1208|  8.50k|      break;
 1209|       |
 1210|      0|    case MSTATE_RATELIMITING:
  ------------------
  |  Branch (1210:5): [True: 0, False: 67.8k]
  ------------------
 1211|      0|      result = mstate_ratelimit_pollset(data, ps);
 1212|      0|      break;
 1213|       |
 1214|      0|    case MSTATE_DONE:
  ------------------
  |  Branch (1214:5): [True: 0, False: 67.8k]
  ------------------
 1215|      0|    case MSTATE_COMPLETED:
  ------------------
  |  Branch (1215:5): [True: 0, False: 67.8k]
  ------------------
 1216|      0|    case MSTATE_MSGSENT:
  ------------------
  |  Branch (1216:5): [True: 0, False: 67.8k]
  ------------------
 1217|       |      /* nothing more to poll for */
 1218|      0|      break;
 1219|       |
 1220|      0|    default:
  ------------------
  |  Branch (1220:5): [True: 0, False: 67.8k]
  ------------------
 1221|      0|      failf(data, "multi_getsock: unexpected multi state %d",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1222|      0|            (int)data->mstate);
 1223|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1223:7): [Folded, False: 0]
  |  Branch (1223:7): [Folded, False: 0]
  ------------------
 1224|      0|      break;
 1225|  67.8k|    }
 1226|  67.8k|  }
 1227|       |
 1228|   138k|  if(result) {
  ------------------
  |  Branch (1228:6): [True: 0, False: 138k]
  ------------------
 1229|      0|    if(result == CURLE_OUT_OF_MEMORY)
  ------------------
  |  Branch (1229:8): [True: 0, False: 0]
  ------------------
 1230|      0|      return CURLM_OUT_OF_MEMORY;
 1231|      0|    failf(data, "error determining pollset: %d", (int)result);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1232|      0|    return CURLM_INTERNAL_ERROR;
 1233|      0|  }
 1234|       |
 1235|   138k|#ifdef CURLVERBOSE
 1236|   138k|  if(CURL_TRC_M_is_verbose(data)) {
  ------------------
  |  |  135|   138k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  ------------------
  |  |  |  |  329|   138k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|   276k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 138k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 17.2k, False: 120k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   276k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 17.2k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  17.2k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|   138k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  17.2k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 7.62k, False: 9.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1237|  7.62k|    size_t timeout_count = multi_timeouts_count(&data->state.timeouts);
 1238|  7.62k|    switch(ps->n) {
 1239|     49|    case 0:
  ------------------
  |  Branch (1239:5): [True: 49, False: 7.57k]
  ------------------
 1240|     49|      CURL_TRC_M(data, "pollset[], timeouts=%zu, paused %d/%d (r/w)",
  ------------------
  |  |  148|     49|  do {                                   \
  |  |  149|     49|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|     49|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|     49|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|     98|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 49, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 49, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|     98|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 49, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|     49|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|     49|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|     49|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 49, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     49|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|     49|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 49]
  |  |  ------------------
  ------------------
 1241|     49|                 timeout_count,
 1242|     49|                 Curl_xfer_send_is_paused(data),
 1243|     49|                 Curl_xfer_recv_is_paused(data));
 1244|     49|      break;
 1245|  7.57k|    case 1:
  ------------------
  |  Branch (1245:5): [True: 7.57k, False: 49]
  ------------------
 1246|  7.57k|      CURL_TRC_M(data, "pollset[fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu",
  ------------------
  |  |  148|  7.57k|  do {                                   \
  |  |  149|  7.57k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  7.57k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  7.57k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  15.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 7.57k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 7.57k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  15.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 7.57k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  7.57k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  7.57k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  7.57k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 7.57k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  30.2k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 7.57k, False: 0]
  |  |  |  Branch (150:28): [True: 15, False: 7.55k]
  |  |  ------------------
  |  |  151|  7.57k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 7.57k]
  |  |  ------------------
  ------------------
 1247|  7.57k|                 ps->sockets[0],
 1248|  7.57k|                 (ps->actions[0] & CURL_POLL_IN) ? "IN" : "",
 1249|  7.57k|                 (ps->actions[0] & CURL_POLL_OUT) ? "OUT" : "",
 1250|  7.57k|                 timeout_count);
 1251|  7.57k|      break;
 1252|      0|    case 2:
  ------------------
  |  Branch (1252:5): [True: 0, False: 7.62k]
  ------------------
 1253|      0|      CURL_TRC_M(data, "pollset[fd=%" FMT_SOCKET_T " %s%s, "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1254|      0|                 "fd=%" FMT_SOCKET_T " %s%s], timeouts=%zu",
 1255|      0|                 ps->sockets[0],
 1256|      0|                 (ps->actions[0] & CURL_POLL_IN) ? "IN" : "",
 1257|      0|                 (ps->actions[0] & CURL_POLL_OUT) ? "OUT" : "",
 1258|      0|                 ps->sockets[1],
 1259|      0|                 (ps->actions[1] & CURL_POLL_IN) ? "IN" : "",
 1260|      0|                 (ps->actions[1] & CURL_POLL_OUT) ? "OUT" : "",
 1261|      0|                 timeout_count);
 1262|      0|      break;
 1263|      0|    default:
  ------------------
  |  Branch (1263:5): [True: 0, False: 7.62k]
  ------------------
 1264|      0|      CURL_TRC_M(data, "pollset[fds=%u], timeouts=%zu", ps->n, timeout_count);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1265|      0|      break;
 1266|  7.62k|    }
 1267|  7.62k|    CURL_TRC_EASY_TIMERS(data);
  ------------------
  |  |  333|  7.62k|  do {                                  \
  |  |  334|  7.62k|    if(CURL_TRC_TIMER_is_verbose(data)) \
  |  |  ------------------
  |  |  |  |  139|  7.62k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  7.62k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  15.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 7.62k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 7.62k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  15.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 7.62k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  7.62k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  7.62k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  7.62k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 7.62k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  335|  7.62k|      Curl_trc_easy_timers(data);       \
  |  |  336|  7.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (336:11): [Folded, False: 7.62k]
  |  |  ------------------
  ------------------
 1268|  7.62k|  }
 1269|   138k|#endif
 1270|       |
 1271|   138k|  return CURLM_OK;
 1272|   138k|}
curl_multi_fdset:
 1277|  54.8k|{
 1278|  54.8k|  struct Curl_mapi_guard guard;
 1279|  54.8k|  CURLMcode mresult;
 1280|       |
 1281|  54.8k|  if(CURL_MAPI_ENTER(&guard, m, multi_fdset, &mresult)) {
  ------------------
  |  |  190|  54.8k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 54.8k, False: 0]
  |  |  |  Branch (190:50): [True: 54.8k, False: 0]
  |  |  ------------------
  ------------------
 1282|       |    /* Scan through all the easy handles to get the file descriptors set.
 1283|       |       Some easy handles may not have connected to the remote host yet,
 1284|       |       and then we must make sure that is done. */
 1285|  54.8k|    struct Curl_multi *multi = m;
 1286|  54.8k|    struct easy_pollset ps;
 1287|  54.8k|    int this_max_fd = -1;
 1288|  54.8k|    unsigned int i;
 1289|  54.8k|    uint32_t mid;
 1290|  54.8k|    (void)exc_fd_set;
 1291|       |
 1292|  54.8k|    Curl_pollset_init(&ps);
 1293|  54.8k|    if(Curl_uint32_bset_first(&multi->process, &mid)) {
  ------------------
  |  Branch (1293:8): [True: 54.8k, False: 0]
  ------------------
 1294|   109k|      do {
 1295|   109k|        struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 1296|       |
 1297|   109k|        if(!data) {
  ------------------
  |  Branch (1297:12): [True: 0, False: 109k]
  ------------------
 1298|      0|          DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1298:11): [Folded, False: 0]
  |  Branch (1298:11): [Folded, False: 0]
  ------------------
 1299|      0|          continue;
 1300|      0|        }
 1301|       |
 1302|   109k|        Curl_multi_pollset(data, &ps);
 1303|   219k|        for(i = 0; i < ps.n; i++) {
  ------------------
  |  Branch (1303:20): [True: 109k, False: 109k]
  ------------------
 1304|   109k|          if(!FDSET_SOCK(ps.sockets[i]))
  ------------------
  |  |   91|   109k|#define FDSET_SOCK(s) ((s) < FD_SETSIZE)
  ------------------
  |  Branch (1304:14): [True: 0, False: 109k]
  ------------------
 1305|       |            /* pretend it does not exist */
 1306|      0|            continue;
 1307|   109k|          if(ps.actions[i] & CURL_POLL_IN)
  ------------------
  |  |  283|   109k|#define CURL_POLL_IN     1
  ------------------
  |  Branch (1307:14): [True: 109k, False: 0]
  ------------------
 1308|   109k|            FD_SET(ps.sockets[i], read_fd_set);
 1309|   109k|          if(ps.actions[i] & CURL_POLL_OUT)
  ------------------
  |  |  284|   109k|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (1309:14): [True: 0, False: 109k]
  ------------------
 1310|   109k|            FD_SET(ps.sockets[i], write_fd_set);
 1311|   109k|          if((int)ps.sockets[i] > this_max_fd)
  ------------------
  |  Branch (1311:14): [True: 109k, False: 0]
  ------------------
 1312|   109k|            this_max_fd = (int)ps.sockets[i];
 1313|   109k|        }
 1314|   109k|      } while(Curl_uint32_bset_next(&multi->process, mid, &mid));
  ------------------
  |  Branch (1314:15): [True: 54.8k, False: 54.8k]
  ------------------
 1315|  54.8k|    }
 1316|       |
 1317|  54.8k|    Curl_cshutdn_setfds(&multi->cshutdn, multi->admin,
 1318|  54.8k|                        read_fd_set, write_fd_set, &this_max_fd);
 1319|       |
 1320|  54.8k|    *max_fd = this_max_fd;
 1321|  54.8k|    Curl_pollset_cleanup(&ps);
 1322|       |
 1323|  54.8k|    mresult = CURLM_OK;
 1324|  54.8k|  }
 1325|  54.8k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  54.8k|  Curl_mapi_leave(g)
  ------------------
 1326|  54.8k|  return mresult;
 1327|  54.8k|}
curl_multi_poll:
 1699|    395|{
 1700|    395|  struct Curl_mapi_guard guard;
 1701|    395|  CURLMcode mresult;
 1702|       |
 1703|    395|  if(CURL_MAPI_ENTER(&guard, m, multi_poll, &mresult)) {
  ------------------
  |  |  190|    395|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 395, False: 0]
  |  |  |  Branch (190:50): [True: 395, False: 0]
  |  |  ------------------
  ------------------
 1704|    395|    mresult = multi_wait(m, extra_fds, extra_nfds, timeout_ms, ret, TRUE);
  ------------------
  |  |  986|    395|#define TRUE true
  ------------------
 1705|    395|  }
 1706|    395|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|    395|  Curl_mapi_leave(g)
  ------------------
 1707|    395|  return mresult;
 1708|    395|}
Curl_multi_wakeup_internal:
 1738|    150|{
 1739|       |  /* This is expected to be invocable from another thread which
 1740|       |   * does NOT outlive the multi handle. Check for sanity. */
 1741|    150|  if(GOOD_MULTI_HANDLE(multi))
  ------------------
  |  |   48|    150|  (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |   41|    150|#define CURLMULTI_MAGIC_NUMBER 0x000bab1e
  |  |  ------------------
  |  |                 (((x) && (x)->magic == CURLMULTI_MAGIC_NUMBER) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|    150|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (48:3): [True: 150, False: 0]
  |  |  |  Branch (48:5): [True: 150, False: 0]
  |  |  |  Branch (48:12): [True: 150, False: 0]
  |  |  ------------------
  |  |   49|    150|  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                 (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (1741:6): [True: 0, False: 0]
  |  Branch (1741:6): [True: 0, False: 0]
  ------------------
 1742|    150|    Curl_wakeup_signal(multi->wakeup_internal);
 1743|      0|  else
 1744|       |    DEBUGASSERT(0);
  ------------------
  |  | 1016|    150|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1744:5): [Folded, False: 0]
  |  Branch (1744:5): [Folded, False: 0]
  ------------------
 1745|    150|}
Curl_multi_connchanged:
 1776|  11.3k|{
 1777|       |  /* May be invoked for a `data->multi` when no multi is present. */
 1778|  11.3k|  if(multi)
  ------------------
  |  Branch (1778:6): [True: 11.3k, False: 0]
  ------------------
 1779|  11.3k|    multi->recheckstate = TRUE;
  ------------------
  |  |  986|  11.3k|#define TRUE true
  ------------------
 1780|  11.3k|}
curl_multi_perform:
 3040|   122k|{
 3041|   122k|  struct Curl_mapi_guard guard;
 3042|   122k|  CURLMcode mresult;
 3043|       |
 3044|   122k|  if(CURL_MAPI_ENTER(&guard, m, multi_perform, &mresult)) {
  ------------------
  |  |  190|   122k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 122k, False: 0]
  |  |  |  Branch (190:50): [True: 122k, False: 0]
  |  |  ------------------
  ------------------
 3045|   122k|    mresult = multi_perform(m, running_handles);
 3046|   122k|  }
 3047|   122k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|   122k|  Curl_mapi_leave(g)
  ------------------
 3048|   122k|  return mresult;
 3049|   122k|}
curl_multi_cleanup:
 3052|  9.76k|{
 3053|  9.76k|  struct Curl_mapi_guard guard;
 3054|  9.76k|  CURLMcode mresult;
 3055|       |
 3056|  9.76k|  if(CURL_MAPI_ENTER(&guard, m, multi_cleanup, &mresult)) {
  ------------------
  |  |  190|  9.76k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 9.76k, False: 0]
  |  |  |  Branch (190:50): [True: 9.76k, False: 0]
  |  |  ------------------
  ------------------
 3057|  9.76k|    struct Curl_multi *multi = m;
 3058|  9.76k|    void *entry;
 3059|  9.76k|    uint32_t mid;
 3060|       |
 3061|       |    /* First remove all remaining easy handles,
 3062|       |     * close internal ones. admin handle is special */
 3063|  9.76k|    if(Curl_uint32_tbl_first(&multi->xfers, &mid, &entry)) {
  ------------------
  |  Branch (3063:8): [True: 9.76k, False: 0]
  ------------------
 3064|  9.76k|      do {
 3065|  9.76k|        struct Curl_easy *data = entry;
 3066|  9.76k|        if(!GOOD_EASY_HANDLE(data)) {
  ------------------
  |  |   34|  9.76k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|  9.76k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|  9.76k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:5): [True: 9.76k, False: 0]
  |  |  |  Branch (34:12): [True: 9.76k, False: 0]
  |  |  ------------------
  |  |   35|  9.76k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (3066:12): [True: 0, False: 9.76k]
  |  Branch (3066:13): [True: 0, False: 0]
  |  Branch (3066:13): [True: 0, False: 0]
  ------------------
 3067|      0|          mresult = CURLM_BAD_HANDLE;
 3068|      0|          goto out;
 3069|      0|        }
 3070|       |
 3071|  9.76k|#ifdef DEBUGBUILD
 3072|  9.76k|        if(mid != data->mid) {
  ------------------
  |  Branch (3072:12): [True: 0, False: 9.76k]
  ------------------
 3073|      0|          CURL_TRC_M(data, "multi_cleanup: still present with mid=%u, "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3074|      0|                     "but unexpected data->mid=%u\n", mid, data->mid);
 3075|      0|          DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3075:11): [Folded, False: 0]
  |  Branch (3075:11): [Folded, False: 0]
  ------------------
 3076|      0|        }
 3077|  9.76k|#endif
 3078|       |
 3079|  9.76k|        if(data == multi->admin)
  ------------------
  |  Branch (3079:12): [True: 9.76k, False: 0]
  ------------------
 3080|  9.76k|          continue;
 3081|       |
 3082|      0|        if(!data->state.done && data->conn)
  ------------------
  |  Branch (3082:12): [True: 0, False: 0]
  |  Branch (3082:33): [True: 0, False: 0]
  ------------------
 3083|       |          /* if DONE was never called for this handle */
 3084|      0|          (void)multi_done(data, CURLE_OK, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3085|       |
 3086|      0|        data->multi = NULL; /* clear the association */
 3087|      0|        Curl_uint32_tbl_remove(&multi->xfers, mid);
 3088|      0|        data->mid = UINT32_MAX;
 3089|       |
 3090|       |#ifdef USE_LIBPSL
 3091|       |        if(data->psl == &multi->psl)
 3092|       |          data->psl = NULL;
 3093|       |#endif
 3094|      0|        if(data->state.internal)
  ------------------
  |  Branch (3094:12): [True: 0, False: 0]
  ------------------
 3095|      0|          Curl_close(&data);
 3096|  9.76k|      } while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry));
  ------------------
  |  Branch (3096:15): [True: 0, False: 9.76k]
  ------------------
 3097|  9.76k|    }
 3098|       |
 3099|  9.76k|#ifdef USE_RESOLV_THREADED
 3100|  9.76k|    Curl_async_thrdd_multi_destroy(multi, !multi->quick_exit);
 3101|  9.76k|#endif
 3102|  9.76k|    Curl_cpool_destroy(&multi->cpool, multi->admin);
 3103|  9.76k|    Curl_cshutdn_destroy(&multi->cshutdn, multi->admin);
 3104|  9.76k|    if(multi->admin) {
  ------------------
  |  Branch (3104:8): [True: 9.76k, False: 0]
  ------------------
 3105|  9.76k|      CURL_TRC_M(multi->admin, "multi_cleanup, closing admin handle, done");
  ------------------
  |  |  148|  9.76k|  do {                                   \
  |  |  149|  9.76k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.76k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.76k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  19.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.76k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 9.76k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  19.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.76k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.76k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
 3106|  9.76k|      multi->admin->multi = NULL;
 3107|  9.76k|      Curl_uint32_tbl_remove(&multi->xfers, multi->admin->mid);
 3108|  9.76k|      Curl_close(&multi->admin);
 3109|  9.76k|    }
 3110|       |
 3111|  9.76k|    multi->magic = 0; /* not good anymore */
 3112|       |
 3113|  9.76k|    Curl_multi_ev_cleanup(multi);
 3114|  9.76k|    Curl_hash_destroy(&multi->proto_hash);
 3115|  9.76k|    Curl_dnscache_destroy(&multi->dnscache);
 3116|  9.76k|    Curl_psl_destroy(&multi->psl);
 3117|  9.76k|#ifdef USE_SSL
 3118|  9.76k|    Curl_ssl_scache_destroy(multi->ssl_scache);
 3119|  9.76k|#endif
 3120|       |
 3121|       |#ifdef USE_WINSOCK
 3122|       |    WSACloseEvent(multi->wsa_event);
 3123|       |#endif
 3124|  9.76k|#ifdef ENABLE_WAKEUP
 3125|  9.76k|  Curl_wakeup_destroy(multi->wakeup_pair);
 3126|  9.76k|#endif
 3127|  9.76k|#ifdef ENABLE_INTERNAL_WAKEUP
 3128|  9.76k|  Curl_wakeup_destroy(multi->wakeup_internal);
 3129|  9.76k|#endif
 3130|       |
 3131|  9.76k|    multi_xfer_bufs_free(multi);
 3132|  9.76k|    Curl_mntfy_cleanup(multi);
 3133|  9.76k|#ifdef DEBUGBUILD
 3134|  9.76k|    if(Curl_uint32_tbl_count(&multi->xfers)) {
  ------------------
  |  Branch (3134:8): [True: 0, False: 9.76k]
  ------------------
 3135|      0|      multi_xfer_tbl_dump(multi);
 3136|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3136:7): [Folded, False: 0]
  |  Branch (3136:7): [Folded, False: 0]
  ------------------
 3137|      0|    }
 3138|  9.76k|#endif
 3139|  9.76k|    Curl_uint32_bset_destroy(&multi->process);
 3140|  9.76k|    Curl_uint32_bset_destroy(&multi->dirty);
 3141|  9.76k|    Curl_uint32_bset_destroy(&multi->pending);
 3142|  9.76k|    Curl_uint32_bset_destroy(&multi->msgsent);
 3143|  9.76k|    Curl_uint32_tbl_destroy(&multi->xfers);
 3144|  9.76k|    curlx_memzero(multi, sizeof(*multi));
 3145|  9.76k|    curlx_free(multi);
  ------------------
  |  | 1503|  9.76k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3146|       |
 3147|  9.76k|    mresult = CURLM_OK;
 3148|  9.76k|  }
 3149|  9.76k|out:
 3150|  9.76k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  9.76k|  Curl_mapi_leave(g)
  ------------------
 3151|  9.76k|  return mresult;
 3152|  9.76k|}
curl_multi_info_read:
 3162|  17.8k|{
 3163|  17.8k|  struct Curl_mapi_guard guard;
 3164|  17.8k|  CURLMsg *msg_result = NULL;
 3165|       |
 3166|  17.8k|  *msgs_in_queue = 0; /* default to none */
 3167|  17.8k|  if(CURL_MAPI_ENTER(&guard, m, multi_info_read, NULL)) {
  ------------------
  |  |  190|  17.8k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 17.8k, False: 0]
  |  |  |  Branch (190:50): [True: 17.8k, False: 0]
  |  |  ------------------
  ------------------
 3168|  17.8k|    struct Curl_multi *multi = m;
 3169|  17.8k|    uint32_t mid;
 3170|  17.8k|    if(Curl_uint32_bset_first(&multi->msgsent, &mid)) {
  ------------------
  |  Branch (3170:8): [True: 8.05k, False: 9.76k]
  ------------------
 3171|  8.05k|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3172|       |
 3173|  8.05k|      DEBUGASSERT(data);
  ------------------
  |  | 1016|  8.05k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3173:7): [True: 0, False: 8.05k]
  |  Branch (3173:7): [True: 8.05k, False: 0]
  ------------------
 3174|  8.05k|      Curl_uint32_bset_remove(&multi->msgsent, mid);
 3175|  8.05k|      *msgs_in_queue =
 3176|  8.05k|        curlx_uztosi(Curl_uint32_bset_count(&multi->msgsent));
 3177|  8.05k|      if(data)
  ------------------
  |  Branch (3177:10): [True: 8.05k, False: 0]
  ------------------
 3178|  8.05k|        msg_result = &data->msg;
 3179|  8.05k|    }
 3180|  17.8k|  }
 3181|  17.8k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  17.8k|  Curl_mapi_leave(g)
  ------------------
 3182|  17.8k|  return msg_result;
 3183|  17.8k|}
Curl_multi_will_close:
 3186|  9.20k|{
 3187|  9.20k|  if(data) {
  ------------------
  |  Branch (3187:6): [True: 9.20k, False: 0]
  ------------------
 3188|  9.20k|    struct Curl_multi *multi = data->multi;
 3189|  9.20k|    if(multi) {
  ------------------
  |  Branch (3189:8): [True: 9.20k, False: 0]
  ------------------
 3190|  9.20k|      CURL_TRC_M(data, "Curl_multi_will_close fd=%" FMT_SOCKET_T, s);
  ------------------
  |  |  148|  9.20k|  do {                                   \
  |  |  149|  9.20k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.20k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.20k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  18.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.20k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 2, False: 9.20k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  18.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.20k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      2|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.20k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.20k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.20k]
  |  |  ------------------
  ------------------
 3191|  9.20k|      Curl_multi_ev_socket_done(multi, data, s);
 3192|  9.20k|    }
 3193|  9.20k|  }
 3194|  9.20k|}
curl_multi_setopt:
 3402|  8.85k|{
 3403|  8.85k|  struct Curl_mapi_guard guard;
 3404|  8.85k|  CURLMcode mresult = CURLM_OK;
 3405|       |
 3406|  8.85k|  if(CURL_MAPI_ENTER(&guard, m, multi_setopt, &mresult)) {
  ------------------
  |  |  190|  8.85k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 8.85k, False: 0]
  |  |  |  Branch (190:50): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
 3407|  8.85k|    struct Curl_multi *multi = m;
 3408|  8.85k|    va_list param;
 3409|  8.85k|    unsigned long uarg;
 3410|  8.85k|    size_t szarg;
 3411|       |
 3412|  8.85k|    va_start(param, option);
 3413|       |
 3414|  8.85k|    switch(option) {
 3415|  2.21k|    case CURLMOPT_SOCKETFUNCTION:
  ------------------
  |  Branch (3415:5): [True: 2.21k, False: 6.64k]
  ------------------
 3416|  2.21k|      multi->socket_cb = va_arg(param, curl_socket_callback);
 3417|  2.21k|      break;
 3418|  2.21k|    case CURLMOPT_SOCKETDATA:
  ------------------
  |  Branch (3418:5): [True: 2.21k, False: 6.64k]
  ------------------
 3419|  2.21k|      multi->socket_userp = va_arg(param, void *);
 3420|  2.21k|      break;
 3421|      0|    case CURLMOPT_PUSHFUNCTION:
  ------------------
  |  Branch (3421:5): [True: 0, False: 8.85k]
  ------------------
 3422|      0|      multi->push_cb = va_arg(param, curl_push_callback);
 3423|      0|      break;
 3424|      0|    case CURLMOPT_PUSHDATA:
  ------------------
  |  Branch (3424:5): [True: 0, False: 8.85k]
  ------------------
 3425|      0|      multi->push_userp = va_arg(param, void *);
 3426|      0|      break;
 3427|      0|    case CURLMOPT_PIPELINING:
  ------------------
  |  Branch (3427:5): [True: 0, False: 8.85k]
  ------------------
 3428|      0|      multi->multiplexing = va_arg(param, long) & CURLPIPE_MULTIPLEX ? 1 : 0;
  ------------------
  |  |   87|      0|#define CURLPIPE_MULTIPLEX 2L
  ------------------
  |  Branch (3428:29): [True: 0, False: 0]
  ------------------
 3429|      0|      break;
 3430|  2.21k|    case CURLMOPT_TIMERFUNCTION:
  ------------------
  |  Branch (3430:5): [True: 2.21k, False: 6.64k]
  ------------------
 3431|  2.21k|      multi->timer_cb = va_arg(param, curl_multi_timer_callback);
 3432|  2.21k|      break;
 3433|  2.21k|    case CURLMOPT_TIMERDATA:
  ------------------
  |  Branch (3433:5): [True: 2.21k, False: 6.64k]
  ------------------
 3434|  2.21k|      multi->timer_userp = va_arg(param, void *);
 3435|  2.21k|      break;
 3436|      0|    case CURLMOPT_MAXCONNECTS:
  ------------------
  |  Branch (3436:5): [True: 0, False: 8.85k]
  ------------------
 3437|      0|      uarg = va_arg(param, unsigned long);
 3438|      0|      if(uarg <= UINT32_MAX)
  ------------------
  |  Branch (3438:10): [True: 0, False: 0]
  ------------------
 3439|      0|        multi->maxconnects = (uint32_t)uarg;
 3440|      0|      break;
 3441|      0|    case CURLMOPT_MAX_HOST_CONNECTIONS:
  ------------------
  |  Branch (3441:5): [True: 0, False: 8.85k]
  ------------------
 3442|      0|      if(!curlx_sltouz(va_arg(param, long), &szarg))
  ------------------
  |  Branch (3442:10): [True: 0, False: 0]
  ------------------
 3443|      0|        mresult = CURLM_BAD_FUNCTION_ARGUMENT;
 3444|      0|      multi->max_host_connections = (szarg < UINT32_MAX) ?
  ------------------
  |  Branch (3444:37): [True: 0, False: 0]
  ------------------
 3445|      0|                                    (uint32_t)szarg : UINT32_MAX;
 3446|      0|      break;
 3447|      0|    case CURLMOPT_MAX_TOTAL_CONNECTIONS:
  ------------------
  |  Branch (3447:5): [True: 0, False: 8.85k]
  ------------------
 3448|      0|      if(!curlx_sltouz(va_arg(param, long), &szarg))
  ------------------
  |  Branch (3448:10): [True: 0, False: 0]
  ------------------
 3449|      0|        mresult = CURLM_BAD_FUNCTION_ARGUMENT;
 3450|      0|      multi->max_total_connections = (szarg < UINT32_MAX) ?
  ------------------
  |  Branch (3450:38): [True: 0, False: 0]
  ------------------
 3451|      0|                                     (uint32_t)szarg : UINT32_MAX;
 3452|      0|      break;
 3453|       |      /* options formerly used for pipelining */
 3454|      0|    case CURLMOPT_MAX_PIPELINE_LENGTH:
  ------------------
  |  Branch (3454:5): [True: 0, False: 8.85k]
  ------------------
 3455|      0|      break;
 3456|      0|    case CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE:
  ------------------
  |  Branch (3456:5): [True: 0, False: 8.85k]
  ------------------
 3457|      0|      break;
 3458|      0|    case CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE:
  ------------------
  |  Branch (3458:5): [True: 0, False: 8.85k]
  ------------------
 3459|      0|      break;
 3460|      0|    case CURLMOPT_PIPELINING_SITE_BL:
  ------------------
  |  Branch (3460:5): [True: 0, False: 8.85k]
  ------------------
 3461|      0|      break;
 3462|      0|    case CURLMOPT_PIPELINING_SERVER_BL:
  ------------------
  |  Branch (3462:5): [True: 0, False: 8.85k]
  ------------------
 3463|      0|      break;
 3464|      0|    case CURLMOPT_MAX_CONCURRENT_STREAMS: {
  ------------------
  |  Branch (3464:5): [True: 0, False: 8.85k]
  ------------------
 3465|      0|      if(!curlx_sltouz(va_arg(param, long), &szarg) ||
  ------------------
  |  Branch (3465:10): [True: 0, False: 0]
  ------------------
 3466|      0|         !szarg || (szarg > (size_t)INT_MAX)) /* preserve previous cutoff */
  ------------------
  |  Branch (3466:10): [True: 0, False: 0]
  |  Branch (3466:20): [True: 0, False: 0]
  ------------------
 3467|      0|        multi->max_concurrent_streams = 100;
 3468|      0|      else
 3469|      0|        multi->max_concurrent_streams = (szarg < UINT32_MAX) ?
  ------------------
  |  Branch (3469:41): [True: 0, False: 0]
  ------------------
 3470|      0|                                       (uint32_t)szarg : UINT32_MAX;
 3471|      0|      break;
 3472|      0|    }
 3473|      0|    case CURLMOPT_NETWORK_CHANGED: {
  ------------------
  |  Branch (3473:5): [True: 0, False: 8.85k]
  ------------------
 3474|      0|      long val = va_arg(param, long);
 3475|      0|      if(val & CURLMNWC_CLEAR_ALL)
  ------------------
  |  |  419|      0|#define CURLMNWC_CLEAR_ALL (1L << 0)
  ------------------
  |  Branch (3475:10): [True: 0, False: 0]
  ------------------
 3476|       |        /* In the beginning, all values available to set were 1 by mistake. We
 3477|       |           converted this to mean "all", thus setting all the bits
 3478|       |           automatically */
 3479|      0|        val = CURLMNWC_CLEAR_DNS | CURLMNWC_CLEAR_CONNS;
  ------------------
  |  |  429|      0|#define CURLMNWC_CLEAR_DNS (1L << 2)
  ------------------
                      val = CURLMNWC_CLEAR_DNS | CURLMNWC_CLEAR_CONNS;
  ------------------
  |  |  424|      0|#define CURLMNWC_CLEAR_CONNS (1L << 1)
  ------------------
 3480|      0|      if(val & CURLMNWC_CLEAR_DNS) {
  ------------------
  |  |  429|      0|#define CURLMNWC_CLEAR_DNS (1L << 2)
  ------------------
  |  Branch (3480:10): [True: 0, False: 0]
  ------------------
 3481|      0|        Curl_dnscache_clear(multi->admin);
 3482|      0|      }
 3483|      0|      if(val & CURLMNWC_CLEAR_CONNS) {
  ------------------
  |  |  424|      0|#define CURLMNWC_CLEAR_CONNS (1L << 1)
  ------------------
  |  Branch (3483:10): [True: 0, False: 0]
  ------------------
 3484|      0|        Curl_cpool_nw_changed(&multi->cpool, multi->admin);
 3485|      0|      }
 3486|      0|      break;
 3487|      0|    }
 3488|      0|    case CURLMOPT_NOTIFYFUNCTION:
  ------------------
  |  Branch (3488:5): [True: 0, False: 8.85k]
  ------------------
 3489|      0|      multi->ntfy.ntfy_cb = va_arg(param, curl_notify_callback);
 3490|      0|      break;
 3491|      0|    case CURLMOPT_NOTIFYDATA:
  ------------------
  |  Branch (3491:5): [True: 0, False: 8.85k]
  ------------------
 3492|      0|      multi->ntfy.ntfy_cb_data = va_arg(param, void *);
 3493|      0|      break;
 3494|      0|    case CURLMOPT_RESOLVE_THREADS_MAX:
  ------------------
  |  Branch (3494:5): [True: 0, False: 8.85k]
  ------------------
 3495|      0|#ifdef USE_RESOLV_THREADED
 3496|      0|      uarg = va_arg(param, long);
 3497|      0|      if((uarg <= 0) || (uarg > UINT32_MAX))
  ------------------
  |  Branch (3497:10): [True: 0, False: 0]
  |  Branch (3497:25): [True: 0, False: 0]
  ------------------
 3498|      0|        mresult = CURLM_BAD_FUNCTION_ARGUMENT;
 3499|      0|      else {
 3500|      0|        CURLcode result = Curl_async_thrdd_multi_set_props(
 3501|      0|          multi, 0, (uint32_t)uarg, 2000);
 3502|      0|        switch(result) {
 3503|      0|        case CURLE_OK:
  ------------------
  |  Branch (3503:9): [True: 0, False: 0]
  ------------------
 3504|      0|          mresult = CURLM_OK;
 3505|      0|          break;
 3506|      0|        case CURLE_BAD_FUNCTION_ARGUMENT:
  ------------------
  |  Branch (3506:9): [True: 0, False: 0]
  ------------------
 3507|      0|          mresult = CURLM_BAD_FUNCTION_ARGUMENT;
 3508|      0|          break;
 3509|      0|        case CURLE_OUT_OF_MEMORY:
  ------------------
  |  Branch (3509:9): [True: 0, False: 0]
  ------------------
 3510|      0|          mresult = CURLM_OUT_OF_MEMORY;
 3511|      0|          break;
 3512|      0|        default:
  ------------------
  |  Branch (3512:9): [True: 0, False: 0]
  ------------------
 3513|      0|          mresult = CURLM_INTERNAL_ERROR;
 3514|      0|          break;
 3515|      0|        }
 3516|      0|      }
 3517|      0|#endif
 3518|      0|      break;
 3519|      0|    case CURLMOPT_QUICK_EXIT:
  ------------------
  |  Branch (3519:5): [True: 0, False: 8.85k]
  ------------------
 3520|      0|      multi->quick_exit = va_arg(param, long) ? 1 : 0;
  ------------------
  |  Branch (3520:27): [True: 0, False: 0]
  ------------------
 3521|      0|      break;
 3522|      0|    default:
  ------------------
  |  Branch (3522:5): [True: 0, False: 8.85k]
  ------------------
 3523|      0|      mresult = CURLM_UNKNOWN_OPTION;
 3524|      0|      break;
 3525|  8.85k|    }
 3526|  8.85k|    va_end(param);
 3527|  8.85k|  }
 3528|  8.85k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  8.85k|  Curl_mapi_leave(g)
  ------------------
 3529|  8.85k|  return mresult;
 3530|  8.85k|}
curl_multi_socket_action:
 3549|  13.3k|{
 3550|  13.3k|  struct Curl_mapi_guard guard;
 3551|  13.3k|  CURLMcode mresult;
 3552|       |
 3553|  13.3k|  if(CURL_MAPI_ENTER(&guard, m, multi_socket_action, &mresult)) {
  ------------------
  |  |  190|  13.3k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 13.3k, False: 0]
  |  |  |  Branch (190:50): [True: 13.3k, False: 0]
  |  |  ------------------
  ------------------
 3554|  13.3k|    mresult = multi_socket(m, FALSE, s, ev_bitmask, running_handles);
  ------------------
  |  |  989|  13.3k|#define FALSE false
  ------------------
 3555|  13.3k|  }
 3556|  13.3k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  13.3k|  Curl_mapi_leave(g)
  ------------------
 3557|  13.3k|  return mresult;
 3558|  13.3k|}
curl_multi_timeout:
 3635|  44.4k|{
 3636|  44.4k|  struct Curl_mapi_guard guard;
 3637|  44.4k|  CURLMcode mresult;
 3638|       |
 3639|  44.4k|  if(CURL_MAPI_ENTER(&guard, m, multi_timeout, &mresult)) {
  ------------------
  |  |  190|  44.4k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 44.4k, False: 0]
  |  |  |  Branch (190:50): [True: 44.4k, False: 0]
  |  |  ------------------
  ------------------
 3640|  44.4k|    int itimeout_ms;
 3641|       |
 3642|  44.4k|    multi_timeout(m, NULL, &itimeout_ms);
 3643|  44.4k|    *timeout_ms = (long)itimeout_ms;
 3644|  44.4k|    mresult = CURLM_OK;
 3645|  44.4k|  }
 3646|  44.4k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  44.4k|  Curl_mapi_leave(g)
  ------------------
 3647|  44.4k|  return mresult;
 3648|  44.4k|}
Curl_update_timer:
 3655|   155k|{
 3656|   155k|  timediff_t timeouts_offset_us = 0;
 3657|   155k|  int timeout_ms;
 3658|   155k|  int rc;
 3659|   155k|  bool set_value = FALSE;
  ------------------
  |  |  989|   155k|#define FALSE false
  ------------------
 3660|       |
 3661|   155k|  if(!multi->timer_cb || multi->dead)
  ------------------
  |  Branch (3661:6): [True: 137k, False: 17.7k]
  |  Branch (3661:26): [True: 0, False: 17.7k]
  ------------------
 3662|   137k|    return CURLM_OK;
 3663|  17.7k|  multi_timeout(multi, &timeouts_offset_us, &timeout_ms);
 3664|       |
 3665|  17.7k|  if(timeout_ms < 0 && !multi->last_timeout_set) {
  ------------------
  |  Branch (3665:6): [True: 3.59k, False: 14.1k]
  |  Branch (3665:24): [True: 1.37k, False: 2.21k]
  ------------------
 3666|       |    /* nothing to do */
 3667|  1.37k|  }
 3668|  16.3k|  else if(timeout_ms < 0) {
  ------------------
  |  Branch (3668:11): [True: 2.21k, False: 14.1k]
  ------------------
 3669|       |    /* there is no timeout now but there was one previously */
 3670|  2.21k|    CURL_TRC_M(multi->admin, "[TIMER] clear");
  ------------------
  |  |  148|  2.21k|  do {                                   \
  |  |  149|  2.21k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  2.21k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  2.21k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  4.42k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 2.21k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 2.21k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  4.42k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  2.21k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  2.21k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  2.21k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 2.21k]
  |  |  ------------------
  ------------------
 3671|  2.21k|    timeout_ms = -1; /* normalize */
 3672|  2.21k|    set_value = TRUE;
  ------------------
  |  |  986|  2.21k|#define TRUE true
  ------------------
 3673|  2.21k|  }
 3674|  14.1k|  else if(!multi->last_timeout_set) {
  ------------------
  |  Branch (3674:11): [True: 2.21k, False: 11.9k]
  ------------------
 3675|  2.21k|    CURL_TRC_M(multi->admin, "[TIMER] set %dms, none before", timeout_ms);
  ------------------
  |  |  148|  2.21k|  do {                                   \
  |  |  149|  2.21k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  2.21k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  2.21k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  4.42k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 2.21k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 2.21k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  4.42k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  2.21k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  2.21k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  2.21k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 2.21k]
  |  |  ------------------
  ------------------
 3676|  2.21k|    set_value = TRUE;
  ------------------
  |  |  986|  2.21k|#define TRUE true
  ------------------
 3677|  2.21k|  }
 3678|  11.9k|  else if(multi->last_expire_offset_us != timeouts_offset_us) {
  ------------------
  |  Branch (3678:11): [True: 6.21k, False: 5.73k]
  ------------------
 3679|       |    /* We had a timeout before and have one now, the absolute timestamp
 3680|       |     * differs. The relative timeout_ms may be the same, but the starting
 3681|       |     * point differs. Let the application restart its timer. */
 3682|  6.21k|    CURL_TRC_M(multi->admin, "[TIMER] set %dms, replace previous",
  ------------------
  |  |  148|  6.21k|  do {                                   \
  |  |  149|  6.21k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  6.21k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  6.21k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  12.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 6.21k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 6.21k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  12.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  6.21k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  6.21k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  6.21k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 6.21k]
  |  |  ------------------
  ------------------
 3683|  6.21k|               timeout_ms);
 3684|  6.21k|    set_value = TRUE;
  ------------------
  |  |  986|  6.21k|#define TRUE true
  ------------------
 3685|  6.21k|  }
 3686|  5.73k|  else {
 3687|       |    /* We have same expire time as previously. Our relative 'timeout_ms'
 3688|       |     * may be different now, but the application has the timer running
 3689|       |     * and we do not to tell it to start this again. */
 3690|  5.73k|  }
 3691|       |
 3692|  17.7k|  if(set_value) {
  ------------------
  |  Branch (3692:6): [True: 10.6k, False: 7.10k]
  ------------------
 3693|  10.6k|    struct Curl_mapi_guard guard;
 3694|       |
 3695|  10.6k|    multi->last_expire_offset_us = timeouts_offset_us;
 3696|  10.6k|    multi->last_timeout_set = timeout_ms >= 0;
 3697|  10.6k|    CURL_CBAPI_MULTI_START(&guard, multi, multi_timer_cb);
  ------------------
  |  |  203|  10.6k|  Curl_cbapi_enter(g, NULL, m, CURL_CBAPI_FN_##fn)
  ------------------
 3698|  10.6k|    rc = multi->timer_cb(multi, timeout_ms, multi->timer_userp);
 3699|  10.6k|    CURL_CBAPI_MULTI_END(&guard);
  ------------------
  |  |  207|  10.6k|  Curl_cbapi_leave(g)
  ------------------
 3700|  10.6k|    if(rc == -1) {
  ------------------
  |  Branch (3700:8): [True: 0, False: 10.6k]
  ------------------
 3701|      0|      multi->dead = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3702|      0|      return CURLM_ABORTED_BY_CALLBACK;
 3703|      0|    }
 3704|  10.6k|  }
 3705|  17.7k|  return CURLM_OK;
 3706|  17.7k|}
Curl_expire_set:
 3821|  29.7k|{
 3822|  29.7k|  struct Curl_multi *multi = data->multi;
 3823|  29.7k|  struct expire_timers *timeouts = &data->state.timeouts;
 3824|  29.7k|  uint8_t prev_id = timeouts->first;
 3825|  29.7k|  struct curltime set;
 3826|       |
 3827|       |  /* this is only interesting while there is still an associated multi struct
 3828|       |     remaining! */
 3829|  29.7k|  if(!multi)
  ------------------
  |  Branch (3829:6): [True: 0, False: 29.7k]
  ------------------
 3830|      0|    return;
 3831|  29.7k|  DEBUGASSERT(eid < EXPIRE_LAST);
  ------------------
  |  | 1016|  29.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3831:3): [True: 0, False: 29.7k]
  |  Branch (3831:3): [True: 29.7k, False: 0]
  ------------------
 3832|  29.7k|  if(ms > INT_MAX)
  ------------------
  |  Branch (3832:6): [True: 0, False: 29.7k]
  ------------------
 3833|       |    /* Cap ridiculous timeouts, 31-bit ms is still 3.5 weeks. When the time
 3834|       |       goes to the user, it must fit in this size. */
 3835|      0|    ms = INT_MAX;
 3836|       |
 3837|  29.7k|  set = *pnow;
 3838|  29.7k|  set.tv_sec += (time_t)(ms / 1000); /* may be a 64 to 32-bit conversion */
 3839|  29.7k|  set.tv_usec += (int)(ms % 1000) * 1000;
 3840|  29.7k|  if(set.tv_usec >= 1000000) {
  ------------------
  |  Branch (3840:6): [True: 4.60k, False: 25.1k]
  ------------------
 3841|  4.60k|    set.tv_sec++;
 3842|  4.60k|    set.tv_usec -= 1000000;
 3843|  4.60k|  }
 3844|       |
 3845|       |  /* Add the timeout, will replace any previous value for this timer. */
 3846|  29.7k|  multi_set_timeout(data, &set, eid);
 3847|  29.7k|  DEBUGASSERT(timeouts->first < EXPIRE_LAST);
  ------------------
  |  | 1016|  29.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3847:3): [True: 0, False: 29.7k]
  |  Branch (3847:3): [True: 29.7k, False: 0]
  ------------------
 3848|       |
 3849|  29.7k|  if(Curl_timeouts_has(data)) {
  ------------------
  |  Branch (3849:6): [True: 20.1k, False: 9.66k]
  ------------------
 3850|       |    /* data has already a timeout registered. If the first timer
 3851|       |     * was NOT the one we just set AND is still the first one,
 3852|       |     * nothing changed from the timeouts point of view. The
 3853|       |     * set timer triggers after the one already registered. Leave. */
 3854|  20.1k|    if((prev_id != eid) && (prev_id == timeouts->first))
  ------------------
  |  Branch (3854:8): [True: 15.9k, False: 4.14k]
  |  Branch (3854:28): [True: 11.1k, False: 4.78k]
  ------------------
 3855|  11.1k|      return;
 3856|       |
 3857|       |    /* Since this is an updated time, we must remove data from
 3858|       |     * timeouts and then add it again. */
 3859|  8.92k|    Curl_timeouts_remove(&multi->timeouts, data);
 3860|  8.92k|  }
 3861|       |
 3862|       |  /* Insert the new timer expiry since it is our local minimum. */
 3863|  18.5k|  Curl_timeouts_add(&multi->timeouts, data,
 3864|  18.5k|                    timeouts->offset_us[timeouts->first]);
 3865|  18.5k|}
Curl_expire_latest:
 3871|   126k|{
 3872|   126k|  struct expire_timers *timeouts = &data->state.timeouts;
 3873|   126k|  uint8_t id, nid = (uint8_t)eid;
 3874|       |
 3875|   126k|  if(!data->multi)
  ------------------
  |  Branch (3875:6): [True: 0, False: 126k]
  ------------------
 3876|      0|    return;
 3877|       |
 3878|   258k|  for(id = timeouts->first; id < EXPIRE_LAST; id = timeouts->next[id]) {
  ------------------
  |  Branch (3878:29): [True: 252k, False: 5.46k]
  ------------------
 3879|   252k|    if(id == nid) { /* expire timer is set */
  ------------------
  |  Branch (3879:8): [True: 121k, False: 131k]
  ------------------
 3880|   121k|      struct curltime newset = *pnow;
 3881|   121k|      timediff_t now_us =
 3882|   121k|        Curl_timeouts_offset_us(&data->multi->timeouts, &newset);
 3883|       |
 3884|   121k|      if(now_us >= timeouts->offset_us[nid]) /* already expired, set again */
  ------------------
  |  Branch (3884:10): [True: 2.20k, False: 119k]
  ------------------
 3885|  2.20k|        break;
 3886|   119k|      if(((timeouts->offset_us[nid] - now_us) / 1000) < ms)
  ------------------
  |  Branch (3886:10): [True: 117k, False: 2.07k]
  ------------------
 3887|   117k|        return; /* existing timeout is earlier */
 3888|  2.07k|      break;
 3889|   119k|    }
 3890|   252k|  }
 3891|  9.74k|  Curl_expire_set(data, eid, ms, pnow);
 3892|  9.74k|}
Curl_expire_clear:
 3904|  10.9k|{
 3905|       |  /* remove the timer, if there */
 3906|  10.9k|  multi_clear_timeout(data, eid);
 3907|  10.9k|  CURL_TRC_TIMER(data, eid, "cleared");
  ------------------
  |  |  173|  10.9k|  do {                                        \
  |  |  174|  10.9k|    if(CURL_TRC_TIMER_is_verbose(data))       \
  |  |  ------------------
  |  |  |  |  139|  10.9k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  10.9k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  21.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 10.9k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 1.16k, False: 9.80k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  21.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 1.16k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  1.16k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  10.9k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.16k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 221, False: 939]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  10.9k|      Curl_trc_timer(data, tid, __VA_ARGS__); \
  |  |  176|  10.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (176:11): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 3908|  10.9k|}
Curl_expire_clear_all:
 3914|  37.5k|{
 3915|  37.5k|  struct Curl_multi *multi = data->multi;
 3916|       |
 3917|       |  /* this is only interesting while there is still an associated multi struct
 3918|       |     remaining! */
 3919|  37.5k|  if(!multi)
  ------------------
  |  Branch (3919:6): [True: 19.7k, False: 17.8k]
  ------------------
 3920|  19.7k|    return;
 3921|       |
 3922|  17.8k|  if(Curl_timeouts_remove(&multi->timeouts, data)) {
  ------------------
  |  Branch (3922:6): [True: 9.66k, False: 8.14k]
  ------------------
 3923|       |    /* Since this is an cleared time, we must remove the previous entry from
 3924|       |       the splay tree */
 3925|  9.66k|    multi_timeouts_init(data);
 3926|       |
 3927|  9.66k|    if(data->id >= 0)
  ------------------
  |  Branch (3927:8): [True: 9.66k, False: 0]
  ------------------
 3928|  9.66k|      CURL_TRC_M(data, "[TIMEOUT] all cleared");
  ------------------
  |  |  148|  9.66k|  do {                                   \
  |  |  149|  9.66k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.66k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.66k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  19.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.66k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 957, False: 8.70k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  19.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 957, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    957|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.66k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    957|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 190, False: 767]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.66k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.66k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.66k]
  |  |  ------------------
  ------------------
 3929|  9.66k|  }
 3930|  17.8k|}
curl_multi_assign:
 3934|  8.33k|{
 3935|  8.33k|  struct Curl_mapi_guard guard;
 3936|  8.33k|  CURLMcode mresult;
 3937|       |
 3938|  8.33k|  if(CURL_MAPI_ENTER(&guard, m, multi_assign, &mresult)) {
  ------------------
  |  |  190|  8.33k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 8.33k, False: 0]
  |  |  |  Branch (190:50): [True: 8.33k, False: 0]
  |  |  ------------------
  ------------------
 3939|  8.33k|    mresult = Curl_multi_ev_assign(m, sockfd, sockp);
 3940|  8.33k|  }
 3941|  8.33k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  8.33k|  Curl_mapi_leave(g)
  ------------------
 3942|  8.33k|  return mresult;
 3943|  8.33k|}
curl_multi_get_handles:
 4014|  9.76k|{
 4015|  9.76k|  struct Curl_mapi_guard guard;
 4016|  9.76k|  CURL **a = NULL;
 4017|       |
 4018|  9.76k|  if(CURL_MAPI_ENTER(&guard, m, multi_get_handles, NULL)) {
  ------------------
  |  |  190|  9.76k|  Curl_mapi_enter(g, m, CURL_MAPI_FN_##fn, r) && (m)
  |  |  ------------------
  |  |  |  Branch (190:3): [True: 9.76k, False: 0]
  |  |  |  Branch (190:50): [True: 9.76k, False: 0]
  |  |  ------------------
  ------------------
 4019|  9.76k|    struct Curl_multi *multi = m;
 4020|  9.76k|    void *entry;
 4021|  9.76k|    size_t count = Curl_uint32_tbl_count(&multi->xfers);
 4022|       |
 4023|  9.76k|    a = curlx_malloc(sizeof(struct Curl_easy *) * (count + 1));
  ------------------
  |  | 1498|  9.76k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 4024|  9.76k|    if(a) {
  ------------------
  |  Branch (4024:8): [True: 9.76k, False: 0]
  ------------------
 4025|  9.76k|      unsigned int i = 0;
 4026|  9.76k|      uint32_t mid;
 4027|       |
 4028|  9.76k|      if(Curl_uint32_tbl_first(&multi->xfers, &mid, &entry)) {
  ------------------
  |  Branch (4028:10): [True: 9.76k, False: 0]
  ------------------
 4029|  19.5k|        do {
 4030|  19.5k|          struct Curl_easy *data = entry;
 4031|  19.5k|          DEBUGASSERT(i < count);
  ------------------
  |  | 1016|  19.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4031:11): [True: 0, False: 19.5k]
  |  Branch (4031:11): [True: 19.5k, False: 0]
  ------------------
 4032|  19.5k|          if(!data->state.internal)
  ------------------
  |  Branch (4032:14): [True: 9.76k, False: 9.76k]
  ------------------
 4033|  9.76k|            a[i++] = data;
 4034|  19.5k|        } while(Curl_uint32_tbl_next(&multi->xfers, mid, &mid, &entry));
  ------------------
  |  Branch (4034:17): [True: 9.76k, False: 9.76k]
  ------------------
 4035|  9.76k|      }
 4036|  9.76k|      a[i] = NULL; /* last entry is a NULL */
 4037|  9.76k|    }
 4038|  9.76k|  }
 4039|  9.76k|  CURL_MAPI_LEAVE(&guard);
  ------------------
  |  |  192|  9.76k|  Curl_mapi_leave(g)
  ------------------
 4040|  9.76k|  return a;
 4041|  9.76k|}
Curl_multi_xfer_buf_borrow:
 4105|  9.62k|{
 4106|  9.62k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4106:3): [True: 0, False: 9.62k]
  |  Branch (4106:3): [True: 9.62k, False: 0]
  ------------------
 4107|  9.62k|  DEBUGASSERT(data->multi);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4107:3): [True: 0, False: 9.62k]
  |  Branch (4107:3): [True: 9.62k, False: 0]
  ------------------
 4108|  9.62k|  *pbuf = NULL;
 4109|  9.62k|  *pbuflen = 0;
 4110|  9.62k|  if(!data->multi) {
  ------------------
  |  Branch (4110:6): [True: 0, False: 9.62k]
  ------------------
 4111|      0|    failf(data, "transfer has no multi handle");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4112|      0|    return CURLE_FAILED_INIT;
 4113|      0|  }
 4114|  9.62k|  if(!data->set.buffer_size) {
  ------------------
  |  Branch (4114:6): [True: 0, False: 9.62k]
  ------------------
 4115|      0|    failf(data, "transfer buffer size is 0");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4116|      0|    return CURLE_FAILED_INIT;
 4117|      0|  }
 4118|  9.62k|  if(data->multi->xfer_buf_borrowed) {
  ------------------
  |  Branch (4118:6): [True: 0, False: 9.62k]
  ------------------
 4119|      0|    failf(data, "attempt to borrow xfer_buf when already borrowed");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4120|      0|    return CURLE_AGAIN;
 4121|      0|  }
 4122|       |
 4123|  9.62k|  if(data->multi->xfer_buf &&
  ------------------
  |  Branch (4123:6): [True: 7.70k, False: 1.92k]
  ------------------
 4124|  7.70k|     data->set.buffer_size > data->multi->xfer_buf->len) {
  ------------------
  |  Branch (4124:6): [True: 0, False: 7.70k]
  ------------------
 4125|       |    /* not large enough, get a new one */
 4126|      0|    curlx_safefree(data->multi->xfer_buf);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4127|      0|  }
 4128|       |
 4129|  9.62k|  if(!data->multi->xfer_buf) {
  ------------------
  |  Branch (4129:6): [True: 1.92k, False: 7.70k]
  ------------------
 4130|  1.92k|    data->multi->xfer_buf =
 4131|  1.92k|      fixed_buf_create(curlx_uitouz(data->set.buffer_size));
 4132|  1.92k|    if(!data->multi->xfer_buf) {
  ------------------
  |  Branch (4132:8): [True: 0, False: 1.92k]
  ------------------
 4133|      0|      failf(data, "could not allocate xfer_buf of %u bytes",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4134|      0|            data->set.buffer_size);
 4135|      0|      return CURLE_OUT_OF_MEMORY;
 4136|      0|    }
 4137|  1.92k|  }
 4138|       |
 4139|  9.62k|  data->multi->xfer_buf_borrowed = TRUE;
  ------------------
  |  |  986|  9.62k|#define TRUE true
  ------------------
 4140|  9.62k|  *pbuf = data->multi->xfer_buf->data;
 4141|  9.62k|  *pbuflen = data->multi->xfer_buf->len;
 4142|  9.62k|  return CURLE_OK;
 4143|  9.62k|}
Curl_multi_xfer_buf_release:
 4146|  9.62k|{
 4147|  9.62k|  (void)buf;
 4148|  9.62k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4148:3): [True: 0, False: 9.62k]
  |  Branch (4148:3): [True: 9.62k, False: 0]
  ------------------
 4149|  9.62k|  DEBUGASSERT(data->multi);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4149:3): [True: 0, False: 9.62k]
  |  Branch (4149:3): [True: 9.62k, False: 0]
  ------------------
 4150|  9.62k|  DEBUGASSERT(!buf || (data->multi->xfer_buf &&
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4150:3): [True: 0, False: 0]
  |  Branch (4150:3): [True: 0, False: 0]
  |  Branch (4150:3): [True: 9.62k, False: 0]
  |  Branch (4150:3): [True: 9.62k, False: 0]
  |  Branch (4150:3): [True: 9.62k, False: 0]
  |  Branch (4150:3): [True: 0, False: 9.62k]
  ------------------
 4151|  9.62k|                       data->multi->xfer_buf->data == buf));
 4152|  9.62k|  data->multi->xfer_buf_borrowed = FALSE;
  ------------------
  |  |  989|  9.62k|#define FALSE false
  ------------------
 4153|  9.62k|}
Curl_multi_xfer_sockbuf_borrow:
 4205|  16.0k|{
 4206|  16.0k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  16.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4206:3): [True: 0, False: 16.0k]
  |  Branch (4206:3): [True: 16.0k, False: 0]
  ------------------
 4207|  16.0k|  *pbuf = NULL;
 4208|  16.0k|  if(!data->multi) {
  ------------------
  |  Branch (4208:6): [True: 0, False: 16.0k]
  ------------------
 4209|       |    /* When a SHARE gets destroyed and has a connection pool, we get
 4210|       |     * call with share->admin which does not have a multi handle. */
 4211|      0|    *pbuf = curlx_malloc(blen);
  ------------------
  |  | 1498|      0|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 4212|      0|    return *pbuf ? CURLE_OK : CURLE_OUT_OF_MEMORY;
  ------------------
  |  Branch (4212:12): [True: 0, False: 0]
  ------------------
 4213|      0|  }
 4214|  16.0k|  if(data->multi->xfer_sockbuf_borrowed) {
  ------------------
  |  Branch (4214:6): [True: 0, False: 16.0k]
  ------------------
 4215|      0|    failf(data, "attempt to borrow xfer_sockbuf when already borrowed");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4216|      0|    return CURLE_AGAIN;
 4217|      0|  }
 4218|       |
 4219|  16.0k|  if(data->multi->xfer_sockbuf && blen > data->multi->xfer_sockbuf->len) {
  ------------------
  |  Branch (4219:6): [True: 14.0k, False: 1.96k]
  |  Branch (4219:35): [True: 0, False: 14.0k]
  ------------------
 4220|       |    /* not large enough, get a new one */
 4221|      0|    curlx_safefree(data->multi->xfer_sockbuf);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4222|      0|  }
 4223|       |
 4224|  16.0k|  if(!data->multi->xfer_sockbuf) {
  ------------------
  |  Branch (4224:6): [True: 1.96k, False: 14.0k]
  ------------------
 4225|  1.96k|    data->multi->xfer_sockbuf = fixed_buf_create(blen);
 4226|  1.96k|    if(!data->multi->xfer_sockbuf) {
  ------------------
  |  Branch (4226:8): [True: 0, False: 1.96k]
  ------------------
 4227|      0|      failf(data, "could not allocate xfer_sockbuf of %zu bytes", blen);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4228|      0|      return CURLE_OUT_OF_MEMORY;
 4229|      0|    }
 4230|  1.96k|  }
 4231|       |
 4232|  16.0k|  data->multi->xfer_sockbuf_borrowed = TRUE;
  ------------------
  |  |  986|  16.0k|#define TRUE true
  ------------------
 4233|  16.0k|  *pbuf = data->multi->xfer_sockbuf->data;
 4234|  16.0k|  return CURLE_OK;
 4235|  16.0k|}
Curl_multi_xfer_sockbuf_release:
 4238|  16.0k|{
 4239|  16.0k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  16.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4239:3): [True: 0, False: 16.0k]
  |  Branch (4239:3): [True: 16.0k, False: 0]
  ------------------
 4240|  16.0k|  if(!data->multi) {
  ------------------
  |  Branch (4240:6): [True: 0, False: 16.0k]
  ------------------
 4241|       |    /* When a SHARE gets destroyed and has a connection pool, we get
 4242|       |     * call with share->admin which does not have a multi handle. */
 4243|      0|    curlx_free(buf);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 4244|      0|  }
 4245|  16.0k|  else {
 4246|  16.0k|    DEBUGASSERT(!buf || (data->multi->xfer_sockbuf &&
  ------------------
  |  | 1016|  16.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4246:5): [True: 0, False: 0]
  |  Branch (4246:5): [True: 0, False: 0]
  |  Branch (4246:5): [True: 16.0k, False: 0]
  |  Branch (4246:5): [True: 16.0k, False: 0]
  |  Branch (4246:5): [True: 16.0k, False: 0]
  |  Branch (4246:5): [True: 0, False: 16.0k]
  ------------------
 4247|  16.0k|                         data->multi->xfer_sockbuf->data == buf));
 4248|  16.0k|    data->multi->xfer_sockbuf_borrowed = FALSE;
  ------------------
  |  |  989|  16.0k|#define FALSE false
  ------------------
 4249|  16.0k|  }
 4250|  16.0k|}
Curl_multi_get_easy:
 4265|   456k|{
 4266|   456k|  struct Curl_easy *data = Curl_uint32_tbl_get(&multi->xfers, mid);
 4267|   456k|  if(GOOD_EASY_HANDLE(data))
  ------------------
  |  |   34|   456k|  (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |   28|   456k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  |  |  ------------------
  |  |                 (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \
  |  |  ------------------
  |  |  |  |  986|   456k|#define TRUE true
  |  |  ------------------
  |  |  |  Branch (34:3): [True: 456k, False: 0]
  |  |  |  Branch (34:5): [True: 456k, False: 0]
  |  |  |  Branch (34:12): [True: 456k, False: 0]
  |  |  ------------------
  |  |   35|   456k|   (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |                  (DEBUGASSERT(!(x)), FALSE))
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  ------------------
  |  Branch (4267:6): [True: 0, False: 0]
  |  Branch (4267:6): [True: 0, False: 0]
  ------------------
 4268|   456k|    return data;
 4269|      0|  CURL_TRC_M(multi->admin, "invalid easy handle in xfer table for mid=%u",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4270|      0|             mid);
 4271|      0|  Curl_uint32_tbl_remove(&multi->xfers, mid);
 4272|       |  return NULL;
 4273|   456k|}
Curl_multi_xfers_attached:
 4290|  1.57k|{
 4291|  1.57k|  if(!multi || !multi->admin) {
  ------------------
  |  Branch (4291:6): [True: 0, False: 1.57k]
  |  Branch (4291:16): [True: 0, False: 1.57k]
  ------------------
 4292|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4292:5): [Folded, False: 0]
  |  Branch (4292:5): [Folded, False: 0]
  ------------------
 4293|      0|    return 0;
 4294|      0|  }
 4295|       |  /* Discount the admin handle */
 4296|  1.57k|  return Curl_uint32_tbl_count(&multi->xfers) - 1;
 4297|  1.57k|}
Curl_multi_mark_dirty:
 4300|  23.9k|{
 4301|  23.9k|  if(data->multi && data->mid != UINT32_MAX)
  ------------------
  |  Branch (4301:6): [True: 23.9k, False: 0]
  |  Branch (4301:21): [True: 23.9k, False: 0]
  ------------------
 4302|  23.9k|    Curl_uint32_bset_add(&data->multi->dirty, data->mid);
 4303|  23.9k|}
multi.c:multi_xfers_add:
  419|  9.76k|{
  420|  9.76k|  uint32_t capacity = Curl_uint32_tbl_capacity(&multi->xfers);
  421|  9.76k|  uint32_t new_size = 0;
  422|       |  /* Prepare to make this into a CURLMOPT_MAX_TRANSFERS, because some
  423|       |   * applications may want to prevent a run-away of their memory use. */
  424|       |  /* UINT_MAX is our "invalid" id, do not let the table grow up to that. */
  425|  9.76k|  const uint32_t max_capacity = UINT_MAX - 1;
  426|       |
  427|  9.76k|  if(capacity < max_capacity) {
  ------------------
  |  Branch (427:6): [True: 9.76k, False: 0]
  ------------------
  428|       |    /* We want `multi->xfers` to have "sufficient" free rows, so that we do
  429|       |     * not have to reuse the `mid` from a removed easy right away.
  430|       |     * Check if an 8th of the capacity is still free */
  431|  9.76k|    uint32_t used = Curl_uint32_tbl_count(&multi->xfers);
  432|  9.76k|    uint32_t unused = capacity - used;
  433|  9.76k|    uint32_t min_unused = CURLMAX(capacity >> 3, 4);
  ------------------
  |  | 1314|  9.76k|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1314:24): [True: 9.76k, False: 0]
  |  |  ------------------
  ------------------
  434|  9.76k|    if(unused < min_unused) {
  ------------------
  |  Branch (434:8): [True: 0, False: 9.76k]
  ------------------
  435|       |      /* Grow by 50% of current capacity, in range of [128, 2048],
  436|       |       * which means the table grows max by 16kb on 64-bit arch. */
  437|      0|      uint32_t growth = CURLMIN(CURLMAX(capacity >> 1, 128), 2048);
  ------------------
  |  | 1315|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 0, False: 0]
  |  |  |  Branch (1315:25): [True: 0, False: 0]
  |  |  |  Branch (1315:37): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  438|       |      /* Make sure the uint arithmetic here works on the corner
  439|       |       * cases where we are close to max_capacity or UINT_MAX */
  440|      0|      if((max_capacity - growth) <= capacity)
  ------------------
  |  Branch (440:10): [True: 0, False: 0]
  ------------------
  441|      0|        new_size = max_capacity;
  442|      0|      else
  443|      0|        new_size = capacity + growth;
  444|      0|    }
  445|  9.76k|  }
  446|       |
  447|  9.76k|  if(new_size > capacity) {
  ------------------
  |  Branch (447:6): [True: 0, False: 9.76k]
  ------------------
  448|       |    /* Grow the bitsets first. Should one fail, we do not need
  449|       |     * to downsize the already resized ones. The sets continue
  450|       |     * to work properly when larger than the table, but not
  451|       |     * the other way around. */
  452|      0|    CURL_TRC_M(data, "increasing xfer table size to %u", new_size);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  453|      0|    if(Curl_uint32_bset_resize(&multi->process, new_size) ||
  ------------------
  |  Branch (453:8): [True: 0, False: 0]
  ------------------
  454|      0|       Curl_uint32_bset_resize(&multi->dirty, new_size) ||
  ------------------
  |  Branch (454:8): [True: 0, False: 0]
  ------------------
  455|      0|       Curl_uint32_bset_resize(&multi->pending, new_size) ||
  ------------------
  |  Branch (455:8): [True: 0, False: 0]
  ------------------
  456|      0|       Curl_uint32_bset_resize(&multi->msgsent, new_size) ||
  ------------------
  |  Branch (456:8): [True: 0, False: 0]
  ------------------
  457|      0|       Curl_uint32_tbl_resize(&multi->xfers, new_size))
  ------------------
  |  Branch (457:8): [True: 0, False: 0]
  ------------------
  458|      0|      return CURLM_OUT_OF_MEMORY;
  459|      0|  }
  460|       |
  461|       |  /* Insert the easy into the table now */
  462|  9.76k|  if(!Curl_uint32_tbl_add(&multi->xfers, data, &data->mid)) {
  ------------------
  |  Branch (462:6): [True: 0, False: 9.76k]
  ------------------
  463|       |    /* MUST only happen when table is full */
  464|      0|    DEBUGASSERT(Curl_uint32_tbl_capacity(&multi->xfers) <=
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (464:5): [True: 0, False: 0]
  |  Branch (464:5): [True: 0, False: 0]
  ------------------
  465|      0|                Curl_uint32_tbl_count(&multi->xfers));
  466|      0|    return CURLM_OUT_OF_MEMORY;
  467|      0|  }
  468|  9.76k|  return CURLM_OK;
  469|  9.76k|}
multi.c:mstate:
  155|  62.8k|{
  156|  62.8k|  uint8_t oldstate = data->mstate;
  157|  62.8k|  static const mstate_enter_func state_enter[MSTATE_LAST] = {
  158|  62.8k|    NULL,                      /* INIT */
  159|  62.8k|    NULL,                      /* PENDING */
  160|  62.8k|    NULL,                      /* SETUP */
  161|  62.8k|    mstate_enter_connect,      /* CONNECT */
  162|  62.8k|    NULL,                      /* CONNECTING */
  163|  62.8k|    NULL,                      /* PROTOCONNECT */
  164|  62.8k|    NULL,                      /* PROTOCONNECTING */
  165|  62.8k|    NULL,                      /* DO */
  166|  62.8k|    NULL,                      /* DOING */
  167|  62.8k|    NULL,                      /* DOING_MORE */
  168|  62.8k|    mstate_enter_did,          /* DID */
  169|  62.8k|    NULL,                      /* PERFORMING */
  170|  62.8k|    NULL,                      /* RATELIMITING */
  171|  62.8k|    mstate_enter_done,         /* DONE */
  172|  62.8k|    mstate_enter_completed,    /* COMPLETED */
  173|       |    NULL                       /* MSGSENT */
  174|  62.8k|  };
  175|       |
  176|  62.8k|  if(oldstate == state)
  ------------------
  |  Branch (176:6): [True: 9.76k, False: 53.1k]
  ------------------
  177|       |    /* do not bother when the new state is the same as the old state */
  178|  9.76k|    return;
  179|       |
  180|  53.1k|#ifdef DEBUGBUILD
  181|  53.1k|  NOVERBOSE((void)lineno);
  ------------------
  |  | 1638|  53.1k|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1199|  53.1k|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:35): [Folded, False: 53.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  53.1k|  CURL_TRC_M(data, "-> [%s] (line %d)", CURL_MSTATE_NAME(state), lineno);
  ------------------
  |  |  148|  53.1k|  do {                                   \
  |  |  149|  53.1k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  53.1k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  53.1k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|   106k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 53.1k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 5.01k, False: 48.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|   106k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 5.01k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  5.01k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  53.1k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  5.01k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 847, False: 4.16k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  53.1k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  53.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 53.1k]
  |  |  ------------------
  ------------------
  183|       |#else
  184|       |  CURL_TRC_M(data, "-> [%s]", CURL_MSTATE_NAME(state));
  185|       |#endif
  186|       |
  187|       |  /* really switching state */
  188|  53.1k|  data->mstate = (uint8_t)state;
  189|  53.1k|  if(state_enter[state])
  ------------------
  |  Branch (189:6): [True: 20.1k, False: 32.9k]
  ------------------
  190|  20.1k|    state_enter[state](data, (CURLMstate)oldstate);
  191|  53.1k|}
multi.c:mstate_enter_connect:
   96|  9.66k|{
   97|  9.66k|  (void)from_state;
   98|  9.66k|  Curl_init_CONNECT(data);
   99|  9.66k|}
multi.c:mstate_enter_did:
  103|  1.92k|{
  104|  1.92k|  (void)from_state;
  105|  1.92k|  data->req.chunk = FALSE;
  ------------------
  |  |  989|  1.92k|#define FALSE false
  ------------------
  106|  1.92k|  Curl_pgrsTime(data, TIMER_PRETRANSFER);
  107|  1.92k|  if(!CURL_REQ_WANT_SEND(data))
  ------------------
  |  |   39|  1.92k|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  1.92k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  |  Branch (107:6): [True: 1.83k, False: 94]
  ------------------
  108|  1.83k|    Curl_pgrsTime(data, TIMER_POSTRANSFER);
  109|  1.92k|}
multi.c:mstate_enter_done:
  113|    533|{
  114|    533|  (void)from_state;
  115|    533|  CURLM_NTFY(data, CURLMNOTIFY_EASY_DONE);
  ------------------
  |  |   52|    533|  do {                                                \
  |  |   53|    533|    if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \
  |  |  ------------------
  |  |  |  Branch (53:8): [True: 533, False: 0]
  |  |  |  Branch (53:15): [True: 533, False: 0]
  |  |  |  Branch (53:29): [True: 0, False: 533]
  |  |  ------------------
  |  |   54|    533|      Curl_mntfy_add((d), (t));                       \
  |  |   55|    533|  } while(0)
  |  |  ------------------
  |  |  |  Branch (55:11): [Folded, False: 533]
  |  |  ------------------
  ------------------
  116|    533|}
multi.c:mstate_enter_completed:
  120|  8.05k|{
  121|       |  /* we sometimes directly jump to COMPLETED, trigger things
  122|       |   * we then missed. Not when coming from before DO: the transfer
  123|       |   * failed to resolve/connect and never sent any request. */
  124|  8.05k|  if((from_state >= MSTATE_DO) && (from_state < MSTATE_DID)) {
  ------------------
  |  Branch (124:6): [True: 1.15k, False: 6.89k]
  |  Branch (124:35): [True: 30, False: 1.12k]
  ------------------
  125|     30|    Curl_pgrsTime(data, TIMER_PRETRANSFER);
  126|     30|    Curl_pgrsTime(data, TIMER_POSTRANSFER);
  127|     30|    Curl_pgrsTime(data, TIMER_STARTTRANSFER);
  128|     30|  }
  129|       |  /* multi_done() should have run and detached any connection already */
  130|  8.05k|  DEBUGASSERT(!data->conn);
  ------------------
  |  | 1016|  8.05k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (130:3): [True: 0, False: 8.05k]
  |  Branch (130:3): [True: 8.05k, False: 0]
  ------------------
  131|  8.05k|  Curl_pgrsCompleted(data);
  132|  8.05k|  if(from_state < MSTATE_DONE)
  ------------------
  |  Branch (132:6): [True: 7.51k, False: 533]
  ------------------
  133|  7.51k|    CURLM_NTFY(data, CURLMNOTIFY_EASY_DONE);
  ------------------
  |  |   52|  7.51k|  do {                                                \
  |  |   53|  7.51k|    if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \
  |  |  ------------------
  |  |  |  Branch (53:8): [True: 7.51k, False: 0]
  |  |  |  Branch (53:15): [True: 7.51k, False: 0]
  |  |  |  Branch (53:29): [True: 0, False: 7.51k]
  |  |  ------------------
  |  |   54|  7.51k|      Curl_mntfy_add((d), (t));                       \
  |  |   55|  7.51k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (55:11): [Folded, False: 7.51k]
  |  |  ------------------
  ------------------
  134|       |  /* changing to COMPLETED means it is in process and needs to go */
  135|  8.05k|  DEBUGASSERT(Curl_uint32_bset_contains(&data->multi->process, data->mid));
  ------------------
  |  | 1016|  8.05k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (135:3): [True: 0, False: 8.05k]
  |  Branch (135:3): [True: 8.05k, False: 0]
  ------------------
  136|  8.05k|  Curl_uint32_bset_remove(&data->multi->process, data->mid);
  137|  8.05k|  Curl_uint32_bset_remove(&data->multi->pending, data->mid); /* to be sure */
  138|       |
  139|  8.05k|  if(Curl_uint32_bset_empty(&data->multi->process)) {
  ------------------
  |  Branch (139:6): [True: 0, False: 8.05k]
  ------------------
  140|       |    /* free the transfer buffer when we have no more active transfers */
  141|      0|    multi_xfer_bufs_free(data->multi);
  142|      0|  }
  143|       |  /* Important: reset the conn pointer so that we do not point to memory
  144|       |     that could be freed anytime */
  145|  8.05k|  Curl_detach_connection(data);
  146|  8.05k|  Curl_expire_clear_all(data); /* stop all timers */
  147|  8.05k|}
multi.c:multi_warn_debug:
  389|   268k|{
  390|   268k|  if(!multi->warned) {
  ------------------
  |  Branch (390:6): [True: 9.76k, False: 258k]
  ------------------
  391|  9.76k|    infof(data, "!!! WARNING !!!");
  ------------------
  |  |  143|  9.76k|  do {                               \
  |  |  144|  9.76k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  9.76k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 9.76k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 965, False: 8.79k]
  |  |  |  |  ------------------
  |  |  |  |  323|  9.76k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 965, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    965|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  9.76k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
  392|  9.76k|    infof(data, "This is a debug build of libcurl, "
  ------------------
  |  |  143|  9.76k|  do {                               \
  |  |  144|  9.76k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  9.76k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 9.76k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 965, False: 8.79k]
  |  |  |  |  ------------------
  |  |  |  |  323|  9.76k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 965, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    965|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  9.76k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
  393|  9.76k|                "do not use in production.");
  394|       |    multi->warned = TRUE;
  ------------------
  |  |  986|  9.76k|#define TRUE true
  ------------------
  395|  9.76k|  }
  396|   268k|}
multi.c:multi_done:
  686|  9.37k|{
  687|  9.37k|  CURLcode result;
  688|  9.37k|  struct connectdata *conn = data->conn;
  689|  9.37k|  const struct curltime *pnow = Curl_pgrs_now(data);
  690|       |
  691|  9.37k|  CURL_TRC_M(data, "multi_done: status: %d prem: %d done: %d",
  ------------------
  |  |  148|  9.37k|  do {                                   \
  |  |  149|  9.37k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.37k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.37k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  18.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.37k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 925, False: 8.44k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  18.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 925, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    925|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.37k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    925|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 182, False: 743]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.37k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.37k]
  |  |  ------------------
  ------------------
  692|  9.37k|             (int)status, (int)premature, data->state.done);
  693|       |
  694|  9.37k|  if(data->state.done) {
  ------------------
  |  Branch (694:6): [True: 0, False: 9.37k]
  ------------------
  695|       |    /* Stop if multi_done() has already been called */
  696|      0|    return CURLE_OK;
  697|      0|  }
  698|  9.37k|  data->state.done = TRUE; /* called now! */
  ------------------
  |  |  986|  9.37k|#define TRUE true
  ------------------
  699|       |
  700|       |  /* Shut down any ongoing async resolver operation. */
  701|  9.37k|  Curl_resolv_shutdown_all(data);
  702|       |
  703|       |  /* Cleanup possible redirect junk */
  704|  9.37k|  curlx_safefree(data->req.newurl);
  ------------------
  |  | 1359|  9.37k|  do {                      \
  |  | 1360|  9.37k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.37k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.37k|    (ptr) = NULL;           \
  |  | 1362|  9.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.37k]
  |  |  ------------------
  ------------------
  705|  9.37k|  curlx_safefree(data->req.location);
  ------------------
  |  | 1359|  9.37k|  do {                      \
  |  | 1360|  9.37k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.37k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.37k|    (ptr) = NULL;           \
  |  | 1362|  9.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.37k]
  |  |  ------------------
  ------------------
  706|       |
  707|  9.37k|  switch(status) {
  708|      0|  case CURLE_ABORTED_BY_CALLBACK:
  ------------------
  |  Branch (708:3): [True: 0, False: 9.37k]
  ------------------
  709|     22|  case CURLE_READ_ERROR:
  ------------------
  |  Branch (709:3): [True: 22, False: 9.34k]
  ------------------
  710|     22|  case CURLE_WRITE_ERROR:
  ------------------
  |  Branch (710:3): [True: 0, False: 9.37k]
  ------------------
  711|       |    /* When we are aborted due to a callback return code it has to be counted
  712|       |       as premature as there is trouble ahead if we do not. We have many
  713|       |       callbacks and protocols work differently, we could potentially do this
  714|       |       more fine-grained in the future. */
  715|     22|    premature = TRUE;
  ------------------
  |  |  986|     22|#define TRUE true
  ------------------
  716|     22|    FALLTHROUGH();
  ------------------
  |  |  752|     22|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  717|  9.37k|  default:
  ------------------
  |  Branch (717:3): [True: 9.34k, False: 22]
  ------------------
  718|  9.37k|    break;
  719|  9.37k|  }
  720|       |
  721|       |  /* this calls the protocol-specific function pointer previously set */
  722|  9.37k|  if(conn && conn->scheme->run->done && (data->mstate >= MSTATE_PROTOCONNECT))
  ------------------
  |  Branch (722:6): [True: 9.37k, False: 0]
  |  Branch (722:14): [True: 9.37k, False: 0]
  |  Branch (722:41): [True: 1.95k, False: 7.41k]
  ------------------
  723|  1.95k|    result = conn->scheme->run->done(data, status, premature);
  724|  7.41k|  else
  725|  7.41k|    result = status;
  726|       |
  727|  9.37k|  if(data->mstate > MSTATE_CONNECTING &&
  ------------------
  |  Branch (727:6): [True: 1.95k, False: 7.41k]
  ------------------
  728|  1.95k|     (result != CURLE_ABORTED_BY_CALLBACK)) {
  ------------------
  |  Branch (728:6): [True: 1.95k, False: 0]
  ------------------
  729|       |    /* avoid this if
  730|       |     * - the transfer has not connected
  731|       |     * - we already aborted by callback to avoid this calling another callback
  732|       |     */
  733|  1.95k|    int rc = Curl_pgrsDone(data, pnow);
  734|  1.95k|    if(!result && rc)
  ------------------
  |  Branch (734:8): [True: 1.33k, False: 619]
  |  Branch (734:19): [True: 0, False: 1.33k]
  ------------------
  735|      0|      result = CURLE_ABORTED_BY_CALLBACK;
  736|  1.95k|  }
  737|       |
  738|       |  /* Make sure that transfer client writes are really done now. */
  739|  9.37k|  result = Curl_1st_fatal(result, Curl_xfer_write_done(data, premature));
  740|       |
  741|  9.37k|  if(!result)
  ------------------
  |  Branch (741:6): [True: 2.22k, False: 7.14k]
  ------------------
  742|  2.22k|    result = Curl_req_done(&data->req, data, premature);
  743|       |
  744|  9.37k|  if(conn) {
  ------------------
  |  Branch (744:6): [True: 9.37k, False: 0]
  ------------------
  745|       |    /* Detach connection and decide what to do with it. */
  746|  9.37k|    struct multi_done_ctx mdctx;
  747|       |
  748|       |    /* Inform connection filters that this transfer is done and they
  749|       |     * need to give up any references to `data`. */
  750|  9.37k|    Curl_conn_ev_data_done(data, premature);
  751|  9.37k|    Curl_detach_connection(data);
  752|  9.37k|    Curl_dnscache_prune(data, pnow);
  753|       |
  754|  9.37k|    memset(&mdctx, 0, sizeof(mdctx));
  755|  9.37k|    mdctx.premature = premature;
  756|  9.37k|    Curl_cpool_return(data, conn, multi_done_locked, &mdctx, pnow);
  757|       |
  758|  9.37k|    if(data->multi)
  ------------------
  |  Branch (758:8): [True: 9.37k, False: 0]
  ------------------
  759|  9.37k|      multi_schedule_pending(data->multi);
  760|  9.37k|  }
  761|       |
  762|       |  /* flush the netrc cache */
  763|  9.37k|  Curl_netrc_cleanup(&data->state.netrc);
  764|  9.37k|  return result;
  765|  9.37k|}
multi.c:multi_done_locked:
  648|  9.37k|{
  649|  9.37k|  struct multi_done_ctx *mdctx = userdata;
  650|       |
  651|  9.37k|  (void)pnow;
  652|  9.37k|  CURL_TRC_M(data, "multi_done_locked, in use=%u", conn->attached_xfers);
  ------------------
  |  |  148|  9.37k|  do {                                   \
  |  |  149|  9.37k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.37k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.37k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  18.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.37k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 925, False: 8.44k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  18.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 925, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    925|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.37k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    925|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 182, False: 743]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.37k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.37k]
  |  |  ------------------
  ------------------
  653|  9.37k|  if(CONN_INUSE(conn)) {
  ------------------
  |  |  327|  9.37k|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  |  |  ------------------
  |  |  |  Branch (327:23): [True: 0, False: 9.37k]
  |  |  ------------------
  ------------------
  654|       |    /* Stop if still used. */
  655|      0|    CURL_TRC_M(data, "Connection still in use %u, no more multi_done now!",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  656|      0|               conn->attached_xfers);
  657|      0|    return CPOOL_DO_KEEP;
  658|      0|  }
  659|       |
  660|  9.37k|  if(multi_conn_should_close(conn, data, (bool)mdctx->premature)) {
  ------------------
  |  Branch (660:6): [True: 7.42k, False: 1.94k]
  ------------------
  661|  7.42k|    CURL_TRC_M(data, "multi_done, terminating conn #%" FMT_OFF_T " to %s:%u, "
  ------------------
  |  |  148|  7.42k|  do {                                   \
  |  |  149|  7.42k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  7.42k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  7.42k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  14.8k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 7.42k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 780, False: 6.64k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  14.8k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 780, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    780|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  7.42k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    780|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 178, False: 602]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  7.42k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  7.42k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 7.42k]
  |  |  ------------------
  ------------------
  662|  7.42k|               "forbid=%d, close=%d, premature=%d, conn_multiplex=%d",
  663|  7.42k|               conn->connection_id, conn->origin->user_hostname,
  664|  7.42k|               conn->origin->port,
  665|  7.42k|               data->set.reuse_forbid, conn->bits.close, mdctx->premature,
  666|  7.42k|               Curl_conn_is_multiplex(conn));
  667|  7.42k|    connclose(conn);
  ------------------
  |  |   72|  7.42k|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   66|  7.42k|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
  668|  7.42k|    return mdctx->premature ? CPOOL_DO_TERMINATE : CPOOL_DO_CLOSE;
  ------------------
  |  Branch (668:12): [True: 7.42k, False: 1]
  ------------------
  669|  7.42k|  }
  670|  1.94k|  else if(!Curl_conn_get_max_concurrent(data, conn)) {
  ------------------
  |  Branch (670:11): [True: 376, False: 1.57k]
  ------------------
  671|    376|    CURL_TRC_M(data, "multi_done, conn #%" FMT_OFF_T " to %s:%u was shutdown"
  ------------------
  |  |  148|    376|  do {                                   \
  |  |  149|    376|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|    376|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|    376|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|    752|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 376, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 23, False: 353]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|    752|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 23, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|     23|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|    376|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|     23|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 1, False: 22]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    376|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|    376|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 376]
  |  |  ------------------
  ------------------
  672|    376|               " by server, not reusing", conn->connection_id,
  673|    376|               conn->origin->user_hostname, conn->origin->port);
  674|    376|    connclose(conn);
  ------------------
  |  |   72|    376|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   66|    376|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
  675|    376|    return mdctx->premature ? CPOOL_DO_TERMINATE : CPOOL_DO_CLOSE;
  ------------------
  |  Branch (675:12): [True: 376, False: 0]
  ------------------
  676|    376|  }
  677|  1.57k|  else {
  678|  1.57k|    return CPOOL_DO_IDLE;
  679|  1.57k|  }
  680|  9.37k|}
multi.c:multi_conn_should_close:
  610|  9.37k|{
  611|       |  /* if conn->bits.close is TRUE, it means that the connection should be
  612|       |     closed in spite of everything else. */
  613|  9.37k|  if(conn->bits.close)
  ------------------
  |  Branch (613:6): [True: 0, False: 9.37k]
  ------------------
  614|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  615|       |
  616|       |  /* if data->set.reuse_forbid is TRUE, it means the libcurl client has forced
  617|       |     us to close this connection. This is ignored for requests taking place in
  618|       |     a NEGOTIATE authentication handshake. */
  619|  9.37k|  if(data->set.reuse_forbid
  ------------------
  |  Branch (619:6): [True: 25, False: 9.34k]
  ------------------
  620|       |#ifdef USE_SPNEGO
  621|       |     && !(conn->http_negotiate_state == CURL_NEGO_AUTH_RECV ||
  622|       |          conn->proxy_negotiate_state == CURL_NEGO_AUTH_RECV)
  623|       |#endif
  624|  9.37k|    )
  625|     25|    return TRUE;
  ------------------
  |  |  986|     25|#define TRUE true
  ------------------
  626|       |
  627|       |  /* Unless this connection is for a "connect-only" transfer, it
  628|       |   * needs to be closed if the protocol handler does not support reuse. */
  629|  9.34k|  if(!data->set.connect_only && conn->scheme &&
  ------------------
  |  Branch (629:6): [True: 9.34k, False: 0]
  |  Branch (629:33): [True: 9.34k, False: 0]
  ------------------
  630|  9.34k|     !(conn->scheme->flags & PROTOPT_CONN_REUSE))
  ------------------
  |  |  244|  9.34k|#define PROTOPT_CONN_REUSE (1 << 16)  /* this protocol can reuse connections */
  ------------------
  |  Branch (630:6): [True: 0, False: 9.34k]
  ------------------
  631|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  632|       |
  633|       |  /* if premature is TRUE, it means this connection was said to be DONE before
  634|       |     the entire request operation is complete and thus we cannot know in what
  635|       |     state it is for reusing, so we are forced to close it. In a perfect world
  636|       |     we can add code that keep track of if we really must close it here or not,
  637|       |     but currently we have no such detail knowledge. */
  638|  9.34k|  if(premature && !Curl_conn_is_multiplex(conn))
  ------------------
  |  Branch (638:6): [True: 8.78k, False: 562]
  |  Branch (638:19): [True: 7.39k, False: 1.38k]
  ------------------
  639|  7.39k|    return TRUE;
  ------------------
  |  |  986|  7.39k|#define TRUE true
  ------------------
  640|       |
  641|  1.94k|  return FALSE;
  ------------------
  |  |  989|  1.94k|#define FALSE false
  ------------------
  642|  9.34k|}
multi.c:multi_assess_wakeup:
  407|  40.6k|{
  408|  40.6k|#ifdef ENABLE_INTERNAL_WAKEUP
  409|  40.6k|  if(multi->socket_cb)
  ------------------
  |  Branch (409:6): [True: 11.3k, False: 29.3k]
  ------------------
  410|  11.3k|    return Curl_multi_ev_assess_xfer(multi, multi->admin);
  411|       |#else
  412|       |  (void)multi;
  413|       |#endif
  414|  29.3k|  return CURLM_OK;
  415|  40.6k|}
multi.c:mstate_connecting_pollset:
 1024|  59.3k|{
 1025|  59.3k|  struct connectdata *conn = data->conn;
 1026|  59.3k|  CURLcode result = CURLE_OK;
 1027|       |
 1028|  59.3k|  if(Curl_xfer_recv_is_paused(data))
  ------------------
  |  Branch (1028:6): [True: 0, False: 59.3k]
  ------------------
 1029|      0|    return CURLE_OK;
 1030|       |  /* If a socket is set, receiving is default. If the socket
 1031|       |   * has not been determined yet (eyeballing), always ask the
 1032|       |   * connection filters for what to monitor. */
 1033|  59.3k|  if(conn->chain.sock != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  59.3k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1033:6): [True: 0, False: 59.3k]
  ------------------
 1034|      0|    result = Curl_pollset_change(data, ps, conn->chain.sock, CURL_POLL_IN, 0);
  ------------------
  |  |  283|      0|#define CURL_POLL_IN     1
  ------------------
 1035|      0|    if(!result)
  ------------------
  |  Branch (1035:8): [True: 0, False: 0]
  ------------------
 1036|      0|      result = multi_adjust_pollset(data, ps);
 1037|      0|  }
 1038|  59.3k|  if(!result)
  ------------------
  |  Branch (1038:6): [True: 59.3k, False: 0]
  ------------------
 1039|  59.3k|    result = Curl_conn_adjust_pollset(data, conn, ps);
 1040|  59.3k|  return result;
 1041|  59.3k|}
multi.c:multi_adjust_pollset:
  995|  8.50k|{
  996|  8.50k|  struct connectdata *conn = data->conn;
  997|  8.50k|  bool send_blocked, recv_blocked;
  998|  8.50k|  CURLcode result = CURLE_OK;
  999|       |
 1000|  8.50k|  if(!ps->n)
  ------------------
  |  Branch (1000:6): [True: 0, False: 8.50k]
  ------------------
 1001|      0|    return CURLE_OK;
 1002|       |
 1003|  8.50k|  recv_blocked = (Curl_rlimit_avail(&data->progress.dl.rlimit, NULL) <= 0);
 1004|  8.50k|  send_blocked = (Curl_rlimit_avail(&data->progress.ul.rlimit, NULL) <= 0);
 1005|  8.50k|  if(send_blocked || recv_blocked) {
  ------------------
  |  Branch (1005:6): [True: 0, False: 8.50k]
  |  Branch (1005:22): [True: 0, False: 8.50k]
  ------------------
 1006|      0|    result = multi_cfchain_adjust_ps(
 1007|      0|      data, &conn->chain, recv_blocked, send_blocked, ps);
 1008|      0|  }
 1009|       |
 1010|       |  /* Not blocked and wanting to receive. If there is data pending
 1011|       |   * in the connection filters, make transfer run again. */
 1012|  8.50k|  if(!recv_blocked && (data->mstate != MSTATE_RATELIMITING) &&
  ------------------
  |  Branch (1012:6): [True: 8.50k, False: 0]
  |  Branch (1012:23): [True: 8.50k, False: 0]
  ------------------
 1013|  8.50k|     Curl_pollset_want_recv(data, ps, conn->chain.sock) &&
  ------------------
  |  Branch (1013:6): [True: 8.50k, False: 0]
  ------------------
 1014|  8.50k|     Curl_conn_data_pending(data)) {
  ------------------
  |  Branch (1014:6): [True: 0, False: 8.50k]
  ------------------
 1015|      0|    CURL_TRC_M(data, "pollset[] has POLLIN, but there is still "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1016|      0|               "buffered input -> mark as dirty");
 1017|      0|    Curl_multi_mark_dirty(data);
 1018|      0|  }
 1019|  8.50k|  return result;
 1020|  8.50k|}
multi.c:mstate_perform_pollset:
 1105|  8.50k|{
 1106|  8.50k|  struct connectdata *conn = data->conn;
 1107|  8.50k|  CURLcode result = CURLE_OK;
 1108|       |
 1109|  8.50k|  if(conn->scheme->run->perform_pollset)
  ------------------
  |  Branch (1109:6): [True: 8.50k, False: 0]
  ------------------
 1110|  8.50k|    result = conn->scheme->run->perform_pollset(data, ps);
 1111|      0|  else {
 1112|       |    /* Default is to obey the request flags for send/recv */
 1113|      0|    if(Curl_req_want_recv(data) && conn->bits.want_recv) {
  ------------------
  |  Branch (1113:8): [True: 0, False: 0]
  |  Branch (1113:36): [True: 0, False: 0]
  ------------------
 1114|      0|      result = Curl_pollset_add_in(data, ps, conn->chain.sock);
  ------------------
  |  |  152|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0)
  |  |  ------------------
  |  |  |  |  283|      0|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
 1115|      0|    }
 1116|      0|    if(!result && Curl_req_want_send(data) && conn->bits.want_send) {
  ------------------
  |  Branch (1116:8): [True: 0, False: 0]
  |  Branch (1116:19): [True: 0, False: 0]
  |  Branch (1116:47): [True: 0, False: 0]
  ------------------
 1117|      0|      result = Curl_pollset_add_out(data, ps, conn->chain.sock);
  ------------------
  |  |  156|      0|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, 0)
  |  |  ------------------
  |  |  |  |  284|      0|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
 1118|      0|    }
 1119|      0|  }
 1120|  8.50k|  if(!result)
  ------------------
  |  Branch (1120:6): [True: 8.50k, False: 0]
  ------------------
 1121|  8.50k|    result = multi_adjust_pollset(data, ps);
 1122|  8.50k|  if(!result)
  ------------------
  |  Branch (1122:6): [True: 8.50k, False: 0]
  ------------------
 1123|  8.50k|    result = Curl_conn_adjust_pollset(data, conn, ps);
 1124|  8.50k|  return result;
 1125|  8.50k|}
multi.c:multi_timeouts_count:
 1148|  7.62k|{
 1149|  7.62k|  size_t n = 0;
 1150|  7.62k|  uint8_t eid = timeouts->first;
 1151|  30.3k|  for(; eid < EXPIRE_LAST; eid = timeouts->next[eid])
  ------------------
  |  Branch (1151:9): [True: 22.7k, False: 7.62k]
  ------------------
 1152|  22.7k|    ++n;
 1153|  7.62k|  return n;
 1154|  7.62k|}
multi.c:multi_wait:
 1562|    395|{
 1563|    395|  size_t i;
 1564|    395|  int timeout_internal;
 1565|    395|  int nevents = 0;
 1566|    395|  struct easy_pollset ps;
 1567|    395|  struct pollfd a_few_on_stack[NUM_POLLS_ON_STACK];
 1568|    395|  struct curl_pollfds cpfds;
 1569|    395|  unsigned int curl_nfds = 0; /* how many pfds are for curl transfers */
 1570|    395|  struct Curl_easy *data = NULL;
 1571|    395|  CURLMcode mresult = CURLM_OK;
 1572|    395|  uint32_t mid;
 1573|    395|#ifdef ENABLE_WAKEUP
 1574|    395|  int wakeup_idx = -1;
 1575|    395|#endif
 1576|       |
 1577|    395|  if(timeout_ms < 0)
  ------------------
  |  Branch (1577:6): [True: 0, False: 395]
  ------------------
 1578|      0|    return CURLM_BAD_FUNCTION_ARGUMENT;
 1579|       |
 1580|    395|  Curl_pollset_init(&ps);
 1581|    395|  Curl_pollfds_init(&cpfds, a_few_on_stack, NUM_POLLS_ON_STACK);
  ------------------
  |  | 1554|    395|#define NUM_POLLS_ON_STACK 10
  ------------------
 1582|       |
 1583|       |  /* Add the curl handles to our pollfds first */
 1584|    395|  if(Curl_uint32_bset_first(&multi->process, &mid)) {
  ------------------
  |  Branch (1584:6): [True: 395, False: 0]
  ------------------
 1585|    790|    do {
 1586|    790|      data = Curl_multi_get_easy(multi, mid);
 1587|    790|      if(!data) {
  ------------------
  |  Branch (1587:10): [True: 0, False: 790]
  ------------------
 1588|      0|        DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1588:9): [Folded, False: 0]
  |  Branch (1588:9): [Folded, False: 0]
  ------------------
 1589|      0|        Curl_uint32_bset_remove(&multi->process, mid);
 1590|      0|        Curl_uint32_bset_remove(&multi->dirty, mid);
 1591|      0|        continue;
 1592|      0|      }
 1593|    790|      Curl_multi_pollset(data, &ps);
 1594|    790|      if(Curl_pollfds_add_ps(&cpfds, &ps)) {
  ------------------
  |  Branch (1594:10): [True: 0, False: 790]
  ------------------
 1595|      0|        mresult = CURLM_OUT_OF_MEMORY;
 1596|      0|        goto out;
 1597|      0|      }
 1598|    790|    } while(Curl_uint32_bset_next(&multi->process, mid, &mid));
  ------------------
  |  Branch (1598:13): [True: 395, False: 395]
  ------------------
 1599|    395|  }
 1600|       |
 1601|    395|  if(Curl_cshutdn_add_pollfds(&multi->cshutdn, multi->admin, &cpfds)) {
  ------------------
  |  Branch (1601:6): [True: 0, False: 395]
  ------------------
 1602|      0|    mresult = CURLM_OUT_OF_MEMORY;
 1603|      0|    goto out;
 1604|      0|  }
 1605|       |
 1606|    395|#ifdef ENABLE_WAKEUP
 1607|       |  /* If `extrawait` is TRUE *or* we have `extra_fds`to poll *or* we
 1608|       |   * have transfer sockets to poll, we obey `timeout_ms`.
 1609|       |   * Then we need to also monitor the multi's wakeup
 1610|       |   * socket to catch calls to `curl_multi_wakeup()` during the wait. */
 1611|    395|  if(extrawait || cpfds.n || extra_nfds) {
  ------------------
  |  Branch (1611:6): [True: 395, False: 0]
  |  Branch (1611:19): [True: 0, False: 0]
  |  Branch (1611:30): [True: 0, False: 0]
  ------------------
 1612|    395|    wakeup_idx = cpfds.n;
 1613|    395|    if(Curl_pollfds_add_sock(&cpfds, multi->wakeup_pair[0], POLLIN)) {
  ------------------
  |  Branch (1613:8): [True: 0, False: 395]
  ------------------
 1614|      0|      mresult = CURLM_OUT_OF_MEMORY;
 1615|      0|      goto out;
 1616|      0|    }
 1617|    395|  }
 1618|    395|#endif
 1619|       |
 1620|    395|  curl_nfds = cpfds.n; /* what curl internally uses in cpfds */
 1621|       |  /* Add external file descriptions from poll-like struct curl_waitfd */
 1622|    395|  for(i = 0; i < extra_nfds; i++) {
  ------------------
  |  Branch (1622:14): [True: 0, False: 395]
  ------------------
 1623|      0|    unsigned short events = 0;
 1624|      0|    if(extra_fds[i].events & CURL_WAIT_POLLIN)
  ------------------
  |  |  109|      0|#define CURL_WAIT_POLLIN    0x0001
  ------------------
  |  Branch (1624:8): [True: 0, False: 0]
  ------------------
 1625|      0|      events |= POLLIN;
 1626|      0|    if(extra_fds[i].events & CURL_WAIT_POLLPRI)
  ------------------
  |  |  110|      0|#define CURL_WAIT_POLLPRI   0x0002
  ------------------
  |  Branch (1626:8): [True: 0, False: 0]
  ------------------
 1627|      0|      events |= POLLPRI;
 1628|      0|    if(extra_fds[i].events & CURL_WAIT_POLLOUT)
  ------------------
  |  |  111|      0|#define CURL_WAIT_POLLOUT   0x0004
  ------------------
  |  Branch (1628:8): [True: 0, False: 0]
  ------------------
 1629|      0|      events |= POLLOUT;
 1630|      0|    if(Curl_pollfds_add_sock(&cpfds, extra_fds[i].fd, events)) {
  ------------------
  |  Branch (1630:8): [True: 0, False: 0]
  ------------------
 1631|      0|      mresult = CURLM_OUT_OF_MEMORY;
 1632|      0|      goto out;
 1633|      0|    }
 1634|      0|  }
 1635|       |
 1636|       |  /* We check the internal timeout *AFTER* we collected all sockets to
 1637|       |   * poll. Collecting the sockets may install new timers by protocols
 1638|       |   * and connection filters.
 1639|       |   * Use the shorter one of the internal and the caller requested timeout.
 1640|       |   * If we are called with `!extrawait` and multi_timeout() reports no
 1641|       |   * timeouts exist, do not wait. */
 1642|    395|  multi_timeout(multi, NULL, &timeout_internal);
 1643|    395|  if((timeout_internal >= 0) && (timeout_internal < timeout_ms))
  ------------------
  |  Branch (1643:6): [True: 395, False: 0]
  |  Branch (1643:33): [True: 0, False: 395]
  ------------------
 1644|      0|    timeout_ms = timeout_internal;
 1645|       |
 1646|    395|  if(data)
  ------------------
  |  Branch (1646:6): [True: 395, False: 0]
  ------------------
 1647|    395|    CURL_TRC_M(data, "multi_wait(fds=%u, timeout=%d) tinternal=%d",
  ------------------
  |  |  148|    395|  do {                                   \
  |  |  149|    395|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|    395|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|    395|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|    790|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 395, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 124, False: 271]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|    790|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 124, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    124|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|    395|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    124|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 58, False: 66]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|    395|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|    395|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 395]
  |  |  ------------------
  ------------------
 1648|    395|               cpfds.n, timeout_ms, timeout_internal);
 1649|       |
 1650|       |#ifdef USE_WINSOCK
 1651|       |  mresult = multi_winsock_select(multi, &cpfds, curl_nfds,
 1652|       |                                 extra_fds, extra_nfds,
 1653|       |                                 timeout_ms, extrawait, &nevents);
 1654|       |#else
 1655|    395|  mresult = multi_posix_poll(multi, &cpfds, curl_nfds,
 1656|    395|                             extra_fds, extra_nfds,
 1657|    395|                             timeout_ms, extrawait, &nevents);
 1658|    395|#endif
 1659|       |
 1660|    395|#ifdef ENABLE_WAKEUP
 1661|    395|    if(nevents && (wakeup_idx >= 0)) {
  ------------------
  |  Branch (1661:8): [True: 190, False: 205]
  |  Branch (1661:19): [True: 190, False: 0]
  ------------------
 1662|    190|      if(cpfds.pfds[wakeup_idx].revents & POLLIN) {
  ------------------
  |  Branch (1662:10): [True: 0, False: 190]
  ------------------
 1663|      0|        (void)Curl_wakeup_consume(multi->wakeup_pair, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1664|       |        /* do not count the wakeup socket into the returned value */
 1665|      0|        nevents--;
 1666|      0|      }
 1667|    190|    }
 1668|    395|#endif
 1669|       |
 1670|    395|out:
 1671|    395|  Curl_pollset_cleanup(&ps);
 1672|    395|  Curl_pollfds_cleanup(&cpfds);
 1673|    395|  if(ret)
  ------------------
  |  Branch (1673:6): [True: 395, False: 0]
  ------------------
 1674|    395|    *ret = nevents;
 1675|    395|  return mresult;
 1676|    395|}
multi.c:multi_posix_poll:
 1511|    395|{
 1512|    395|  CURLMcode mresult = CURLM_OK;
 1513|    395|  int nevents = 0;
 1514|    395|  size_t i;
 1515|       |
 1516|    395|  (void)multi;
 1517|    395|  if(cpfds->n) {
  ------------------
  |  Branch (1517:6): [True: 395, False: 0]
  ------------------
 1518|    395|    int pollrc = Curl_poll(cpfds->pfds, cpfds->n, timeout_ms); /* wait... */
 1519|    395|    if(pollrc < 0) {
  ------------------
  |  Branch (1519:8): [True: 0, False: 395]
  ------------------
 1520|      0|      mresult = CURLM_UNRECOVERABLE_POLL;
 1521|      0|      goto out;
 1522|      0|    }
 1523|    395|    nevents = pollrc;
 1524|       |
 1525|       |    /* copy revents results from the poll to the curl_multi_wait poll
 1526|       |       struct, the bit values of the actual underlying poll() implementation
 1527|       |       may not be the same as the ones in the public libcurl API! */
 1528|    395|    for(i = 0; i < extra_nfds; i++) {
  ------------------
  |  Branch (1528:16): [True: 0, False: 395]
  ------------------
 1529|      0|      unsigned r = (unsigned)cpfds->pfds[curl_nfds + i].revents;
 1530|      0|      unsigned short mask = 0;
 1531|      0|      if(r & POLLIN)
  ------------------
  |  Branch (1531:10): [True: 0, False: 0]
  ------------------
 1532|      0|        mask |= CURL_WAIT_POLLIN;
  ------------------
  |  |  109|      0|#define CURL_WAIT_POLLIN    0x0001
  ------------------
 1533|      0|      if(r & POLLOUT)
  ------------------
  |  Branch (1533:10): [True: 0, False: 0]
  ------------------
 1534|      0|        mask |= CURL_WAIT_POLLOUT;
  ------------------
  |  |  111|      0|#define CURL_WAIT_POLLOUT   0x0004
  ------------------
 1535|      0|      if(r & POLLPRI)
  ------------------
  |  Branch (1535:10): [True: 0, False: 0]
  ------------------
 1536|      0|        mask |= CURL_WAIT_POLLPRI;
  ------------------
  |  |  110|      0|#define CURL_WAIT_POLLPRI   0x0002
  ------------------
 1537|      0|      extra_fds[i].revents = (short)mask;
 1538|      0|    }
 1539|    395|  }
 1540|      0|  else if(extrawait) {
  ------------------
  |  Branch (1540:11): [True: 0, False: 0]
  ------------------
 1541|       |    /* No fds to poll, but asked to obey timeout_ms anyway. We cannot
 1542|       |     * use Curl_poll() as it, on some platforms, returns immediately
 1543|       |     * without fds. */
 1544|      0|    curlx_wait_ms(timeout_ms);
 1545|      0|  }
 1546|       |
 1547|    395|out:
 1548|    395|  *pnevents = nevents;
 1549|    395|  return mresult;
 1550|    395|}
multi.c:multi_perform:
 2965|   122k|{
 2966|   122k|  CURLMcode returncode = CURLM_OK;
 2967|   122k|  struct curltime start;
 2968|   122k|  uint32_t mid;
 2969|   122k|  struct Curl_sigpipe_ctx sigpipe_ctx;
 2970|       |
 2971|   122k|  curlx_pnow(&start);
 2972|   122k|  sigpipe_init(&sigpipe_ctx);
 2973|       |
 2974|   122k|  if(Curl_uint32_bset_first(&multi->process, &mid)) {
  ------------------
  |  Branch (2974:6): [True: 122k, False: 0]
  ------------------
 2975|   122k|    CURL_TRC_M(multi->admin, "multi_perform(running=%u)",
  ------------------
  |  |  148|   122k|  do {                                   \
  |  |  149|   122k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|   122k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|   122k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|   244k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 122k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 122k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|   244k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|   122k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|   122k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|   122k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 122k]
  |  |  ------------------
  ------------------
 2976|   122k|               multi_xfers_running(multi));
 2977|   244k|    do {
 2978|   244k|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 2979|   244k|      CURLMcode mresult;
 2980|   244k|      if(!data) {
  ------------------
  |  Branch (2980:10): [True: 0, False: 244k]
  ------------------
 2981|      0|        DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2981:9): [Folded, False: 0]
  |  Branch (2981:9): [Folded, False: 0]
  ------------------
 2982|      0|        Curl_uint32_bset_remove(&multi->process, mid);
 2983|      0|        Curl_uint32_bset_remove(&multi->dirty, mid);
 2984|      0|        continue;
 2985|      0|      }
 2986|   244k|      mresult = multi_runsingle(multi, data, &sigpipe_ctx);
 2987|   244k|      if(mresult)
  ------------------
  |  Branch (2987:10): [True: 0, False: 244k]
  ------------------
 2988|      0|        returncode = mresult;
 2989|   244k|    } while(Curl_uint32_bset_next(&multi->process, mid, &mid));
  ------------------
  |  Branch (2989:13): [True: 122k, False: 122k]
  ------------------
 2990|   122k|  }
 2991|   122k|  sigpipe_restore(&sigpipe_ctx);
 2992|       |
 2993|   122k|  if(multi_ischanged(multi, TRUE))
  ------------------
  |  |  986|   122k|#define TRUE true
  ------------------
  |  Branch (2993:6): [True: 6.42k, False: 115k]
  ------------------
 2994|  6.42k|    multi_schedule_pending(multi);
 2995|       |
 2996|   122k|  if(!returncode && CURL_MNTFY_HAS_ENTRIES(multi))
  ------------------
  |  |   58|   122k|  ((m)->ntfy.flags & CURL_MNTFY_FLAG_HAS_ENTRIES)
  |  |  ------------------
  |  |  |  |   28|   122k|#define CURL_MNTFY_FLAG_HAS_ENTRIES  ((uint32_t)1 << 31)
  |  |  ------------------
  |  |  |  Branch (58:3): [True: 0, False: 122k]
  |  |  ------------------
  ------------------
  |  Branch (2996:6): [True: 122k, False: 0]
  ------------------
 2997|      0|    returncode = Curl_mntfy_dispatch_all(multi);
 2998|       |
 2999|       |  /*
 3000|       |   * Remove all expired timers from the splay since handles are dealt
 3001|       |   * with unconditionally by this function and curl_multi_timeout() requires
 3002|       |   * that already passed/handled expire times are removed from the splay.
 3003|       |   *
 3004|       |   * It is important that the 'now' value is set at the entry of this function
 3005|       |   * and not for the current time as it may have ticked a little while since
 3006|       |   * then and then we risk this loop to remove timers that actually have not
 3007|       |   * been handled!
 3008|       |   */
 3009|   122k|  while(Curl_timeouts_remove_expired(&multi->timeouts, &start, &mid)) {
  ------------------
  |  Branch (3009:9): [True: 0, False: 122k]
  ------------------
 3010|       |    /* the removed may have another timeout in queue */
 3011|      0|    struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3012|      0|    if(!data) {
  ------------------
  |  Branch (3012:8): [True: 0, False: 0]
  ------------------
 3013|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3013:7): [Folded, False: 0]
  |  Branch (3013:7): [Folded, False: 0]
  ------------------
 3014|      0|      continue;
 3015|      0|    }
 3016|      0|    (void)add_next_timeout(&start, multi, data);
 3017|      0|    if(data->mstate == MSTATE_PENDING) {
  ------------------
  |  Branch (3017:8): [True: 0, False: 0]
  ------------------
 3018|      0|      bool stream_unused;
 3019|      0|      CURLcode result_unused;
 3020|      0|      if(multi_handle_timeout(data, Curl_pgrs_now(data),
  ------------------
  |  Branch (3020:10): [True: 0, False: 0]
  ------------------
 3021|      0|                              &stream_unused, &result_unused, TRUE)) {
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 3022|      0|        infof(data, "PENDING handle timeout");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3023|      0|        move_pending_to_connect(multi, data);
 3024|      0|      }
 3025|      0|    }
 3026|      0|  }
 3027|       |
 3028|   122k|  if(running_handles) {
  ------------------
  |  Branch (3028:6): [True: 122k, False: 0]
  ------------------
 3029|   122k|    uint32_t running = multi_xfers_running(multi);
 3030|   122k|    *running_handles = (running < INT_MAX) ? (int)running : INT_MAX;
  ------------------
  |  Branch (3030:24): [True: 122k, False: 0]
  ------------------
 3031|   122k|  }
 3032|       |
 3033|   122k|  if(CURLM_OK >= returncode)
  ------------------
  |  Branch (3033:6): [True: 122k, False: 0]
  ------------------
 3034|   122k|    returncode = Curl_update_timer(multi);
 3035|       |
 3036|   122k|  return returncode;
 3037|   122k|}
multi.c:multi_runsingle:
 2769|   258k|{
 2770|   258k|  CURLMcode mresult = CURLM_OK;
 2771|   258k|  CURLcode result = CURLE_OK;
 2772|   258k|  const struct curltime *pnow = NULL;
 2773|       |
 2774|   258k|  if(multi->dead) {
  ------------------
  |  Branch (2774:6): [True: 0, False: 258k]
  ------------------
 2775|       |    /* a multi-level callback returned error before, meaning every individual
 2776|       |     transfer now has failed */
 2777|      0|    result = CURLE_ABORTED_BY_CALLBACK;
 2778|      0|    multi_posttransfer(data);
 2779|      0|    multi_done(data, result, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2780|      0|    multistate(data, MSTATE_COMPLETED);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2781|      0|  }
 2782|       |
 2783|   258k|  multi_warn_debug(multi, data);
 2784|       |
 2785|       |  /* transfer runs now, clear the dirty bit. This may be set
 2786|       |   * again during processing, triggering a re-run later. */
 2787|   258k|  Curl_uint32_bset_remove(&multi->dirty, data->mid);
 2788|       |
 2789|   258k|  if(data == multi->admin) {
  ------------------
  |  Branch (2789:6): [True: 122k, False: 136k]
  ------------------
 2790|   122k|#ifdef ENABLE_INTERNAL_WAKEUP
 2791|       |    /* Consume any pending wakeup signals before processing.
 2792|       |     * This is necessary for event based processing. See #21547 */
 2793|   122k|    (void)Curl_wakeup_consume(multi->wakeup_internal, TRUE);
  ------------------
  |  |  986|   122k|#define TRUE true
  ------------------
 2794|   122k|#endif
 2795|   122k|#ifdef USE_RESOLV_THREADED
 2796|   122k|    Curl_async_thrdd_multi_process(multi);
 2797|   122k|#endif
 2798|   122k|    Curl_cshutdn_perform(&multi->cshutdn, multi->admin, sigpipe_ctx);
 2799|   122k|    goto out;
 2800|   122k|  }
 2801|       |
 2802|   136k|  sigpipe_apply(data, sigpipe_ctx);
 2803|   173k|  do {
 2804|       |    /* A "stream" here is a logical stream if the protocol can handle that
 2805|       |       (HTTP/2), or the full connection for older protocols */
 2806|   173k|    bool stream_error = FALSE;
  ------------------
  |  |  989|   173k|#define FALSE false
  ------------------
 2807|   173k|    mresult = CURLM_OK;
 2808|   173k|    pnow = NULL;
 2809|       |
 2810|   173k|    if(multi_ischanged(multi, TRUE)) {
  ------------------
  |  |  986|   173k|#define TRUE true
  ------------------
  |  Branch (2810:8): [True: 1.95k, False: 171k]
  ------------------
 2811|  1.95k|      CURL_TRC_M(data, "multi changed, check CONNECT_PEND queue");
  ------------------
  |  |  148|  1.95k|  do {                                   \
  |  |  149|  1.95k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  1.95k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  1.95k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  3.91k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  3.91k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  1.95k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 4, False: 143]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  1.95k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  1.95k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
 2812|  1.95k|      multi_schedule_pending(multi); /* multiplexed */
 2813|  1.95k|    }
 2814|       |
 2815|   173k|    if(data->mstate > MSTATE_CONNECT &&
  ------------------
  |  Branch (2815:8): [True: 144k, False: 29.0k]
  ------------------
 2816|   144k|       data->mstate < MSTATE_COMPLETED) {
  ------------------
  |  Branch (2816:8): [True: 144k, False: 0]
  ------------------
 2817|       |      /* Make sure we set the connection's current owner */
 2818|   144k|      DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|   144k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2818:7): [True: 0, False: 144k]
  |  Branch (2818:7): [True: 144k, False: 0]
  ------------------
 2819|   144k|      if(!data->conn) {
  ------------------
  |  Branch (2819:10): [True: 0, False: 144k]
  ------------------
 2820|      0|        mresult = CURLM_INTERNAL_ERROR;
 2821|      0|        goto out;
 2822|      0|      }
 2823|   144k|    }
 2824|       |
 2825|       |    /* Wait for the connect state as only then is the start time stored, but
 2826|       |       we must not check already completed handles.
 2827|       |
 2828|       |       Check the overall timeout here but defer the connect timeout to after
 2829|       |       the state machine ran (below): the connection may have completed in
 2830|       |       the window since the application last called us, and the state
 2831|       |       machine must get to see the connected socket before we declare the
 2832|       |       connect timed out. Otherwise an application that is slow to call
 2833|       |       curl_multi_perform() gets CURLE_OPERATION_TIMEDOUT on a connection
 2834|       |       that is already up.
 2835|       |
 2836|       |       In MSTATE_CONNECT no connect is underway yet, so the connect timeout
 2837|       |       is still checked here: a transfer queued by a connection limit past
 2838|       |       its connect timeout must fail instead of going back to PENDING. */
 2839|   173k|    if((data->mstate >= MSTATE_CONNECT) && (data->mstate < MSTATE_COMPLETED)) {
  ------------------
  |  Branch (2839:8): [True: 153k, False: 19.4k]
  |  Branch (2839:44): [True: 153k, False: 0]
  ------------------
 2840|   153k|      pnow = Curl_pgrs_now(data);
 2841|   153k|      if(multi_handle_timeout(data, pnow, &stream_error, &result,
  ------------------
  |  Branch (2841:10): [True: 0, False: 153k]
  ------------------
 2842|   153k|                              data->mstate == MSTATE_CONNECT))
 2843|       |        /* Skip the statemachine and go directly to error handling section. */
 2844|      0|        goto statemachine_end;
 2845|   153k|      pnow = NULL;
 2846|   153k|    }
 2847|       |
 2848|   173k|    switch(data->mstate) {
 2849|  9.76k|    case MSTATE_INIT:
  ------------------
  |  Branch (2849:5): [True: 9.76k, False: 163k]
  ------------------
 2850|       |      /* Transitional state. init this transfer. A handle never comes back to
 2851|       |         this state. */
 2852|  9.76k|      mresult = multistate_init(data, &result);
 2853|  9.76k|      break;
 2854|       |
 2855|  9.66k|    case MSTATE_SETUP:
  ------------------
  |  Branch (2855:5): [True: 9.66k, False: 163k]
  ------------------
 2856|       |      /* Transitional state. Setup things for a new transfer. The handle
 2857|       |         can come back to this state on a redirect. */
 2858|  9.66k|      mresult = multistate_setup(data);
 2859|  9.66k|      break;
 2860|       |
 2861|  9.66k|    case MSTATE_CONNECT:
  ------------------
  |  Branch (2861:5): [True: 9.66k, False: 163k]
  ------------------
 2862|  9.66k|      mresult = multistate_connect(multi, data, &result);
 2863|  9.66k|      break;
 2864|       |
 2865|   128k|    case MSTATE_CONNECTING:
  ------------------
  |  Branch (2865:5): [True: 128k, False: 45.0k]
  ------------------
 2866|       |      /* awaiting a completion of an asynch TCP connect */
 2867|   128k|      mresult = multistate_connecting(data, &stream_error, &result);
 2868|   128k|      break;
 2869|       |
 2870|  1.95k|    case MSTATE_PROTOCONNECT:
  ------------------
  |  Branch (2870:5): [True: 1.95k, False: 171k]
  ------------------
 2871|  1.95k|      mresult = multistate_protoconnect(data, &stream_error, &result);
 2872|  1.95k|      break;
 2873|       |
 2874|      0|    case MSTATE_PROTOCONNECTING:
  ------------------
  |  Branch (2874:5): [True: 0, False: 173k]
  ------------------
 2875|       |      /* protocol-specific connect phase */
 2876|      0|      mresult = multistate_protoconnecting(data, &stream_error, &result);
 2877|      0|      break;
 2878|       |
 2879|  1.95k|    case MSTATE_DO:
  ------------------
  |  Branch (2879:5): [True: 1.95k, False: 171k]
  ------------------
 2880|  1.95k|      mresult = multistate_do(data, &stream_error, &result);
 2881|  1.95k|      break;
 2882|       |
 2883|      0|    case MSTATE_DOING:
  ------------------
  |  Branch (2883:5): [True: 0, False: 173k]
  ------------------
 2884|       |      /* we continue DOING until the DO phase is complete */
 2885|      0|      mresult = multistate_doing(data, &stream_error, &result);
 2886|      0|      break;
 2887|       |
 2888|      0|    case MSTATE_DOING_MORE:
  ------------------
  |  Branch (2888:5): [True: 0, False: 173k]
  ------------------
 2889|       |      /*
 2890|       |       * When we are connected, DOING MORE and then go DID
 2891|       |       */
 2892|      0|      mresult = multistate_doing_more(data, &stream_error, &result);
 2893|      0|      break;
 2894|       |
 2895|  1.92k|    case MSTATE_DID:
  ------------------
  |  Branch (2895:5): [True: 1.92k, False: 171k]
  ------------------
 2896|  1.92k|      mresult = multistate_did(multi, data);
 2897|  1.92k|      break;
 2898|       |
 2899|      0|    case MSTATE_RATELIMITING: /* limit-rate exceeded in either direction */
  ------------------
  |  Branch (2899:5): [True: 0, False: 173k]
  ------------------
 2900|      0|      mresult = multistate_ratelimiting(data, &result);
 2901|      0|      break;
 2902|       |
 2903|  9.62k|    case MSTATE_PERFORMING:
  ------------------
  |  Branch (2903:5): [True: 9.62k, False: 163k]
  ------------------
 2904|  9.62k|      mresult = multistate_performing(data, &stream_error, &result);
 2905|  9.62k|      break;
 2906|       |
 2907|    533|    case MSTATE_DONE:
  ------------------
  |  Branch (2907:5): [True: 533, False: 172k]
  ------------------
 2908|    533|      mresult = multistate_done(data, &result);
 2909|    533|      break;
 2910|       |
 2911|      0|    case MSTATE_COMPLETED:
  ------------------
  |  Branch (2911:5): [True: 0, False: 173k]
  ------------------
 2912|      0|      break;
 2913|       |
 2914|      0|    case MSTATE_PENDING:
  ------------------
  |  Branch (2914:5): [True: 0, False: 173k]
  ------------------
 2915|      0|    case MSTATE_MSGSENT:
  ------------------
  |  Branch (2915:5): [True: 0, False: 173k]
  ------------------
 2916|       |      /* handles in these states should NOT be in this list */
 2917|      0|      break;
 2918|       |
 2919|      0|    default:
  ------------------
  |  Branch (2919:5): [True: 0, False: 173k]
  ------------------
 2920|      0|      mresult = CURLM_INTERNAL_ERROR;
 2921|      0|      goto out;
 2922|   173k|    }
 2923|       |
 2924|   173k|    if(data->mstate >= MSTATE_CONNECT &&
  ------------------
  |  Branch (2924:8): [True: 163k, False: 9.76k]
  ------------------
 2925|   163k|       data->mstate < MSTATE_COMPLETED &&
  ------------------
  |  Branch (2925:8): [True: 163k, False: 533]
  ------------------
 2926|   163k|       (Curl_is_connecting(data) ||
  ------------------
  |  Branch (2926:9): [True: 147k, False: 15.4k]
  ------------------
 2927|  15.4k|        (data->conn && data->conn->connect_start_ms >= 0)) &&
  ------------------
  |  Branch (2927:10): [True: 14.8k, False: 619]
  |  Branch (2927:24): [True: 0, False: 14.8k]
  ------------------
 2928|   147k|       mresult != CURLM_CALL_MULTI_PERFORM &&
  ------------------
  |  Branch (2928:8): [True: 126k, False: 20.9k]
  ------------------
 2929|   126k|       !multi_ischanged(multi, FALSE)) {
  ------------------
  |  |  989|   126k|#define FALSE false
  ------------------
  |  Branch (2929:8): [True: 120k, False: 6.55k]
  ------------------
 2930|       |      /* We now handle stream timeouts if and only if this will be the last
 2931|       |       * loop iteration. We only check this on the last iteration to ensure
 2932|       |       * that if we know we have additional work to do immediately
 2933|       |       * (i.e. CURLM_CALL_MULTI_PERFORM == TRUE) then we should do that before
 2934|       |       * declaring the connection timed out as we may almost have a completed
 2935|       |       * connection. This covers the connect of the transfer's connection,
 2936|       |       * a handshake still connecting in a later state (WebSocket Upgrade)
 2937|       |       * and a connect of a secondary connection (`connect_start_ms` set),
 2938|       |       * like the FTP data connection. */
 2939|   120k|      pnow = Curl_pgrs_now(data);
 2940|   120k|      multi_handle_timeout(data, pnow, &stream_error, &result, TRUE);
  ------------------
  |  |  986|   120k|#define TRUE true
  ------------------
 2941|   120k|    }
 2942|       |
 2943|   173k|statemachine_end:
 2944|   173k|    if(!pnow)
  ------------------
  |  Branch (2944:8): [True: 53.3k, False: 120k]
  ------------------
 2945|  53.3k|      pnow = Curl_pgrs_now(data);
 2946|   173k|    result = is_finished(multi, data, pnow, stream_error, result);
 2947|   173k|    if(result)
  ------------------
  |  Branch (2947:8): [True: 7.51k, False: 165k]
  ------------------
 2948|  7.51k|      mresult = CURLM_CALL_MULTI_PERFORM;
 2949|       |
 2950|   173k|    if(MSTATE_COMPLETED == data->mstate) {
  ------------------
  |  Branch (2950:8): [True: 8.05k, False: 165k]
  ------------------
 2951|  8.05k|      handle_completed(multi, data, result);
 2952|  8.05k|      mresult = CURLM_OK;
 2953|  8.05k|      goto out;
 2954|  8.05k|    }
 2955|   173k|  } while((mresult == CURLM_CALL_MULTI_PERFORM) ||
  ------------------
  |  Branch (2955:11): [True: 37.0k, False: 128k]
  ------------------
 2956|   128k|          multi_ischanged(multi, FALSE));
  ------------------
  |  |  989|   128k|#define FALSE false
  ------------------
  |  Branch (2956:11): [True: 0, False: 128k]
  ------------------
 2957|       |
 2958|   258k|out:
 2959|   258k|  data->done = (uint8_t)result;
 2960|   258k|  return mresult;
 2961|   136k|}
multi.c:multi_posttransfer:
 1976|  7.97k|{
 1977|       |#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(MSG_NOSIGNAL)
 1978|       |  /* restore the signal handler for SIGPIPE before we get back */
 1979|       |  if(!data->set.no_signal)
 1980|       |    signal(SIGPIPE, data->state.prev_signal);
 1981|       |#else
 1982|  7.97k|  (void)data;
 1983|  7.97k|#endif
 1984|  7.97k|}
multi.c:multistate_init:
 2518|  9.76k|{
 2519|  9.76k|  if(!data->state.really_alive) {
  ------------------
  |  Branch (2519:6): [True: 9.76k, False: 0]
  ------------------
 2520|  9.76k|    data->state.really_alive = TRUE;
  ------------------
  |  |  986|  9.76k|#define TRUE true
  ------------------
 2521|  9.76k|    ++data->multi->xfers_really_alive;
 2522|  9.76k|    if(data->multi->xfers_really_alive == 1) {
  ------------------
  |  Branch (2522:8): [True: 9.76k, False: 0]
  ------------------
 2523|  9.76k|      CURLMcode mresult = multi_assess_wakeup(data->multi);
 2524|  9.76k|      if(mresult) {
  ------------------
  |  Branch (2524:10): [True: 16, False: 9.74k]
  ------------------
 2525|     16|        failf(data, "error enabling wakeup listening: %d", mresult);
  ------------------
  |  |   62|     16|#define failf Curl_failf
  ------------------
 2526|     16|        return mresult;
 2527|     16|      }
 2528|  9.76k|    }
 2529|  9.76k|  }
 2530|       |
 2531|  9.74k|  *result = Curl_pretransfer(data);
 2532|  9.74k|  if(*result)
  ------------------
  |  Branch (2532:6): [True: 80, False: 9.66k]
  ------------------
 2533|     80|    return CURLM_OK;
 2534|       |
 2535|       |  /* after init, go SETUP */
 2536|  9.66k|  multistate(data, MSTATE_SETUP);
  ------------------
  |  |  196|  9.66k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2537|  9.66k|  Curl_pgrsTime(data, TIMER_STARTOP);
 2538|  9.66k|  return CURLM_CALL_MULTI_PERFORM;
 2539|  9.74k|}
multi.c:multistate_setup:
 2542|  9.66k|{
 2543|  9.66k|  const struct curltime *pnow = Curl_pgrs_now(data);
 2544|  9.66k|  timediff_t ctimeout_ms = (data->set.connecttimeout > 0) ?
  ------------------
  |  Branch (2544:28): [True: 9.66k, False: 0]
  ------------------
 2545|  9.66k|    data->set.connecttimeout : DEFAULT_CONNECT_TIMEOUT;
  ------------------
  |  |   45|      0|#define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */
  ------------------
 2546|       |
 2547|  9.66k|  Curl_pgrsTimeWas(data, TIMER_STARTSINGLE, *pnow);
 2548|  9.66k|  if(data->set.timeout)
  ------------------
  |  Branch (2548:6): [True: 9.66k, False: 0]
  ------------------
 2549|  9.66k|    Curl_expire_set(data, EXPIRE_TIMEOUT, data->set.timeout, pnow);
 2550|       |  /* Since a connection might go to pending and back to CONNECT several
 2551|       |     times before it actually takes off, we need to set the timeout once
 2552|       |     in SETUP before we enter CONNECT the first time. */
 2553|  9.66k|  Curl_expire_set(data, EXPIRE_CONNECTTIMEOUT, ctimeout_ms, pnow);
 2554|       |
 2555|  9.66k|  multistate(data, MSTATE_CONNECT);
  ------------------
  |  |  196|  9.66k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2556|  9.66k|  return CURLM_CALL_MULTI_PERFORM;
 2557|  9.66k|}
multi.c:multistate_connect:
 2368|  9.66k|{
 2369|       |  /* Connect. We want to get a connection identifier filled in. This state can
 2370|       |     be entered from SETUP and from PENDING. */
 2371|  9.66k|  bool connected;
 2372|  9.66k|  CURLMcode mresult = CURLM_OK;
 2373|  9.66k|  CURLcode result = Curl_connect(data, &connected);
 2374|  9.66k|  if(result == CURLE_NO_CONNECTION_AVAILABLE) {
  ------------------
  |  Branch (2374:6): [True: 0, False: 9.66k]
  ------------------
 2375|       |    /* There was no connection available. We will go to the pending state and
 2376|       |       wait for an available connection. */
 2377|      0|    multistate(data, MSTATE_PENDING);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2378|       |    /* move from process to pending set */
 2379|      0|    Curl_uint32_bset_remove(&multi->process, data->mid);
 2380|      0|    Curl_uint32_bset_remove(&multi->dirty, data->mid);
 2381|      0|    Curl_uint32_bset_add(&multi->pending, data->mid);
 2382|      0|    *resultp = CURLE_OK;
 2383|      0|    return mresult;
 2384|      0|  }
 2385|  9.66k|  else
 2386|  9.66k|    multi_schedule_pending(data->multi);
 2387|       |
 2388|  9.66k|  if(!result) {
  ------------------
  |  Branch (2388:6): [True: 9.37k, False: 293]
  ------------------
 2389|       |    /* after the connect has been sent off, go WAITCONNECT unless the
 2390|       |       protocol connect is already done and we can go directly to WAITDO or
 2391|       |       DO! */
 2392|  9.37k|    mresult = CURLM_CALL_MULTI_PERFORM;
 2393|       |
 2394|  9.37k|    if(connected) {
  ------------------
  |  Branch (2394:8): [True: 0, False: 9.37k]
  ------------------
 2395|      0|      if(!data->conn->bits.reuse && Curl_conn_is_multiplex(data->conn)) {
  ------------------
  |  Branch (2395:10): [True: 0, False: 0]
  |  Branch (2395:37): [True: 0, False: 0]
  ------------------
 2396|       |        /* new connection, can multiplex, wake pending handles */
 2397|      0|        multi_schedule_pending(data->multi);
 2398|      0|      }
 2399|      0|      multistate(data, MSTATE_PROTOCONNECT);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2400|      0|    }
 2401|  9.37k|    else {
 2402|  9.37k|      multistate(data, MSTATE_CONNECTING);
  ------------------
  |  |  196|  9.37k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2403|  9.37k|    }
 2404|  9.37k|  }
 2405|  9.66k|  *resultp = result;
 2406|  9.66k|  return mresult;
 2407|  9.66k|}
multi.c:multistate_connecting:
 2562|   128k|{
 2563|   128k|  bool connected;
 2564|       |
 2565|   128k|  if(!data->conn) {
  ------------------
  |  Branch (2565:6): [True: 0, False: 128k]
  ------------------
 2566|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2566:5): [Folded, False: 0]
  |  Branch (2566:5): [Folded, False: 0]
  ------------------
 2567|      0|    *result = CURLE_FAILED_INIT;
 2568|      0|    return CURLM_OK;
 2569|      0|  }
 2570|   128k|  if(!Curl_xfer_recv_is_paused(data)) {
  ------------------
  |  Branch (2570:6): [True: 128k, False: 0]
  ------------------
 2571|   128k|    *result = Curl_conn_connect(data, FALSE, &connected);
  ------------------
  |  |  989|   128k|#define FALSE false
  ------------------
 2572|   128k|    if(connected && !*result) {
  ------------------
  |  Branch (2572:8): [True: 1.95k, False: 126k]
  |  Branch (2572:21): [True: 1.95k, False: 0]
  ------------------
 2573|  1.95k|      if(!data->conn->bits.reuse && Curl_conn_is_multiplex(data->conn)) {
  ------------------
  |  Branch (2573:10): [True: 1.95k, False: 0]
  |  Branch (2573:37): [True: 1.95k, False: 0]
  ------------------
 2574|       |        /* new connection, can multiplex, wake pending handles */
 2575|  1.95k|        multi_schedule_pending(data->multi);
 2576|  1.95k|      }
 2577|  1.95k|      multistate(data, MSTATE_PROTOCONNECT);
  ------------------
  |  |  196|  1.95k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2578|  1.95k|      return CURLM_CALL_MULTI_PERFORM;
 2579|  1.95k|    }
 2580|   126k|    else if(*result) {
  ------------------
  |  Branch (2580:13): [True: 6.52k, False: 119k]
  ------------------
 2581|       |      /* failure detected */
 2582|  6.52k|      CURL_TRC_M(data, "connect failed -> %d", (int)*result);
  ------------------
  |  |  148|  6.52k|  do {                                   \
  |  |  149|  6.52k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  6.52k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  6.52k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  13.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 6.52k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 645, False: 5.88k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  13.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 645, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    645|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  6.52k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    645|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 121, False: 524]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  6.52k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  6.52k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 6.52k]
  |  |  ------------------
  ------------------
 2583|  6.52k|      multi_posttransfer(data);
 2584|  6.52k|      multi_done(data, *result, TRUE);
  ------------------
  |  |  986|  6.52k|#define TRUE true
  ------------------
 2585|  6.52k|      *stream_error = TRUE;
  ------------------
  |  |  986|  6.52k|#define TRUE true
  ------------------
 2586|  6.52k|      return CURLM_OK;
 2587|  6.52k|    }
 2588|   128k|  }
 2589|   119k|  return CURLM_OK;
 2590|   128k|}
multi.c:multistate_protoconnect:
 2595|  1.95k|{
 2596|  1.95k|  bool protocol_connected = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 2597|       |
 2598|  1.95k|  if(!*result && data->conn->bits.reuse) {
  ------------------
  |  Branch (2598:6): [True: 1.95k, False: 0]
  |  Branch (2598:18): [True: 0, False: 1.95k]
  ------------------
 2599|       |    /* ftp seems to hang when protoconnect on reused connection since we
 2600|       |     * handle PROTOCONNECT in general inside the filters, it seems wrong to
 2601|       |     * restart this on a reused connection.
 2602|       |     */
 2603|      0|    multistate(data, MSTATE_DO);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2604|      0|    return CURLM_CALL_MULTI_PERFORM;
 2605|      0|  }
 2606|  1.95k|  if(!*result)
  ------------------
  |  Branch (2606:6): [True: 1.95k, False: 0]
  ------------------
 2607|  1.95k|    *result = protocol_connect(data, &protocol_connected);
 2608|  1.95k|  if(!*result && !protocol_connected) {
  ------------------
  |  Branch (2608:6): [True: 1.95k, False: 0]
  |  Branch (2608:18): [True: 0, False: 1.95k]
  ------------------
 2609|       |    /* switch to waiting state */
 2610|      0|    multistate(data, MSTATE_PROTOCONNECTING);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2611|      0|    return CURLM_CALL_MULTI_PERFORM;
 2612|      0|  }
 2613|  1.95k|  else if(!*result) {
  ------------------
  |  Branch (2613:11): [True: 1.95k, False: 0]
  ------------------
 2614|       |    /* protocol connect has completed, go WAITDO or DO */
 2615|  1.95k|    multistate(data, MSTATE_DO);
  ------------------
  |  |  196|  1.95k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2616|  1.95k|    return CURLM_CALL_MULTI_PERFORM;
 2617|  1.95k|  }
 2618|       |
 2619|       |  /* failure detected */
 2620|      0|  multi_posttransfer(data);
 2621|      0|  multi_done(data, *result, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2622|       |  *stream_error = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2623|      0|  return CURLM_OK;
 2624|  1.95k|}
multi.c:protocol_connect:
 1946|  1.95k|{
 1947|  1.95k|  struct connectdata *conn = data->conn;
 1948|  1.95k|  CURLcode result = CURLE_OK;
 1949|       |
 1950|  1.95k|  DEBUGASSERT(conn);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1950:3): [True: 0, False: 1.95k]
  |  Branch (1950:3): [True: 1.95k, False: 0]
  ------------------
 1951|  1.95k|  DEBUGASSERT(protocol_done);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1951:3): [True: 0, False: 1.95k]
  |  Branch (1951:3): [True: 1.95k, False: 0]
  ------------------
 1952|  1.95k|  DEBUGASSERT(Curl_conn_is_connected(conn));
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1952:3): [True: 0, False: 1.95k]
  |  Branch (1952:3): [True: 1.95k, False: 0]
  ------------------
 1953|       |
 1954|  1.95k|  *protocol_done = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 1955|  1.95k|  if(!conn->bits.protoconnstart) {
  ------------------
  |  Branch (1955:6): [True: 1.95k, False: 0]
  ------------------
 1956|  1.95k|    if(conn->scheme->run->connect_it) {
  ------------------
  |  Branch (1956:8): [True: 0, False: 1.95k]
  ------------------
 1957|       |      /* Call the protocol-specific connect function */
 1958|      0|      result = conn->scheme->run->connect_it(data, protocol_done);
 1959|      0|      if(result)
  ------------------
  |  Branch (1959:10): [True: 0, False: 0]
  ------------------
 1960|      0|        return result;
 1961|      0|    }
 1962|  1.95k|    conn->bits.protoconnstart = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
 1963|  1.95k|  }
 1964|       |
 1965|       |  /* Unless this protocol does not have any protocol-connect callback, as
 1966|       |     then we know we are done. */
 1967|  1.95k|  if(!conn->scheme->run->connecting)
  ------------------
  |  Branch (1967:6): [True: 1.95k, False: 0]
  ------------------
 1968|  1.95k|    *protocol_done = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
 1969|  1.95k|  return CURLE_OK;
 1970|  1.95k|}
multi.c:multistate_do:
 2195|  1.95k|{
 2196|  1.95k|  CURLMcode mresult = CURLM_OK;
 2197|  1.95k|  CURLcode result = CURLE_OK;
 2198|  1.95k|  if(data->set.fprereq) {
  ------------------
  |  Branch (2198:6): [True: 0, False: 1.95k]
  ------------------
 2199|      0|    struct Curl_mapi_guard guard;
 2200|      0|    int prereq_rc;
 2201|       |
 2202|       |    /* call the prerequest callback function */
 2203|      0|    CURL_CBAPI_START(&guard, data, easy_fprereq);
  ------------------
  |  |  201|      0|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
 2204|      0|    prereq_rc = data->set.fprereq(data->set.prereq_userp,
 2205|      0|                                  data->info.primary.remote_ip,
 2206|      0|                                  data->info.primary.local_ip,
 2207|      0|                                  data->info.primary.remote_port,
 2208|      0|                                  data->info.primary.local_port);
 2209|      0|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|      0|  Curl_cbapi_leave(g)
  ------------------
 2210|      0|    if(prereq_rc != CURL_PREREQFUNC_OK) {
  ------------------
  |  |  508|      0|#define CURL_PREREQFUNC_OK 0
  ------------------
  |  Branch (2210:8): [True: 0, False: 0]
  ------------------
 2211|      0|      failf(data, "operation aborted by pre-request callback");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2212|       |      /* failure in pre-request callback - do not do any other processing */
 2213|      0|      result = CURLE_ABORTED_BY_CALLBACK;
 2214|      0|      multi_posttransfer(data);
 2215|      0|      multi_done(data, result, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2216|      0|      *stream_errorp = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2217|      0|      goto end;
 2218|      0|    }
 2219|      0|  }
 2220|       |
 2221|  1.95k|  if(data->set.connect_only && !data->set.connect_only_ws) {
  ------------------
  |  Branch (2221:6): [True: 0, False: 1.95k]
  |  Branch (2221:32): [True: 0, False: 0]
  ------------------
 2222|      0|    multistate(data, MSTATE_DONE);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2223|      0|    mresult = CURLM_CALL_MULTI_PERFORM;
 2224|      0|  }
 2225|  1.95k|  else {
 2226|  1.95k|    bool dophase_done = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 2227|       |    /* Perform the protocol's DO action */
 2228|  1.95k|    result = multi_do(data, &dophase_done);
 2229|       |
 2230|  1.95k|    if(!result) {
  ------------------
  |  Branch (2230:8): [True: 1.92k, False: 30]
  ------------------
 2231|  1.92k|      if(!dophase_done) {
  ------------------
  |  Branch (2231:10): [True: 0, False: 1.92k]
  ------------------
 2232|      0|#ifndef CURL_DISABLE_FTP
 2233|       |        /* some steps needed for wildcard matching */
 2234|      0|        if(data->state.wildcardmatch) {
  ------------------
  |  Branch (2234:12): [True: 0, False: 0]
  ------------------
 2235|      0|          struct WildcardData *wc = data->wildcard;
 2236|      0|          if(wc->state == CURLWC_DONE || wc->state == CURLWC_SKIP) {
  ------------------
  |  Branch (2236:14): [True: 0, False: 0]
  |  Branch (2236:42): [True: 0, False: 0]
  ------------------
 2237|       |            /* skip some states if it is important */
 2238|      0|            multi_done(data, CURLE_OK, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2239|       |
 2240|       |            /* if there is no connection left, skip the DONE state */
 2241|      0|            multistate(data, data->conn ? MSTATE_DONE : MSTATE_COMPLETED);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  |  |  ------------------
  |  |  |  Branch (196:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2242|      0|            mresult = CURLM_CALL_MULTI_PERFORM;
 2243|      0|            goto end;
 2244|      0|          }
 2245|      0|        }
 2246|      0|#endif
 2247|       |        /* DO was not completed in one function call, we must continue
 2248|       |           DOING... */
 2249|      0|        multistate(data, MSTATE_DOING);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2250|      0|        mresult = CURLM_CALL_MULTI_PERFORM;
 2251|      0|      }
 2252|       |
 2253|       |      /* after DO, go DO_DONE... or DO_MORE */
 2254|  1.92k|      else if(data->conn->bits.do_more) {
  ------------------
  |  Branch (2254:15): [True: 0, False: 1.92k]
  ------------------
 2255|       |        /* we are supposed to do more, but we need to sit down, relax and wait
 2256|       |           a little while first */
 2257|      0|        multistate(data, MSTATE_DOING_MORE);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2258|      0|        mresult = CURLM_CALL_MULTI_PERFORM;
 2259|      0|      }
 2260|  1.92k|      else {
 2261|       |        /* we are done with the DO, now DID */
 2262|  1.92k|        multistate(data, MSTATE_DID);
  ------------------
  |  |  196|  1.92k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2263|  1.92k|        mresult = CURLM_CALL_MULTI_PERFORM;
 2264|  1.92k|      }
 2265|  1.92k|    }
 2266|     30|    else if((result == CURLE_SEND_ERROR) &&
  ------------------
  |  Branch (2266:13): [True: 1, False: 29]
  ------------------
 2267|      1|            data->conn->bits.reuse) {
  ------------------
  |  Branch (2267:13): [True: 0, False: 1]
  ------------------
 2268|       |      /*
 2269|       |       * In this situation, a connection that we were trying to use may have
 2270|       |       * unexpectedly died. If possible, send the connection back to the
 2271|       |       * CONNECT phase so we can try again.
 2272|       |       */
 2273|      0|      const struct Curl_scheme *handler = data->conn->scheme;
 2274|      0|      char *newurl = NULL;
 2275|      0|      followtype follow = FOLLOW_NONE;
 2276|      0|      CURLcode drc;
 2277|       |
 2278|      0|      drc = Curl_retry_request(data, &newurl);
 2279|      0|      if(drc) {
  ------------------
  |  Branch (2279:10): [True: 0, False: 0]
  ------------------
 2280|       |        /* a failure here pretty much implies an out of memory */
 2281|      0|        result = drc;
 2282|      0|        *stream_errorp = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2283|      0|      }
 2284|       |
 2285|      0|      multi_posttransfer(data);
 2286|      0|      drc = multi_done(data, result, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2287|       |
 2288|       |      /* When set to retry the connection, we must go back to the CONNECT
 2289|       |       * state */
 2290|      0|      if(newurl) {
  ------------------
  |  Branch (2290:10): [True: 0, False: 0]
  ------------------
 2291|      0|        if(!drc || (drc == CURLE_SEND_ERROR)) {
  ------------------
  |  Branch (2291:12): [True: 0, False: 0]
  |  Branch (2291:20): [True: 0, False: 0]
  ------------------
 2292|      0|          follow = FOLLOW_RETRY;
 2293|      0|          drc = multi_follow(data, handler, newurl, follow);
 2294|      0|          if(!drc) {
  ------------------
  |  Branch (2294:14): [True: 0, False: 0]
  ------------------
 2295|      0|            multistate(data, MSTATE_SETUP);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2296|      0|            mresult = CURLM_CALL_MULTI_PERFORM;
 2297|      0|            result = CURLE_OK;
 2298|      0|          }
 2299|      0|          else {
 2300|       |            /* Follow failed */
 2301|      0|            result = drc;
 2302|      0|          }
 2303|      0|        }
 2304|      0|        else {
 2305|       |          /* done did not return OK or SEND_ERROR */
 2306|      0|          result = drc;
 2307|      0|        }
 2308|      0|      }
 2309|      0|      else {
 2310|       |        /* Have error handler disconnect conn if we cannot retry */
 2311|      0|        *stream_errorp = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2312|      0|      }
 2313|      0|      curlx_free(newurl);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2314|      0|    }
 2315|     30|    else {
 2316|       |      /* failure detected */
 2317|     30|      multi_posttransfer(data);
 2318|     30|      if(data->conn)
  ------------------
  |  Branch (2318:10): [True: 30, False: 0]
  ------------------
 2319|     30|        multi_done(data, result, FALSE);
  ------------------
  |  |  989|     30|#define FALSE false
  ------------------
 2320|     30|      *stream_errorp = TRUE;
  ------------------
  |  |  986|     30|#define TRUE true
  ------------------
 2321|     30|    }
 2322|  1.95k|  }
 2323|  1.95k|end:
 2324|  1.95k|  *resultp = result;
 2325|  1.95k|  return mresult;
 2326|  1.95k|}
multi.c:multi_do:
 1809|  1.95k|{
 1810|  1.95k|  CURLcode result = CURLE_OK;
 1811|  1.95k|  struct connectdata *conn = data->conn;
 1812|       |
 1813|  1.95k|  DEBUGASSERT(conn);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1813:3): [True: 0, False: 1.95k]
  |  Branch (1813:3): [True: 1.95k, False: 0]
  ------------------
 1814|  1.95k|  DEBUGASSERT(conn->scheme);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1814:3): [True: 0, False: 1.95k]
  |  Branch (1814:3): [True: 1.95k, False: 0]
  ------------------
 1815|       |
 1816|  1.95k|  if(conn->scheme->run->do_it)
  ------------------
  |  Branch (1816:6): [True: 1.95k, False: 0]
  ------------------
 1817|  1.95k|    result = conn->scheme->run->do_it(data, done);
 1818|       |
 1819|  1.95k|  return result;
 1820|  1.95k|}
multi.c:multistate_did:
 2707|  1.92k|{
 2708|  1.92k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  1.92k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2708:3): [True: 0, False: 1.92k]
  |  Branch (2708:3): [True: 1.92k, False: 0]
  ------------------
 2709|  1.92k|  if(data->conn->bits.multiplex)
  ------------------
  |  Branch (2709:6): [True: 1.92k, False: 0]
  ------------------
 2710|       |    /* Check if we can move pending requests to send pipe */
 2711|  1.92k|    multi_schedule_pending(multi); /* multiplexed */
 2712|       |
 2713|       |  /* Only perform the transfer if there is a good socket to work with.
 2714|       |     Having both BAD is a signal to skip immediately to DONE */
 2715|  1.92k|  if(data->conn->bits.want_recv || data->conn->bits.want_send) {
  ------------------
  |  Branch (2715:6): [True: 1.92k, False: 0]
  |  Branch (2715:36): [True: 0, False: 0]
  ------------------
 2716|  1.92k|    multistate(data, MSTATE_PERFORMING);
  ------------------
  |  |  196|  1.92k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2717|       |    /* Do not return CURLM_CALL_MULTI_PERFORM to give other transfers
 2718|       |     * a chance to send off their requests.
 2719|       |     * Note: Some SFTP handlers do not seem to like this.
 2720|       |     *       Restrict it to HTTP families. */
 2721|  1.92k|    return ((multi->xfers_alive > 1) &&
  ------------------
  |  Branch (2721:13): [True: 0, False: 1.92k]
  ------------------
 2722|      0|            (data->conn->scheme->protocol & PROTO_FAMILY_HTTP)) ?
  ------------------
  |  |   83|      0|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|      0|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|      0|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   62|      0|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   84|      0|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   63|      0|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (2722:13): [True: 0, False: 0]
  ------------------
 2723|  1.92k|           CURLM_OK : CURLM_CALL_MULTI_PERFORM;
 2724|  1.92k|  }
 2725|      0|  else {
 2726|      0|#ifndef CURL_DISABLE_FTP
 2727|      0|    if(data->state.wildcardmatch &&
  ------------------
  |  Branch (2727:8): [True: 0, False: 0]
  ------------------
 2728|      0|       ((data->conn->scheme->flags & PROTOPT_WILDCARD) == 0)) {
  ------------------
  |  |  237|      0|#define PROTOPT_WILDCARD (1 << 12)  /* protocol supports wildcard matching */
  ------------------
  |  Branch (2728:8): [True: 0, False: 0]
  ------------------
 2729|      0|      data->wildcard->state = CURLWC_DONE;
 2730|      0|    }
 2731|      0|#endif
 2732|      0|    multistate(data, MSTATE_DONE);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2733|      0|    return CURLM_CALL_MULTI_PERFORM;
 2734|      0|  }
 2735|  1.92k|}
multi.c:mspeed_check:
 2009|  18.1k|{
 2010|  18.1k|  if(Curl_rlimit_active(&data->progress.dl.rlimit) ||
  ------------------
  |  Branch (2010:6): [True: 94, False: 18.0k]
  ------------------
 2011|  18.0k|     Curl_rlimit_active(&data->progress.ul.rlimit)) {
  ------------------
  |  Branch (2011:6): [True: 0, False: 18.0k]
  ------------------
 2012|       |    /* check if our send/recv limits require idle waits */
 2013|     94|    const struct curltime *pnow = Curl_pgrs_now(data);
 2014|     94|    timediff_t recv_ms, send_ms;
 2015|       |
 2016|     94|    send_ms = Curl_rlimit_wait_ms(&data->progress.ul.rlimit, pnow);
 2017|     94|    recv_ms = Curl_rlimit_wait_ms(&data->progress.dl.rlimit, pnow);
 2018|       |
 2019|     94|    if(send_ms || recv_ms) {
  ------------------
  |  Branch (2019:8): [True: 0, False: 94]
  |  Branch (2019:19): [True: 0, False: 94]
  ------------------
 2020|      0|      if(data->mstate != MSTATE_RATELIMITING) {
  ------------------
  |  Branch (2020:10): [True: 0, False: 0]
  ------------------
 2021|      0|        multistate(data, MSTATE_RATELIMITING);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2022|      0|      }
 2023|      0|      Curl_expire_set(data, EXPIRE_TOOFAST, CURLMAX(send_ms, recv_ms), pnow);
  ------------------
  |  | 1314|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1314:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2024|      0|      Curl_multi_clear_dirty(data);
 2025|      0|      CURL_TRC_M(data, "[RLIMIT] waiting %" FMT_TIMEDIFF_T "ms",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2026|      0|                 CURLMAX(send_ms, recv_ms));
 2027|      0|      return CURLE_AGAIN;
 2028|      0|    }
 2029|     94|    else {
 2030|       |      /* when will the rate limits increase next? The transfer needs
 2031|       |       * to run again at that time or it may stall. */
 2032|     94|      send_ms = Curl_rlimit_next_step_ms(&data->progress.ul.rlimit, pnow);
 2033|     94|      recv_ms = Curl_rlimit_next_step_ms(&data->progress.dl.rlimit, pnow);
 2034|     94|      if(send_ms || recv_ms) {
  ------------------
  |  Branch (2034:10): [True: 0, False: 94]
  |  Branch (2034:21): [True: 94, False: 0]
  ------------------
 2035|     94|        timediff_t next_ms = CURLMIN(send_ms, recv_ms);
  ------------------
  |  | 1315|     94|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 94, False: 0]
  |  |  ------------------
  ------------------
 2036|     94|        if(!next_ms)
  ------------------
  |  Branch (2036:12): [True: 94, False: 0]
  ------------------
 2037|     94|          next_ms = CURLMAX(send_ms, recv_ms);
  ------------------
  |  | 1314|     94|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1314:24): [True: 0, False: 94]
  |  |  ------------------
  ------------------
 2038|     94|        Curl_expire_set(data, EXPIRE_TOOFAST, next_ms, pnow);
 2039|     94|        CURL_TRC_M(data, "[RLIMIT] next token update in %" FMT_TIMEDIFF_T "ms",
  ------------------
  |  |  148|     94|  do {                                   \
  |  |  149|     94|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|     94|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|     94|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|    188|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 94, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 22, False: 72]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|    188|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 22, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|     22|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|     94|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|     22|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 22]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|     94|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|     94|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 94]
  |  |  ------------------
  ------------------
 2040|     94|                   next_ms);
 2041|     94|      }
 2042|     94|    }
 2043|     94|  }
 2044|       |
 2045|  18.1k|  if(data->mstate != MSTATE_PERFORMING) {
  ------------------
  |  Branch (2045:6): [True: 0, False: 18.1k]
  ------------------
 2046|      0|    CURL_TRC_M(data, "[RLIMIT] wait over, continue");
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2047|      0|    multistate(data, MSTATE_PERFORMING);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2048|      0|  }
 2049|  18.1k|  return CURLE_OK;
 2050|  18.1k|}
multi.c:multistate_performing:
 2055|  9.62k|{
 2056|  9.62k|  char *newurl = NULL;
 2057|  9.62k|  bool retry = FALSE;
  ------------------
  |  |  989|  9.62k|#define FALSE false
  ------------------
 2058|  9.62k|  CURLMcode mresult = CURLM_OK;
 2059|  9.62k|  CURLcode result = *resultp = CURLE_OK;
 2060|  9.62k|  *stream_errorp = FALSE;
  ------------------
  |  |  989|  9.62k|#define FALSE false
  ------------------
 2061|       |
 2062|  9.62k|  if(mspeed_check(data) == CURLE_AGAIN)
  ------------------
  |  Branch (2062:6): [True: 0, False: 9.62k]
  ------------------
 2063|      0|    return CURLM_OK;
 2064|       |
 2065|       |  /* read/write data if it is ready to do so */
 2066|  9.62k|  result = Curl_sendrecv(data);
 2067|       |
 2068|  9.62k|  if(data->req.done || (result == CURLE_RECV_ERROR)) {
  ------------------
  |  Branch (2068:6): [True: 533, False: 9.09k]
  |  Branch (2068:24): [True: 378, False: 8.71k]
  ------------------
 2069|       |    /* If CURLE_RECV_ERROR happens early enough, we assume it was a race
 2070|       |     * condition and the server closed the reused connection exactly when we
 2071|       |     * wanted to use it, so figure out if that is indeed the case.
 2072|       |     */
 2073|    911|    CURLcode ret = Curl_retry_request(data, &newurl);
 2074|    911|    if(!ret)
  ------------------
  |  Branch (2074:8): [True: 911, False: 0]
  ------------------
 2075|    911|      retry = !!newurl;
 2076|      0|    else if(!result)
  ------------------
  |  Branch (2076:13): [True: 0, False: 0]
  ------------------
 2077|      0|      result = ret;
 2078|       |
 2079|    911|    if(retry) {
  ------------------
  |  Branch (2079:8): [True: 0, False: 911]
  ------------------
 2080|       |      /* if we are to retry, set the result to OK and consider the
 2081|       |         request as done */
 2082|      0|      result = CURLE_OK;
 2083|      0|      data->req.done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2084|      0|    }
 2085|    911|  }
 2086|  8.71k|#ifndef CURL_DISABLE_HTTP
 2087|  8.71k|  else if(!data->set.never_retry &&
  ------------------
  |  Branch (2087:11): [True: 8.71k, False: 0]
  ------------------
 2088|  8.71k|          (result == CURLE_HTTP2_STREAM) &&
  ------------------
  |  Branch (2088:11): [True: 0, False: 8.71k]
  ------------------
 2089|      0|          Curl_h2_http_1_1_error(data)) {
  ------------------
  |  Branch (2089:11): [True: 0, False: 0]
  ------------------
 2090|      0|    CURLcode ret = Curl_retry_request(data, &newurl);
 2091|       |
 2092|      0|    if(!ret) {
  ------------------
  |  Branch (2092:8): [True: 0, False: 0]
  ------------------
 2093|      0|      infof(data, "Downgrades to HTTP/1.1");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2094|      0|      streamclose(data->conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 2095|      0|      data->state.http_neg.wanted = CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 2096|      0|      data->state.http_neg.allowed = CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 2097|       |      /* clear the error message bit too as we ignore the one we got */
 2098|      0|      data->state.errorbuf = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2099|      0|      if(!newurl)
  ------------------
  |  Branch (2099:10): [True: 0, False: 0]
  ------------------
 2100|       |        /* typically for HTTP_1_1_REQUIRED error on first flight */
 2101|      0|        newurl = Curl_bufref_dup(&data->state.url);
  ------------------
  |  |   49|      0|#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
 2102|      0|      if(!newurl) {
  ------------------
  |  Branch (2102:10): [True: 0, False: 0]
  ------------------
 2103|      0|        result = CURLE_OUT_OF_MEMORY;
 2104|      0|      }
 2105|      0|      else {
 2106|       |        /* if we are to retry, set the result to OK and consider the request
 2107|       |          as done */
 2108|      0|        retry = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2109|      0|        result = CURLE_OK;
 2110|      0|        data->req.done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2111|      0|      }
 2112|      0|    }
 2113|      0|    else
 2114|      0|      result = ret;
 2115|      0|  }
 2116|  9.62k|#endif
 2117|       |
 2118|  9.62k|  if(result) {
  ------------------
  |  Branch (2118:6): [True: 589, False: 9.04k]
  ------------------
 2119|       |    /*
 2120|       |     * The transfer phase returned error, we mark the connection to get closed
 2121|       |     * to prevent being reused. This is because we cannot possibly know if the
 2122|       |     * connection is in a good shape or not now. Unless it is a protocol which
 2123|       |     * uses two "channels" like FTP, as then the error happened in the data
 2124|       |     * connection.
 2125|       |     */
 2126|       |
 2127|    589|    if(!(data->conn->scheme->flags & PROTOPT_DUAL) &&
  ------------------
  |  |  215|    589|#define PROTOPT_DUAL (1 << 1)      /* this protocol uses two connections */
  ------------------
  |  Branch (2127:8): [True: 589, False: 0]
  ------------------
 2128|    589|       result != CURLE_HTTP2_STREAM)
  ------------------
  |  Branch (2128:8): [True: 589, False: 0]
  ------------------
 2129|    589|      streamclose(data->conn);
  ------------------
  |  |   71|    589|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|    589|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 2130|       |
 2131|    589|    multi_posttransfer(data);
 2132|    589|    multi_done(data, result, TRUE);
  ------------------
  |  |  986|    589|#define TRUE true
  ------------------
 2133|    589|  }
 2134|  9.04k|  else if(data->req.done && !Curl_cwriter_is_paused(data)) {
  ------------------
  |  |  195|    533|#define Curl_cwriter_is_paused(d)     ((bool)(d)->req.writer.paused)
  ------------------
  |  Branch (2134:11): [True: 533, False: 8.50k]
  |  Branch (2134:29): [True: 533, False: 0]
  ------------------
 2135|    533|    const struct Curl_scheme *handler = data->conn->scheme;
 2136|       |
 2137|       |    /* call this even if the readwrite function returned error */
 2138|    533|    multi_posttransfer(data);
 2139|       |
 2140|       |    /* When we follow redirects or is set to retry the connection, we must to
 2141|       |       go back to the CONNECT state */
 2142|    533|    if(data->req.newurl || retry) {
  ------------------
  |  Branch (2142:8): [True: 0, False: 533]
  |  Branch (2142:28): [True: 0, False: 533]
  ------------------
 2143|      0|      followtype follow = FOLLOW_NONE;
 2144|      0|      if(!retry) {
  ------------------
  |  Branch (2144:10): [True: 0, False: 0]
  ------------------
 2145|       |        /* if the URL is a follow-location and not a retried request then
 2146|       |           figure out the URL here */
 2147|      0|        curlx_free(newurl);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2148|      0|        newurl = data->req.newurl;
 2149|      0|        data->req.newurl = NULL;
 2150|      0|        follow = FOLLOW_REDIR;
 2151|      0|      }
 2152|      0|      else
 2153|      0|        follow = FOLLOW_RETRY;
 2154|      0|      (void)multi_done(data, CURLE_OK, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2155|       |      /* multi_done() might return CURLE_GOT_NOTHING */
 2156|      0|      result = multi_follow(data, handler, newurl, follow);
 2157|      0|      if(!result) {
  ------------------
  |  Branch (2157:10): [True: 0, False: 0]
  ------------------
 2158|      0|        multistate(data, MSTATE_SETUP);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2159|      0|        mresult = CURLM_CALL_MULTI_PERFORM;
 2160|      0|      }
 2161|      0|    }
 2162|    533|    else {
 2163|       |      /* after the transfer is done, go DONE */
 2164|       |
 2165|       |      /* but first check to see if we got a location info even though we are
 2166|       |         not following redirects */
 2167|    533|      if(data->req.location) {
  ------------------
  |  Branch (2167:10): [True: 0, False: 533]
  ------------------
 2168|      0|        curlx_free(newurl);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2169|      0|        newurl = data->req.location;
 2170|      0|        data->req.location = NULL;
 2171|      0|        result = multi_follow(data, handler, newurl, FOLLOW_FAKE);
 2172|      0|        if(result) {
  ------------------
  |  Branch (2172:12): [True: 0, False: 0]
  ------------------
 2173|      0|          *stream_errorp = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2174|      0|          result = multi_done(data, result, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2175|      0|        }
 2176|      0|      }
 2177|       |
 2178|    533|      if(!result) {
  ------------------
  |  Branch (2178:10): [True: 533, False: 0]
  ------------------
 2179|    533|        multistate(data, MSTATE_DONE);
  ------------------
  |  |  196|    533|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2180|    533|        mresult = CURLM_CALL_MULTI_PERFORM;
 2181|    533|      }
 2182|    533|    }
 2183|    533|  }
 2184|  8.50k|  else { /* not errored, not done */
 2185|  8.50k|    mspeed_check(data);
 2186|  8.50k|  }
 2187|  9.62k|  curlx_free(newurl);
  ------------------
  |  | 1503|  9.62k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2188|  9.62k|  *resultp = result;
 2189|  9.62k|  return mresult;
 2190|  9.62k|}
multi.c:multistate_done:
 2738|    533|{
 2739|    533|  if(data->conn) {
  ------------------
  |  Branch (2739:6): [True: 533, False: 0]
  ------------------
 2740|    533|    CURLcode result;
 2741|       |
 2742|       |    /* post-transfer command */
 2743|    533|    result = multi_done(data, *presult, FALSE);
  ------------------
  |  |  989|    533|#define FALSE false
  ------------------
 2744|       |
 2745|       |    /* allow a previously set error code take precedence */
 2746|    533|    if(!(*presult))
  ------------------
  |  Branch (2746:8): [True: 533, False: 0]
  ------------------
 2747|    533|      *presult = result;
 2748|    533|  }
 2749|       |
 2750|    533|#ifndef CURL_DISABLE_FTP
 2751|    533|  if(data->state.wildcardmatch) {
  ------------------
  |  Branch (2751:6): [True: 0, False: 533]
  ------------------
 2752|      0|    if(data->wildcard->state != CURLWC_DONE) {
  ------------------
  |  Branch (2752:8): [True: 0, False: 0]
  ------------------
 2753|       |      /* if a wildcard is set and we are not ending -> lets start again
 2754|       |         with MSTATE_INIT */
 2755|      0|      multistate(data, MSTATE_INIT);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2756|      0|      return CURLM_CALL_MULTI_PERFORM;
 2757|      0|    }
 2758|      0|  }
 2759|    533|#endif
 2760|       |  /* after we have DONE what we are supposed to do, go COMPLETED, and
 2761|       |     it does not matter what the multi_done() returned! */
 2762|    533|  multistate(data, MSTATE_COMPLETED);
  ------------------
  |  |  196|    533|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2763|    533|  return CURLM_CALL_MULTI_PERFORM;
 2764|    533|}
multi.c:is_finished:
 2415|   173k|{
 2416|   173k|  if(data->mstate < MSTATE_COMPLETED) {
  ------------------
  |  Branch (2416:6): [True: 172k, False: 533]
  ------------------
 2417|   172k|    if(result) {
  ------------------
  |  Branch (2417:8): [True: 7.51k, False: 165k]
  ------------------
 2418|       |      /*
 2419|       |       * If an error was returned, and we are not in completed state now,
 2420|       |       * then we go to completed and consider this transfer aborted.
 2421|       |       */
 2422|       |
 2423|       |      /* No attempt to disconnect connections must be made before this -
 2424|       |         connection detach and termination happens only here */
 2425|       |
 2426|       |      /* Check if we can move pending requests to send pipe */
 2427|  7.51k|      multi_schedule_pending(multi); /* connection */
 2428|       |
 2429|  7.51k|      if(data->conn) {
  ------------------
  |  Branch (2429:10): [True: 0, False: 7.51k]
  ------------------
 2430|      0|        if(stream_error) {
  ------------------
  |  Branch (2430:12): [True: 0, False: 0]
  ------------------
 2431|       |          /* Do not attempt to send data over a connection that timed out */
 2432|      0|          bool dead_connection = result == CURLE_OPERATION_TIMEDOUT;
 2433|      0|          struct connectdata *conn = data->conn;
 2434|       |
 2435|       |          /* This is where we make sure that the conn pointer is reset.
 2436|       |             We do not have to do this in every case block above where a
 2437|       |             failure is detected */
 2438|      0|          Curl_detach_connection(data);
 2439|      0|          Curl_conn_close(data, conn, dead_connection);
 2440|      0|        }
 2441|      0|      }
 2442|  7.51k|      else if(data->mstate == MSTATE_CONNECT) {
  ------------------
  |  Branch (2442:15): [True: 293, False: 7.22k]
  ------------------
 2443|       |        /* Curl_connect() failed */
 2444|    293|        multi_posttransfer(data);
 2445|    293|        Curl_pgrsUpdate_nometer(data);
 2446|    293|      }
 2447|       |
 2448|  7.51k|      multistate(data, MSTATE_COMPLETED);
  ------------------
  |  |  196|  7.51k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2449|  7.51k|      return result;
 2450|  7.51k|    }
 2451|       |    /* if there is still a connection to use, call the progress function */
 2452|   165k|    else if(data->conn && Curl_conn_is_connected(data->conn)) {
  ------------------
  |  Branch (2452:13): [True: 145k, False: 19.3k]
  |  Branch (2452:27): [True: 16.8k, False: 129k]
  ------------------
 2453|  16.8k|      result = Curl_pgrsUpdateX(data, pnow);
 2454|  16.8k|      if(result) {
  ------------------
  |  Branch (2454:10): [True: 0, False: 16.8k]
  ------------------
 2455|       |        /* aborted due to progress callback return code must close the
 2456|       |           connection */
 2457|      0|        streamclose(data->conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 2458|       |
 2459|       |        /* if not yet in DONE state, go there. */
 2460|      0|        if(data->mstate < MSTATE_DONE)
  ------------------
  |  Branch (2460:12): [True: 0, False: 0]
  ------------------
 2461|      0|          multistate(data, MSTATE_DONE);
  ------------------
  |  |  196|      0|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2462|      0|        return result;
 2463|      0|      }
 2464|  16.8k|    }
 2465|   172k|  }
 2466|   165k|  return result;
 2467|   173k|}
multi.c:handle_completed:
 2472|  8.05k|{
 2473|  8.05k|  bool msg_to_app = data->master_mid == UINT32_MAX;
 2474|       |
 2475|  8.05k|  if(!msg_to_app) {
  ------------------
  |  Branch (2475:6): [True: 0, False: 8.05k]
  ------------------
 2476|       |    /* A sub transfer, not reported to the application. Is anyone still
 2477|       |     * interested in processing its results? */
 2478|      0|    if(data->sub_xfer_done) {
  ------------------
  |  Branch (2478:8): [True: 0, False: 0]
  ------------------
 2479|      0|      struct Curl_easy *master = Curl_multi_get_easy(multi, data->master_mid);
 2480|       |
 2481|      0|      CURL_TRC_M(data, "sub xfer done for master %u", data->master_mid);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2482|      0|      if(master)
  ------------------
  |  Branch (2482:10): [True: 0, False: 0]
  ------------------
 2483|      0|        data->sub_xfer_done(data, master, result);
 2484|      0|      else
 2485|      0|        CURL_TRC_M(data, "master easy %u already gone.", data->master_mid);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2486|      0|    }
 2487|      0|  }
 2488|  8.05k|  else {
 2489|       |    /* now fill in the CURLMsg with this info */
 2490|  8.05k|    struct CURLMsg *msg = &data->msg;
 2491|       |
 2492|  8.05k|    msg->msg = CURLMSG_DONE;
 2493|  8.05k|    msg->easy_handle = data;
 2494|  8.05k|    msg->data.result = result;
 2495|       |
 2496|  8.05k|    DEBUGASSERT(!data->conn);
  ------------------
  |  | 1016|  8.05k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2496:5): [True: 0, False: 8.05k]
  |  Branch (2496:5): [True: 8.05k, False: 0]
  ------------------
 2497|  8.05k|  }
 2498|  8.05k|  multistate(data, MSTATE_MSGSENT);
  ------------------
  |  |  196|  8.05k|#define multistate(x, y) mstate(x, y, __LINE__)
  ------------------
 2499|       |
 2500|       |  /* remove from the other sets */
 2501|  8.05k|  Curl_uint32_bset_remove(&multi->process, data->mid);
 2502|  8.05k|  Curl_uint32_bset_remove(&multi->dirty, data->mid);
 2503|  8.05k|  Curl_uint32_bset_remove(&multi->pending, data->mid);
 2504|  8.05k|  if(msg_to_app)
  ------------------
  |  Branch (2504:6): [True: 8.05k, False: 0]
  ------------------
 2505|  8.05k|    multi_addmsg(multi, data);
 2506|  8.05k|  if(data->state.really_alive) {
  ------------------
  |  Branch (2506:6): [True: 8.05k, False: 0]
  ------------------
 2507|  8.05k|    data->state.really_alive = FALSE;
  ------------------
  |  |  989|  8.05k|#define FALSE false
  ------------------
 2508|  8.05k|    --multi->xfers_really_alive;
 2509|  8.05k|    if(!multi->xfers_really_alive)
  ------------------
  |  Branch (2509:8): [True: 8.05k, False: 0]
  ------------------
 2510|  8.05k|      (void)multi_assess_wakeup(multi);
 2511|  8.05k|  }
 2512|  8.05k|  --multi->xfers_alive;
 2513|  8.05k|  if(!multi->xfers_alive)
  ------------------
  |  Branch (2513:6): [True: 8.05k, False: 0]
  ------------------
 2514|  8.05k|    multi_assess_wakeup(multi);
 2515|  8.05k|}
multi.c:multi_addmsg:
  216|  8.05k|{
  217|  8.05k|  if(Curl_uint32_bset_empty(&multi->msgsent))
  ------------------
  |  Branch (217:6): [True: 8.05k, False: 0]
  ------------------
  218|  8.05k|    CURLM_NTFY(multi->admin, CURLMNOTIFY_INFO_READ);
  ------------------
  |  |   52|  8.05k|  do {                                                \
  |  |   53|  8.05k|    if((d) && (d)->multi && (d)->multi->ntfy.ntfy_cb) \
  |  |  ------------------
  |  |  |  Branch (53:8): [True: 8.05k, False: 0]
  |  |  |  Branch (53:15): [True: 8.05k, False: 0]
  |  |  |  Branch (53:29): [True: 0, False: 8.05k]
  |  |  ------------------
  |  |   54|  8.05k|      Curl_mntfy_add((d), (t));                       \
  |  |   55|  8.05k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (55:11): [Folded, False: 8.05k]
  |  |  ------------------
  ------------------
  219|  8.05k|  Curl_uint32_bset_add(&multi->msgsent, data->mid);
  220|  8.05k|}
multi.c:multi_ischanged:
 1757|   564k|{
 1758|   564k|  bool retval = FALSE;
  ------------------
  |  |  989|   564k|#define FALSE false
  ------------------
 1759|   564k|  DEBUGASSERT(multi);
  ------------------
  |  | 1016|   564k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1759:3): [True: 0, False: 564k]
  |  Branch (1759:3): [True: 564k, False: 0]
  ------------------
 1760|   564k|  if(multi) {
  ------------------
  |  Branch (1760:6): [True: 564k, False: 0]
  ------------------
 1761|   564k|    retval = (bool)multi->recheckstate;
 1762|   564k|    if(clear)
  ------------------
  |  Branch (1762:8): [True: 309k, False: 254k]
  ------------------
 1763|   309k|      multi->recheckstate = FALSE;
  ------------------
  |  |  989|   309k|#define FALSE false
  ------------------
 1764|   564k|  }
 1765|   564k|  return retval;
 1766|   564k|}
multi.c:add_next_timeout:
 3215|  2.20k|{
 3216|  2.20k|  struct expire_timers *timeouts = &data->state.timeouts;
 3217|  2.20k|  timediff_t now_us = Curl_timeouts_offset_us(&multi->timeouts, pnow);
 3218|       |
 3219|  4.41k|  while(timeouts->first < EXPIRE_LAST) {
  ------------------
  |  Branch (3219:9): [True: 4.41k, False: 0]
  ------------------
 3220|  4.41k|    if(timeouts->offset_us[timeouts->first] <= now_us)  /* already expired */
  ------------------
  |  Branch (3220:8): [True: 2.20k, False: 2.20k]
  ------------------
 3221|  2.20k|      timeouts->first = timeouts->next[timeouts->first];
 3222|  2.20k|    else /* timeouts are sorted, first is first in the future now */
 3223|  2.20k|      break;
 3224|  4.41k|  }
 3225|       |
 3226|  2.20k|  if(timeouts->first < EXPIRE_LAST) {
  ------------------
  |  Branch (3226:6): [True: 2.20k, False: 0]
  ------------------
 3227|       |    /* Insert this node again into the splay. Keep the timer in the list in
 3228|       |       case we need to recompute future timers. */
 3229|  2.20k|    Curl_timeouts_add(&multi->timeouts, data,
 3230|  2.20k|                      timeouts->offset_us[timeouts->first]);
 3231|  2.20k|  }
 3232|  2.20k|  return CURLM_OK;
 3233|  2.20k|}
multi.c:multi_handle_timeout:
 1852|   274k|{
 1853|   274k|  timediff_t timeout_ms;
 1854|       |
 1855|   274k|  timeout_ms = connect_timeout ? Curl_timeleft_now_ms(data, pnow) :
  ------------------
  |  Branch (1855:16): [True: 129k, False: 144k]
  ------------------
 1856|   274k|               Curl_timeleft_total_now_ms(data, pnow);
 1857|   274k|  if(timeout_ms < 0) {
  ------------------
  |  Branch (1857:6): [True: 0, False: 274k]
  ------------------
 1858|       |    /* Handle timed out */
 1859|      0|    timerid base_timer = Curl_is_connecting(data) ?
  ------------------
  |  Branch (1859:26): [True: 0, False: 0]
  ------------------
 1860|      0|                         TIMER_STARTSINGLE : TIMER_STARTOP;
 1861|      0|    timediff_t elapsed_ms = Curl_pgrs_since_ms(data, NULL, base_timer);
 1862|      0|    if(data->mstate == MSTATE_CONNECTING) {
  ------------------
  |  Branch (1862:8): [True: 0, False: 0]
  ------------------
 1863|      0|      failf(data, "%s timed out after %" FMT_TIMEDIFF_T " milliseconds",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1864|      0|            data->conn->bits.dns_resolved ? "Connection" : "Resolving",
  ------------------
  |  Branch (1864:13): [True: 0, False: 0]
  ------------------
 1865|      0|            elapsed_ms);
 1866|       |      /* keep what we know about a partly done connect, e.g. TCP done
 1867|       |       * but TLS handshake still ongoing */
 1868|      0|      Curl_cfchain_report_failed(data, &data->conn->chain);
 1869|      0|    }
 1870|      0|    else {
 1871|      0|      struct SingleRequest *k = &data->req;
 1872|      0|      if(k->size != -1) {
  ------------------
  |  Branch (1872:10): [True: 0, False: 0]
  ------------------
 1873|      0|        failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1874|      0|              " milliseconds with %" FMT_OFF_T " out of %"
 1875|      0|              FMT_OFF_T " bytes received",
 1876|      0|              elapsed_ms, k->bytecount, k->size);
 1877|      0|      }
 1878|      0|      else {
 1879|      0|        failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1880|      0|              " milliseconds with %" FMT_OFF_T " bytes received",
 1881|      0|              elapsed_ms, k->bytecount);
 1882|      0|      }
 1883|      0|    }
 1884|      0|    *result = CURLE_OPERATION_TIMEDOUT;
 1885|      0|    if(data->conn) {
  ------------------
  |  Branch (1885:8): [True: 0, False: 0]
  ------------------
 1886|       |      /* Force connection closed if the connection has indeed been used */
 1887|      0|      if(data->mstate > MSTATE_DO) {
  ------------------
  |  Branch (1887:10): [True: 0, False: 0]
  ------------------
 1888|      0|        streamclose(data->conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
 1889|      0|        *stream_error = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1890|      0|      }
 1891|      0|      (void)multi_done(data, *result, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1892|      0|    }
 1893|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1894|      0|  }
 1895|       |
 1896|   274k|  return FALSE;
  ------------------
  |  |  989|   274k|#define FALSE false
  ------------------
 1897|   274k|}
multi.c:multi_timeouts_init:
 3197|  29.2k|{
 3198|  29.2k|  data->state.timeouts.first = EXPIRE_LAST;
 3199|       |  data->state.timeouts.splaynode.registered = FALSE;
  ------------------
  |  |  989|  29.2k|#define FALSE false
  ------------------
 3200|  29.2k|}
multi.c:multi_socket:
 3319|  13.3k|{
 3320|  13.3k|  CURLMcode mresult = CURLM_OK;
 3321|  13.3k|  struct Curl_sigpipe_ctx pipe_ctx;
 3322|  13.3k|  struct curltime now;
 3323|  13.3k|  uint32_t run_xfers;
 3324|       |
 3325|  13.3k|  (void)ev_bitmask;
 3326|  13.3k|  sigpipe_init(&pipe_ctx);
 3327|       |
 3328|  13.3k|  if(checkall) {
  ------------------
  |  Branch (3328:6): [True: 0, False: 13.3k]
  ------------------
 3329|       |    /* *perform() deals with running_handles on its own */
 3330|      0|    mresult = multi_perform(multi, running_handles);
 3331|       |
 3332|      0|    if(mresult != CURLM_BAD_HANDLE) {
  ------------------
  |  Branch (3332:8): [True: 0, False: 0]
  ------------------
 3333|       |      /* Reassess event status of all active transfers, but keep any error
 3334|       |         from multi_perform() */
 3335|      0|      CURLMcode mresult2 =
 3336|      0|        Curl_multi_ev_assess_xfer_bset(multi, &multi->process);
 3337|      0|      if(!mresult)
  ------------------
  |  Branch (3337:10): [True: 0, False: 0]
  ------------------
 3338|      0|        mresult = mresult2;
 3339|      0|    }
 3340|      0|    goto out;
 3341|      0|  }
 3342|       |
 3343|  13.3k|  if(s != CURL_SOCKET_TIMEOUT) {
  ------------------
  |  |  288|  13.3k|#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
  |  |  ------------------
  |  |  |  |  147|  13.3k|#define CURL_SOCKET_BAD (-1)
  |  |  ------------------
  ------------------
  |  Branch (3343:6): [True: 9.97k, False: 3.36k]
  ------------------
 3344|       |    /* Mark all transfers of that socket as dirty */
 3345|  9.97k|    Curl_multi_ev_dirty_xfers(multi, s);
 3346|  9.97k|  }
 3347|  3.36k|  else {
 3348|       |    /* Asked to run due to time-out. Clear the 'last_expire_ts' variable to
 3349|       |       force Curl_update_timer() to trigger a callback to the app again even
 3350|       |       if the same timeout is still the one to run after this call. That
 3351|       |       handles the case when the application asks libcurl to run the timeout
 3352|       |       prematurely. */
 3353|  3.36k|    multi->last_expire_offset_us = 0;
 3354|       |
 3355|       |    /* Applications may set `socket_cb` *after* having added transfers
 3356|       |     * first. *Then* kick off processing with a
 3357|       |     * curl_multi_socket_action(TIMEOUT) afterwards. Make sure our
 3358|       |     * admin handle registers its pollset with the callbacks present. */
 3359|  3.36k|    mresult = multi_assess_wakeup(multi);
 3360|  3.36k|    if(mresult)
  ------------------
  |  Branch (3360:8): [True: 0, False: 3.36k]
  ------------------
 3361|      0|      goto out;
 3362|  3.36k|  }
 3363|       |
 3364|  13.3k|  curlx_pnow(&now);
 3365|  13.3k|  multi_mark_expired_as_dirty(multi, &now);
 3366|  13.3k|  mresult = multi_run_dirty(multi, &pipe_ctx, &run_xfers);
 3367|  13.3k|  if(mresult)
  ------------------
  |  Branch (3367:6): [True: 18, False: 13.3k]
  ------------------
 3368|     18|    goto out;
 3369|       |
 3370|  13.3k|  if(run_xfers) {
  ------------------
  |  Branch (3370:6): [True: 13.3k, False: 0]
  ------------------
 3371|       |    /* Running transfers takes time. With a new timestamp, we might catch
 3372|       |     * other expires which are due now. Instead of telling the application
 3373|       |     * to set a 0 timeout and call us again, we run them here.
 3374|       |     * Do that only once or it might be unfair to transfers on other
 3375|       |     * sockets. */
 3376|  13.3k|    curlx_pnow(&now);
 3377|  13.3k|    multi_mark_expired_as_dirty(multi, &now);
 3378|  13.3k|    mresult = multi_run_dirty(multi, &pipe_ctx, &run_xfers);
 3379|  13.3k|  }
 3380|       |
 3381|  13.3k|out:
 3382|  13.3k|  sigpipe_restore(&pipe_ctx);
 3383|       |
 3384|  13.3k|  if(multi_ischanged(multi, TRUE))
  ------------------
  |  |  986|  13.3k|#define TRUE true
  ------------------
  |  Branch (3384:6): [True: 511, False: 12.8k]
  ------------------
 3385|    511|    multi_schedule_pending(multi);
 3386|       |
 3387|  13.3k|  if(!mresult && CURL_MNTFY_HAS_ENTRIES(multi))
  ------------------
  |  |   58|  13.3k|  ((m)->ntfy.flags & CURL_MNTFY_FLAG_HAS_ENTRIES)
  |  |  ------------------
  |  |  |  |   28|  13.3k|#define CURL_MNTFY_FLAG_HAS_ENTRIES  ((uint32_t)1 << 31)
  |  |  ------------------
  |  |  |  Branch (58:3): [True: 0, False: 13.3k]
  |  |  ------------------
  ------------------
  |  Branch (3387:6): [True: 13.3k, False: 18]
  ------------------
 3388|      0|    mresult = Curl_mntfy_dispatch_all(multi);
 3389|       |
 3390|  13.3k|  if(running_handles) {
  ------------------
  |  Branch (3390:6): [True: 13.3k, False: 0]
  ------------------
 3391|  13.3k|    uint32_t running = multi_xfers_running(multi);
 3392|  13.3k|    *running_handles = (running < INT_MAX) ? (int)running : INT_MAX;
  ------------------
  |  Branch (3392:24): [True: 13.3k, False: 0]
  ------------------
 3393|  13.3k|  }
 3394|       |
 3395|  13.3k|  if(CURLM_OK >= mresult)
  ------------------
  |  Branch (3395:6): [True: 13.3k, False: 18]
  ------------------
 3396|  13.3k|    mresult = Curl_update_timer(multi);
 3397|  13.3k|  return mresult;
 3398|  13.3k|}
multi.c:multi_mark_expired_as_dirty:
 3237|  26.6k|{
 3238|  26.6k|  struct Curl_easy *data = NULL;
 3239|  26.6k|  uint32_t mid;
 3240|       |
 3241|       |  /*
 3242|       |   * The loop following here will go on as long as there are expire-times left
 3243|       |   * to process (compared to `ts`) in the splay and 'data' will be
 3244|       |   * re-assigned for every expired handle we deal with.
 3245|       |   */
 3246|  28.8k|  while(Curl_timeouts_remove_expired(&multi->timeouts, ts, &mid)) {
  ------------------
  |  Branch (3246:9): [True: 2.20k, False: 26.6k]
  ------------------
 3247|       |    /* Check if there is one (more) expired timer to deal with! This function
 3248|       |       extracts a matching node if there is one */
 3249|  2.20k|    data = Curl_multi_get_easy(multi, mid);
 3250|  2.20k|    if(!data) {
  ------------------
  |  Branch (3250:8): [True: 0, False: 2.20k]
  ------------------
 3251|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3251:7): [Folded, False: 0]
  |  Branch (3251:7): [Folded, False: 0]
  ------------------
 3252|      0|      continue;
 3253|      0|    }
 3254|  2.20k|#ifdef CURLVERBOSE
 3255|  2.20k|    if(CURL_TRC_TIMER_is_verbose(data)) {
  ------------------
  |  |  139|  2.20k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  ------------------
  |  |  |  |  329|  2.20k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  4.41k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 2.20k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 162, False: 2.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  4.41k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 162, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    162|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  2.20k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    162|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 2, False: 160]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3256|      2|      if(data->state.timeouts.first < EXPIRE_LAST) {
  ------------------
  |  Branch (3256:10): [True: 2, False: 0]
  ------------------
 3257|      2|        CURL_TRC_TIMER(data, data->state.timeouts.first, "has expired");
  ------------------
  |  |  173|      2|  do {                                        \
  |  |  174|      2|    if(CURL_TRC_TIMER_is_verbose(data))       \
  |  |  ------------------
  |  |  |  |  139|      2|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      2|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      4|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      4|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      2|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      2|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|      2|      Curl_trc_timer(data, tid, __VA_ARGS__); \
  |  |  176|      2|  } while(0)
  |  |  ------------------
  |  |  |  Branch (176:11): [Folded, False: 2]
  |  |  ------------------
  ------------------
 3258|      2|      }
 3259|      2|    }
 3260|  2.20k|#endif
 3261|  2.20k|    (void)add_next_timeout(ts, multi, data);
 3262|  2.20k|    Curl_multi_mark_dirty(data);
 3263|  2.20k|  }
 3264|  26.6k|}
multi.c:multi_run_dirty:
 3269|  26.6k|{
 3270|  26.6k|  CURLMcode mresult = CURLM_OK;
 3271|  26.6k|  uint32_t mid;
 3272|       |
 3273|  26.6k|  *pnum = 0;
 3274|  26.6k|  if(Curl_uint32_bset_first(&multi->dirty, &mid)) {
  ------------------
  |  Branch (3274:6): [True: 13.9k, False: 12.6k]
  ------------------
 3275|  14.1k|    do {
 3276|  14.1k|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3277|  14.1k|      if(data) {
  ------------------
  |  Branch (3277:10): [True: 14.1k, False: 0]
  ------------------
 3278|  14.1k|        CURL_TRC_M(data, "multi_run_dirty");
  ------------------
  |  |  148|  14.1k|  do {                                   \
  |  |  149|  14.1k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  14.1k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  14.1k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  28.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 14.1k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 1.75k, False: 12.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  28.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 1.75k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  1.75k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  14.1k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.75k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 65, False: 1.68k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  14.1k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  14.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 14.1k]
  |  |  ------------------
  ------------------
 3279|       |
 3280|  14.1k|        if(!Curl_uint32_bset_contains(&multi->process, mid)) {
  ------------------
  |  Branch (3280:12): [True: 0, False: 14.1k]
  ------------------
 3281|      0|          if(Curl_uint32_bset_contains(&multi->pending, mid)) {
  ------------------
  |  Branch (3281:14): [True: 0, False: 0]
  ------------------
 3282|       |            /* Something happened on the pending transfer, act on it. */
 3283|      0|            move_pending_to_connect(multi, data);
 3284|      0|          }
 3285|      0|          else {
 3286|       |            /* We are no longer processing this transfer */
 3287|      0|            Curl_uint32_bset_remove(&multi->dirty, mid);
 3288|      0|            continue;
 3289|      0|          }
 3290|      0|        }
 3291|       |
 3292|  14.1k|        (*pnum)++;
 3293|       |        /* runsingle() clears the dirty mid */
 3294|  14.1k|        mresult = multi_runsingle(multi, data, sigpipe_ctx);
 3295|       |
 3296|  14.1k|        if(CURLM_OK >= mresult) {
  ------------------
  |  Branch (3296:12): [True: 14.0k, False: 16]
  ------------------
 3297|       |          /* reassess event handling of data */
 3298|  14.0k|          mresult = Curl_multi_ev_assess_xfer(multi, data);
 3299|  14.0k|          if(mresult)
  ------------------
  |  Branch (3299:14): [True: 2, False: 14.0k]
  ------------------
 3300|      2|            goto out;
 3301|  14.0k|        }
 3302|  14.1k|      }
 3303|      0|      else {
 3304|      0|        CURL_TRC_M(multi->admin, "multi_run_dirty, %u no longer found", mid);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3305|      0|        Curl_uint32_bset_remove(&multi->dirty, mid);
 3306|      0|      }
 3307|  14.1k|    } while(Curl_uint32_bset_next(&multi->dirty, mid, &mid));
  ------------------
  |  Branch (3307:13): [True: 141, False: 13.9k]
  ------------------
 3308|  13.9k|  }
 3309|       |
 3310|  26.6k|out:
 3311|  26.6k|  return mresult;
 3312|  26.6k|}
multi.c:multi_timeout:
 3596|  62.5k|{
 3597|  62.5k|  if(multi->dead) {
  ------------------
  |  Branch (3597:6): [True: 0, False: 62.5k]
  ------------------
 3598|      0|    if(pexire_offset_us)
  ------------------
  |  Branch (3598:8): [True: 0, False: 0]
  ------------------
 3599|      0|      *pexire_offset_us = 0;
 3600|      0|    *timeout_ms = 0;
 3601|      0|    return;
 3602|      0|  }
 3603|       |
 3604|  62.5k|  if(multi_has_dirties(multi)) {
  ------------------
  |  Branch (3604:6): [True: 2.21k, False: 60.3k]
  ------------------
 3605|  2.21k|    if(pexire_offset_us) {
  ------------------
  |  Branch (3605:8): [True: 2.21k, False: 1]
  ------------------
 3606|  2.21k|      struct curltime now;
 3607|  2.21k|      curlx_pnow(&now);
 3608|  2.21k|      *pexire_offset_us = Curl_timeouts_offset_us(&multi->timeouts, &now);
 3609|  2.21k|    }
 3610|  2.21k|    *timeout_ms = 0;
 3611|  2.21k|    return;
 3612|  2.21k|  }
 3613|  60.3k|  else {
 3614|  60.3k|    struct curltime now;
 3615|  60.3k|    uint32_t mid;
 3616|       |
 3617|  60.3k|    curlx_pnow(&now);
 3618|  60.3k|    *timeout_ms = Curl_timeouts_next_ms(&multi->timeouts, &now,
 3619|  60.3k|                                        pexire_offset_us, &mid);
 3620|  60.3k|#ifdef CURLVERBOSE
 3621|  60.3k|    if(mid != UINT32_MAX) {
  ------------------
  |  Branch (3621:8): [True: 56.7k, False: 3.59k]
  ------------------
 3622|  56.7k|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3623|  56.7k|      if(data && CURL_TRC_TIMER_is_verbose(data) &&
  ------------------
  |  |  139|  56.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  ------------------
  |  |  |  |  329|   113k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|   113k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 56.7k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 5.77k, False: 50.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   113k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 5.77k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  5.77k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|   113k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  5.77k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 301, False: 5.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3623:10): [True: 56.7k, False: 0]
  ------------------
 3624|    301|         (data->state.timeouts.first < EXPIRE_LAST)) {
  ------------------
  |  Branch (3624:10): [True: 301, False: 0]
  ------------------
 3625|    301|        CURL_TRC_TIMER(data, data->state.timeouts.first,
  ------------------
  |  |  173|    301|  do {                                        \
  |  |  174|    301|    if(CURL_TRC_TIMER_is_verbose(data))       \
  |  |  ------------------
  |  |  |  |  139|    301|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|    301|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|    602|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 301, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 301, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|    602|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 301, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    301|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|    301|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    301|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 301, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|    301|      Curl_trc_timer(data, tid, __VA_ARGS__); \
  |  |  176|    301|  } while(0)
  |  |  ------------------
  |  |  |  Branch (176:11): [Folded, False: 301]
  |  |  ------------------
  ------------------
 3626|    301|                       "gives multi timeout in %dms", *timeout_ms);
 3627|    301|      }
 3628|  56.7k|    }
 3629|  60.3k|#endif
 3630|  60.3k|  }
 3631|  62.5k|}
multi.c:multi_has_dirties:
 3573|  62.5k|{
 3574|  62.5k|  uint32_t mid;
 3575|  62.5k|  if(Curl_uint32_bset_first(&multi->dirty, &mid)) {
  ------------------
  |  Branch (3575:6): [True: 2.21k, False: 60.3k]
  ------------------
 3576|  2.21k|    do {
 3577|  2.21k|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3578|  2.21k|      if(data) {
  ------------------
  |  Branch (3578:10): [True: 2.21k, False: 0]
  ------------------
 3579|  2.21k|        if(Curl_uint32_bset_contains(&multi->process, mid))
  ------------------
  |  Branch (3579:12): [True: 2.21k, False: 0]
  ------------------
 3580|  2.21k|          return TRUE;
  ------------------
  |  |  986|  2.21k|#define TRUE true
  ------------------
 3581|       |        /* We are no longer processing this transfer */
 3582|      0|        Curl_uint32_bset_remove(&multi->dirty, mid);
 3583|      0|      }
 3584|      0|      else {
 3585|      0|        CURL_TRC_M(multi->admin, "dirty transfer %u no longer found", mid);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3586|      0|        Curl_uint32_bset_remove(&multi->dirty, mid);
 3587|      0|      }
 3588|  2.21k|    } while(Curl_uint32_bset_next(&multi->dirty, mid, &mid));
  ------------------
  |  Branch (3588:13): [True: 0, False: 0]
  ------------------
 3589|  2.21k|  }
 3590|  60.3k|  return FALSE;
  ------------------
  |  |  989|  60.3k|#define FALSE false
  ------------------
 3591|  62.5k|}
multi.c:multi_set_timeout:
 3782|  29.7k|{
 3783|  29.7k|  struct expire_timers *timeouts = &data->state.timeouts;
 3784|  29.7k|  uint8_t *anchor = &timeouts->first;
 3785|  29.7k|  uint8_t id = (uint8_t)eid;
 3786|       |
 3787|  29.7k|  if((unsigned)eid >= EXPIRE_LAST) {
  ------------------
  |  Branch (3787:6): [True: 0, False: 29.7k]
  ------------------
 3788|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3788:5): [Folded, False: 0]
  |  Branch (3788:5): [Folded, False: 0]
  ------------------
 3789|      0|    return CURLM_BAD_FUNCTION_ARGUMENT;
 3790|      0|  }
 3791|       |  /* remove from list, store time and re-insert */
 3792|  29.7k|  multi_clear_timeout(data, eid);
 3793|  29.7k|  timeouts->offset_us[id] =
 3794|  29.7k|    Curl_timeouts_offset_us(&data->multi->timeouts, stamp);
 3795|       |
 3796|  43.3k|  while(*anchor < EXPIRE_LAST) {
  ------------------
  |  Branch (3796:9): [True: 22.2k, False: 21.0k]
  ------------------
 3797|  22.2k|    if(timeouts->offset_us[*anchor] > timeouts->offset_us[id])
  ------------------
  |  Branch (3797:8): [True: 8.69k, False: 13.5k]
  ------------------
 3798|  8.69k|      break;
 3799|  13.5k|    anchor = &timeouts->next[*anchor];
 3800|  13.5k|  }
 3801|  29.7k|  timeouts->next[eid] = *anchor;
 3802|  29.7k|  *anchor = id;
 3803|  29.7k|  DEBUGASSERT(multi_timeouts_check(data));
  ------------------
  |  | 1016|  29.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3803:3): [True: 0, False: 29.7k]
  |  Branch (3803:3): [True: 29.7k, False: 0]
  ------------------
 3804|  29.7k|  CURL_TRC_TIMER(data, eid, "set for %" FMT_TIMEDIFF_T "us",
  ------------------
  |  |  173|  29.7k|  do {                                        \
  |  |  174|  29.7k|    if(CURL_TRC_TIMER_is_verbose(data))       \
  |  |  ------------------
  |  |  |  |  139|  29.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  29.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  59.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 29.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 3.12k, False: 26.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  59.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 3.12k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  3.12k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  29.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  3.12k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 640, False: 2.48k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  29.7k|      Curl_trc_timer(data, tid, __VA_ARGS__); \
  |  |  176|  29.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (176:11): [Folded, False: 29.7k]
  |  |  ------------------
  ------------------
 3805|  29.7k|                 curlx_ptimediff_us(stamp, Curl_pgrs_now(data)));
 3806|  29.7k|  return CURLM_OK;
 3807|  29.7k|}
multi.c:multi_timeouts_check:
 3710|  70.5k|{
 3711|  70.5k|  struct expire_timers *timeouts = &data->state.timeouts;
 3712|  70.5k|  uint8_t id;
 3713|  70.5k|  int i = 0;
 3714|   186k|  for(id = timeouts->first; id < EXPIRE_LAST; id = timeouts->next[id]) {
  ------------------
  |  Branch (3714:29): [True: 115k, False: 70.5k]
  ------------------
 3715|   115k|    if(++i >= EXPIRE_LAST) {
  ------------------
  |  Branch (3715:8): [True: 0, False: 115k]
  ------------------
 3716|      0|      failf(data, "expire timeouts looped: %d iterations and no end", i);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3717|      0|      return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 3718|      0|    }
 3719|   115k|    if(id == timeouts->next[id]) {
  ------------------
  |  Branch (3719:8): [True: 0, False: 115k]
  ------------------
 3720|      0|      failf(data, "expire timeouts wrong: %d points to itself", (int)id);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3721|      0|      return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 3722|      0|    }
 3723|   115k|    if((timeouts->next[id] < EXPIRE_LAST) &&
  ------------------
  |  Branch (3723:8): [True: 54.8k, False: 60.8k]
  ------------------
 3724|  54.8k|       (timeouts->offset_us[id] > timeouts->offset_us[timeouts->next[id]])) {
  ------------------
  |  Branch (3724:8): [True: 0, False: 54.8k]
  ------------------
 3725|      0|      failf(data, "expire timeouts not sorted: %d happens after %d but "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3726|      0|            "is listed before", (int)id, (int)timeouts->next[id]);
 3727|      0|      return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 3728|      0|    }
 3729|   115k|  }
 3730|  70.5k|  return TRUE;
  ------------------
  |  |  986|  70.5k|#define TRUE true
  ------------------
 3731|  70.5k|}
multi.c:multi_clear_timeout:
 3738|  40.7k|{
 3739|  40.7k|  struct expire_timers *timeouts = &data->state.timeouts;
 3740|  40.7k|  uint8_t orig_first = timeouts->first;
 3741|  40.7k|  uint8_t *anchor = &timeouts->first;
 3742|  40.7k|  uint8_t id = (uint8_t)eid;
 3743|       |
 3744|  40.7k|  if((unsigned)eid >= EXPIRE_LAST) {
  ------------------
  |  Branch (3744:6): [True: 0, False: 40.7k]
  ------------------
 3745|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3745:5): [Folded, False: 0]
  |  Branch (3745:5): [Folded, False: 0]
  ------------------
 3746|      0|    return;
 3747|      0|  }
 3748|       |
 3749|  87.2k|  while(*anchor < EXPIRE_LAST) {
  ------------------
  |  Branch (3749:9): [True: 51.4k, False: 35.8k]
  ------------------
 3750|  51.4k|    if(*anchor == id) {
  ------------------
  |  Branch (3750:8): [True: 4.86k, False: 46.5k]
  ------------------
 3751|  4.86k|      *anchor = timeouts->next[id];
 3752|  4.86k|      break;
 3753|  4.86k|    }
 3754|  46.5k|    anchor = &timeouts->next[*anchor];
 3755|  46.5k|  }
 3756|  40.7k|  DEBUGASSERT(multi_timeouts_check(data));
  ------------------
  |  | 1016|  40.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3756:3): [True: 0, False: 40.7k]
  |  Branch (3756:3): [True: 40.7k, False: 0]
  ------------------
 3757|  40.7k|  if(Curl_timeouts_has(data)) {
  ------------------
  |  Branch (3757:6): [True: 31.0k, False: 9.66k]
  ------------------
 3758|  31.0k|    struct Curl_multi *multi = data->multi;
 3759|       |
 3760|  31.0k|    if(!multi) {
  ------------------
  |  Branch (3760:8): [True: 0, False: 31.0k]
  ------------------
 3761|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3761:7): [Folded, False: 0]
  |  Branch (3761:7): [Folded, False: 0]
  ------------------
 3762|      0|      return;
 3763|      0|    }
 3764|  31.0k|    if((timeouts->first >= EXPIRE_LAST) || /* no more timeouts */
  ------------------
  |  Branch (3764:8): [True: 0, False: 31.0k]
  ------------------
 3765|  31.0k|       (timeouts->first != orig_first)) {  /* active timeout changed */
  ------------------
  |  Branch (3765:8): [True: 4.14k, False: 26.9k]
  ------------------
 3766|  4.14k|      Curl_timeouts_remove(&multi->timeouts, data);
 3767|  4.14k|    }
 3768|  31.0k|    if((timeouts->first < EXPIRE_LAST) && !Curl_timeouts_has(data)) {
  ------------------
  |  Branch (3768:8): [True: 31.0k, False: 0]
  |  Branch (3768:43): [True: 4.14k, False: 26.9k]
  ------------------
 3769|  4.14k|      Curl_timeouts_add(&multi->timeouts, data,
 3770|  4.14k|                        timeouts->offset_us[timeouts->first]);
 3771|  4.14k|    }
 3772|  31.0k|  }
 3773|  40.7k|}
multi.c:multi_schedule_pending:
 3972|  49.0k|{
 3973|  49.0k|  uint32_t mid = multi->last_pending_mid;
 3974|       |
 3975|  49.0k|  if(mid) {
  ------------------
  |  Branch (3975:6): [True: 0, False: 49.0k]
  ------------------
 3976|      0|    while(Curl_uint32_bset_next(&multi->pending, mid, &mid)) {
  ------------------
  |  Branch (3976:11): [True: 0, False: 0]
  ------------------
 3977|      0|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3978|      0|      if(data) {
  ------------------
  |  Branch (3978:10): [True: 0, False: 0]
  ------------------
 3979|      0|        move_pending_to_connect(multi, data);
 3980|      0|        multi->last_pending_mid = mid;
 3981|      0|        return;
 3982|      0|      }
 3983|       |      /* transfer no longer known, should not happen */
 3984|      0|      Curl_uint32_bset_remove(&multi->pending, mid);
 3985|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3985:7): [Folded, False: 0]
  |  Branch (3985:7): [Folded, False: 0]
  ------------------
 3986|      0|    }
 3987|       |    /* found no pending transfers with `mid` larger than `last_pending_mid`.
 3988|       |     * Start at the beginning of the pending set again. */
 3989|      0|    multi->last_pending_mid = 0;
 3990|      0|  }
 3991|       |
 3992|  49.0k|  if(Curl_uint32_bset_first(&multi->pending, &mid)) {
  ------------------
  |  Branch (3992:6): [True: 0, False: 49.0k]
  ------------------
 3993|      0|    do {
 3994|      0|      struct Curl_easy *data = Curl_multi_get_easy(multi, mid);
 3995|      0|      if(data) {
  ------------------
  |  Branch (3995:10): [True: 0, False: 0]
  ------------------
 3996|      0|        move_pending_to_connect(multi, data);
 3997|      0|        multi->last_pending_mid = mid;
 3998|      0|        return;
 3999|      0|      }
 4000|       |      /* transfer no longer known, should not happen */
 4001|      0|      Curl_uint32_bset_remove(&multi->pending, mid);
 4002|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4002:7): [Folded, False: 0]
  |  Branch (4002:7): [Folded, False: 0]
  ------------------
 4003|      0|    } while(Curl_uint32_bset_next(&multi->pending, mid, &mid));
  ------------------
  |  Branch (4003:13): [True: 0, False: 0]
  ------------------
 4004|      0|  }
 4005|  49.0k|}
multi.c:fixed_buf_create:
 4093|  3.89k|{
 4094|  3.89k|  struct Curl_fixed_buf *fbuf;
 4095|  3.89k|  if((SIZE_MAX - sizeof(*fbuf)) < len)
  ------------------
  |  Branch (4095:6): [True: 0, False: 3.89k]
  ------------------
 4096|      0|    return NULL; /* too large */
 4097|  3.89k|  fbuf = curlx_malloc(len + sizeof(*fbuf));
  ------------------
  |  | 1498|  3.89k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 4098|  3.89k|  if(fbuf)
  ------------------
  |  Branch (4098:6): [True: 3.89k, False: 0]
  ------------------
 4099|  3.89k|    fbuf->len = len;
 4100|  3.89k|  return fbuf;
 4101|  3.89k|}
multi.c:multi_xfer_bufs_free:
 4253|  9.76k|{
 4254|  9.76k|  DEBUGASSERT(multi);
  ------------------
  |  | 1016|  9.76k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4254:3): [True: 0, False: 9.76k]
  |  Branch (4254:3): [True: 9.76k, False: 0]
  ------------------
 4255|  9.76k|  curlx_safefree(multi->xfer_buf);
  ------------------
  |  | 1359|  9.76k|  do {                      \
  |  | 1360|  9.76k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.76k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.76k|    (ptr) = NULL;           \
  |  | 1362|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
 4256|  9.76k|  multi->xfer_buf_borrowed = FALSE;
  ------------------
  |  |  989|  9.76k|#define FALSE false
  ------------------
 4257|  9.76k|  curlx_safefree(multi->xfer_ulbuf);
  ------------------
  |  | 1359|  9.76k|  do {                      \
  |  | 1360|  9.76k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.76k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.76k|    (ptr) = NULL;           \
  |  | 1362|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
 4258|  9.76k|  multi->xfer_ulbuf_borrowed = FALSE;
  ------------------
  |  |  989|  9.76k|#define FALSE false
  ------------------
 4259|  9.76k|  curlx_safefree(multi->xfer_sockbuf);
  ------------------
  |  | 1359|  9.76k|  do {                      \
  |  | 1360|  9.76k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.76k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.76k|    (ptr) = NULL;           \
  |  | 1362|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
 4260|       |  multi->xfer_sockbuf_borrowed = FALSE;
  ------------------
  |  |  989|  9.76k|#define FALSE false
  ------------------
 4261|  9.76k|}
multi.c:multi_xfers_running:
 4281|   136k|{
 4282|   136k|  if(!multi) {
  ------------------
  |  Branch (4282:6): [True: 0, False: 136k]
  ------------------
 4283|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (4283:5): [Folded, False: 0]
  |  Branch (4283:5): [Folded, False: 0]
  ------------------
 4284|      0|    return 0;
 4285|      0|  }
 4286|   136k|  return multi->xfers_alive;
 4287|   136k|}

Curl_multi_ev_assess_xfer:
  549|  25.4k|{
  550|       |  return mev_assess(multi, data, NULL);
  551|  25.4k|}
Curl_multi_ev_assign:
  580|  8.33k|{
  581|  8.33k|  struct mev_sh_entry *e = mev_sh_entry_get(&multi->ev.sh_entries, s);
  582|  8.33k|  if(!e)
  ------------------
  |  Branch (582:6): [True: 0, False: 8.33k]
  ------------------
  583|      0|    return CURLM_BAD_SOCKET;
  584|  8.33k|  e->user_data = user_data;
  585|  8.33k|  return CURLM_OK;
  586|  8.33k|}
Curl_multi_ev_dirty_xfers:
  590|  9.97k|{
  591|  9.97k|  struct mev_sh_entry *entry;
  592|       |
  593|  9.97k|  DEBUGASSERT(s != CURL_SOCKET_TIMEOUT);
  ------------------
  |  | 1016|  9.97k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (593:3): [True: 0, False: 9.97k]
  |  Branch (593:3): [True: 9.97k, False: 0]
  ------------------
  594|  9.97k|  entry = mev_sh_entry_get(&multi->ev.sh_entries, s);
  595|       |
  596|       |  /* Unmatched socket, we cannot act on it but we ignore this fact. In
  597|       |     real-world tests it has been proved that libevent can in fact give
  598|       |     the application actions even though the socket was previously
  599|       |     asked to get removed, so thus we better survive stray socket actions
  600|       |     and move on. */
  601|  9.97k|  if(entry) {
  ------------------
  |  Branch (601:6): [True: 9.97k, False: 0]
  ------------------
  602|  9.97k|    struct Curl_easy *data;
  603|  9.97k|    uint32_t mid;
  604|       |
  605|  9.97k|    if(Curl_uint32_spbset_first(&entry->xfers, &mid)) {
  ------------------
  |  Branch (605:8): [True: 9.97k, False: 0]
  ------------------
  606|  9.97k|      do {
  607|  9.97k|        data = Curl_multi_get_easy(multi, mid);
  608|  9.97k|        if(data) {
  ------------------
  |  Branch (608:12): [True: 9.97k, False: 0]
  ------------------
  609|  9.97k|          Curl_multi_mark_dirty(data);
  610|  9.97k|        }
  611|      0|        else {
  612|      0|          CURL_TRC_M(multi->admin, "socket transfer %u no longer found", mid);
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  613|      0|          Curl_uint32_spbset_remove(&entry->xfers, mid);
  614|      0|        }
  615|  9.97k|      } while(Curl_uint32_spbset_next(&entry->xfers, mid, &mid));
  ------------------
  |  Branch (615:15): [True: 0, False: 9.97k]
  ------------------
  616|  9.97k|    }
  617|       |
  618|  9.97k|    if(entry->conn)
  ------------------
  |  Branch (618:8): [True: 0, False: 9.97k]
  ------------------
  619|      0|      Curl_multi_mark_dirty(multi->admin);
  620|  9.97k|  }
  621|  9.97k|}
Curl_multi_ev_socket_done:
  625|  9.20k|{
  626|  9.20k|  mev_forget_socket(multi, data, s, "socket done");
  627|  9.20k|}
Curl_multi_ev_xfer_done:
  631|  9.82k|{
  632|  9.82k|  DEBUGASSERT(!data->conn); /* transfer should have been detached */
  ------------------
  |  | 1016|  9.82k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (632:3): [True: 0, False: 9.82k]
  |  Branch (632:3): [True: 9.82k, False: 0]
  ------------------
  633|  9.82k|  (void)mev_assess(multi, data, NULL);
  634|  9.82k|  Curl_meta_remove(data, CURL_META_MEV_POLLSET);
  ------------------
  |  |   34|  9.82k|#define CURL_META_MEV_POLLSET   "meta:mev:ps"
  ------------------
  635|  9.82k|}
Curl_multi_ev_conn_done:
  640|  9.39k|{
  641|  9.39k|  (void)mev_assess(multi, data, conn);
  642|  9.39k|  Curl_conn_meta_remove(conn, CURL_META_MEV_POLLSET);
  ------------------
  |  |   34|  9.39k|#define CURL_META_MEV_POLLSET   "meta:mev:ps"
  ------------------
  643|  9.39k|}
Curl_multi_ev_init:
  646|  9.82k|{
  647|  9.82k|  Curl_hash_init(&multi->ev.sh_entries, hashsize, CURL_HASH_TYPE_SOCKET,
  648|  9.82k|                 mev_sh_entry_dtor);
  649|  9.82k|}
Curl_multi_ev_cleanup:
  652|  9.82k|{
  653|  9.82k|  Curl_hash_destroy(&multi->ev.sh_entries);
  654|  9.82k|}
multi_ev.c:mev_assess:
  504|  44.7k|{
  505|  44.7k|  struct easy_pollset ps, *last_ps;
  506|  44.7k|  CURLMcode mresult = CURLM_OK;
  507|       |
  508|  44.7k|  if(!multi || !multi->socket_cb)
  ------------------
  |  Branch (508:6): [True: 0, False: 44.7k]
  |  Branch (508:16): [True: 14.9k, False: 29.7k]
  ------------------
  509|  14.9k|    return CURLM_OK;
  510|       |
  511|  29.7k|  Curl_pollset_init(&ps);
  512|  29.7k|  if(conn) {
  ------------------
  |  Branch (512:6): [True: 2.10k, False: 27.6k]
  ------------------
  513|  2.10k|    CURLcode result = Curl_conn_adjust_pollset(data, conn, &ps);
  514|  2.10k|    if(result) {
  ------------------
  |  Branch (514:8): [True: 0, False: 2.10k]
  ------------------
  515|      0|      mresult = (result == CURLE_OUT_OF_MEMORY) ?
  ------------------
  |  Branch (515:17): [True: 0, False: 0]
  ------------------
  516|      0|        CURLM_OUT_OF_MEMORY : CURLM_INTERNAL_ERROR;
  517|      0|      goto out;
  518|      0|    }
  519|  2.10k|  }
  520|  27.6k|  else {
  521|  27.6k|    mresult = Curl_multi_pollset(data, &ps);
  522|  27.6k|    if(mresult)
  ------------------
  |  Branch (522:8): [True: 0, False: 27.6k]
  ------------------
  523|      0|      goto out;
  524|  27.6k|  }
  525|  29.7k|  last_ps = mev_get_last_pollset(data, conn);
  526|       |
  527|  29.7k|  if(!last_ps && ps.n) {
  ------------------
  |  Branch (527:6): [True: 9.17k, False: 20.6k]
  |  Branch (527:18): [True: 4.18k, False: 4.98k]
  ------------------
  528|  4.18k|    if(conn)
  ------------------
  |  Branch (528:8): [True: 0, False: 4.18k]
  ------------------
  529|      0|      last_ps = mev_add_new_conn_pollset(conn);
  530|  4.18k|    else
  531|  4.18k|      last_ps = mev_add_new_xfer_pollset(data);
  532|  4.18k|    if(!last_ps) {
  ------------------
  |  Branch (532:8): [True: 9, False: 4.17k]
  ------------------
  533|      9|      mresult = CURLM_OUT_OF_MEMORY;
  534|      9|      goto out;
  535|      9|    }
  536|  4.18k|  }
  537|       |
  538|  29.7k|  if(last_ps)
  ------------------
  |  Branch (538:6): [True: 24.8k, False: 4.98k]
  ------------------
  539|  24.8k|    mresult = mev_pollset_diff(multi, data, conn, &ps, last_ps);
  540|  4.98k|  else
  541|  29.7k|    DEBUGASSERT(!ps.n);
  ------------------
  |  | 1016|  29.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (541:5): [True: 0, False: 4.98k]
  |  Branch (541:5): [True: 4.98k, False: 0]
  ------------------
  542|  29.7k|out:
  543|  29.7k|  Curl_pollset_cleanup(&ps);
  544|  29.7k|  return mresult;
  545|  29.7k|}
multi_ev.c:mev_get_last_pollset:
  171|  30.1k|{
  172|  30.1k|  if(data) {
  ------------------
  |  Branch (172:6): [True: 30.1k, False: 0]
  ------------------
  173|  30.1k|    if(conn)
  ------------------
  |  Branch (173:8): [True: 2.10k, False: 28.0k]
  ------------------
  174|  2.10k|      return Curl_conn_meta_get(conn, CURL_META_MEV_POLLSET);
  ------------------
  |  |   34|  2.10k|#define CURL_META_MEV_POLLSET   "meta:mev:ps"
  ------------------
  175|  28.0k|    return Curl_meta_get(data, CURL_META_MEV_POLLSET);
  ------------------
  |  |   34|  28.0k|#define CURL_META_MEV_POLLSET   "meta:mev:ps"
  ------------------
  176|  30.1k|  }
  177|      0|  return NULL;
  178|  30.1k|}
multi_ev.c:mev_pollset_dtor:
  135|  4.18k|{
  136|  4.18k|  struct easy_pollset *ps = entry;
  137|  4.18k|  (void)key;
  138|  4.18k|  (void)klen;
  139|  4.18k|  if(ps) {
  ------------------
  |  Branch (139:6): [True: 4.18k, False: 0]
  ------------------
  140|  4.18k|    Curl_pollset_cleanup(ps);
  141|  4.18k|    curlx_free(ps);
  ------------------
  |  | 1503|  4.18k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  142|  4.18k|  }
  143|  4.18k|}
multi_ev.c:mev_add_new_xfer_pollset:
  158|  4.18k|{
  159|  4.18k|  struct easy_pollset *ps;
  160|       |
  161|  4.18k|  ps = Curl_pollset_create();
  162|  4.18k|  if(!ps)
  ------------------
  |  Branch (162:6): [True: 4, False: 4.18k]
  ------------------
  163|      4|    return NULL;
  164|  4.18k|  if(Curl_meta_set(data, CURL_META_MEV_POLLSET, ps, mev_pollset_dtor))
  ------------------
  |  |   34|  4.18k|#define CURL_META_MEV_POLLSET   "meta:mev:ps"
  ------------------
  |  Branch (164:6): [True: 5, False: 4.17k]
  ------------------
  165|      5|    return NULL;
  166|  4.17k|  return ps;
  167|  4.18k|}
multi_ev.c:mev_pollset_diff:
  359|  24.8k|{
  360|  24.8k|  struct mev_sh_entry *entry;
  361|  24.8k|  curl_socket_t s;
  362|  24.8k|  unsigned int i, j;
  363|  24.8k|  CURLMcode mresult;
  364|       |
  365|       |  /* The transfer `data` reports in `ps` the sockets it is interested
  366|       |   * in and which combination of CURL_POLL_IN/CURL_POLL_OUT it wants
  367|       |   * to have monitored for events.
  368|       |   * There can be more than 1 transfer interested in the same socket
  369|       |   * and 1 transfer might be interested in more than 1 socket.
  370|       |   * `prev_ps` is the pollset copy from the previous call here. On
  371|       |   * the 1st call it will be empty.
  372|       |   */
  373|  24.8k|  DEBUGASSERT(ps);
  ------------------
  |  | 1016|  24.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (373:3): [True: 0, False: 24.8k]
  |  Branch (373:3): [True: 24.8k, False: 0]
  ------------------
  374|  24.8k|  DEBUGASSERT(prev_ps);
  ------------------
  |  | 1016|  24.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (374:3): [True: 0, False: 24.8k]
  |  Branch (374:3): [True: 24.8k, False: 0]
  ------------------
  375|       |
  376|       |  /* Handle changes to sockets the transfer is interested in. */
  377|  40.6k|  for(i = 0; i < ps->n; i++) {
  ------------------
  |  Branch (377:14): [True: 15.8k, False: 24.7k]
  ------------------
  378|  15.8k|    unsigned char last_action;
  379|  15.8k|    bool first_time = FALSE; /* data/conn appears first time on socket */
  ------------------
  |  |  989|  15.8k|#define FALSE false
  ------------------
  380|       |
  381|  15.8k|    s = ps->sockets[i];
  382|       |    /* Have we handled this socket before? */
  383|  15.8k|    entry = mev_sh_entry_get(&multi->ev.sh_entries, s);
  384|  15.8k|    if(!entry) {
  ------------------
  |  Branch (384:8): [True: 4.17k, False: 11.7k]
  ------------------
  385|       |      /* new socket, add new entry */
  386|  4.17k|      first_time = TRUE;
  ------------------
  |  |  986|  4.17k|#define TRUE true
  ------------------
  387|  4.17k|      entry = mev_sh_entry_add(&multi->ev.sh_entries, s);
  388|  4.17k|      if(!entry) /* fatal */
  ------------------
  |  Branch (388:10): [True: 9, False: 4.16k]
  ------------------
  389|      9|        return CURLM_OUT_OF_MEMORY;
  390|  4.16k|      CURL_TRC_M(data, "ev new entry fd=%" FMT_SOCKET_T, s);
  ------------------
  |  |  148|  4.16k|  do {                                   \
  |  |  149|  4.16k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  4.16k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  4.16k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  8.33k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 4.16k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 4.01k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  8.33k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  4.16k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 4, False: 143]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  4.16k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  4.16k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 4.16k]
  |  |  ------------------
  ------------------
  391|  4.16k|    }
  392|  11.7k|    else if(conn) {
  ------------------
  |  Branch (392:13): [True: 0, False: 11.7k]
  ------------------
  393|      0|      first_time = !mev_sh_entry_conn_known(entry, conn);
  394|      0|    }
  395|  11.7k|    else {
  396|  11.7k|      first_time = !mev_sh_entry_xfer_known(entry, data);
  397|  11.7k|    }
  398|       |
  399|       |    /* What was the previous action the transfer had regarding this socket?
  400|       |     * If the transfer is new to the socket, disregard the information
  401|       |     * in `last_poll`, because the socket might have been destroyed and
  402|       |     * reopened. We would have cleared the sh_entry for that, but the socket
  403|       |     * might still be mentioned in the hashed pollsets. */
  404|  15.8k|    last_action = 0;
  405|  15.8k|    if(first_time) {
  ------------------
  |  Branch (405:8): [True: 4.16k, False: 11.7k]
  ------------------
  406|  4.16k|      if(conn) {
  ------------------
  |  Branch (406:10): [True: 0, False: 4.16k]
  ------------------
  407|      0|        if(!mev_sh_entry_conn_add(entry, conn))
  ------------------
  |  Branch (407:12): [True: 0, False: 0]
  ------------------
  408|      0|          return CURLM_OUT_OF_MEMORY;
  409|      0|      }
  410|  4.16k|      else {
  411|  4.16k|        if(!mev_sh_entry_xfer_add(entry, data))
  ------------------
  |  Branch (411:12): [True: 0, False: 4.16k]
  ------------------
  412|      0|          return CURLM_OUT_OF_MEMORY;
  413|  4.16k|      }
  414|  4.16k|      CURL_TRC_M(data, "ev entry fd=%" FMT_SOCKET_T ", added %s #%" FMT_OFF_T
  ------------------
  |  |  148|  4.16k|  do {                                   \
  |  |  149|  4.16k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  4.16k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  4.16k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  8.33k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 4.16k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 4.01k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  8.33k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  4.16k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 4, False: 143]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  4.16k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 4]
  |  |  |  Branch (150:28): [True: 0, False: 4]
  |  |  |  Branch (150:28): [True: 0, False: 4]
  |  |  ------------------
  |  |  151|  4.16k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 4.16k]
  |  |  ------------------
  ------------------
  415|  4.16k|                 ", total=%u/%d (xfer/conn)", s,
  416|  4.16k|                 conn ? "connection" : "transfer",
  417|  4.16k|                 conn ? conn->connection_id : data->mid,
  418|  4.16k|                 Curl_uint32_spbset_count(&entry->xfers),
  419|  4.16k|                 entry->conn ? 1 : 0);
  420|  4.16k|    }
  421|  11.7k|    else {
  422|  11.7k|      for(j = 0; j < prev_ps->n; j++) {
  ------------------
  |  Branch (422:18): [True: 11.7k, False: 0]
  ------------------
  423|  11.7k|        if(s == prev_ps->sockets[j]) {
  ------------------
  |  Branch (423:12): [True: 11.7k, False: 0]
  ------------------
  424|  11.7k|          last_action = prev_ps->actions[j];
  425|  11.7k|          break;
  426|  11.7k|        }
  427|  11.7k|      }
  428|  11.7k|    }
  429|       |    /* track readers/writers changes and report to socket callback */
  430|  15.8k|    mresult = mev_sh_entry_update(multi, data, entry, s,
  431|  15.8k|                                  last_action, ps->actions[i]);
  432|  15.8k|    if(mresult)
  ------------------
  |  Branch (432:8): [True: 0, False: 15.8k]
  ------------------
  433|      0|      return mresult;
  434|  15.8k|  }
  435|       |
  436|       |  /* Handle changes to sockets the transfer is NO LONGER interested in. */
  437|  40.2k|  for(i = 0; i < prev_ps->n; i++) {
  ------------------
  |  Branch (437:14): [True: 15.4k, False: 24.7k]
  ------------------
  438|  15.4k|    bool stillused = FALSE;
  ------------------
  |  |  989|  15.4k|#define FALSE false
  ------------------
  439|       |
  440|  15.4k|    s = prev_ps->sockets[i];
  441|  15.4k|    for(j = 0; j < ps->n; j++) {
  ------------------
  |  Branch (441:16): [True: 11.7k, False: 3.77k]
  ------------------
  442|  11.7k|      if(s == ps->sockets[j]) {
  ------------------
  |  Branch (442:10): [True: 11.7k, False: 0]
  ------------------
  443|       |        /* socket is still supervised */
  444|  11.7k|        stillused = TRUE;
  ------------------
  |  |  986|  11.7k|#define TRUE true
  ------------------
  445|  11.7k|        break;
  446|  11.7k|      }
  447|  11.7k|    }
  448|  15.4k|    if(stillused)
  ------------------
  |  Branch (448:8): [True: 11.7k, False: 3.77k]
  ------------------
  449|  11.7k|      continue;
  450|       |
  451|  3.77k|    entry = mev_sh_entry_get(&multi->ev.sh_entries, s);
  452|       |    /* if entry does not exist, we were either never told about it or
  453|       |     * have already cleaned up this socket via Curl_multi_ev_socket_done().
  454|       |     * In other words: this is perfectly normal */
  455|  3.77k|    if(!entry)
  ------------------
  |  Branch (455:8): [True: 0, False: 3.77k]
  ------------------
  456|      0|      continue;
  457|       |
  458|  3.77k|    if(conn && !mev_sh_entry_conn_remove(entry, conn)) {
  ------------------
  |  Branch (458:8): [True: 0, False: 3.77k]
  |  Branch (458:16): [True: 0, False: 0]
  ------------------
  459|       |      /* `conn` says in `prev_ps` that it had been using a socket,
  460|       |       * but `conn` has not been registered for it.
  461|       |       * This should not happen if our book-keeping is correct? */
  462|      0|      CURL_TRC_M(data, "ev entry fd=%" FMT_SOCKET_T ", conn lost "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  463|      0|                 "interest but is not registered", s);
  464|      0|      DEBUGASSERT(NULL);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (464:7): [True: 0, False: 0]
  |  Branch (464:7): [True: 0, False: 0]
  ------------------
  465|      0|      continue;
  466|      0|    }
  467|       |
  468|  3.77k|    if(!conn && !mev_sh_entry_xfer_remove(entry, data)) {
  ------------------
  |  Branch (468:8): [True: 3.77k, False: 0]
  |  Branch (468:17): [True: 0, False: 3.77k]
  ------------------
  469|       |      /* `data` says in `prev_ps` that it had been using a socket,
  470|       |       * but `data` has not been registered for it.
  471|       |       * This should not happen if our book-keeping is correct? */
  472|      0|      CURL_TRC_M(data, "ev entry fd=%" FMT_SOCKET_T ", transfer lost "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  473|      0|                 "interest but is not registered", s);
  474|      0|      DEBUGASSERT(NULL);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (474:7): [True: 0, False: 0]
  |  Branch (474:7): [True: 0, False: 0]
  ------------------
  475|      0|      continue;
  476|      0|    }
  477|       |
  478|  3.77k|    if(mev_sh_entry_user_count(entry)) {
  ------------------
  |  Branch (478:8): [True: 0, False: 3.77k]
  ------------------
  479|       |      /* track readers/writers changes and report to socket callback */
  480|      0|      mresult = mev_sh_entry_update(multi, data, entry, s,
  481|      0|                                    prev_ps->actions[i], 0);
  482|      0|      if(mresult)
  ------------------
  |  Branch (482:10): [True: 0, False: 0]
  ------------------
  483|      0|        return mresult;
  484|      0|      CURL_TRC_M(data, "ev entry fd=%" FMT_SOCKET_T ", removed transfer, "
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 0]
  |  |  ------------------
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  485|      0|                 "total=%u/%d (xfer/conn)", s,
  486|      0|                 Curl_uint32_spbset_count(&entry->xfers),
  487|      0|                 entry->conn ? 1 : 0);
  488|      0|    }
  489|  3.77k|    else {
  490|  3.77k|      mresult = mev_forget_socket(multi, data, s, "last user gone");
  491|  3.77k|      if(mresult)
  ------------------
  |  Branch (491:10): [True: 0, False: 3.77k]
  ------------------
  492|      0|        return mresult;
  493|  3.77k|    }
  494|  3.77k|  } /* for loop over num */
  495|       |
  496|       |  /* Remember for next time */
  497|  24.7k|  Curl_pollset_move(prev_ps, ps);
  498|  24.7k|  return CURLM_OK;
  499|  24.7k|}
multi_ev.c:mev_sh_entry_add:
   84|  4.17k|{
   85|  4.17k|  struct mev_sh_entry *there = mev_sh_entry_get(sh, s);
   86|  4.17k|  struct mev_sh_entry *check;
   87|       |
   88|  4.17k|  if(there) {
  ------------------
  |  Branch (88:6): [True: 0, False: 4.17k]
  ------------------
   89|       |    /* it is present, return fine */
   90|      0|    return there;
   91|      0|  }
   92|       |
   93|       |  /* not present, add it */
   94|  4.17k|  check = curlx_calloc(1, sizeof(struct mev_sh_entry));
  ------------------
  |  | 1500|  4.17k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   95|  4.17k|  if(!check)
  ------------------
  |  Branch (95:6): [True: 3, False: 4.17k]
  ------------------
   96|      3|    return NULL; /* major failure */
   97|       |
   98|  4.17k|  Curl_uint32_spbset_init(&check->xfers);
   99|       |
  100|       |  /* make/add new hash entry */
  101|  4.17k|  if(!Curl_hash_add(sh, (char *)&s, sizeof(curl_socket_t), check)) {
  ------------------
  |  Branch (101:6): [True: 6, False: 4.16k]
  ------------------
  102|      6|    mev_sh_entry_dtor(check);
  103|      6|    return NULL; /* major failure */
  104|      6|  }
  105|  4.16k|#ifdef DEBUGBUILD
  106|  4.16k|  check->magic = SH_ENTRY_MAGIC;
  ------------------
  |  |   38|  4.16k|#define SH_ENTRY_MAGIC 0x570091d
  ------------------
  107|  4.16k|#endif
  108|  4.16k|  return check; /* things are good in sockhash land */
  109|  4.17k|}
multi_ev.c:mev_sh_entry_xfer_known:
  124|  11.7k|{
  125|  11.7k|  return Curl_uint32_spbset_contains(&e->xfers, data->mid);
  126|  11.7k|}
multi_ev.c:mev_sh_entry_xfer_add:
  182|  4.16k|{
  183|       |   /* detect weird values */
  184|  4.16k|  DEBUGASSERT(mev_sh_entry_user_count(e) < 100000);
  ------------------
  |  | 1016|  4.16k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (184:3): [True: 0, False: 4.16k]
  |  Branch (184:3): [True: 4.16k, False: 0]
  ------------------
  185|  4.16k|  return Curl_uint32_spbset_add(&e->xfers, data->mid);
  186|  4.16k|}
multi_ev.c:mev_sh_entry_update:
  281|  15.8k|{
  282|  15.8k|  int rc, comboaction;
  283|       |
  284|       |  /* we should only be called when the callback exists */
  285|  15.8k|  DEBUGASSERT(multi->socket_cb);
  ------------------
  |  | 1016|  15.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (285:3): [True: 0, False: 15.8k]
  |  Branch (285:3): [True: 15.8k, False: 0]
  ------------------
  286|  15.8k|  DEBUGASSERT(entry->magic == SH_ENTRY_MAGIC);
  ------------------
  |  | 1016|  15.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (286:3): [True: 0, False: 15.8k]
  |  Branch (286:3): [True: 15.8k, False: 0]
  ------------------
  287|  15.8k|  if(!multi->socket_cb)
  ------------------
  |  Branch (287:6): [True: 0, False: 15.8k]
  ------------------
  288|      0|    return CURLM_OK;
  289|       |
  290|       |  /* Transfer `data` goes from `last_action` to `cur_action` on socket `s`
  291|       |   * with `multi->ev.sh_entries` entry `entry`. Update `entry` and trigger
  292|       |   * `multi->socket_cb` on change, if the callback is set. */
  293|  15.8k|  if(last_action == cur_action)  /* nothing from `data` changed */
  ------------------
  |  Branch (293:6): [True: 11.6k, False: 4.19k]
  ------------------
  294|  11.6k|    return CURLM_OK;
  295|       |
  296|  4.19k|  if(last_action & CURL_POLL_IN) {
  ------------------
  |  |  283|  4.19k|#define CURL_POLL_IN     1
  ------------------
  |  Branch (296:6): [True: 29, False: 4.16k]
  ------------------
  297|     29|    DEBUGASSERT(entry->readers);
  ------------------
  |  | 1016|     29|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (297:5): [True: 0, False: 29]
  |  Branch (297:5): [True: 29, False: 0]
  ------------------
  298|     29|    if(!(cur_action & CURL_POLL_IN))
  ------------------
  |  |  283|     29|#define CURL_POLL_IN     1
  ------------------
  |  Branch (298:8): [True: 0, False: 29]
  ------------------
  299|      0|      entry->readers--;
  300|     29|  }
  301|  4.16k|  else if(cur_action & CURL_POLL_IN)
  ------------------
  |  |  283|  4.16k|#define CURL_POLL_IN     1
  ------------------
  |  Branch (301:11): [True: 4.16k, False: 0]
  ------------------
  302|  4.16k|    entry->readers++;
  303|       |
  304|  4.19k|  if(last_action & CURL_POLL_OUT) {
  ------------------
  |  |  284|  4.19k|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (304:6): [True: 9, False: 4.18k]
  ------------------
  305|      9|    DEBUGASSERT(entry->writers);
  ------------------
  |  | 1016|      9|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (305:5): [True: 0, False: 9]
  |  Branch (305:5): [True: 9, False: 0]
  ------------------
  306|      9|    if(!(cur_action & CURL_POLL_OUT))
  ------------------
  |  |  284|      9|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (306:8): [True: 9, False: 0]
  ------------------
  307|      9|      entry->writers--;
  308|      9|  }
  309|  4.18k|  else if(cur_action & CURL_POLL_OUT)
  ------------------
  |  |  284|  4.18k|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (309:11): [True: 20, False: 4.16k]
  ------------------
  310|     20|    entry->writers++;
  311|       |
  312|  4.19k|  DEBUGASSERT(entry->readers <= mev_sh_entry_user_count(entry));
  ------------------
  |  | 1016|  4.19k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (312:3): [True: 0, False: 4.19k]
  |  Branch (312:3): [True: 4.19k, False: 0]
  ------------------
  313|  4.19k|  DEBUGASSERT(entry->writers <= mev_sh_entry_user_count(entry));
  ------------------
  |  | 1016|  4.19k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (313:3): [True: 0, False: 4.19k]
  |  Branch (313:3): [True: 4.19k, False: 0]
  ------------------
  314|  4.19k|  DEBUGASSERT(entry->writers + entry->readers);
  ------------------
  |  | 1016|  4.19k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (314:3): [True: 0, False: 4.19k]
  |  Branch (314:3): [True: 4.19k, False: 0]
  ------------------
  315|       |
  316|  4.19k|  CURL_TRC_M(data, "ev update fd=%" FMT_SOCKET_T ", action '%s%s' -> '%s%s'"
  ------------------
  |  |  148|  4.19k|  do {                                   \
  |  |  149|  4.19k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  4.19k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  4.19k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  8.39k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 4.19k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 159, False: 4.03k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  8.39k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 159, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    159|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  4.19k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    159|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 4, False: 155]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  4.19k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 0, False: 4]
  |  |  |  Branch (150:28): [True: 0, False: 4]
  |  |  |  Branch (150:28): [True: 4, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 4]
  |  |  ------------------
  |  |  151|  4.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 4.19k]
  |  |  ------------------
  ------------------
  317|  4.19k|             " (%u/%u r/w)", s,
  318|  4.19k|             (last_action & CURL_POLL_IN) ? "IN" : "",
  319|  4.19k|             (last_action & CURL_POLL_OUT) ? "OUT" : "",
  320|  4.19k|             (cur_action & CURL_POLL_IN) ? "IN" : "",
  321|  4.19k|             (cur_action & CURL_POLL_OUT) ? "OUT" : "",
  322|  4.19k|             entry->readers, entry->writers);
  323|       |
  324|  4.19k|  comboaction = (entry->writers ? CURL_POLL_OUT : 0) |
  ------------------
  |  |  284|     20|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (324:18): [True: 20, False: 4.17k]
  ------------------
  325|  4.19k|                (entry->readers ? CURL_POLL_IN : 0);
  ------------------
  |  |  283|  4.19k|#define CURL_POLL_IN     1
  ------------------
  |  Branch (325:18): [True: 4.19k, False: 0]
  ------------------
  326|  4.19k|  if(((int)entry->action == comboaction)) /* nothing for socket changed */
  ------------------
  |  Branch (326:6): [True: 0, False: 4.19k]
  ------------------
  327|      0|    return CURLM_OK;
  328|       |
  329|  4.19k|  CURL_TRC_M(data, "ev update call(fd=%" FMT_SOCKET_T ", ev=%s%s)",
  ------------------
  |  |  148|  4.19k|  do {                                   \
  |  |  149|  4.19k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  4.19k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  4.19k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  8.39k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 4.19k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 159, False: 4.03k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  8.39k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 159, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    159|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  4.19k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    159|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 4, False: 155]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  4.19k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (150:28): [True: 4, False: 0]
  |  |  |  Branch (150:28): [True: 0, False: 4]
  |  |  ------------------
  |  |  151|  4.19k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 4.19k]
  |  |  ------------------
  ------------------
  330|  4.19k|             s, (comboaction & CURL_POLL_IN) ? "IN" : "",
  331|  4.19k|             (comboaction & CURL_POLL_OUT) ? "OUT" : "");
  332|  4.19k|  {
  333|  4.19k|    struct Curl_mapi_guard guard;
  334|  4.19k|    CURL_CBAPI_MULTI_START(&guard, multi, multi_socket_cb);
  ------------------
  |  |  203|  4.19k|  Curl_cbapi_enter(g, NULL, m, CURL_CBAPI_FN_##fn)
  ------------------
  335|  4.19k|    rc = multi->socket_cb(data, s, comboaction, multi->socket_userp,
  336|  4.19k|                          entry->user_data);
  337|  4.19k|    CURL_CBAPI_MULTI_END(&guard);
  ------------------
  |  |  207|  4.19k|  Curl_cbapi_leave(g)
  ------------------
  338|  4.19k|  }
  339|  4.19k|  if(rc == -1) {
  ------------------
  |  Branch (339:6): [True: 0, False: 4.19k]
  ------------------
  340|      0|    multi->dead = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  341|      0|    return CURLM_ABORTED_BY_CALLBACK;
  342|      0|  }
  343|       |  /* curl_easy_pause() is documented as callable from any callback; it
  344|       |   * re-enters mev_assess() which may free this 'entry'. Re-fetch. */
  345|  4.19k|  entry = mev_sh_entry_get(&multi->ev.sh_entries, s);
  346|  4.19k|  if(entry) {
  ------------------
  |  Branch (346:6): [True: 4.19k, False: 0]
  ------------------
  347|  4.19k|    DEBUGASSERT(entry->magic == SH_ENTRY_MAGIC);
  ------------------
  |  | 1016|  4.19k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (347:5): [True: 0, False: 4.19k]
  |  Branch (347:5): [True: 4.19k, False: 0]
  ------------------
  348|  4.19k|    entry->announced = TRUE;
  ------------------
  |  |  986|  4.19k|#define TRUE true
  ------------------
  349|  4.19k|    entry->action = (unsigned int)comboaction;
  350|  4.19k|  }
  351|  4.19k|  return CURLM_OK;
  352|  4.19k|}
multi_ev.c:mev_sh_entry_xfer_remove:
  202|  3.77k|{
  203|  3.77k|  bool present = Curl_uint32_spbset_contains(&e->xfers, data->mid);
  204|  3.77k|  if(present)
  ------------------
  |  Branch (204:6): [True: 3.77k, False: 0]
  ------------------
  205|  3.77k|    Curl_uint32_spbset_remove(&e->xfers, data->mid);
  206|  3.77k|  return present;
  207|  3.77k|}
multi_ev.c:mev_sh_entry_user_count:
  118|  16.3k|{
  119|  16.3k|  return Curl_uint32_spbset_count(&e->xfers) + (e->conn ? 1 : 0);
  ------------------
  |  Branch (119:49): [True: 0, False: 16.3k]
  ------------------
  120|  16.3k|}
multi_ev.c:mev_sh_entry_get:
   73|  63.4k|{
   74|  63.4k|  if(s != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  63.4k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (74:6): [True: 63.4k, False: 0]
  ------------------
   75|       |    /* only look for proper sockets */
   76|  63.4k|    return Curl_hash_pick(sh, (const char *)&s, sizeof(curl_socket_t));
   77|  63.4k|  }
   78|      0|  return NULL;
   79|  63.4k|}
multi_ev.c:mev_forget_socket:
  226|  12.9k|{
  227|  12.9k|  struct mev_sh_entry *entry = mev_sh_entry_get(&multi->ev.sh_entries, s);
  228|  12.9k|  uint32_t mid;
  229|  12.9k|  int rc = 0;
  230|       |
  231|  12.9k|  if(!entry) /* we never knew or already forgot about this socket */
  ------------------
  |  Branch (231:6): [True: 8.80k, False: 4.16k]
  ------------------
  232|  8.80k|    return CURLM_OK;
  233|       |
  234|       |  /* Remove the socket from any pollset that is still registered. */
  235|  4.16k|  if(Curl_uint32_spbset_first(&entry->xfers, &mid)) {
  ------------------
  |  Branch (235:6): [True: 395, False: 3.77k]
  ------------------
  236|    395|    do {
  237|    395|      struct Curl_easy *sdata = Curl_multi_get_easy(multi, mid);
  238|    395|      if(sdata) {
  ------------------
  |  Branch (238:10): [True: 395, False: 0]
  ------------------
  239|    395|        struct easy_pollset *ps = mev_get_last_pollset(sdata, NULL);
  240|    395|        if(ps)
  ------------------
  |  Branch (240:12): [True: 395, False: 0]
  ------------------
  241|    395|          Curl_pollset_remove(ps, s);
  242|    395|      }
  243|    395|    } while(Curl_uint32_spbset_next(&entry->xfers, mid, &mid));
  ------------------
  |  Branch (243:13): [True: 0, False: 395]
  ------------------
  244|    395|  }
  245|       |
  246|  4.16k|  if(entry->conn) {
  ------------------
  |  Branch (246:6): [True: 0, False: 4.16k]
  ------------------
  247|      0|    struct easy_pollset *ps = mev_get_last_pollset(data, entry->conn);
  248|      0|    if(ps)
  ------------------
  |  Branch (248:8): [True: 0, False: 0]
  ------------------
  249|      0|      Curl_pollset_remove(ps, s);
  250|      0|  }
  251|       |
  252|       |  /* We managed this socket before, tell the socket callback to forget it. */
  253|  4.16k|  if(entry->announced && multi->socket_cb) {
  ------------------
  |  Branch (253:6): [True: 4.16k, False: 0]
  |  Branch (253:26): [True: 4.16k, False: 0]
  ------------------
  254|  4.16k|    struct Curl_mapi_guard guard;
  255|       |
  256|  4.16k|    NOVERBOSE((void)cause);
  ------------------
  |  | 1638|  4.16k|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1199|  4.16k|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:35): [Folded, False: 4.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|  4.16k|    CURL_TRC_M(data, "ev %s, call(fd=%" FMT_SOCKET_T ", ev=REMOVE)", cause, s);
  ------------------
  |  |  148|  4.16k|  do {                                   \
  |  |  149|  4.16k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  4.16k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  4.16k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  8.33k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 4.16k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 122, False: 4.04k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  8.33k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 122, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    122|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  4.16k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    122|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 3, False: 119]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  4.16k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  4.16k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 4.16k]
  |  |  ------------------
  ------------------
  258|  4.16k|    CURL_CBAPI_MULTI_START(&guard, multi, multi_socket_cb);
  ------------------
  |  |  203|  4.16k|  Curl_cbapi_enter(g, NULL, m, CURL_CBAPI_FN_##fn)
  ------------------
  259|  4.16k|    rc = multi->socket_cb(data, s, CURL_POLL_REMOVE,
  ------------------
  |  |  286|  4.16k|#define CURL_POLL_REMOVE 4
  ------------------
  260|  4.16k|                          multi->socket_userp, entry->user_data);
  261|  4.16k|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|  4.16k|  Curl_cbapi_leave(g)
  ------------------
  262|  4.16k|    entry = mev_sh_entry_get(&multi->ev.sh_entries, s);
  263|  4.16k|    if(entry)
  ------------------
  |  Branch (263:8): [True: 4.16k, False: 0]
  ------------------
  264|  4.16k|      entry->announced = FALSE;
  ------------------
  |  |  989|  4.16k|#define FALSE false
  ------------------
  265|  4.16k|  }
  266|       |
  267|  4.16k|  mev_sh_entry_kill(multi, s);
  268|  4.16k|  if(rc == -1) {
  ------------------
  |  Branch (268:6): [True: 0, False: 4.16k]
  ------------------
  269|      0|    multi->dead = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  270|      0|    return CURLM_ABORTED_BY_CALLBACK;
  271|      0|  }
  272|  4.16k|  return CURLM_OK;
  273|  4.16k|}
multi_ev.c:mev_sh_entry_kill:
  113|  4.16k|{
  114|  4.16k|  Curl_hash_delete(&multi->ev.sh_entries, (char *)&s, sizeof(curl_socket_t));
  115|  4.16k|}
multi_ev.c:mev_sh_entry_dtor:
   61|  4.17k|{
   62|  4.17k|  struct mev_sh_entry *entry = (struct mev_sh_entry *)freethis;
   63|  4.17k|  Curl_uint32_spbset_destroy(&entry->xfers);
   64|  4.17k|#ifdef DEBUGBUILD
   65|  4.17k|  entry->magic = 0;
   66|  4.17k|#endif
   67|  4.17k|  curlx_free(entry);
  ------------------
  |  | 1503|  4.17k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   68|  4.17k|}

Curl_mntfy_init:
  131|  9.82k|{
  132|  9.82k|  memset(&multi->ntfy, 0, sizeof(multi->ntfy));
  133|  9.82k|}
Curl_mntfy_cleanup:
  136|  9.82k|{
  137|  9.82k|  while(multi->ntfy.head) {
  ------------------
  |  Branch (137:9): [True: 0, False: 9.82k]
  ------------------
  138|      0|    struct mntfy_chunk *chunk = multi->ntfy.head;
  139|      0|    multi->ntfy.head = chunk->next;
  140|      0|    mnfty_chunk_destroy(chunk);
  141|      0|  }
  142|       |  multi->ntfy.tail = NULL;
  143|  9.82k|}
Curl_mntfy_remove:
  179|  9.76k|{
  180|  9.76k|  struct Curl_multi *multi = data ? data->multi : NULL;
  ------------------
  |  Branch (180:30): [True: 9.76k, False: 0]
  ------------------
  181|  9.76k|  uint32_t mid = data ? data->mid : UINT32_MAX;
  ------------------
  |  Branch (181:18): [True: 9.76k, False: 0]
  ------------------
  182|  9.76k|  struct mntfy_chunk *chunk;
  183|  9.76k|  size_t i;
  184|       |
  185|  9.76k|  if(!multi || (mid == UINT32_MAX))
  ------------------
  |  Branch (185:6): [True: 0, False: 9.76k]
  |  Branch (185:16): [True: 0, False: 9.76k]
  ------------------
  186|      0|    return;
  187|       |
  188|  9.76k|  for(chunk = multi->ntfy.head; chunk; chunk = chunk->next) {
  ------------------
  |  Branch (188:33): [True: 0, False: 9.76k]
  ------------------
  189|      0|    for(i = chunk->r_offset; i < chunk->w_offset; ++i) {
  ------------------
  |  Branch (189:30): [True: 0, False: 0]
  ------------------
  190|      0|      if(chunk->entries[i].mid == mid)
  ------------------
  |  Branch (190:10): [True: 0, False: 0]
  ------------------
  191|      0|        chunk->entries[i].mid = UINT32_MAX;
  192|      0|    }
  193|      0|  }
  194|  9.76k|}

Curl_netrc_init:
  669|  19.7k|{
  670|  19.7k|  curlx_dyn_init(&store->filebuf, MAX_NETRC_FILE);
  ------------------
  |  |   77|  19.7k|#define MAX_NETRC_FILE  (128 * 1024)
  ------------------
  671|  19.7k|  store->loaded = FALSE;
  ------------------
  |  |  989|  19.7k|#define FALSE false
  ------------------
  672|       |  store->filename = NULL;
  673|  19.7k|}
Curl_netrc_cleanup:
  675|  29.1k|{
  676|  29.1k|  curlx_dyn_free(&store->filebuf);
  677|  29.1k|  curlx_safefree(store->filename);
  ------------------
  |  | 1359|  29.1k|  do {                      \
  |  | 1360|  29.1k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  29.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  29.1k|    (ptr) = NULL;           \
  |  | 1362|  29.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 29.1k]
  |  |  ------------------
  ------------------
  678|       |  store->loaded = FALSE;
  ------------------
  |  |  989|  29.1k|#define FALSE false
  ------------------
  679|  29.1k|}

Curl_peer_link:
  300|   141k|{
  301|   141k|  if(*pdest != src) {
  ------------------
  |  Branch (301:6): [True: 137k, False: 4.04k]
  ------------------
  302|   137k|    Curl_peer_unlink(pdest);
  303|   137k|    *pdest = src;
  304|   137k|    if(src) {
  ------------------
  |  Branch (304:8): [True: 137k, False: 0]
  ------------------
  305|   137k|      uint32_t newcount = Curl_refcount_incr(&src->refcount);
  ------------------
  |  |   56|   137k|  (atomic_fetch_add_explicit(c, 1U, memory_order_relaxed) + 1U)
  ------------------
  306|   137k|      (void)newcount;
  307|       |      DEBUGASSERT(newcount < UINT32_MAX);
  ------------------
  |  | 1016|   137k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (307:7): [True: 0, False: 137k]
  |  Branch (307:7): [True: 137k, False: 0]
  ------------------
  308|   137k|    }
  309|   137k|  }
  310|   141k|}
Curl_peer_unlink:
  313|   552k|{
  314|   552k|  if(*ppeer) {
  ------------------
  |  Branch (314:6): [True: 156k, False: 396k]
  ------------------
  315|   156k|    struct Curl_peer *peer = *ppeer;
  316|   156k|    uint32_t newcount;
  317|       |
  318|   156k|    *ppeer = NULL;
  319|       |
  320|   156k|    newcount = Curl_refcount_decr(&peer->refcount);
  ------------------
  |  |   58|   156k|  (atomic_fetch_sub_explicit(c, 1U, memory_order_acq_rel) - 1U)
  ------------------
  321|   156k|    DEBUGASSERT(newcount < UINT32_MAX); /* wraparound check */
  ------------------
  |  | 1016|   156k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (321:5): [True: 0, False: 156k]
  |  Branch (321:5): [True: 156k, False: 0]
  ------------------
  322|       |
  323|   156k|    if(!newcount)
  ------------------
  |  Branch (323:8): [True: 18.7k, False: 137k]
  ------------------
  324|  18.7k|      curlx_free(peer);
  ------------------
  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  325|   156k|  }
  326|   552k|}
Curl_peer_equal:
  329|  39.9k|{
  330|  39.9k|  return (p1 == p2) ||
  ------------------
  |  Branch (330:10): [True: 30.4k, False: 9.48k]
  ------------------
  331|  9.48k|         (p1 && p2 &&
  ------------------
  |  Branch (331:11): [True: 9.48k, False: 0]
  |  Branch (331:17): [True: 2.03k, False: 7.45k]
  ------------------
  332|  2.03k|          (p1->scheme == p2->scheme) &&
  ------------------
  |  Branch (332:11): [True: 2.02k, False: 5]
  ------------------
  333|  2.02k|          Curl_peer_same_destination(p1, p2));
  ------------------
  |  Branch (333:11): [True: 0, False: 2.02k]
  ------------------
  334|  39.9k|}
Curl_peer_same_destination:
  358|  71.1k|{
  359|  71.1k|  return (p1 == p2) ||
  ------------------
  |  Branch (359:10): [True: 51.4k, False: 19.6k]
  ------------------
  360|  19.6k|         (p1 && p2 &&
  ------------------
  |  Branch (360:11): [True: 19.6k, False: 0]
  |  Branch (360:17): [True: 19.6k, False: 0]
  ------------------
  361|  19.6k|          (p1->port == p2->port) &&
  ------------------
  |  Branch (361:11): [True: 2.02k, False: 17.6k]
  ------------------
  362|  2.02k|          peer_same_hostname(p1, p2) &&
  ------------------
  |  Branch (362:11): [True: 0, False: 2.02k]
  ------------------
  363|      0|          (p1->scopeid == p2->scopeid) &&
  ------------------
  |  Branch (363:11): [True: 0, False: 0]
  ------------------
  364|      0|          (p1->scopeid || peer_same_zoneid(p1->zoneid, p2->zoneid)));
  ------------------
  |  Branch (364:12): [True: 0, False: 0]
  |  Branch (364:27): [True: 0, False: 0]
  ------------------
  365|  71.1k|}
Curl_peer_from_url:
  371|  9.46k|{
  372|  9.46k|  struct peer_parse pp;
  373|  9.46k|  char *zoneid = NULL, *scheme = NULL, *hostname = NULL;
  374|  9.46k|  CURLUcode uc;
  375|  9.46k|  CURLcode result;
  376|       |
  377|  9.46k|  Curl_peer_unlink(ppeer);
  378|  9.46k|  memset(&pp, 0, sizeof(pp));
  379|       |
  380|  9.46k|  uc = curl_url_get(uh, CURLUPART_SCHEME, &scheme, 0);
  381|  9.46k|  if(uc)
  ------------------
  |  Branch (381:6): [True: 14, False: 9.44k]
  ------------------
  382|     14|    return Curl_uc_to_curlcode(uc);
  383|  9.44k|  pp.scheme = Curl_get_scheme(scheme);
  384|  9.44k|  if(!pp.scheme) {
  ------------------
  |  Branch (384:6): [True: 0, False: 9.44k]
  ------------------
  385|      0|    failf(data, "Protocol \"%s\" not supported%s", scheme,
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  386|      0|          data->state.this_is_a_follow ? " (in redirect)" : "");
  ------------------
  |  Branch (386:11): [True: 0, False: 0]
  ------------------
  387|      0|    result = CURLE_UNSUPPORTED_PROTOCOL;
  388|      0|    goto out;
  389|      0|  }
  390|       |
  391|  9.44k|  uc = curl_url_get(uh, CURLUPART_HOST, &hostname, 0);
  392|  9.44k|  if(uc) {
  ------------------
  |  Branch (392:6): [True: 6, False: 9.44k]
  ------------------
  393|      6|    if((uc == CURLUE_NO_HOST) && (pp.scheme->flags & PROTOPT_NONETWORK))
  ------------------
  |  |  221|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (393:8): [True: 0, False: 6]
  |  Branch (393:34): [True: 0, False: 0]
  ------------------
  394|      0|      ; /* acceptable */
  395|      6|    else {
  396|      6|      result = CURLE_OUT_OF_MEMORY;
  397|      6|      goto out;
  398|      6|    }
  399|      6|  }
  400|  9.44k|  else if(strlen(hostname) > MAX_URL_LEN) {
  ------------------
  |  |   29|  9.44k|#define MAX_URL_LEN 0xffff
  ------------------
  |  Branch (400:11): [True: 0, False: 9.44k]
  ------------------
  401|      0|    failf(data, "Too long hostname (maximum is %d)", MAX_URL_LEN);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
                  failf(data, "Too long hostname (maximum is %d)", MAX_URL_LEN);
  ------------------
  |  |   29|      0|#define MAX_URL_LEN 0xffff
  ------------------
  402|      0|    result = CURLE_URL_MALFORMAT;
  403|      0|    goto out;
  404|      0|  }
  405|       |
  406|  9.44k|  pp.host_user.str = hostname ? hostname : "";
  ------------------
  |  Branch (406:22): [True: 9.44k, False: 0]
  ------------------
  407|  9.44k|  pp.host_user.len = strlen(pp.host_user.str);
  408|  9.44k|  if(pp.host_user.len) {
  ------------------
  |  Branch (408:6): [True: 9.44k, False: 0]
  ------------------
  409|  9.44k|    result = peer_parse_host(data, &pp, FALSE);
  ------------------
  |  |  989|  9.44k|#define FALSE false
  ------------------
  410|  9.44k|    if(result)
  ------------------
  |  Branch (410:8): [True: 0, False: 9.44k]
  ------------------
  411|      0|      goto out;
  412|  9.44k|  }
  413|      0|  else
  414|      0|    pp.host = pp.host_user;
  415|       |
  416|  9.44k|  if(port_override) {
  ------------------
  |  Branch (416:6): [True: 0, False: 9.44k]
  ------------------
  417|       |    /* if set, we use this instead of the port possibly given in the URL */
  418|      0|    char portbuf[16];
  419|      0|    curl_msnprintf(portbuf, sizeof(portbuf), "%d", port_override);
  420|      0|    uc = curl_url_set(uh, CURLUPART_PORT, portbuf, 0);
  421|      0|    if(uc) {
  ------------------
  |  Branch (421:8): [True: 0, False: 0]
  ------------------
  422|      0|      result = CURLE_OUT_OF_MEMORY;
  423|      0|      goto out;
  424|      0|    }
  425|      0|    else
  426|      0|      pp.port = port_override;
  427|      0|  }
  428|  9.44k|  else {
  429|  9.44k|    uc = Curl_url_get_port(uh, &pp.port);
  430|  9.44k|    if(uc) {
  ------------------
  |  Branch (430:8): [True: 0, False: 9.44k]
  ------------------
  431|      0|      if(uc == CURLUE_OUT_OF_MEMORY) {
  ------------------
  |  Branch (431:10): [True: 0, False: 0]
  ------------------
  432|      0|        result = CURLE_OUT_OF_MEMORY;
  433|      0|        goto out;
  434|      0|      }
  435|      0|      else if(!(pp.scheme->flags & PROTOPT_NONETWORK)) {
  ------------------
  |  |  221|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (435:15): [True: 0, False: 0]
  ------------------
  436|      0|        result = CURLE_URL_MALFORMAT;
  437|      0|        goto out;
  438|      0|      }
  439|       |      /* no port ok when not a network scheme */
  440|      0|    }
  441|  9.44k|  }
  442|       |
  443|  9.44k|  if(scopeid_override)
  ------------------
  |  Branch (443:6): [True: 0, False: 9.44k]
  ------------------
  444|       |    /* Override any scope id from an URL zone. */
  445|      0|    pp.scopeid = scopeid_override;
  446|  9.44k|  else {
  447|  9.44k|    if(curl_url_get(uh, CURLUPART_ZONEID, &zoneid, 0) ==
  ------------------
  |  Branch (447:8): [True: 0, False: 9.44k]
  ------------------
  448|  9.44k|       CURLUE_OUT_OF_MEMORY) {
  449|      0|      result = CURLE_OUT_OF_MEMORY;
  450|      0|      goto out;
  451|      0|    }
  452|  9.44k|    if(zoneid) {
  ------------------
  |  Branch (452:8): [True: 0, False: 9.44k]
  ------------------
  453|      0|      pp.zoneid.str = zoneid;
  454|      0|      pp.zoneid.len = strlen(zoneid);
  455|      0|    }
  456|  9.44k|  }
  457|       |
  458|  9.44k|  result = peer_create(&pp, ppeer);
  459|  9.44k|  if(result)
  ------------------
  |  Branch (459:6): [True: 1, False: 9.44k]
  ------------------
  460|      1|    failf(data, "Error %d creating peer for %s:%u",
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
  461|      1|          (int)result, pp.host_user.str, pp.port);
  462|       |
  463|  9.44k|out:
  464|  9.44k|  peer_parse_clear(&pp);
  465|  9.44k|  curlx_free(scheme);
  ------------------
  |  | 1503|  9.44k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  466|  9.44k|  curlx_free(hostname);
  ------------------
  |  | 1503|  9.44k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  467|  9.44k|  curlx_free(zoneid);
  ------------------
  |  | 1503|  9.44k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  468|  9.44k|  return result;
  469|  9.44k|}
Curl_peer_from_connect_to:
  477|  2.00k|{
  478|  2.00k|  struct peer_parse pp;
  479|  2.00k|  const char *portstr = NULL;
  480|  2.00k|  bool port_switch = FALSE;
  ------------------
  |  |  989|  2.00k|#define FALSE false
  ------------------
  481|  2.00k|  CURLcode result;
  482|       |
  483|  2.00k|  Curl_peer_unlink(ppeer);
  484|  2.00k|  memset(&pp, 0, sizeof(pp));
  485|  2.00k|  if(!connect_to || !*connect_to)
  ------------------
  |  Branch (485:6): [True: 0, False: 2.00k]
  |  Branch (485:21): [True: 0, False: 2.00k]
  ------------------
  486|      0|    return CURLE_FAILED_INIT;
  487|       |
  488|  2.00k|  pp.scheme = dest->scheme;
  489|       |
  490|       |  /* detect and extract RFC6874-style IPv6-addresses */
  491|  2.00k|  if(connect_to[0] == '[') {
  ------------------
  |  Branch (491:6): [True: 0, False: 2.00k]
  ------------------
  492|      0|    const char *s = strchr(connect_to + 1, ']');
  493|      0|    if(!s) {
  ------------------
  |  Branch (493:8): [True: 0, False: 0]
  ------------------
  494|      0|      failf(data, "Invalid IPv6 address format in '%s'", connect_to);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  495|      0|      result = CURLE_SETOPT_OPTION_SYNTAX;
  496|      0|      goto out;
  497|      0|    }
  498|      0|    portstr = strchr(s, ':');
  499|      0|    pp.host_user.str = connect_to;
  500|      0|    pp.host_user.len = s - pp.host_user.str + 1;
  501|      0|    pp.ipv6 = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  502|      0|  }
  503|  2.00k|  else {
  504|  2.00k|    portstr = strchr(connect_to, ':');
  505|  2.00k|    pp.host_user.str = connect_to;
  506|  2.00k|    pp.host_user.len = portstr ?
  ------------------
  |  Branch (506:24): [True: 2.00k, False: 0]
  ------------------
  507|  2.00k|      (size_t)(portstr - connect_to) : strlen(connect_to);
  508|  2.00k|  }
  509|       |
  510|  2.00k|  if(!pp.host_user.len) { /* no hostname found, only port switch */
  ------------------
  |  Branch (510:6): [True: 0, False: 2.00k]
  ------------------
  511|      0|    port_switch = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  512|      0|    pp.host_user.str = dest->user_hostname;
  513|      0|    pp.host_user.len = strlen(dest->user_hostname);
  514|      0|  }
  515|       |
  516|  2.00k|  result = peer_parse_host(data, &pp, FALSE);
  ------------------
  |  |  989|  2.00k|#define FALSE false
  ------------------
  517|  2.00k|  if(result)
  ------------------
  |  Branch (517:6): [True: 0, False: 2.00k]
  ------------------
  518|      0|    goto out;
  519|       |  /* On a port switch, ipv6 must stay the same */
  520|  2.00k|  DEBUGASSERT(!port_switch || ((bool)pp.ipv6 == (bool)dest->ipv6));
  ------------------
  |  | 1016|  2.00k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (520:3): [True: 2.00k, False: 0]
  |  Branch (520:3): [True: 0, False: 0]
  |  Branch (520:3): [True: 2.00k, False: 0]
  |  Branch (520:3): [True: 0, False: 0]
  ------------------
  521|       |
  522|  2.00k|  if(portstr && portstr[1]) {
  ------------------
  |  Branch (522:6): [True: 2.00k, False: 0]
  |  Branch (522:17): [True: 0, False: 2.00k]
  ------------------
  523|      0|    const char *p = portstr + 1;
  524|      0|    curl_off_t portparse;
  525|      0|    if(curlx_str_number(&p, &portparse, 0xffff)) {
  ------------------
  |  Branch (525:8): [True: 0, False: 0]
  ------------------
  526|      0|      failf(data, "No valid port number in '%s'", connect_to);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  527|      0|      result = CURLE_SETOPT_OPTION_SYNTAX;
  528|      0|      goto out;
  529|      0|    }
  530|      0|    pp.port = (uint16_t)portparse; /* we know it will fit */
  531|      0|  }
  532|  2.00k|  else
  533|  2.00k|    pp.port = dest->port;
  534|       |
  535|       |#ifndef USE_IPV6
  536|       |  if(pp.ipv6) {
  537|       |    failf(data, "Use of IPv6 in *_CONNECT_TO without IPv6 support built-in");
  538|       |    result = CURLE_NOT_BUILT_IN;
  539|       |    goto out;
  540|       |  }
  541|       |#endif
  542|  2.00k|  if(pp.ipv6 && port_switch) {
  ------------------
  |  Branch (542:6): [True: 0, False: 2.00k]
  |  Branch (542:17): [True: 0, False: 0]
  ------------------
  543|      0|    if(dest->zoneid) {
  ------------------
  |  Branch (543:8): [True: 0, False: 0]
  ------------------
  544|      0|      pp.zoneid.str = dest->zoneid;
  545|      0|      pp.zoneid.len = strlen(dest->zoneid);
  546|      0|    }
  547|      0|    pp.scopeid = dest->scopeid;
  548|      0|  }
  549|       |
  550|  2.00k|  result = peer_create(&pp, ppeer);
  551|  2.00k|  CURL_TRC_M(data, "connect-to peer_create2 -> %d", (int)result);
  ------------------
  |  |  148|  2.00k|  do {                                   \
  |  |  149|  2.00k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  2.00k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  2.00k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  4.00k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 2.00k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 154, False: 1.84k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  4.00k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 154, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    154|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  2.00k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    154|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 7, False: 147]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  2.00k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  2.00k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 2.00k]
  |  |  ------------------
  ------------------
  552|       |
  553|  2.00k|out:
  554|  2.00k|  CURL_TRC_M(data, "parse connect_to peer: %s -> %d", connect_to, (int)result);
  ------------------
  |  |  148|  2.00k|  do {                                   \
  |  |  149|  2.00k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  2.00k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  2.00k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  4.00k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 2.00k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 154, False: 1.84k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  4.00k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 154, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    154|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  2.00k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    154|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 7, False: 147]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  2.00k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  2.00k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 2.00k]
  |  |  ------------------
  ------------------
  555|  2.00k|  peer_parse_clear(&pp);
  556|  2.00k|  return result;
  557|  2.00k|}
Curl_scheme_to_proxytype:
  568|  14.5k|{
  569|  14.5k|  if(!scheme)
  ------------------
  |  Branch (569:6): [True: 0, False: 14.5k]
  ------------------
  570|      0|    return CURLE_OK;
  571|       |
  572|  14.5k|  if(curl_strequal("https", scheme)) {
  ------------------
  |  Branch (572:6): [True: 0, False: 14.5k]
  ------------------
  573|      0|    if(*proxytype != CURLPROXY_HTTPS2 && *proxytype != CURLPROXY_HTTPS3)
  ------------------
  |  |  798|      0|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  ------------------
                  if(*proxytype != CURLPROXY_HTTPS2 && *proxytype != CURLPROXY_HTTPS3)
  ------------------
  |  |  807|      0|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (573:8): [True: 0, False: 0]
  |  Branch (573:42): [True: 0, False: 0]
  ------------------
  574|      0|      *proxytype = CURLPROXY_HTTPS;
  ------------------
  |  |  796|      0|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  ------------------
  575|      0|  }
  576|  14.5k|  else if(curl_strequal("socks5h", scheme))
  ------------------
  |  Branch (576:11): [True: 0, False: 14.5k]
  ------------------
  577|      0|    *proxytype = CURLPROXY_SOCKS5_HOSTNAME;
  ------------------
  |  |  804|      0|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  578|  14.5k|  else if(curl_strequal("socks5", scheme))
  ------------------
  |  Branch (578:11): [True: 0, False: 14.5k]
  ------------------
  579|      0|    *proxytype = CURLPROXY_SOCKS5;
  ------------------
  |  |  802|      0|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  580|  14.5k|  else if(curl_strequal("socks4a", scheme))
  ------------------
  |  Branch (580:11): [True: 0, False: 14.5k]
  ------------------
  581|      0|    *proxytype = CURLPROXY_SOCKS4A;
  ------------------
  |  |  803|      0|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  582|  14.5k|  else if(curl_strequal("socks4", scheme) || curl_strequal("socks", scheme))
  ------------------
  |  Branch (582:11): [True: 0, False: 14.5k]
  |  Branch (582:46): [True: 0, False: 14.5k]
  ------------------
  583|      0|    *proxytype = CURLPROXY_SOCKS4;
  ------------------
  |  |  800|      0|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  584|  14.5k|  else if(curl_strequal("http", scheme)) {
  ------------------
  |  Branch (584:11): [True: 14.5k, False: 0]
  ------------------
  585|  14.5k|    if(*proxytype != CURLPROXY_HTTP_1_0)
  ------------------
  |  |  794|  14.5k|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (585:8): [True: 14.5k, False: 0]
  ------------------
  586|  14.5k|      *proxytype = CURLPROXY_HTTP;
  ------------------
  |  |  792|  14.5k|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  587|  14.5k|  }
  588|      0|  else {
  589|       |    /* Any other xxx:// reject! */
  590|      0|    failf(data, "Unsupported proxy scheme for \'%s\'", url);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  591|      0|    return CURLE_COULDNT_CONNECT;
  592|      0|  }
  593|  14.5k|  return CURLE_OK;
  594|  14.5k|}
Curl_peer_from_proxy_url:
  602|  7.28k|{
  603|  7.28k|  struct peer_parse pp;
  604|  7.28k|  char *scheme = NULL;
  605|  7.28k|  char *portptr = NULL;
  606|  7.28k|#ifdef USE_UNIX_SOCKETS
  607|  7.28k|  bool is_socks = FALSE;
  ------------------
  |  |  989|  7.28k|#define FALSE false
  ------------------
  608|  7.28k|#endif
  609|  7.28k|  CURLUcode uc;
  610|  7.28k|  CURLcode result = CURLE_OK;
  611|       |
  612|  7.28k|  Curl_peer_unlink(ppeer);
  613|  7.28k|  memset(&pp, 0, sizeof(pp));
  614|  7.28k|  pp.port = CURL_DEFAULT_PROXY_PORT;
  ------------------
  |  |   76|  7.28k|#define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */
  ------------------
  615|  7.28k|  uc = curl_url_get(uh, CURLUPART_SCHEME, &scheme,
  616|  7.28k|                    CURLU_NON_SUPPORT_SCHEME | CURLU_NO_GUESS_SCHEME);
  ------------------
  |  |   91|  7.28k|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
                                  CURLU_NON_SUPPORT_SCHEME | CURLU_NO_GUESS_SCHEME);
  ------------------
  |  |  106|  7.28k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
  617|  7.28k|  if(uc) {
  ------------------
  |  Branch (617:6): [True: 1, False: 7.28k]
  ------------------
  618|      1|    if(uc == CURLUE_OUT_OF_MEMORY) {
  ------------------
  |  Branch (618:8): [True: 1, False: 0]
  ------------------
  619|      1|      result = CURLE_OUT_OF_MEMORY;
  620|      1|      goto out;
  621|      1|    }
  622|       |    /* URL came without scheme, the passed `proxytype` determines it */
  623|      0|    switch(proxytype) {
  624|      0|    case CURLPROXY_HTTP:
  ------------------
  |  |  792|      0|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  |  Branch (624:5): [True: 0, False: 0]
  ------------------
  625|      0|    case CURLPROXY_HTTP_1_0:
  ------------------
  |  |  794|      0|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (625:5): [True: 0, False: 0]
  ------------------
  626|      0|      pp.scheme = &Curl_scheme_http;
  627|      0|      break;
  628|      0|    case CURLPROXY_HTTPS:
  ------------------
  |  |  796|      0|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  ------------------
  |  Branch (628:5): [True: 0, False: 0]
  ------------------
  629|      0|    case CURLPROXY_HTTPS2:
  ------------------
  |  |  798|      0|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  ------------------
  |  Branch (629:5): [True: 0, False: 0]
  ------------------
  630|      0|    case CURLPROXY_HTTPS3:
  ------------------
  |  |  807|      0|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (630:5): [True: 0, False: 0]
  ------------------
  631|      0|      pp.scheme = &Curl_scheme_https;
  632|      0|      break;
  633|      0|    case CURLPROXY_SOCKS4:
  ------------------
  |  |  800|      0|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (633:5): [True: 0, False: 0]
  ------------------
  634|      0|      pp.scheme = &Curl_scheme_socks4;
  635|      0|      break;
  636|      0|    case CURLPROXY_SOCKS4A:
  ------------------
  |  |  803|      0|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  |  Branch (636:5): [True: 0, False: 0]
  ------------------
  637|      0|      pp.scheme = &Curl_scheme_socks4a;
  638|      0|      break;
  639|      0|    case CURLPROXY_SOCKS5:
  ------------------
  |  |  802|      0|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  |  Branch (639:5): [True: 0, False: 0]
  ------------------
  640|      0|      pp.scheme = &Curl_scheme_socks5;
  641|      0|      break;
  642|      0|    case CURLPROXY_SOCKS5_HOSTNAME:
  ------------------
  |  |  804|      0|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  |  Branch (642:5): [True: 0, False: 0]
  ------------------
  643|      0|      pp.scheme = &Curl_scheme_socks5h;
  644|      0|      break;
  645|      0|    default:
  ------------------
  |  Branch (645:5): [True: 0, False: 0]
  ------------------
  646|      0|      failf(data, "Unsupported proxy type %u for \'%s\'", proxytype, url);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  647|      0|      result = CURLE_COULDNT_RESOLVE_PROXY;
  648|      0|      goto out;
  649|      0|    }
  650|      0|  }
  651|  7.28k|  else {
  652|  7.28k|    pp.scheme = Curl_get_scheme(scheme);
  653|  7.28k|    result = Curl_scheme_to_proxytype(data, scheme, &proxytype, url);
  654|  7.28k|    if(result)
  ------------------
  |  Branch (654:8): [True: 0, False: 7.28k]
  ------------------
  655|      0|      goto out;
  656|  7.28k|  }
  657|  7.28k|  DEBUGASSERT(pp.scheme);
  ------------------
  |  | 1016|  7.28k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (657:3): [True: 0, False: 7.28k]
  |  Branch (657:3): [True: 7.28k, False: 0]
  ------------------
  658|       |
  659|  7.28k|  if(CURL_PROXY_IS_HTTPS(proxytype) &&
  ------------------
  |  |   42|  14.5k|  (((t) == CURLPROXY_HTTPS) ||  \
  |  |  ------------------
  |  |  |  |  796|  7.28k|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  |  |  ------------------
  |  |  |  Branch (42:4): [True: 0, False: 7.28k]
  |  |  ------------------
  |  |   43|  7.28k|   ((t) == CURLPROXY_HTTPS2) || \
  |  |  ------------------
  |  |  |  |  798|  7.28k|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  |  |  ------------------
  |  |  |  Branch (43:4): [True: 0, False: 7.28k]
  |  |  ------------------
  |  |   44|  14.5k|   ((t) == CURLPROXY_HTTPS3))
  |  |  ------------------
  |  |  |  |  807|  7.28k|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 0, False: 7.28k]
  |  |  ------------------
  ------------------
  660|      0|     !Curl_ssl_supports(data, SSLSUPP_HTTPS_PROXY)) {
  ------------------
  |  |   40|      0|#define SSLSUPP_HTTPS_PROXY  (1 << 4) /* supports access via HTTPS proxies */
  ------------------
  |  Branch (660:6): [True: 0, False: 0]
  ------------------
  661|      0|    failf(data, "Unsupported proxy \'%s\', libcurl is built without the "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  662|      0|          "HTTPS-proxy support.", url);
  663|      0|    result = CURLE_NOT_BUILT_IN;
  664|      0|    goto out;
  665|      0|  }
  666|       |
  667|  7.28k|  switch(pp.scheme->family) {
  668|      0|  case CURLPROTO_SOCKS:
  ------------------
  |  |   65|      0|#define CURLPROTO_SOCKS  (1LL << 33)
  ------------------
  |  Branch (668:3): [True: 0, False: 7.28k]
  ------------------
  669|      0|#ifdef USE_UNIX_SOCKETS
  670|      0|    is_socks = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  671|      0|#endif
  672|      0|    break;
  673|  7.28k|  case CURLPROTO_HTTP:
  ------------------
  |  | 1088|  7.28k|#define CURLPROTO_HTTP    (1L << 0)
  ------------------
  |  Branch (673:3): [True: 7.28k, False: 0]
  ------------------
  674|  7.28k|    break;
  675|      0|  default:
  ------------------
  |  Branch (675:3): [True: 0, False: 7.28k]
  ------------------
  676|      0|    failf(data, "Unsupported proxy protocol for \'%s\'", url);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  677|      0|    result = CURLE_COULDNT_CONNECT;
  678|      0|    goto out;
  679|  7.28k|  }
  680|       |
  681|  7.28k|  uc = curl_url_get(uh, CURLUPART_PORT, &portptr, 0);
  682|  7.28k|  if(uc == CURLUE_OUT_OF_MEMORY) {
  ------------------
  |  Branch (682:6): [True: 1, False: 7.28k]
  ------------------
  683|      1|    result = CURLE_OUT_OF_MEMORY;
  684|      1|    goto out;
  685|      1|  }
  686|  7.28k|  if(portptr) {
  ------------------
  |  Branch (686:6): [True: 7.28k, False: 0]
  ------------------
  687|  7.28k|    curl_off_t num;
  688|  7.28k|    const char *p = portptr;
  689|  7.28k|    if(!curlx_str_number(&p, &num, UINT16_MAX))
  ------------------
  |  Branch (689:8): [True: 7.28k, False: 0]
  ------------------
  690|  7.28k|      pp.port = (uint16_t)num;
  691|       |    /* Should we not error out when the port number is invalid? */
  692|  7.28k|    curlx_free(portptr);
  ------------------
  |  | 1503|  7.28k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  693|  7.28k|  }
  694|      0|  else {
  695|       |    /* No port in URL, take the set one or the proxy default */
  696|      0|    if(data->set.proxyport)
  ------------------
  |  Branch (696:8): [True: 0, False: 0]
  ------------------
  697|      0|      pp.port = data->set.proxyport;
  698|      0|    else if(CURL_PROXY_IS_HTTPS(proxytype))
  ------------------
  |  |   42|      0|  (((t) == CURLPROXY_HTTPS) ||  \
  |  |  ------------------
  |  |  |  |  796|      0|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  |  |  ------------------
  |  |  |  Branch (42:4): [True: 0, False: 0]
  |  |  ------------------
  |  |   43|      0|   ((t) == CURLPROXY_HTTPS2) || \
  |  |  ------------------
  |  |  |  |  798|      0|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  |  |  ------------------
  |  |  |  Branch (43:4): [True: 0, False: 0]
  |  |  ------------------
  |  |   44|      0|   ((t) == CURLPROXY_HTTPS3))
  |  |  ------------------
  |  |  |  |  807|      0|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  699|      0|      pp.port = CURL_DEFAULT_HTTPS_PROXY_PORT;
  ------------------
  |  |   77|      0|#define CURL_DEFAULT_HTTPS_PROXY_PORT 443 /* default https proxy port unless
  ------------------
  700|      0|    else
  701|      0|      pp.port = CURL_DEFAULT_PROXY_PORT;
  ------------------
  |  |   76|      0|#define CURL_DEFAULT_PROXY_PORT 1080 /* default proxy port unless specified */
  ------------------
  702|      0|  }
  703|       |
  704|       |  /* now, clone the proxy hostname */
  705|  7.28k|  uc = curl_url_get(uh, CURLUPART_HOST, &pp.tmp_host_user, CURLU_URLDECODE);
  ------------------
  |  |   94|  7.28k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
  706|  7.28k|  if(uc) {
  ------------------
  |  Branch (706:6): [True: 1, False: 7.28k]
  ------------------
  707|      1|    result = CURLE_OUT_OF_MEMORY;
  708|      1|    goto out;
  709|      1|  }
  710|  7.28k|  pp.host_user.str = pp.tmp_host_user;
  711|  7.28k|  pp.host_user.len = strlen(pp.tmp_host_user);
  712|       |
  713|  7.28k|#ifdef USE_UNIX_SOCKETS
  714|  7.28k|  if(is_socks && curl_strequal(UNIX_SOCKET_PREFIX, pp.tmp_host_user)) {
  ------------------
  |  |  562|      0|#define UNIX_SOCKET_PREFIX "localhost"
  ------------------
  |  Branch (714:6): [True: 0, False: 7.28k]
  |  Branch (714:18): [True: 0, False: 0]
  ------------------
  715|      0|    uc = curl_url_get(uh, CURLUPART_PATH, &pp.tmp_host, CURLU_URLDECODE);
  ------------------
  |  |   94|      0|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
  716|      0|    if(uc) {
  ------------------
  |  Branch (716:8): [True: 0, False: 0]
  ------------------
  717|      0|      result = CURLE_OUT_OF_MEMORY;
  718|      0|      goto out;
  719|      0|    }
  720|       |    /* path will be "/", if no path was found */
  721|      0|    if(strcmp("/", pp.tmp_host)) {
  ------------------
  |  Branch (721:8): [True: 0, False: 0]
  ------------------
  722|      0|      pp.host.str = pp.tmp_host;
  723|      0|      pp.host.len = strlen(pp.tmp_host);
  724|      0|      pp.unix_socket = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  725|      0|    }
  726|      0|    else {
  727|      0|      pp.host = pp.host_user;
  728|      0|    }
  729|      0|  }
  730|  7.28k|#endif /* USE_UNIX_SOCKETS */
  731|       |
  732|  7.28k|  if(!pp.host.len) {
  ------------------
  |  Branch (732:6): [True: 7.28k, False: 0]
  ------------------
  733|  7.28k|    result = peer_parse_host(data, &pp, FALSE);
  ------------------
  |  |  989|  7.28k|#define FALSE false
  ------------------
  734|  7.28k|    if(result)
  ------------------
  |  Branch (734:8): [True: 0, False: 7.28k]
  ------------------
  735|      0|      goto out;
  736|  7.28k|  }
  737|       |
  738|  7.28k|  uc = curl_url_get(uh, CURLUPART_ZONEID, &pp.tmp_zoneid, 0);
  739|  7.28k|  if(uc == CURLUE_OUT_OF_MEMORY) {
  ------------------
  |  Branch (739:6): [True: 0, False: 7.28k]
  ------------------
  740|      0|    result = CURLE_OUT_OF_MEMORY;
  741|      0|    goto out;
  742|      0|  }
  743|  7.28k|  if(pp.tmp_zoneid) {
  ------------------
  |  Branch (743:6): [True: 0, False: 7.28k]
  ------------------
  744|      0|    pp.zoneid.str = pp.tmp_zoneid;
  745|      0|    pp.zoneid.len = strlen(pp.tmp_zoneid);
  746|      0|  }
  747|       |
  748|  7.28k|  *pproxytype = proxytype;
  749|  7.28k|  result = peer_create(&pp, ppeer);
  750|       |
  751|  7.28k|out:
  752|  7.28k|  peer_parse_clear(&pp);
  753|  7.28k|  curlx_free(scheme);
  ------------------
  |  | 1503|  7.28k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  754|  7.28k|#ifdef DEBUGBUILD
  755|  7.28k|  if(!result)
  ------------------
  |  Branch (755:6): [True: 7.28k, False: 5]
  ------------------
  756|  7.28k|    DEBUGASSERT(*ppeer);
  ------------------
  |  | 1016|  7.28k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (756:5): [True: 0, False: 7.28k]
  |  Branch (756:5): [True: 7.28k, False: 0]
  ------------------
  757|  7.28k|#endif
  758|  7.28k|  return result;
  759|  7.28k|}
peer.c:peer_parse_host:
  186|  18.7k|{
  187|  18.7k|  if(!pp || !pp->host_user.str || !pp->host_user.len)
  ------------------
  |  Branch (187:6): [True: 0, False: 18.7k]
  |  Branch (187:13): [True: 0, False: 18.7k]
  |  Branch (187:35): [True: 0, False: 18.7k]
  ------------------
  188|      0|    return CURLE_FAILED_INIT;
  189|       |
  190|  18.7k|  if(pp->host_user.str[0] == '[') {
  ------------------
  |  Branch (190:6): [True: 5.70k, False: 13.0k]
  ------------------
  191|  5.70k|    const char *s = pp->host_user.str + 1;
  192|  5.70k|    struct Curl_str tmp;
  193|  5.70k|    if(curlx_str_until(&s, &tmp, pp->host_user.len - 1, ']'))
  ------------------
  |  Branch (193:8): [True: 0, False: 5.70k]
  ------------------
  194|      0|      return CURLE_URL_MALFORMAT;
  195|       |
  196|  5.70k|    if(!Curl_looks_like_ipv6(tmp.str, tmp.len, TRUE,
  ------------------
  |  |  986|  5.70k|#define TRUE true
  ------------------
  |  Branch (196:8): [True: 0, False: 5.70k]
  ------------------
  197|  5.70k|                             &pp->host, &pp->zoneid)) {
  198|      0|      failf(data, "Invalid IPv6 address format in '%.*s'",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  199|      0|            (int)pp->host_user.len, pp->host_user.str);
  200|      0|      return CURLE_URL_MALFORMAT;
  201|      0|    }
  202|  5.70k|    pp->ipv6 = TRUE;
  ------------------
  |  |  986|  5.70k|#define TRUE true
  ------------------
  203|  5.70k|  }
  204|  13.0k|  else {
  205|  13.0k|#ifdef USE_IDN
  206|  13.0k|    if(!Curl_is_ASCII_str(&pp->host_user)) {
  ------------------
  |  Branch (206:8): [True: 0, False: 13.0k]
  ------------------
  207|      0|      CURLcode result;
  208|      0|      if(!pp->tmp_host_user) {
  ------------------
  |  Branch (208:10): [True: 0, False: 0]
  ------------------
  209|       |        /* need a null-terminated string for IDN */
  210|      0|        pp->tmp_host_user = curlx_memdup0(pp->host_user.str,
  211|      0|                                          pp->host_user.len);
  212|      0|        if(!pp->tmp_host_user)
  ------------------
  |  Branch (212:12): [True: 0, False: 0]
  ------------------
  213|      0|          return CURLE_OUT_OF_MEMORY;
  214|      0|      }
  215|      0|      result = Curl_idn_decode(pp->tmp_host_user, &pp->tmp_host);
  216|      0|      if(!result &&
  ------------------
  |  Branch (216:10): [True: 0, False: 0]
  ------------------
  217|      0|         Curl_hostname_check(pp->tmp_host, strlen(pp->tmp_host))) {
  ------------------
  |  Branch (217:10): [True: 0, False: 0]
  ------------------
  218|      0|        failf(data, "Illegal hostname: %s", pp->tmp_host);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  219|      0|        result = CURLE_URL_MALFORMAT;
  220|      0|      }
  221|      0|      if(result)
  ------------------
  |  Branch (221:10): [True: 0, False: 0]
  ------------------
  222|      0|        return result;
  223|      0|      pp->host.str = pp->tmp_host;
  224|      0|      pp->host.len = strlen(pp->host.str);
  225|      0|    }
  226|  13.0k|    else
  227|  13.0k|#endif
  228|  13.0k|    if(scan_for_ipv6 &&
  ------------------
  |  Branch (228:8): [True: 0, False: 13.0k]
  ------------------
  229|      0|       Curl_looks_like_ipv6(pp->host_user.str, pp->host_user.len, TRUE,
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  |  Branch (229:8): [True: 0, False: 0]
  ------------------
  230|      0|                            &pp->host, &pp->zoneid)) {
  231|      0|      if(pp->host_user.len < MAX_IPADR_LEN) {
  ------------------
  |  |   41|      0|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  |  Branch (231:10): [True: 0, False: 0]
  ------------------
  232|      0|        char tmp[MAX_IPADR_LEN];
  233|      0|        memcpy(tmp, pp->host_user.str, pp->host_user.len);
  234|      0|        tmp[pp->host_user.len] = 0;
  235|      0|        pp->ipv6 = !Curl_is_ipv4addr(tmp);
  236|      0|      }
  237|      0|      else
  238|      0|        pp->ipv6 = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  239|      0|    }
  240|  13.0k|    else
  241|  13.0k|      pp->host = pp->host_user;
  242|  13.0k|  }
  243|  18.7k|  return CURLE_OK;
  244|  18.7k|}
peer.c:peer_create:
  105|  18.7k|{
  106|  18.7k|  struct Curl_peer *peer = NULL;
  107|  18.7k|  CURLcode result = CURLE_OK;
  108|  18.7k|  size_t zone_alen = 0, host_alen = 0;
  109|       |
  110|  18.7k|  if(!pp || !pp->scheme)
  ------------------
  |  Branch (110:6): [True: 0, False: 18.7k]
  |  Branch (110:13): [True: 0, False: 18.7k]
  ------------------
  111|      0|    return CURLE_FAILED_INIT;
  112|  18.7k|  if(!pp->host.len && !(pp->scheme->flags & PROTOPT_NONETWORK))
  ------------------
  |  |  221|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (112:6): [True: 0, False: 18.7k]
  |  Branch (112:23): [True: 0, False: 0]
  ------------------
  113|      0|    return CURLE_FAILED_INIT;
  114|       |
  115|  18.7k|  if((pp->host.str != pp->host_user.str) ||
  ------------------
  |  Branch (115:6): [True: 5.70k, False: 13.0k]
  ------------------
  116|  13.0k|     (pp->host.len != pp->host_user.len)) {
  ------------------
  |  Branch (116:6): [True: 0, False: 13.0k]
  ------------------
  117|  5.70k|    host_alen = pp->host.len + 1;
  118|  5.70k|  }
  119|  18.7k|  zone_alen = pp->zoneid.len ? (pp->zoneid.len + 1) : 0;
  ------------------
  |  Branch (119:15): [True: 0, False: 18.7k]
  ------------------
  120|       |
  121|       |  /* null-terminator already part of struct */
  122|  18.7k|  peer = curlx_calloc(1, sizeof(*peer) +
  ------------------
  |  | 1500|  18.7k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  123|  18.7k|                         pp->host_user.len + host_alen + zone_alen);
  124|  18.7k|  if(!peer) {
  ------------------
  |  Branch (124:6): [True: 4, False: 18.7k]
  ------------------
  125|      4|    result = CURLE_OUT_OF_MEMORY;
  126|      4|    goto out;
  127|      4|  }
  128|       |
  129|  18.7k|  Curl_refcount_init(&peer->refcount, 1);
  ------------------
  |  |   53|  18.7k|#define Curl_refcount_init(c, v) atomic_init(c, v)
  ------------------
  130|  18.7k|  peer->scheme = pp->scheme;
  131|  18.7k|  peer->hostname = peer->user_hostname;
  132|  18.7k|  peer->port = pp->port;
  133|  18.7k|  peer->scopeid = pp->scopeid;
  134|  18.7k|  peer->ipv6 = pp->ipv6;
  135|  18.7k|  peer->unix_socket = pp->unix_socket;
  136|  18.7k|  peer->abstract_uds = pp->abstract_uds;
  137|       |
  138|  18.7k|  if(pp->host_user.len)
  ------------------
  |  Branch (138:6): [True: 18.7k, False: 0]
  ------------------
  139|  18.7k|    memcpy(peer->user_hostname, pp->host_user.str, pp->host_user.len);
  140|       |
  141|  18.7k|  if(host_alen) {
  ------------------
  |  Branch (141:6): [True: 5.70k, False: 13.0k]
  ------------------
  142|  5.70k|    peer->hostname = peer->user_hostname + pp->host_user.len + 1;
  143|  5.70k|    memcpy(peer->hostname, pp->host.str, pp->host.len);
  144|  5.70k|  }
  145|       |
  146|  18.7k|  if(zone_alen) {
  ------------------
  |  Branch (146:6): [True: 0, False: 18.7k]
  ------------------
  147|      0|    peer->zoneid = peer->user_hostname + pp->host_user.len + 1 + host_alen;
  148|      0|    memcpy(peer->zoneid, pp->zoneid.str, pp->zoneid.len);
  149|      0|#ifdef USE_IPV6
  150|       |    /* Determine scope_id if not already provided */
  151|      0|    if(!peer->scopeid) {
  ------------------
  |  Branch (151:8): [True: 0, False: 0]
  ------------------
  152|      0|      const char *p = peer->zoneid;
  153|      0|      curl_off_t scope;
  154|      0|      if(!curlx_str_number(&p, &scope, UINT_MAX) && !*p) {
  ------------------
  |  Branch (154:10): [True: 0, False: 0]
  |  Branch (154:53): [True: 0, False: 0]
  ------------------
  155|       |        /* A plain number, use it directly as a scope id. */
  156|      0|        peer->scopeid = (uint32_t)scope;
  157|      0|      }
  158|      0|#ifdef HAVE_IF_NAMETOINDEX
  159|      0|      else {
  160|       |        /* Zone identifier is not fully numeric */
  161|      0|        unsigned int idx = 0;
  162|      0|        idx = if_nametoindex(peer->zoneid);
  163|      0|        if(idx) {
  ------------------
  |  Branch (163:12): [True: 0, False: 0]
  ------------------
  164|      0|          peer->scopeid = (uint32_t)idx;
  165|      0|        }
  166|      0|        else {
  167|       |          /* Do we want to return an error here? */
  168|      0|        }
  169|      0|      }
  170|      0|#endif /* HAVE_IF_NAMETOINDEX */
  171|      0|    }
  172|      0|#endif /* USE_IPV6 */
  173|      0|  }
  174|       |
  175|  18.7k|out:
  176|  18.7k|  if(!result)
  ------------------
  |  Branch (176:6): [True: 18.7k, False: 4]
  ------------------
  177|  18.7k|    *ppeer = peer;
  178|      4|  else
  179|      4|    Curl_peer_unlink(&peer);
  180|  18.7k|  return result;
  181|  18.7k|}
peer.c:peer_parse_clear:
   96|  18.7k|{
   97|  18.7k|  curlx_free(pp->tmp_host_user);
  ------------------
  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   98|  18.7k|  curlx_free(pp->tmp_host);
  ------------------
  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   99|  18.7k|  curlx_free(pp->tmp_zoneid);
  ------------------
  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  100|  18.7k|  memset(pp, 0, sizeof(*pp));
  101|  18.7k|}
peer.c:peer_same_hostname:
  337|  2.02k|{
  338|       |  /* UNIX domain socket paths must be compared case-sensitive,
  339|       |   * as many filesystem are like that. */
  340|  2.02k|  return (p1->unix_socket == p2->unix_socket) &&
  ------------------
  |  Branch (340:10): [True: 2.02k, False: 0]
  ------------------
  341|  2.02k|         (p1->abstract_uds == p2->abstract_uds) &&
  ------------------
  |  Branch (341:10): [True: 2.02k, False: 0]
  ------------------
  342|  2.02k|         (p1->ipv6 == p2->ipv6) &&
  ------------------
  |  Branch (342:10): [True: 2.02k, False: 0]
  ------------------
  343|       |         /* unix_socket paths are case-sensitive, hostnames are not.
  344|       |          * Do strcmp() first on both, since we do a lot of matches
  345|       |          * on the same names and platform strcmp is way faster. */
  346|  2.02k|         (!strcmp(p1->hostname, p2->hostname) ||
  ------------------
  |  Branch (346:11): [True: 0, False: 2.02k]
  ------------------
  347|  2.02k|          (!p1->unix_socket &&
  ------------------
  |  Branch (347:12): [True: 2.02k, False: 0]
  ------------------
  348|  2.02k|           curl_strequal(p1->hostname, p2->hostname)));
  ------------------
  |  Branch (348:12): [True: 0, False: 2.02k]
  ------------------
  349|  2.02k|}

pgrs_speedcheck:
  134|  8.50k|{
  135|  8.50k|  if(!data->set.low_speed_time || !data->set.low_speed_limit ||
  ------------------
  |  Branch (135:6): [True: 8.50k, False: 0]
  |  Branch (135:35): [True: 0, False: 0]
  ------------------
  136|      0|     Curl_xfer_recv_is_paused(data) || Curl_xfer_send_is_paused(data))
  ------------------
  |  Branch (136:6): [True: 0, False: 0]
  |  Branch (136:40): [True: 0, False: 0]
  ------------------
  137|       |    /* A paused transfer is not qualified for speed checks */
  138|  8.50k|    return CURLE_OK;
  139|       |
  140|      0|  if(data->progress.current_speed >= 0) {
  ------------------
  |  Branch (140:6): [True: 0, False: 0]
  ------------------
  141|      0|    if(data->progress.current_speed < data->set.low_speed_limit) {
  ------------------
  |  Branch (141:8): [True: 0, False: 0]
  ------------------
  142|      0|      if(!data->state.keeps_speed.tv_sec)
  ------------------
  |  Branch (142:10): [True: 0, False: 0]
  ------------------
  143|       |        /* under the limit at this moment */
  144|      0|        data->state.keeps_speed = *pnow;
  145|      0|      else {
  146|       |        /* how long has it been under the limit */
  147|      0|        timediff_t howlong =
  148|      0|          curlx_ptimediff_ms(pnow, &data->state.keeps_speed);
  149|       |
  150|      0|        if(howlong >= data->set.low_speed_time * 1000) {
  ------------------
  |  Branch (150:12): [True: 0, False: 0]
  ------------------
  151|       |          /* too long */
  152|      0|          failf(data, "Operation too slow. Less than %" FMT_OFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  153|      0|                " bytes/sec transferred the last %u seconds",
  154|      0|                data->set.low_speed_limit, data->set.low_speed_time);
  155|      0|          return CURLE_OPERATION_TIMEDOUT;
  156|      0|        }
  157|      0|      }
  158|      0|    }
  159|      0|    else
  160|       |      /* faster right now */
  161|      0|      data->state.keeps_speed.tv_sec = 0;
  162|      0|  }
  163|       |
  164|       |  /* since low speed limit is enabled, set the expire timer to make this
  165|       |     connection's speed get checked again in a second */
  166|      0|  Curl_expire_set(data, EXPIRE_SPEEDCHECK, 1000, pnow);
  167|       |
  168|      0|  return CURLE_OK;
  169|      0|}
Curl_pgrs_now:
  172|  1.98M|{
  173|  1.98M|  curlx_pnow(&data->progress.now);
  174|  1.98M|  return &data->progress.now;
  175|  1.98M|}
Curl_pgrsDone:
  189|  1.95k|{
  190|  1.95k|  int rc;
  191|  1.95k|  data->progress.delta.lastshow_us = -1;
  192|  1.95k|  rc = Curl_pgrsUpdateX(data, pnow); /* the final (forced) update */
  193|  1.95k|  if(rc)
  ------------------
  |  Branch (193:6): [True: 0, False: 1.95k]
  ------------------
  194|      0|    return rc;
  195|       |
  196|  1.95k|  if(!data->progress.hide && !data->progress.callback)
  ------------------
  |  Branch (196:6): [True: 0, False: 1.95k]
  |  Branch (196:30): [True: 0, False: 0]
  ------------------
  197|       |    /* only output if we do not use a progress callback and we are not
  198|       |     * hidden */
  199|      0|    curl_mfprintf(data->set.err, "\n");
  200|       |
  201|  1.95k|  return 0;
  202|  1.95k|}
Curl_pgrsReset:
  205|  10.7k|{
  206|  10.7k|  Curl_pgrsSetUploadCounter(data, 0);
  207|  10.7k|  data->progress.dl.cur_size = 0;
  208|  10.7k|  Curl_pgrsSetUploadSize(data, -1);
  209|  10.7k|  Curl_pgrsSetDownloadSize(data, -1);
  210|  10.7k|  data->progress.speeder_c = 0; /* reset speed records */
  211|  10.7k|  data->progress.deliver = 0;
  212|  10.7k|  pgrs_speedinit(data);
  213|  10.7k|}
Curl_pgrsResetTransferSizes:
  217|  9.66k|{
  218|  9.66k|  Curl_pgrsSetDownloadSize(data, -1);
  219|  9.66k|  Curl_pgrsSetUploadSize(data, -1);
  220|  9.66k|}
Curl_pgrsTimeWas:
  266|  53.0k|{
  267|  53.0k|  timediff_t *delta = NULL;
  268|       |
  269|  53.0k|  switch(timer) {
  270|      0|  default:
  ------------------
  |  Branch (270:3): [True: 0, False: 53.0k]
  ------------------
  271|      0|  case TIMER_NONE:
  ------------------
  |  Branch (271:3): [True: 0, False: 53.0k]
  ------------------
  272|       |    /* mistake filter */
  273|      0|    break;
  274|  9.66k|  case TIMER_STARTOP:
  ------------------
  |  Branch (274:3): [True: 9.66k, False: 43.4k]
  ------------------
  275|       |    /* This is set at the start of a transfer */
  276|  9.66k|    data->progress.delta.startop_us =
  277|  9.66k|      curlx_ptimediff_us(&timestamp, &data->progress.start);
  278|  9.66k|    data->progress.delta.startqueue_us = data->progress.delta.startop_us;
  279|  9.66k|    break;
  280|  9.66k|  case TIMER_STARTSINGLE:
  ------------------
  |  Branch (280:3): [True: 9.66k, False: 43.4k]
  ------------------
  281|       |    /* This is set at the start of each single transfer */
  282|  9.66k|    data->progress.delta.startsingle_us =
  283|  9.66k|      curlx_ptimediff_us(&timestamp, &data->progress.start);
  284|  9.66k|    data->progress.startransfer_added = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  285|  9.66k|    break;
  286|  9.43k|  case TIMER_POSTQUEUE:
  ------------------
  |  Branch (286:3): [True: 9.43k, False: 43.6k]
  ------------------
  287|       |    /* Queue time is accumulative from all involved redirects */
  288|  9.43k|    data->progress.total.queued_us +=
  289|  9.43k|      curlx_ptimediff_us(&timestamp, &data->progress.start) -
  290|  9.43k|      data->progress.delta.startqueue_us;
  291|  9.43k|    break;
  292|  9.23k|  case TIMER_NAMELOOKUP:
  ------------------
  |  Branch (292:3): [True: 9.23k, False: 43.8k]
  ------------------
  293|  9.23k|    delta = &data->progress.total.nslookup_us;
  294|  9.23k|    break;
  295|  8.32k|  case TIMER_CONNECT:
  ------------------
  |  Branch (295:3): [True: 8.32k, False: 44.7k]
  ------------------
  296|  8.32k|    delta = &data->progress.total.connect_us;
  297|  8.32k|    break;
  298|  1.95k|  case TIMER_APPCONNECT:
  ------------------
  |  Branch (298:3): [True: 1.95k, False: 51.1k]
  ------------------
  299|  1.95k|    delta = &data->progress.total.appconnect_us;
  300|  1.95k|    break;
  301|  1.95k|  case TIMER_PRETRANSFER:
  ------------------
  |  Branch (301:3): [True: 1.95k, False: 51.1k]
  ------------------
  302|  1.95k|    delta = &data->progress.total.pretransfer_us;
  303|  1.95k|    break;
  304|    911|  case TIMER_STARTTRANSFER:
  ------------------
  |  Branch (304:3): [True: 911, False: 52.1k]
  ------------------
  305|       |    /* prevent updating t_starttransfer unless:
  306|       |     *   1. this is the first time we are setting t_starttransfer
  307|       |     *   2. a redirect has occurred since the last time t_starttransfer was set
  308|       |     * This prevents repeated invocations of the function from incorrectly
  309|       |     * changing the t_starttransfer time.
  310|       |     */
  311|    911|    if(data->progress.startransfer_added) {
  ------------------
  |  Branch (311:8): [True: 0, False: 911]
  ------------------
  312|      0|      CURL_TRC_M(data, "[%s] ignored", pgrs_timer_name(timer));
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  313|      0|      return;
  314|      0|    }
  315|    911|    data->progress.startransfer_added = TRUE;
  ------------------
  |  |  986|    911|#define TRUE true
  ------------------
  316|    911|    delta = &data->progress.total.starttransfer_us;
  317|    911|    break;
  318|  1.92k|  case TIMER_POSTRANSFER:
  ------------------
  |  Branch (318:3): [True: 1.92k, False: 51.1k]
  ------------------
  319|  1.92k|    delta = &data->progress.total.posttransfer_us;
  320|  1.92k|    break;
  321|      0|  case TIMER_REDIRECT:
  ------------------
  |  Branch (321:3): [True: 0, False: 53.0k]
  ------------------
  322|      0|    data->progress.delta.startredirect_us =
  323|      0|      curlx_ptimediff_us(&timestamp, &data->progress.start);
  324|       |    /* transfer starts queueing again */
  325|      0|    data->progress.delta.startqueue_us =
  326|      0|      data->progress.delta.startredirect_us;
  327|      0|    break;
  328|  53.0k|  }
  329|  53.0k|  if(delta) {
  ------------------
  |  Branch (329:6): [True: 24.3k, False: 28.7k]
  ------------------
  330|  24.3k|    timediff_t us = curlx_ptimediff_us(&timestamp, &data->progress.start) -
  331|  24.3k|                    data->progress.delta.startsingle_us;
  332|  24.3k|    if(us < 1)
  ------------------
  |  Branch (332:8): [True: 0, False: 24.3k]
  ------------------
  333|      0|      us = 1; /* make sure at least one microsecond passed */
  334|  24.3k|    *delta += us;
  335|  24.3k|    CURL_TRC_M(data, "[%s] added %" FMT_TIMEDIFF_T "us",
  ------------------
  |  |  148|  24.3k|  do {                                   \
  |  |  149|  24.3k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  24.3k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  24.3k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  48.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 24.3k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 2.12k, False: 22.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  48.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 2.12k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  2.12k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  24.3k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  2.12k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 284, False: 1.84k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  24.3k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  24.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 24.3k]
  |  |  ------------------
  ------------------
  336|  24.3k|               pgrs_timer_name(timer), us);
  337|  24.3k|  }
  338|  28.7k|  else
  339|  28.7k|    CURL_TRC_M(data, "[%s] set", pgrs_timer_name(timer));
  ------------------
  |  |  148|  28.7k|  do {                                   \
  |  |  149|  28.7k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  28.7k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  28.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  57.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 28.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 2.84k, False: 25.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  57.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 2.84k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  2.84k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  28.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  2.84k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 566, False: 2.28k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  28.7k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  28.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 28.7k]
  |  |  ------------------
  ------------------
  340|  53.0k|}
Curl_pgrsTime:
  349|  23.6k|{
  350|  23.6k|  Curl_pgrsTimeWas(data, timer, *Curl_pgrs_now(data));
  351|  23.6k|}
Curl_pgrsStart:
  354|  9.66k|{
  355|  9.66k|  struct Progress *p = &data->progress;
  356|       |
  357|  9.66k|  if(!pnow)
  ------------------
  |  Branch (357:6): [True: 9.66k, False: 0]
  ------------------
  358|  9.66k|    pnow = Curl_pgrs_now(data);
  359|  9.66k|  p->speeder_c = 0; /* reset the progress meter display */
  360|  9.66k|  p->start = *pnow;
  361|  9.66k|  memset(&p->delta, 0, sizeof(p->delta));
  362|  9.66k|  memset(&p->total, 0, sizeof(p->total));
  363|  9.66k|  p->startransfer_added = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  364|  9.66k|  p->dl.cur_size = 0;
  365|  9.66k|  p->ul.cur_size = 0;
  366|       |  /* the sizes are unknown at start */
  367|  9.66k|  p->dl_size_known = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  368|       |  p->ul_size_known = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  369|  9.66k|}
Curl_pgrs_deliver_check:
  374|    960|{
  375|    960|  if(data->set.max_filesize &&
  ------------------
  |  Branch (375:6): [True: 284, False: 676]
  ------------------
  376|    284|     ((curl_off_t)delta > data->set.max_filesize - data->progress.deliver)) {
  ------------------
  |  Branch (376:6): [True: 10, False: 274]
  ------------------
  377|     10|    failf(data, "Would have exceeded max file size");
  ------------------
  |  |   62|     10|#define failf Curl_failf
  ------------------
  378|     10|    return CURLE_FILESIZE_EXCEEDED;
  379|     10|  }
  380|    950|  return CURLE_OK;
  381|    960|}
Curl_pgrs_deliver_inc:
  386|    950|{
  387|    950|  data->progress.deliver += delta;
  388|    950|}
Curl_pgrs_download_inc:
  391|    117|{
  392|    117|  if(delta) {
  ------------------
  |  Branch (392:6): [True: 117, False: 0]
  ------------------
  393|    117|    data->progress.dl.cur_size += delta;
  394|       |    Curl_rlimit_drain(&data->progress.dl.rlimit, delta, NULL);
  395|    117|  }
  396|    117|}
Curl_pgrs_upload_inc:
  399|    606|{
  400|    606|  if(delta) {
  ------------------
  |  Branch (400:6): [True: 606, False: 0]
  ------------------
  401|    606|    data->progress.ul.cur_size += delta;
  402|       |    Curl_rlimit_drain(&data->progress.ul.rlimit, delta, NULL);
  403|    606|  }
  404|    606|}
Curl_pgrsSetUploadCounter:
  410|  10.7k|{
  411|  10.7k|  data->progress.ul.cur_size = size;
  412|  10.7k|}
Curl_pgrsSetDownloadSize:
  415|  20.4k|{
  416|  20.4k|  if(size >= 0) {
  ------------------
  |  Branch (416:6): [True: 0, False: 20.4k]
  ------------------
  417|      0|    data->progress.dl.total_size = size;
  418|      0|    data->progress.dl_size_known = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  419|      0|  }
  420|  20.4k|  else {
  421|  20.4k|    data->progress.dl.total_size = 0;
  422|       |    data->progress.dl_size_known = FALSE;
  ------------------
  |  |  989|  20.4k|#define FALSE false
  ------------------
  423|  20.4k|  }
  424|  20.4k|}
Curl_pgrsSetUploadSize:
  427|  22.3k|{
  428|  22.3k|  if(size >= 0) {
  ------------------
  |  Branch (428:6): [True: 1.89k, False: 20.4k]
  ------------------
  429|  1.89k|    data->progress.ul.total_size = size;
  430|  1.89k|    data->progress.ul_size_known = TRUE;
  ------------------
  |  |  986|  1.89k|#define TRUE true
  ------------------
  431|  1.89k|  }
  432|  20.4k|  else {
  433|  20.4k|    data->progress.ul.total_size = 0;
  434|       |    data->progress.ul_size_known = FALSE;
  ------------------
  |  |  989|  20.4k|#define FALSE false
  ------------------
  435|  20.4k|  }
  436|  22.3k|}
Curl_pgrsUpdate:
  714|   858k|{
  715|   858k|  return pgrs_update(data, Curl_pgrs_now(data));
  716|   858k|}
Curl_pgrsUpdateX:
  720|  18.7k|{
  721|  18.7k|  return pgrs_update(data, pnow);
  722|  18.7k|}
Curl_pgrsCheckX:
  726|  9.04k|{
  727|  9.04k|  CURLcode result;
  728|       |
  729|  9.04k|  result = pgrs_update(data, pnow);
  730|  9.04k|  if(!result && !data->req.done)
  ------------------
  |  Branch (730:6): [True: 9.04k, False: 0]
  |  Branch (730:17): [True: 8.50k, False: 533]
  ------------------
  731|  8.50k|    result = pgrs_speedcheck(data, pnow);
  732|  9.04k|  return result;
  733|  9.04k|}
Curl_pgrsUpdate_nometer:
  744|    293|{
  745|    293|  (void)progress_calc(data, Curl_pgrs_now(data));
  746|    293|}
Curl_pgrsCompleted:
  749|  8.05k|{
  750|  8.05k|  struct Progress * const p = &data->progress;
  751|  8.05k|  p->total.spent_us = curlx_ptimediff_us(Curl_pgrs_now(data), &p->start);
  752|  8.05k|}
Curl_pgrs_since_ms:
  757|   513k|{
  758|   513k|  if(!pnow)
  ------------------
  |  Branch (758:6): [True: 37, False: 513k]
  ------------------
  759|     37|    pnow = Curl_pgrs_now(data);
  760|   513k|  switch(timer) {
  761|   333k|  case TIMER_STARTOP:
  ------------------
  |  Branch (761:3): [True: 333k, False: 180k]
  ------------------
  762|   333k|    return (curlx_ptimediff_us(pnow, &data->progress.start) -
  763|   333k|            data->progress.delta.startop_us) / 1000;
  764|   180k|  case TIMER_STARTSINGLE:
  ------------------
  |  Branch (764:3): [True: 180k, False: 333k]
  ------------------
  765|   180k|    return (curlx_ptimediff_us(pnow, &data->progress.start) -
  766|   180k|            data->progress.delta.startsingle_us) / 1000;
  767|      0|  default:
  ------------------
  |  Branch (767:3): [True: 0, False: 513k]
  ------------------
  768|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (768:5): [Folded, False: 0]
  |  Branch (768:5): [Folded, False: 0]
  ------------------
  769|      0|    return 0;
  770|   513k|  }
  771|   513k|}
progress.c:pgrs_speedinit:
  123|  10.7k|{
  124|  10.7k|  memset(&data->state.keeps_speed, 0, sizeof(struct curltime));
  125|  10.7k|}
progress.c:pgrs_timer_name:
  254|    850|{
  255|    850|  if((size_t)timer < CURL_ARRAYSIZE(pgrs_timer_names))
  ------------------
  |  | 1326|    850|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (255:6): [True: 850, False: 0]
  ------------------
  256|    850|    return pgrs_timer_names[(size_t)timer];
  257|      0|  return "?";
  258|    850|}
progress.c:pgrs_update:
  708|   886k|{
  709|       |  bool showprogress = progress_calc(data, pnow);
  710|   886k|  return pgrsupdate(data, showprogress);
  711|   886k|}
progress.c:pgrsupdate:
  659|   886k|{
  660|   886k|  if(!data->progress.hide) {
  ------------------
  |  Branch (660:6): [True: 0, False: 886k]
  ------------------
  661|      0|    int rc;
  662|      0|    if(data->set.fxferinfo) {
  ------------------
  |  Branch (662:8): [True: 0, False: 0]
  ------------------
  663|       |      /* There is a callback set, call that */
  664|      0|      struct Curl_mapi_guard guard;
  665|      0|      CURL_CBAPI_START(&guard, data, easy_fxferinfo);
  ------------------
  |  |  201|      0|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
  666|      0|      rc = data->set.fxferinfo(data->set.progress_client,
  667|      0|                               data->progress.dl.total_size,
  668|      0|                               data->progress.dl.cur_size,
  669|      0|                               data->progress.ul.total_size,
  670|      0|                               data->progress.ul.cur_size);
  671|      0|      CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|      0|  Curl_cbapi_leave(g)
  ------------------
  672|      0|      if(rc != CURL_PROGRESSFUNC_CONTINUE) {
  ------------------
  |  |  236|      0|#define CURL_PROGRESSFUNC_CONTINUE 0x10000001
  ------------------
  |  Branch (672:10): [True: 0, False: 0]
  ------------------
  673|      0|        if(rc) {
  ------------------
  |  Branch (673:12): [True: 0, False: 0]
  ------------------
  674|      0|          failf(data, "Callback aborted");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  675|      0|          return CURLE_ABORTED_BY_CALLBACK;
  676|      0|        }
  677|      0|        return CURLE_OK;
  678|      0|      }
  679|      0|    }
  680|      0|    else if(data->set.fprogress) {
  ------------------
  |  Branch (680:13): [True: 0, False: 0]
  ------------------
  681|       |      /* The older deprecated callback is set, call that */
  682|      0|      struct Curl_mapi_guard guard;
  683|      0|      CURL_CBAPI_START(&guard, data, easy_fprogress);
  ------------------
  |  |  201|      0|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
  684|      0|      rc = data->set.fprogress(data->set.progress_client,
  685|      0|                               (double)data->progress.dl.total_size,
  686|      0|                               (double)data->progress.dl.cur_size,
  687|      0|                               (double)data->progress.ul.total_size,
  688|      0|                               (double)data->progress.ul.cur_size);
  689|      0|      CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|      0|  Curl_cbapi_leave(g)
  ------------------
  690|      0|      if(rc != CURL_PROGRESSFUNC_CONTINUE) {
  ------------------
  |  |  236|      0|#define CURL_PROGRESSFUNC_CONTINUE 0x10000001
  ------------------
  |  Branch (690:10): [True: 0, False: 0]
  ------------------
  691|      0|        if(rc) {
  ------------------
  |  Branch (691:12): [True: 0, False: 0]
  ------------------
  692|      0|          failf(data, "Callback aborted");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  693|      0|          return CURLE_ABORTED_BY_CALLBACK;
  694|      0|        }
  695|      0|        return CURLE_OK;
  696|      0|      }
  697|      0|    }
  698|       |
  699|      0|    if(showprogress)
  ------------------
  |  Branch (699:8): [True: 0, False: 0]
  ------------------
  700|      0|      progress_meter(data);
  701|      0|  }
  702|       |
  703|   886k|  return CURLE_OK;
  704|   886k|}
progress.c:progress_calc:
  460|   886k|{
  461|   886k|  struct Progress * const p = &data->progress;
  462|   886k|  int i_next, i_oldest, i_latest;
  463|   886k|  timediff_t duration_us, elapsed_us;
  464|   886k|  curl_off_t amount;
  465|       |
  466|       |  /* The time spent so far (from the start) in microseconds */
  467|   886k|  elapsed_us = curlx_ptimediff_us(pnow, &p->start);
  468|   886k|  p->total.spent_us = elapsed_us;
  469|   886k|  p->dl.speed = trspeed(p->dl.cur_size, p->total.spent_us);
  470|   886k|  p->ul.speed = trspeed(p->ul.cur_size, p->total.spent_us);
  471|       |
  472|   886k|  if(!p->speeder_c) { /* no previous record exists */
  ------------------
  |  Branch (472:6): [True: 9.44k, False: 877k]
  ------------------
  473|  9.44k|    p->speed_amount[0] = p->dl.cur_size + p->ul.cur_size;
  474|  9.44k|    p->speed_time[0] = elapsed_us;
  475|  9.44k|    p->speeder_c++;
  476|       |    /* use the overall average at the start */
  477|  9.44k|    p->current_speed = p->ul.speed + p->dl.speed;
  478|  9.44k|    p->delta.lastshow_us = elapsed_us;
  479|  9.44k|    return TRUE;
  ------------------
  |  |  986|  9.44k|#define TRUE true
  ------------------
  480|  9.44k|  }
  481|       |  /* We have at least one record now. Where to put the next and
  482|       |   * where is the latest one? */
  483|   877k|  i_next = p->speeder_c % CURL_SPEED_RECORDS;
  ------------------
  |  |  438|   877k|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  484|   877k|  i_latest = (i_next > 0) ? (i_next - 1) : (CURL_SPEED_RECORDS - 1);
  ------------------
  |  |  438|      0|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  |  Branch (484:14): [True: 877k, False: 0]
  ------------------
  485|       |
  486|       |  /* Make a new record only when some time has passed.
  487|       |   * Too frequent calls otherwise ruin the history. */
  488|   877k|  if((elapsed_us - p->speed_time[i_latest]) >= (1000 * 1000)) {
  ------------------
  |  Branch (488:6): [True: 0, False: 877k]
  ------------------
  489|      0|    p->speeder_c++;
  490|      0|    i_latest = i_next;
  491|      0|    p->speed_amount[i_latest] = p->dl.cur_size + p->ul.cur_size;
  492|      0|    p->speed_time[i_latest] = elapsed_us;
  493|      0|  }
  494|   877k|  else if(data->req.done) {
  ------------------
  |  Branch (494:11): [True: 1.59k, False: 875k]
  ------------------
  495|       |    /* When a transfer is done, and we did not have a current speed
  496|       |     * already, update the last record. Otherwise, stay at the speed
  497|       |     * we have. The last chunk of data, when rate limiting, would increase
  498|       |     * reported speed since it no longer measures a full second. */
  499|  1.59k|    if(!p->current_speed) {
  ------------------
  |  Branch (499:8): [True: 1.59k, False: 0]
  ------------------
  500|  1.59k|      p->speed_amount[i_latest] = p->dl.cur_size + p->ul.cur_size;
  501|  1.59k|      p->speed_time[i_latest] = elapsed_us;
  502|  1.59k|    }
  503|  1.59k|  }
  504|   875k|  else {
  505|       |    /* transfer ongoing, wait for more time to pass. */
  506|   875k|    return FALSE;
  ------------------
  |  |  989|   875k|#define FALSE false
  ------------------
  507|   875k|  }
  508|       |
  509|  1.59k|  i_oldest = (p->speeder_c < CURL_SPEED_RECORDS) ? 0 :
  ------------------
  |  |  438|  1.59k|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  |  Branch (509:14): [True: 1.59k, False: 0]
  ------------------
  510|  1.59k|             ((i_latest + 1) % CURL_SPEED_RECORDS);
  ------------------
  |  |  438|      0|#define CURL_SPEED_RECORDS (5 + 1) /* 6 entries for 5 seconds */
  ------------------
  511|       |
  512|       |  /* How much we transferred between oldest and current records */
  513|  1.59k|  amount = p->speed_amount[i_latest] - p->speed_amount[i_oldest];
  514|       |  /* How long this took */
  515|  1.59k|  duration_us = p->speed_time[i_latest] - p->speed_time[i_oldest];
  516|  1.59k|  if(duration_us <= 0)
  ------------------
  |  Branch (516:6): [True: 1.59k, False: 0]
  ------------------
  517|  1.59k|    duration_us = 1;
  518|       |
  519|  1.59k|  if(amount > (CURL_OFF_T_MAX / 1000000)) {
  ------------------
  |  |  539|  1.59k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (519:6): [True: 0, False: 1.59k]
  ------------------
  520|       |    /* the 'amount' value is bigger than would fit in 64 bits if
  521|       |       multiplied with 1000000, so we use the double math for this */
  522|      0|    p->current_speed =
  523|      0|      (curl_off_t)(((double)amount * 1000000.0) / (double)duration_us);
  524|      0|  }
  525|  1.59k|  else {
  526|  1.59k|    p->current_speed = amount * 1000000 / duration_us;
  527|  1.59k|  }
  528|       |
  529|  1.59k|  if((p->delta.lastshow_us >= 0) && !data->req.done &&
  ------------------
  |  Branch (529:6): [True: 1.06k, False: 533]
  |  Branch (529:37): [True: 0, False: 1.06k]
  ------------------
  530|      0|     ((elapsed_us - p->delta.lastshow_us) < (1000 * 1000)))
  ------------------
  |  Branch (530:6): [True: 0, False: 0]
  ------------------
  531|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  532|  1.59k|  p->delta.lastshow_us = elapsed_us;
  533|       |  return TRUE;
  ------------------
  |  |  986|  1.59k|#define TRUE true
  ------------------
  534|  1.59k|}
progress.c:trspeed:
  446|  1.77M|{
  447|  1.77M|  if(us < 1)
  ------------------
  |  Branch (447:6): [True: 0, False: 1.77M]
  ------------------
  448|      0|    return size * 1000000;
  449|  1.77M|  else if(size < CURL_OFF_T_MAX / 1000000)
  ------------------
  |  |  539|  1.77M|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  |  Branch (449:11): [True: 1.77M, False: 0]
  ------------------
  450|  1.77M|    return (size * 1000000) / us;
  451|      0|  else if(us >= 1000000)
  ------------------
  |  Branch (451:11): [True: 0, False: 0]
  ------------------
  452|      0|    return size / (us / 1000000);
  453|      0|  else
  454|      0|    return CURL_OFF_T_MAX;
  ------------------
  |  |  539|      0|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  ------------------
  455|  1.77M|}

Curl_getn_scheme:
  573|   131k|{
  574|   131k|  typedef const struct Curl_scheme *(*letterfunc)(const char *ptr);
  575|   131k|  static const letterfunc parse[] = {
  576|   131k|    two_letter_scheme,
  577|   131k|    three_letter_scheme,
  578|   131k|    four_letter_scheme,
  579|   131k|    five_letter_scheme,
  580|   131k|    six_letter_scheme,
  581|   131k|    seven_letter_scheme
  582|   131k|  };
  583|       |
  584|   131k|  if(len < 2 || len > 7)
  ------------------
  |  Branch (584:6): [True: 0, False: 131k]
  |  Branch (584:17): [True: 0, False: 131k]
  ------------------
  585|      0|    return NULL;
  586|       |
  587|   131k|  return parse[len - 2](scheme);
  588|   131k|}
Curl_get_scheme:
  592|  52.5k|{
  593|  52.5k|  return Curl_getn_scheme(scheme, strlen(scheme));
  594|  52.5k|}
protocol.c:two_letter_scheme:
  450|  19.8k|{
  451|  19.8k|  if(MKPROT(0, 0, LWR(scheme[0]), LWR(scheme[1])) == MKPROT(0, 0, 'w', 's'))
  ------------------
  |  |  439|  19.8k|  ((((uint32_t)(a)) << 24) | \
  |  |  440|  19.8k|   (((uint32_t)(b)) << 16) | \
  |  |  441|  19.8k|   (((uint32_t)(c)) <<  8) | \
  |  |  442|  19.8k|    ((uint32_t)(d)))
  ------------------
                if(MKPROT(0, 0, LWR(scheme[0]), LWR(scheme[1])) == MKPROT(0, 0, 'w', 's'))
  ------------------
  |  |  439|  19.8k|  ((((uint32_t)(a)) << 24) | \
  |  |  440|  19.8k|   (((uint32_t)(b)) << 16) | \
  |  |  441|  19.8k|   (((uint32_t)(c)) <<  8) | \
  |  |  442|  19.8k|    ((uint32_t)(d)))
  ------------------
  |  Branch (451:6): [True: 19.8k, False: 0]
  ------------------
  452|  19.8k|    return &Curl_scheme_ws;
  453|      0|  return NULL;
  454|  19.8k|}
protocol.c:three_letter_scheme:
  457|  19.8k|{
  458|  19.8k|  uint32_t prot = MKPROT(0, LWR(scheme[0]), LWR(scheme[1]), LWR(scheme[2]));
  ------------------
  |  |  439|  19.8k|  ((((uint32_t)(a)) << 24) | \
  |  |  440|  19.8k|   (((uint32_t)(b)) << 16) | \
  |  |  441|  19.8k|   (((uint32_t)(c)) <<  8) | \
  |  |  442|  19.8k|    ((uint32_t)(d)))
  ------------------
  459|  19.8k|  switch(prot) {
  ------------------
  |  Branch (459:10): [True: 19.8k, False: 0]
  ------------------
  460|      0|  case MKPROT(0, 'f', 't', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (460:3): [True: 0, False: 19.8k]
  ------------------
  461|      0|    return &Curl_scheme_ftp;
  462|  19.8k|  case MKPROT(0, 'w', 's', 's'):
  ------------------
  |  |  439|  19.8k|  ((((uint32_t)(a)) << 24) | \
  |  |  440|  19.8k|   (((uint32_t)(b)) << 16) | \
  |  |  441|  19.8k|   (((uint32_t)(c)) <<  8) | \
  |  |  442|  19.8k|    ((uint32_t)(d)))
  ------------------
  |  Branch (462:3): [True: 19.8k, False: 0]
  ------------------
  463|  19.8k|    return &Curl_scheme_wss;
  464|      0|  case MKPROT(0, 's', 'c', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (464:3): [True: 0, False: 19.8k]
  ------------------
  465|      0|    return &Curl_scheme_scp;
  466|  19.8k|  }
  467|      0|  return NULL;
  468|  19.8k|}
protocol.c:four_letter_scheme:
  471|  34.4k|{
  472|  34.4k|  uint32_t prot = MKPROT(LWR(scheme[0]), LWR(scheme[1]), LWR(scheme[2]),
  ------------------
  |  |  439|  34.4k|  ((((uint32_t)(a)) << 24) | \
  |  |  440|  34.4k|   (((uint32_t)(b)) << 16) | \
  |  |  441|  34.4k|   (((uint32_t)(c)) <<  8) | \
  |  |  442|  34.4k|    ((uint32_t)(d)))
  ------------------
  473|  34.4k|                         LWR(scheme[3]));
  474|  34.4k|  switch(prot) {
  ------------------
  |  Branch (474:10): [True: 34.4k, False: 0]
  ------------------
  475|  34.4k|  case MKPROT('h', 't', 't', 'p'):
  ------------------
  |  |  439|  34.4k|  ((((uint32_t)(a)) << 24) | \
  |  |  440|  34.4k|   (((uint32_t)(b)) << 16) | \
  |  |  441|  34.4k|   (((uint32_t)(c)) <<  8) | \
  |  |  442|  34.4k|    ((uint32_t)(d)))
  ------------------
  |  Branch (475:3): [True: 34.4k, False: 0]
  ------------------
  476|  34.4k|    return &Curl_scheme_http;
  477|      0|  case MKPROT('i', 'm', 'a', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (477:3): [True: 0, False: 34.4k]
  ------------------
  478|      0|    return &Curl_scheme_imap;
  479|      0|  case MKPROT('l', 'd', 'a', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (479:3): [True: 0, False: 34.4k]
  ------------------
  480|      0|    return &Curl_scheme_ldap;
  481|      0|  case MKPROT('r', 't', 's', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (481:3): [True: 0, False: 34.4k]
  ------------------
  482|      0|    return &Curl_scheme_rtsp;
  483|      0|  case MKPROT('t', 'f', 't', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (483:3): [True: 0, False: 34.4k]
  ------------------
  484|      0|    return &Curl_scheme_tftp;
  485|      0|  case MKPROT('s', 'f', 't', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (485:3): [True: 0, False: 34.4k]
  ------------------
  486|      0|    return &Curl_scheme_sftp;
  487|      0|  case MKPROT('s', 'm', 't', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (487:3): [True: 0, False: 34.4k]
  ------------------
  488|      0|    return &Curl_scheme_smtp;
  489|      0|  case MKPROT('f', 't', 'p', 's'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (489:3): [True: 0, False: 34.4k]
  ------------------
  490|      0|    return &Curl_scheme_ftps;
  491|      0|  case MKPROT('f', 'i', 'l', 'e'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (491:3): [True: 0, False: 34.4k]
  ------------------
  492|      0|    return &Curl_scheme_file;
  493|      0|  case MKPROT('m', 'q', 't', 't'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (493:3): [True: 0, False: 34.4k]
  ------------------
  494|      0|    return &Curl_scheme_mqtt;
  495|      0|  case MKPROT('p', 'o', 'p', '3'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (495:3): [True: 0, False: 34.4k]
  ------------------
  496|      0|    if(scheme[3] == '3')
  ------------------
  |  Branch (496:8): [True: 0, False: 0]
  ------------------
  497|      0|      return &Curl_scheme_pop3;
  498|      0|    break;
  499|      0|  case MKPROT('d', 'i', 'c', 't'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (499:3): [True: 0, False: 34.4k]
  ------------------
  500|      0|    return &Curl_scheme_dict;
  501|  34.4k|  }
  502|      0|  return NULL;
  503|  34.4k|}
protocol.c:five_letter_scheme:
  506|  57.8k|{
  507|  57.8k|  if((scheme[4] | 0x20) == 's') {
  ------------------
  |  Branch (507:6): [True: 57.8k, False: 0]
  ------------------
  508|  57.8k|    uint32_t prot = MKPROT(LWR(scheme[0]), LWR(scheme[1]), LWR(scheme[2]),
  ------------------
  |  |  439|  57.8k|  ((((uint32_t)(a)) << 24) | \
  |  |  440|  57.8k|   (((uint32_t)(b)) << 16) | \
  |  |  441|  57.8k|   (((uint32_t)(c)) <<  8) | \
  |  |  442|  57.8k|    ((uint32_t)(d)))
  ------------------
  509|  57.8k|                           LWR(scheme[3]));
  510|  57.8k|    switch(prot) {
  ------------------
  |  Branch (510:12): [True: 57.8k, False: 0]
  ------------------
  511|  57.8k|    case MKPROT('h', 't', 't', 'p'):
  ------------------
  |  |  439|  57.8k|  ((((uint32_t)(a)) << 24) | \
  |  |  440|  57.8k|   (((uint32_t)(b)) << 16) | \
  |  |  441|  57.8k|   (((uint32_t)(c)) <<  8) | \
  |  |  442|  57.8k|    ((uint32_t)(d)))
  ------------------
  |  Branch (511:5): [True: 57.8k, False: 0]
  ------------------
  512|  57.8k|      return &Curl_scheme_https;
  513|      0|    case MKPROT('l', 'd', 'a', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (513:5): [True: 0, False: 57.8k]
  ------------------
  514|      0|      return &Curl_scheme_ldaps;
  515|      0|    case MKPROT('i', 'm', 'a', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (515:5): [True: 0, False: 57.8k]
  ------------------
  516|      0|      return &Curl_scheme_imaps;
  517|      0|    case MKPROT('s', 'm', 't', 'p'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (517:5): [True: 0, False: 57.8k]
  ------------------
  518|      0|      return &Curl_scheme_smtps;
  519|      0|    case MKPROT('p', 'o', 'p', '3'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (519:5): [True: 0, False: 57.8k]
  ------------------
  520|      0|      if(scheme[3] == '3')
  ------------------
  |  Branch (520:10): [True: 0, False: 0]
  ------------------
  521|      0|        return &Curl_scheme_pop3s;
  522|      0|      break;
  523|      0|    case MKPROT('m', 'q', 't', 't'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (523:5): [True: 0, False: 57.8k]
  ------------------
  524|      0|      return &Curl_scheme_mqtts;
  525|      0|    case MKPROT('s', 'o', 'c', 'k'):
  ------------------
  |  |  439|      0|  ((((uint32_t)(a)) << 24) | \
  |  |  440|      0|   (((uint32_t)(b)) << 16) | \
  |  |  441|      0|   (((uint32_t)(c)) <<  8) | \
  |  |  442|      0|    ((uint32_t)(d)))
  ------------------
  |  Branch (525:5): [True: 0, False: 57.8k]
  ------------------
  526|      0|      return &Curl_scheme_socks;
  527|  57.8k|    }
  528|  57.8k|  }
  529|      0|  return NULL;
  530|  57.8k|}

proxy_check_noproxy:
  212|  9.42k|{
  213|       |  /*
  214|       |   * If we do not have a hostname at all, like for example with a FILE
  215|       |   * transfer, we have nothing to interrogate the noproxy list with.
  216|       |   */
  217|  9.42k|  if(!name || name[0] == '\0')
  ------------------
  |  Branch (217:6): [True: 0, False: 9.42k]
  |  Branch (217:15): [True: 0, False: 9.42k]
  ------------------
  218|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  219|       |
  220|       |  /* no_proxy=domain1.dom,host.domain2.dom
  221|       |   *   (a comma-separated list of hosts which should
  222|       |   *   not be proxied, or an asterisk to override
  223|       |   *   all proxy variables)
  224|       |   */
  225|  9.42k|  if(no_proxy && no_proxy[0]) {
  ------------------
  |  Branch (225:6): [True: 7.27k, False: 2.15k]
  |  Branch (225:18): [True: 0, False: 7.27k]
  ------------------
  226|      0|    const char *p = no_proxy;
  227|      0|    size_t namelen;
  228|      0|    char address[16];
  229|      0|    enum nametype type = TYPE_HOST;
  230|      0|    if(!strcmp("*", no_proxy))
  ------------------
  |  Branch (230:8): [True: 0, False: 0]
  ------------------
  231|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  232|       |
  233|       |    /* NO_PROXY was specified and it was not only an asterisk */
  234|       |
  235|       |    /* Check if name is an IP address; if not, assume it being a hostname. */
  236|      0|    namelen = strlen(name);
  237|      0|    if(curlx_inet_pton(AF_INET, name, &address) == 1)
  ------------------
  |  Branch (237:8): [True: 0, False: 0]
  ------------------
  238|      0|      type = TYPE_IPV4;
  239|      0|#ifdef USE_IPV6
  240|      0|    else if(curlx_inet_pton(AF_INET6, name, &address) == 1)
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|      type = TYPE_IPV6;
  242|      0|#endif
  243|      0|    else {
  244|       |      /* ignore trailing dots in the hostname */
  245|      0|      if(name[namelen - 1] == '.')
  ------------------
  |  Branch (245:10): [True: 0, False: 0]
  ------------------
  246|      0|        namelen--;
  247|      0|    }
  248|       |
  249|      0|    while(*p) {
  ------------------
  |  Branch (249:11): [True: 0, False: 0]
  ------------------
  250|      0|      const char *token;
  251|      0|      size_t tokenlen = 0;
  252|       |
  253|       |      /* pass blanks */
  254|      0|      curlx_str_passblanks(&p);
  255|       |
  256|      0|      token = p;
  257|       |      /* pass over the pattern */
  258|      0|      while(*p && !ISBLANK(*p) && (*p != ',')) {
  ------------------
  |  |   43|      0|#define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
  |  |  ------------------
  |  |  |  Branch (43:22): [True: 0, False: 0]
  |  |  |  Branch (43:38): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (258:13): [True: 0, False: 0]
  |  Branch (258:35): [True: 0, False: 0]
  ------------------
  259|      0|        p++;
  260|      0|        tokenlen++;
  261|      0|      }
  262|       |
  263|      0|      if(tokenlen) {
  ------------------
  |  Branch (263:10): [True: 0, False: 0]
  ------------------
  264|      0|        bool match = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  265|      0|        if(type == TYPE_HOST)
  ------------------
  |  Branch (265:12): [True: 0, False: 0]
  ------------------
  266|      0|          match = match_host(token, tokenlen, name, namelen);
  267|      0|        else
  268|      0|          match = match_ip(type, token, tokenlen, name);
  269|       |
  270|      0|        if(match)
  ------------------
  |  Branch (270:12): [True: 0, False: 0]
  ------------------
  271|      0|          return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  272|      0|      }
  273|       |
  274|       |      /* pass blanks after pattern */
  275|      0|      curlx_str_passblanks(&p);
  276|       |      /* if not a comma, this ends the loop */
  277|      0|      if(*p != ',')
  ------------------
  |  Branch (277:10): [True: 0, False: 0]
  ------------------
  278|      0|        break;
  279|       |      /* pass any number of commas */
  280|      0|      while(*p == ',')
  ------------------
  |  Branch (280:13): [True: 0, False: 0]
  ------------------
  281|      0|        p++;
  282|      0|    } /* while(*p) */
  283|      0|  } /* NO_PROXY was specified and it was not only an asterisk */
  284|       |
  285|  9.42k|  return FALSE;
  ------------------
  |  |  989|  9.42k|#define FALSE false
  ------------------
  286|  9.42k|}
Curl_proxy_init_conn:
  534|  9.42k|{
  535|  9.42k|  char *proxy = NULL;
  536|  9.42k|  char *pre_proxy = NULL;
  537|  9.42k|  const char *str = NULL;
  538|  9.42k|  bool do_env_detect = TRUE;
  ------------------
  |  |  986|  9.42k|#define TRUE true
  ------------------
  539|  9.42k|  CURLcode result = CURLE_OK;
  540|       |
  541|       |  /* Enforce no proxy use unless we decide to use one */
  542|  9.42k|  conn->bits.origin_is_proxy = FALSE;
  ------------------
  |  |  989|  9.42k|#define FALSE false
  ------------------
  543|  9.42k|  DEBUGASSERT(!conn->socks_proxy.peer);
  ------------------
  |  | 1016|  9.42k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (543:3): [True: 0, False: 9.42k]
  |  Branch (543:3): [True: 9.42k, False: 0]
  ------------------
  544|  9.42k|  DEBUGASSERT(!conn->http_proxy.peer);
  ------------------
  |  | 1016|  9.42k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (544:3): [True: 0, False: 9.42k]
  |  Branch (544:3): [True: 9.42k, False: 0]
  ------------------
  545|       |
  546|  9.42k|  if(proxy_do_not_proxy(data))
  ------------------
  |  Branch (546:6): [True: 0, False: 9.42k]
  ------------------
  547|      0|    goto out;
  548|       |
  549|       |  /*************************************************************
  550|       |   * Detect what (if any) proxy to use
  551|       |   *************************************************************/
  552|       |  /* the empty config strings disable proxy use and env detects */
  553|  9.42k|  str = CURL_EASY_STR(data, STRING_PROXY);
  ------------------
  |  | 1206|  9.42k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  554|  9.42k|  if(str) {
  ------------------
  |  Branch (554:6): [True: 9.41k, False: 10]
  ------------------
  555|  9.41k|    if(*str) {
  ------------------
  |  Branch (555:8): [True: 7.29k, False: 2.11k]
  ------------------
  556|  7.29k|      proxy = curlx_strdup(str);
  ------------------
  |  | 1497|  7.29k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  557|       |      /* if global proxy is set, this is it */
  558|  7.29k|      if(!proxy) {
  ------------------
  |  Branch (558:10): [True: 2, False: 7.29k]
  ------------------
  559|      2|        failf(data, "memory shortage");
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
  560|      2|        result = CURLE_OUT_OF_MEMORY;
  561|      2|        goto out;
  562|      2|      }
  563|  7.29k|    }
  564|  2.11k|    else
  565|  2.11k|      do_env_detect = FALSE;
  ------------------
  |  |  989|  2.11k|#define FALSE false
  ------------------
  566|  9.41k|  }
  567|       |
  568|  9.42k|  str = CURL_EASY_STR(data, STRING_PRE_PROXY);
  ------------------
  |  | 1206|  9.42k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  569|  9.42k|  if(str) {
  ------------------
  |  Branch (569:6): [True: 0, False: 9.42k]
  ------------------
  570|      0|    if(*str) {
  ------------------
  |  Branch (570:8): [True: 0, False: 0]
  ------------------
  571|      0|      pre_proxy = curlx_strdup(str);
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  572|       |      /* if global socks proxy is set, this is it */
  573|      0|      if(!pre_proxy) {
  ------------------
  |  Branch (573:10): [True: 0, False: 0]
  ------------------
  574|      0|        failf(data, "memory shortage");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  575|      0|        result = CURLE_OUT_OF_MEMORY;
  576|      0|        goto out;
  577|      0|      }
  578|      0|    }
  579|      0|    else
  580|      0|      do_env_detect = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  581|      0|  }
  582|       |
  583|  9.42k|#ifndef CURL_DISABLE_HTTP
  584|       |  /* None configured, detect possible proxy from environment. */
  585|  9.42k|  if(!proxy && !pre_proxy && do_env_detect)
  ------------------
  |  Branch (585:6): [True: 2.12k, False: 7.29k]
  |  Branch (585:16): [True: 2.12k, False: 0]
  |  Branch (585:30): [True: 10, False: 2.11k]
  ------------------
  586|     10|    proxy = proxy_detect_proxy(data, conn->scheme);
  587|       |#else
  588|       |  (void)do_env_detect;
  589|       |#endif /* CURL_DISABLE_HTTP */
  590|       |
  591|  9.42k|  if(!proxy && !pre_proxy)
  ------------------
  |  Branch (591:6): [True: 2.12k, False: 7.29k]
  |  Branch (591:16): [True: 2.12k, False: 0]
  ------------------
  592|  2.12k|    goto out;
  593|       |
  594|  7.29k|  if(pre_proxy) {
  ------------------
  |  Branch (594:6): [True: 0, False: 7.29k]
  ------------------
  595|      0|    result = parse_proxy(data, pre_proxy, TRUE, &conn->socks_proxy);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  596|      0|    if(result)
  ------------------
  |  Branch (596:8): [True: 0, False: 0]
  ------------------
  597|      0|      goto out;
  598|      0|  }
  599|       |
  600|  7.29k|  if(proxy) {
  ------------------
  |  Branch (600:6): [True: 7.29k, False: 0]
  ------------------
  601|  7.29k|    result = parse_proxy(data, proxy, FALSE, &conn->http_proxy);
  ------------------
  |  |  989|  7.29k|#define FALSE false
  ------------------
  602|  7.29k|    if(result)
  ------------------
  |  Branch (602:8): [True: 13, False: 7.28k]
  ------------------
  603|     13|      goto out;
  604|       |
  605|  7.28k|    switch(conn->http_proxy.proxytype) {
  606|      0|    case CURLPROXY_SOCKS4:
  ------------------
  |  |  800|      0|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (606:5): [True: 0, False: 7.28k]
  ------------------
  607|      0|    case CURLPROXY_SOCKS4A:
  ------------------
  |  |  803|      0|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  |  Branch (607:5): [True: 0, False: 7.28k]
  ------------------
  608|      0|    case CURLPROXY_SOCKS5:
  ------------------
  |  |  802|      0|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  |  Branch (608:5): [True: 0, False: 7.28k]
  ------------------
  609|      0|    case CURLPROXY_SOCKS5_HOSTNAME:
  ------------------
  |  |  804|      0|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  |  Branch (609:5): [True: 0, False: 7.28k]
  ------------------
  610|       |      /* Whoops, it is not an HTTP proxy */
  611|      0|      if(pre_proxy) {
  ------------------
  |  Branch (611:10): [True: 0, False: 0]
  ------------------
  612|       |        /* and we already have a SOCKS pre-proxy. Cannot have both */
  613|      0|        failf(data, "Having a SOCKS pre-proxy and proxy is not "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  614|      0|              "supported with \'%s\'", proxy);
  615|      0|        result = CURLE_COULDNT_RESOLVE_PROXY;
  616|      0|        goto out;
  617|      0|      }
  618|       |      /* switch */
  619|      0|      conn->socks_proxy = conn->http_proxy;
  620|      0|      memset(&conn->http_proxy, 0, sizeof(conn->http_proxy));
  621|      0|      break;
  622|  7.28k|    default:
  ------------------
  |  Branch (622:5): [True: 7.28k, False: 0]
  ------------------
  623|       |      /* all other types are HTTP */
  624|  7.28k|      break;
  625|  7.28k|    }
  626|  7.28k|  }
  627|       |
  628|  7.28k|  if(conn->socks_proxy.peer) {
  ------------------
  |  Branch (628:6): [True: 0, False: 7.28k]
  ------------------
  629|      0|    DEBUGASSERT(!CURL_PROXY_IS_ANY_HTTP(conn->socks_proxy.proxytype));
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (629:5): [True: 0, False: 0]
  |  Branch (629:5): [True: 0, False: 0]
  |  Branch (629:5): [True: 0, False: 0]
  |  Branch (629:5): [True: 0, False: 0]
  |  Branch (629:5): [True: 0, False: 0]
  |  Branch (629:5): [True: 0, False: 0]
  |  Branch (629:5): [True: 0, False: 0]
  |  Branch (629:5): [True: 0, False: 0]
  |  Branch (629:5): [True: 0, False: 0]
  |  Branch (629:5): [True: 0, False: 0]
  ------------------
  630|      0|  }
  631|       |
  632|       |#ifdef CURL_DISABLE_HTTP
  633|       |  if(conn->http_proxy.peer) {
  634|       |    /* asking for an HTTP proxy is a bit funny when HTTP is disabled... */
  635|       |    result = CURLE_UNSUPPORTED_PROTOCOL;
  636|       |    goto out;
  637|       |  }
  638|       |
  639|       |#else /* CURL_DISABLE_HTTP */
  640|  7.28k|  if(conn->http_proxy.peer) {
  ------------------
  |  Branch (640:6): [True: 7.28k, False: 0]
  ------------------
  641|  7.28k|    const struct Curl_scheme *scheme = data->state.origin->scheme;
  642|  7.28k|    bool tunnel_proxy = (bool)data->set.tunnel_thru_httpproxy;
  643|  7.28k|    DEBUGASSERT(CURL_PROXY_IS_ANY_HTTP(conn->http_proxy.proxytype));
  ------------------
  |  | 1016|  7.28k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (643:5): [True: 7.28k, False: 0]
  |  Branch (643:5): [True: 0, False: 0]
  |  Branch (643:5): [True: 0, False: 0]
  |  Branch (643:5): [True: 0, False: 0]
  |  Branch (643:5): [True: 0, False: 0]
  |  Branch (643:5): [True: 7.28k, False: 0]
  |  Branch (643:5): [True: 0, False: 0]
  |  Branch (643:5): [True: 0, False: 0]
  |  Branch (643:5): [True: 0, False: 0]
  |  Branch (643:5): [True: 0, False: 0]
  ------------------
  644|       |
  645|  7.28k|    if(!tunnel_proxy) {
  ------------------
  |  Branch (645:8): [True: 0, False: 7.28k]
  ------------------
  646|       |      /* Decide if we tunnel through proxy automatically */
  647|      0|      if(conn->via_peer) {
  ------------------
  |  Branch (647:10): [True: 0, False: 0]
  ------------------
  648|       |        /* With connect-to, we always tunnel */
  649|      0|        tunnel_proxy = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  650|      0|      }
  651|      0|      else if(scheme->flags & PROTOPT_SSL) {
  ------------------
  |  |  214|      0|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  |  Branch (651:15): [True: 0, False: 0]
  ------------------
  652|       |        /* If the transfer is supposed to be secure, we tunnel */
  653|      0|        tunnel_proxy = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  654|      0|      }
  655|      0|      else if(scheme->flags & PROTOPT_HTTP_PROXY_TUNNEL) {
  ------------------
  |  |  246|      0|#define PROTOPT_HTTP_PROXY_TUNNEL (1 << 18) /* Using this protocol with a
  ------------------
  |  Branch (655:15): [True: 0, False: 0]
  ------------------
  656|       |        /* transfer scheme required tunneling */
  657|      0|        tunnel_proxy = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  658|      0|      }
  659|      0|      else if(!(scheme->protocol & PROTO_FAMILY_HTTP) &&
  ------------------
  |  |   83|      0|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|      0|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|      0|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   62|      0|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   84|      0|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   63|      0|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (659:15): [True: 0, False: 0]
  ------------------
  660|      0|              !(scheme->flags & PROTOPT_PROXY_AS_HTTP)) {
  ------------------
  |  |  233|      0|#define PROTOPT_PROXY_AS_HTTP (1 << 11) /* allow this non-HTTP scheme over a
  ------------------
  |  Branch (660:15): [True: 0, False: 0]
  ------------------
  661|       |        /* Cannot delegate transfer URL to HTTP proxy */
  662|      0|        tunnel_proxy = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  663|      0|      }
  664|      0|    }
  665|       |
  666|  7.28k|    if(!tunnel_proxy) {
  ------------------
  |  Branch (666:8): [True: 0, False: 7.28k]
  ------------------
  667|       |      /* HTTP proxy used in forwarding mode. This means the connection
  668|       |       * is really to the proxy and NOT the origin of the transfer. */
  669|      0|      DEBUGASSERT(!conn->via_peer);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (669:7): [True: 0, False: 0]
  |  Branch (669:7): [True: 0, False: 0]
  ------------------
  670|      0|      Curl_peer_link(&conn->origin, conn->http_proxy.peer);
  671|      0|      conn->scheme = conn->http_proxy.peer->scheme;
  672|      0|      conn->bits.origin_is_proxy = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  673|      0|    }
  674|       |
  675|  7.28k|#ifndef CURL_DISABLE_DIGEST_AUTH
  676|  7.28k|    if(!Curl_safecmp(data->state.envproxy, proxy)) {
  ------------------
  |  Branch (676:8): [True: 7.28k, False: 0]
  ------------------
  677|       |      /* proxy changed */
  678|  7.28k|      Curl_auth_digest_cleanup(&data->state.proxydigest);
  679|  7.28k|      curlx_free(data->state.envproxy);
  ------------------
  |  | 1503|  7.28k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  680|  7.28k|      data->state.envproxy = curlx_strdup(proxy);
  ------------------
  |  | 1497|  7.28k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  681|  7.28k|    }
  682|  7.28k|#endif
  683|  7.28k|  }
  684|  7.28k|#endif /* !CURL_DISABLE_HTTP */
  685|       |
  686|  9.42k|out:
  687|  9.42k|  curlx_free(pre_proxy);
  ------------------
  |  | 1503|  9.42k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  688|  9.42k|  curlx_free(proxy);
  ------------------
  |  | 1503|  9.42k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  689|  9.42k|  return result;
  690|  7.28k|}
proxy.c:proxy_do_not_proxy:
  505|  9.42k|{
  506|  9.42k|  const char *no_proxy;
  507|  9.42k|  char *env_no_proxy = NULL;
  508|  9.42k|  bool do_not_proxy;
  509|       |
  510|       |  /* no proxying if the transfer does not use the network */
  511|  9.42k|  if(data->state.origin->scheme->flags & PROTOPT_NONETWORK)
  ------------------
  |  |  221|  9.42k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (511:6): [True: 0, False: 9.42k]
  ------------------
  512|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  513|       |
  514|  9.42k|  no_proxy = CURL_EASY_STR(data, STRING_NOPROXY);
  ------------------
  |  | 1206|  9.42k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  515|  9.42k|  if(!no_proxy) {
  ------------------
  |  Branch (515:6): [True: 2.15k, False: 7.27k]
  ------------------
  516|  2.15k|    const char *p = "no_proxy";
  517|  2.15k|    env_no_proxy = curl_getenv(p);
  518|  2.15k|    if(!env_no_proxy) {
  ------------------
  |  Branch (518:8): [True: 2.15k, False: 0]
  ------------------
  519|  2.15k|      p = "NO_PROXY";
  520|  2.15k|      env_no_proxy = curl_getenv(p);
  521|  2.15k|    }
  522|  2.15k|    if(env_no_proxy)
  ------------------
  |  Branch (522:8): [True: 0, False: 2.15k]
  ------------------
  523|      0|      infof(data, "Uses proxy env variable %s == '%s'", p, env_no_proxy);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  524|  2.15k|    no_proxy = env_no_proxy;
  525|  2.15k|  }
  526|       |
  527|  9.42k|  do_not_proxy = proxy_check_noproxy(data->state.origin->hostname, no_proxy);
  528|       |  curlx_safefree(env_no_proxy);
  ------------------
  |  | 1359|  9.42k|  do {                      \
  |  | 1360|  9.42k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.42k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.42k|    (ptr) = NULL;           \
  |  | 1362|  9.42k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.42k]
  |  |  ------------------
  ------------------
  529|  9.42k|  return do_not_proxy;
  530|  9.42k|}
proxy.c:proxy_detect_proxy:
  297|     10|{
  298|       |  /* If proxy was not specified, we check for default proxy environment
  299|       |   * variables, to enable i.e Lynx compliance:
  300|       |   *
  301|       |   * http_proxy=http://some.server.dom:port/
  302|       |   * https_proxy=http://some.server.dom:port/
  303|       |   * ftp_proxy=http://some.server.dom:port/
  304|       |   * no_proxy=domain1.dom,host.domain2.dom
  305|       |   *   (a comma-separated list of hosts which should
  306|       |   *   not be proxied, or an asterisk to override
  307|       |   *   all proxy variables)
  308|       |   * all_proxy=http://some.server.dom:port/
  309|       |   *   (seems to exist for the CERN www lib. Probably
  310|       |   *   the first to check for.)
  311|       |   *
  312|       |   * For compatibility, the all-uppercase versions of these variables are
  313|       |   * checked if the lowercase versions do not exist.
  314|       |   */
  315|     10|  const char *env_name = NULL;
  316|     10|  char *proxy = NULL;
  317|     10|  char name_buf[20];
  318|       |
  319|       |  /* Try scheme specific env var first, unless http(s).
  320|       |   * lowercase first, then uppercase. */
  321|     10|  if((scheme != &Curl_scheme_https) && (scheme != &Curl_scheme_http)) {
  ------------------
  |  Branch (321:6): [True: 0, False: 10]
  |  Branch (321:40): [True: 0, False: 0]
  ------------------
  322|      0|    curl_msnprintf(name_buf, sizeof(name_buf), "%s_proxy", scheme->name);
  323|      0|    env_name = name_buf;
  324|      0|    proxy = curl_getenv(env_name);
  325|      0|    if(!proxy) {
  ------------------
  |  Branch (325:8): [True: 0, False: 0]
  ------------------
  326|      0|      Curl_strntoupper(name_buf, name_buf, sizeof(name_buf));
  327|      0|      proxy = curl_getenv(env_name);
  328|      0|    }
  329|      0|  }
  330|       |
  331|     10|  if(!proxy &&
  ------------------
  |  Branch (331:6): [True: 10, False: 0]
  ------------------
  332|     10|     ((scheme == &Curl_scheme_https) || (scheme == &Curl_scheme_wss))) {
  ------------------
  |  Branch (332:7): [True: 10, False: 0]
  |  Branch (332:41): [True: 0, False: 0]
  ------------------
  333|       |    /* Not found, check 'https' env vars, also for 'wss'.
  334|       |     * Again, first lowercase then uppercase. */
  335|     10|    env_name = "https_proxy";
  336|     10|    proxy = curl_getenv(env_name);
  337|     10|    if(!proxy) {
  ------------------
  |  Branch (337:8): [True: 10, False: 0]
  ------------------
  338|     10|      env_name = "HTTPS_PROXY";
  339|     10|      proxy = curl_getenv(env_name);
  340|     10|    }
  341|     10|  }
  342|      0|  else if(!proxy &&
  ------------------
  |  Branch (342:11): [True: 0, False: 0]
  ------------------
  343|      0|          ((scheme == &Curl_scheme_http) || (scheme == &Curl_scheme_ws))) {
  ------------------
  |  Branch (343:12): [True: 0, False: 0]
  |  Branch (343:45): [True: 0, False: 0]
  ------------------
  344|       |    /* Not found, check 'http' env vars, also for 'ws'.
  345|       |     * We do NOT try the uppercase version 'HTTP_PROXY' because of
  346|       |     * security reasons:
  347|       |     *
  348|       |     * When curl is used in a webserver application
  349|       |     * environment (cgi or php), this environment variable can
  350|       |     * be controlled by the web server user by setting the
  351|       |     * http header 'Proxy:' to some value.
  352|       |     *
  353|       |     * This can cause 'internal' http/ftp requests to be
  354|       |     * arbitrarily redirected by any external attacker.
  355|       |     */
  356|      0|    env_name = "http_proxy";
  357|      0|    proxy = curl_getenv(env_name);
  358|      0|  }
  359|       |
  360|     10|  if(!proxy) {
  ------------------
  |  Branch (360:6): [True: 10, False: 0]
  ------------------
  361|       |    /* still not found, last resort checks. */
  362|     10|    env_name = "all_proxy";
  363|     10|    proxy = curl_getenv(env_name);
  364|     10|    if(!proxy) {
  ------------------
  |  Branch (364:8): [True: 10, False: 0]
  ------------------
  365|     10|      env_name = "ALL_PROXY";
  366|     10|      proxy = curl_getenv(env_name);
  367|     10|    }
  368|     10|  }
  369|       |
  370|     10|  if(proxy)
  ------------------
  |  Branch (370:6): [True: 0, False: 10]
  ------------------
  371|      0|    infof(data, "Uses proxy env variable %s == '%s'", env_name, proxy);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  372|       |
  373|     10|  return proxy;
  374|     10|}
proxy.c:parse_proxy:
  386|  7.29k|{
  387|  7.29k|  char *proxyuser = NULL;
  388|  7.29k|  char *proxypasswd = NULL;
  389|  7.29k|  char *scheme = NULL;
  390|  7.29k|  CURLcode result = CURLE_OK;
  391|       |  /* Set the start proxy type for URL scheme guessing */
  392|  7.29k|  uint8_t proxytype = for_pre_proxy ? CURLPROXY_SOCKS4 : data->set.proxytype;
  ------------------
  |  |  800|      0|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (392:23): [True: 0, False: 7.29k]
  ------------------
  393|  7.29k|  CURLU *uhp = curl_url();
  394|  7.29k|  CURLUcode uc;
  395|       |
  396|  7.29k|  if(!uhp) {
  ------------------
  |  Branch (396:6): [True: 2, False: 7.29k]
  ------------------
  397|      2|    result = CURLE_OUT_OF_MEMORY;
  398|      2|    goto error;
  399|      2|  }
  400|       |  /* When parsing the proxy, allowing non-supported schemes since we have
  401|       |     these made up ones for proxies. Guess scheme for URLs without it. */
  402|  7.29k|  uc = curl_url_set(uhp, CURLUPART_URL, proxy,
  403|  7.29k|                    CURLU_NON_SUPPORT_SCHEME | CURLU_GUESS_SCHEME);
  ------------------
  |  |   91|  7.29k|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
                                  CURLU_NON_SUPPORT_SCHEME | CURLU_GUESS_SCHEME);
  ------------------
  |  |   97|  7.29k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
  404|  7.29k|  if(!uc) {
  ------------------
  |  Branch (404:6): [True: 7.29k, False: 4]
  ------------------
  405|       |    /* parsed okay as a URL - only update proxytype when scheme was explicit */
  406|  7.29k|    uc = curl_url_get(uhp, CURLUPART_SCHEME, &scheme, CURLU_NO_GUESS_SCHEME);
  ------------------
  |  |  106|  7.29k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
  407|  7.29k|    if(!uc) {
  ------------------
  |  Branch (407:8): [True: 7.28k, False: 2]
  ------------------
  408|  7.28k|      result = Curl_scheme_to_proxytype(data, scheme, &proxytype, proxy);
  409|  7.28k|      if(result)
  ------------------
  |  Branch (409:10): [True: 0, False: 7.28k]
  ------------------
  410|      0|        goto error;
  411|  7.28k|    }
  412|      2|    else if(uc != CURLUE_NO_SCHEME) {
  ------------------
  |  Branch (412:13): [True: 2, False: 0]
  ------------------
  413|      2|      result = CURLE_OUT_OF_MEMORY;
  414|      2|      goto error;
  415|      2|    }
  416|       |    /* else: no explicit scheme, keep the configured proxytype */
  417|  7.29k|  }
  418|      4|  else {
  419|      4|    failf(data, "Unsupported proxy syntax in \'%s\': %s", proxy,
  ------------------
  |  |   62|      4|#define failf Curl_failf
  ------------------
  420|      4|          curl_url_strerror(uc));
  421|      4|    result = CURLE_COULDNT_RESOLVE_PROXY;
  422|      4|    goto error;
  423|      4|  }
  424|       |
  425|  7.28k|  result = Curl_peer_from_proxy_url(uhp, data, proxy, proxytype,
  426|  7.28k|                                    &proxyinfo->peer, &proxytype);
  427|  7.28k|  if(result)
  ------------------
  |  Branch (427:6): [True: 5, False: 7.28k]
  ------------------
  428|      5|    goto error;
  429|       |
  430|  7.28k|  switch(proxytype) {
  431|  7.28k|    case CURLPROXY_HTTP:
  ------------------
  |  |  792|  7.28k|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  |  Branch (431:5): [True: 7.28k, False: 0]
  ------------------
  432|  7.28k|    case CURLPROXY_HTTP_1_0:
  ------------------
  |  |  794|  7.28k|#define CURLPROXY_HTTP_1_0        1L /* force to use CONNECT HTTP/1.0
  ------------------
  |  Branch (432:5): [True: 0, False: 7.28k]
  ------------------
  433|  7.28k|    case CURLPROXY_HTTPS:
  ------------------
  |  |  796|  7.28k|#define CURLPROXY_HTTPS           2L /* HTTPS but stick to HTTP/1
  ------------------
  |  Branch (433:5): [True: 0, False: 7.28k]
  ------------------
  434|  7.28k|    case CURLPROXY_HTTPS2:
  ------------------
  |  |  798|  7.28k|#define CURLPROXY_HTTPS2          3L /* HTTPS and attempt HTTP/2
  ------------------
  |  Branch (434:5): [True: 0, False: 7.28k]
  ------------------
  435|  7.28k|    case CURLPROXY_HTTPS3:
  ------------------
  |  |  807|  7.28k|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (435:5): [True: 0, False: 7.28k]
  ------------------
  436|  7.28k|      if(for_pre_proxy) {
  ------------------
  |  Branch (436:10): [True: 0, False: 7.28k]
  ------------------
  437|      0|        failf(data, "Unsupported pre-proxy type for \'%s\'", proxy);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  438|      0|        result = CURLE_COULDNT_RESOLVE_PROXY;
  439|      0|        goto error;
  440|      0|      }
  441|  7.28k|      break;
  442|  7.28k|    case CURLPROXY_SOCKS4:
  ------------------
  |  |  800|      0|#define CURLPROXY_SOCKS4          4L /* support added in 7.15.2, enum existed
  ------------------
  |  Branch (442:5): [True: 0, False: 7.28k]
  ------------------
  443|      0|    case CURLPROXY_SOCKS4A:
  ------------------
  |  |  803|      0|#define CURLPROXY_SOCKS4A         6L /* added in 7.18.0 */
  ------------------
  |  Branch (443:5): [True: 0, False: 7.28k]
  ------------------
  444|      0|    case CURLPROXY_SOCKS5:
  ------------------
  |  |  802|      0|#define CURLPROXY_SOCKS5          5L /* added in 7.10 */
  ------------------
  |  Branch (444:5): [True: 0, False: 7.28k]
  ------------------
  445|      0|    case CURLPROXY_SOCKS5_HOSTNAME:
  ------------------
  |  |  804|      0|#define CURLPROXY_SOCKS5_HOSTNAME 7L /* Use the SOCKS5 protocol but pass along
  ------------------
  |  Branch (445:5): [True: 0, False: 7.28k]
  ------------------
  446|      0|      break;
  447|      0|    default:
  ------------------
  |  Branch (447:5): [True: 0, False: 7.28k]
  ------------------
  448|      0|      failf(data, "Unsupported proxy type %u for \'%s\'", proxytype, proxy);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  449|      0|      result = CURLE_COULDNT_RESOLVE_PROXY;
  450|      0|      goto error;
  451|  7.28k|  }
  452|       |
  453|       |  /* Is there a username and password given in this proxy URL? */
  454|  7.28k|  uc = curl_url_get(uhp, CURLUPART_USER, &proxyuser, CURLU_URLDECODE);
  ------------------
  |  |   94|  7.28k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
  455|  7.28k|  if(uc && (uc != CURLUE_NO_USER)) {
  ------------------
  |  Branch (455:6): [True: 7.28k, False: 0]
  |  Branch (455:12): [True: 0, False: 7.28k]
  ------------------
  456|      0|    result = Curl_uc_to_curlcode(uc);
  457|      0|    goto error;
  458|      0|  }
  459|  7.28k|  uc = curl_url_get(uhp, CURLUPART_PASSWORD, &proxypasswd, CURLU_URLDECODE);
  ------------------
  |  |   94|  7.28k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
  460|  7.28k|  if(uc && (uc != CURLUE_NO_PASSWORD)) {
  ------------------
  |  Branch (460:6): [True: 7.28k, False: 0]
  |  Branch (460:12): [True: 0, False: 7.28k]
  ------------------
  461|      0|    result = Curl_uc_to_curlcode(uc);
  462|      0|    goto error;
  463|      0|  }
  464|       |
  465|  7.28k|  if(proxyuser || proxypasswd) {
  ------------------
  |  Branch (465:6): [True: 0, False: 7.28k]
  |  Branch (465:19): [True: 0, False: 7.28k]
  ------------------
  466|      0|    result = Curl_creds_create(proxyuser, proxypasswd, NULL, NULL,
  467|      0|                               CURL_EASY_STR(data, STRING_PROXY_SERVICE_NAME),
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  468|      0|                               CREDS_URL, &proxyinfo->creds);
  ------------------
  |  |   31|      0|#define CREDS_URL    1 /* username/passwd from URL */
  ------------------
  469|      0|    if(result)
  ------------------
  |  Branch (469:8): [True: 0, False: 0]
  ------------------
  470|      0|      goto error;
  471|      0|  }
  472|  7.28k|  else if(!for_pre_proxy &&
  ------------------
  |  Branch (472:11): [True: 7.28k, False: 0]
  ------------------
  473|  7.28k|          (CURL_EASY_STR(data, STRING_PROXYUSERNAME) ||
  ------------------
  |  | 1206|  14.5k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 356, False: 6.92k]
  |  |  ------------------
  ------------------
  474|  6.92k|           CURL_EASY_STR(data, STRING_PROXYPASSWORD) ||
  ------------------
  |  | 1206|  14.2k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 6.92k]
  |  |  ------------------
  ------------------
  475|  6.92k|           CURL_EASY_STR(data, STRING_PROXY_SERVICE_NAME))) {
  ------------------
  |  | 1206|  6.92k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 6.92k]
  |  |  ------------------
  ------------------
  476|       |    /* No user/passwd in URL, if this is not a pre-proxy, the
  477|       |     * CURLOPT_PROXY* settings apply. */
  478|    356|    result = Curl_creds_create(CURL_EASY_STR(data, STRING_PROXYUSERNAME),
  ------------------
  |  | 1206|    356|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  479|    356|                               CURL_EASY_STR(data, STRING_PROXYPASSWORD),
  ------------------
  |  | 1206|    356|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  480|    356|                               NULL, NULL,
  481|    356|                               CURL_EASY_STR(data, STRING_PROXY_SERVICE_NAME),
  ------------------
  |  | 1206|    356|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  482|    356|                               CREDS_OPTION, &proxyinfo->creds);
  ------------------
  |  |   32|    356|#define CREDS_OPTION 2 /* username/passwd set with a CURLOPT_ */
  ------------------
  483|    356|  }
  484|  6.92k|  else
  485|  6.92k|    Curl_creds_unlink(&proxyinfo->creds);
  486|       |
  487|  7.28k|  proxyinfo->proxytype = proxytype;
  488|       |
  489|  7.29k|error:
  490|  7.29k|  curlx_free(scheme);
  ------------------
  |  | 1503|  7.29k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  491|  7.29k|  curlx_free(proxyuser);
  ------------------
  |  | 1503|  7.29k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  492|  7.29k|  curlx_free(proxypasswd);
  ------------------
  |  | 1503|  7.29k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  493|  7.29k|  curl_url_cleanup(uhp);
  494|  7.29k|#ifdef DEBUGBUILD
  495|  7.29k|  if(!result) {
  ------------------
  |  Branch (495:6): [True: 7.28k, False: 13]
  ------------------
  496|  7.28k|    DEBUGASSERT(proxyinfo);
  ------------------
  |  | 1016|  7.28k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (496:5): [True: 0, False: 7.28k]
  |  Branch (496:5): [True: 7.28k, False: 0]
  ------------------
  497|  7.28k|    DEBUGASSERT(proxyinfo->peer);
  ------------------
  |  | 1016|  7.28k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (497:5): [True: 0, False: 7.28k]
  |  Branch (497:5): [True: 7.28k, False: 0]
  ------------------
  498|  7.28k|  }
  499|  7.29k|#endif
  500|  7.29k|  return result;
  501|  7.29k|}

Curl_ptrarray_init:
   31|  9.82k|{
   32|       |  pa->data = NULL;
   33|  9.82k|  pa->n = pa->capacity = 0;
   34|  9.82k|}

Curl_rand_bytes:
  144|  24.0k|{
  145|  24.0k|  CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT;
  146|       |#ifndef DEBUGBUILD
  147|       |  const bool env_override = FALSE;
  148|       |#endif
  149|       |
  150|  24.0k|  DEBUGASSERT(num);
  ------------------
  |  | 1016|  24.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (150:3): [True: 0, False: 24.0k]
  |  Branch (150:3): [True: 24.0k, False: 0]
  ------------------
  151|       |
  152|  24.0k|#ifdef USE_SSL
  153|       |  /* get all bytes in one call unless they are forced for testing */
  154|  24.0k|  if(!env_override || !getenv("CURL_ENTROPY"))
  ------------------
  |  Branch (154:6): [True: 2, False: 24.0k]
  |  Branch (154:23): [True: 24.0k, False: 0]
  ------------------
  155|  24.0k|    return Curl_ssl_random(data, rnd, num);
  156|      0|#endif
  157|       |
  158|      0|  while(num) {
  ------------------
  |  Branch (158:9): [True: 0, False: 0]
  ------------------
  159|      0|    unsigned int r;
  160|      0|    size_t left = num < sizeof(unsigned int) ? num : sizeof(unsigned int);
  ------------------
  |  Branch (160:19): [True: 0, False: 0]
  ------------------
  161|       |
  162|      0|    result = randit(data, &r, env_override);
  163|      0|    if(result)
  ------------------
  |  Branch (163:8): [True: 0, False: 0]
  ------------------
  164|      0|      return result;
  165|       |
  166|      0|    while(left) {
  ------------------
  |  Branch (166:11): [True: 0, False: 0]
  ------------------
  167|      0|      *rnd++ = (unsigned char)(r & 0xFF);
  168|      0|      r >>= 8;
  169|      0|      --num;
  170|      0|      --left;
  171|      0|    }
  172|      0|  }
  173|       |
  174|      0|  return result;
  175|      0|}
Curl_rand_alnum:
  215|  2.51k|{
  216|  2.51k|  CURLcode result = CURLE_OK;
  217|  2.51k|  const unsigned int alnumspace = CURL_CSTRLEN(alnum);
  ------------------
  |  | 1319|  2.51k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
  218|  2.51k|  unsigned int r;
  219|  2.51k|  DEBUGASSERT(num > 1);
  ------------------
  |  | 1016|  2.51k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (219:3): [True: 0, False: 2.51k]
  |  Branch (219:3): [True: 2.51k, False: 0]
  ------------------
  220|       |
  221|  2.51k|  num--; /* save one for null-termination */
  222|       |
  223|  57.9k|  while(num) {
  ------------------
  |  Branch (223:9): [True: 55.3k, False: 2.51k]
  ------------------
  224|  55.3k|    do {
  225|  55.3k|      result = randit(data, &r, TRUE);
  ------------------
  |  |  986|  55.3k|#define TRUE true
  ------------------
  226|  55.3k|      if(result)
  ------------------
  |  Branch (226:10): [True: 0, False: 55.3k]
  ------------------
  227|      0|        return result;
  228|  55.3k|    } while(r >= (UINT_MAX - UINT_MAX % alnumspace));
  ------------------
  |  Branch (228:13): [True: 0, False: 55.3k]
  ------------------
  229|       |
  230|  55.3k|    *rnd++ = (unsigned char)alnum[r % alnumspace];
  231|  55.3k|    num--;
  232|  55.3k|  }
  233|  2.51k|  *rnd = 0;
  234|       |
  235|  2.51k|  return result;
  236|  2.51k|}
rand.c:randit:
   89|  55.3k|{
   90|  55.3k|#ifdef DEBUGBUILD
   91|  55.3k|  if(env_override) {
  ------------------
  |  Branch (91:6): [True: 55.3k, False: 0]
  ------------------
   92|  55.3k|    char *force_entropy = getenv("CURL_ENTROPY");
   93|  55.3k|    if(force_entropy) {
  ------------------
  |  Branch (93:8): [True: 0, False: 55.3k]
  ------------------
   94|      0|      static unsigned int randseed;
   95|      0|      static bool seeded = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
   96|       |
   97|      0|      if(!seeded) {
  ------------------
  |  Branch (97:10): [True: 0, False: 0]
  ------------------
   98|      0|        unsigned int seed = 0;
   99|      0|        size_t elen = strlen(force_entropy);
  100|      0|        size_t clen = sizeof(seed);
  101|      0|        size_t min = elen < clen ? elen : clen;
  ------------------
  |  Branch (101:22): [True: 0, False: 0]
  ------------------
  102|      0|        memcpy((char *)&seed, force_entropy, min);
  103|      0|        randseed = ntohl(seed);
  104|      0|        seeded = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  105|      0|      }
  106|      0|      else
  107|      0|        randseed++;
  108|      0|      *rnd = randseed;
  109|      0|      return CURLE_OK;
  110|      0|    }
  111|  55.3k|  }
  112|       |#else
  113|       |  (void)env_override;
  114|       |#endif
  115|       |
  116|       |  /* data may be NULL! */
  117|  55.3k|#ifdef USE_SSL
  118|  55.3k|  return Curl_ssl_random(data, (unsigned char *)rnd, sizeof(*rnd));
  119|       |#else
  120|       |  return weak_random(data, (unsigned char *)rnd, sizeof(*rnd));
  121|       |#endif
  122|  55.3k|}

Curl_rlimit_change:
  156|    262|{
  157|    262|  DEBUGASSERT(rate_per_sec >= 0);
  ------------------
  |  | 1016|    262|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (157:3): [True: 0, False: 262]
  |  Branch (157:3): [True: 262, False: 0]
  ------------------
  158|    262|  DEBUGASSERT(burst_per_sec >= rate_per_sec || !burst_per_sec);
  ------------------
  |  | 1016|    262|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (158:3): [True: 262, False: 0]
  |  Branch (158:3): [True: 0, False: 0]
  |  Branch (158:3): [True: 262, False: 0]
  |  Branch (158:3): [True: 0, False: 0]
  ------------------
  159|    262|  r->rate_per_step = r->rate_per_sec = rate_per_sec;
  160|    262|  r->burst_per_step = r->burst_per_sec = burst_per_sec;
  161|    262|  r->step_us = CURL_US_PER_SEC;
  ------------------
  |  |   30|    262|#define CURL_US_PER_SEC         1000000
  ------------------
  162|    262|  r->spare_us = 0;
  163|    262|  if(r->tokens > r->rate_per_step)
  ------------------
  |  Branch (163:6): [True: 0, False: 262]
  ------------------
  164|      0|    r->tokens = r->rate_per_step;
  165|       |  /* ts and blocked stay as they are, a paused transfer stays paused */
  166|    262|}
Curl_rlimit_start:
  170|  20.3k|{
  171|       |  /* A start always resets the values to initial defaults, then
  172|       |   * fine tunes the intervals for the total_tokens expected. */
  173|  20.3k|  r->rate_per_step = r->rate_per_sec;
  174|  20.3k|  r->burst_per_step = r->burst_per_sec;
  175|  20.3k|  r->step_us = CURL_US_PER_SEC;
  ------------------
  |  |   30|  20.3k|#define CURL_US_PER_SEC         1000000
  ------------------
  176|  20.3k|  r->spare_us = 0;
  177|  20.3k|  r->tokens = r->rate_per_step;
  178|  20.3k|  r->ts = *pts;
  179|  20.3k|  rlimit_tune_steps(r, total_tokens);
  180|  20.3k|}
Curl_rlimit_active:
  188|  58.6k|{
  189|  58.6k|  return (r->rate_per_step > 0) || r->blocked;
  ------------------
  |  Branch (189:10): [True: 205, False: 58.4k]
  |  Branch (189:36): [True: 0, False: 58.4k]
  ------------------
  190|  58.6k|}
Curl_rlimit_is_blocked:
  193|   216k|{
  194|   216k|  return (bool)r->blocked;
  195|   216k|}
Curl_rlimit_avail:
  199|  17.0k|{
  200|  17.0k|  struct curltime ts;
  201|       |
  202|  17.0k|  if(r->blocked)
  ------------------
  |  Branch (202:6): [True: 0, False: 17.0k]
  ------------------
  203|      0|    return 0;
  204|  17.0k|  else if(r->rate_per_step) {
  ------------------
  |  Branch (204:11): [True: 94, False: 16.9k]
  ------------------
  205|     94|    if(!pts) {
  ------------------
  |  Branch (205:8): [True: 94, False: 0]
  ------------------
  206|     94|      curlx_pnow(&ts);
  207|     94|      pts = &ts;
  208|     94|    }
  209|     94|    rlimit_update(r, pts);
  210|     94|    return r->tokens;
  211|     94|  }
  212|  16.9k|  else
  213|  16.9k|    return INT64_MAX;
  214|  17.0k|}
Curl_rlimit_drain:
  218|    723|{
  219|    723|  struct curltime ts;
  220|       |
  221|    723|  if(r->blocked || !r->rate_per_step)
  ------------------
  |  Branch (221:6): [True: 0, False: 723]
  |  Branch (221:20): [True: 723, False: 0]
  ------------------
  222|    723|    return;
  223|       |
  224|      0|  if(!pts) {
  ------------------
  |  Branch (224:6): [True: 0, False: 0]
  ------------------
  225|      0|    curlx_pnow(&ts);
  226|      0|    pts = &ts;
  227|      0|  }
  228|      0|  rlimit_update(r, pts);
  229|      0|#if 8 <= SIZEOF_SIZE_T
  230|      0|  if(tokens > INT64_MAX) {
  ------------------
  |  Branch (230:6): [True: 0, False: 0]
  ------------------
  231|      0|    r->tokens = INT64_MAX;
  232|      0|  }
  233|      0|  else
  234|      0|#endif
  235|      0|  {
  236|      0|    int64_t val = (int64_t)tokens;
  237|      0|    if((INT64_MIN + val) < r->tokens)
  ------------------
  |  Branch (237:8): [True: 0, False: 0]
  ------------------
  238|      0|      r->tokens -= val;
  239|      0|    else
  240|      0|      r->tokens = INT64_MIN;
  241|      0|  }
  242|      0|}
Curl_rlimit_wait_ms:
  246|    188|{
  247|    188|  timediff_t wait_us, elapsed_us;
  248|       |
  249|    188|  if(r->blocked || !r->rate_per_step)
  ------------------
  |  Branch (249:6): [True: 0, False: 188]
  |  Branch (249:20): [True: 94, False: 94]
  ------------------
  250|     94|    return 0;
  251|     94|  rlimit_update(r, pts);
  252|     94|  if(r->tokens > 0)
  ------------------
  |  Branch (252:6): [True: 94, False: 0]
  ------------------
  253|     94|    return 0;
  254|       |
  255|       |  /* How much time will it take tokens to become positive again?
  256|       |   * Deduct `spare_us` and check against already elapsed time */
  257|      0|  wait_us = r->step_us - r->spare_us;
  258|      0|  if(r->tokens < 0) {
  ------------------
  |  Branch (258:6): [True: 0, False: 0]
  ------------------
  259|      0|    curl_off_t debt_pct = ((-r->tokens) * 100 / r->rate_per_step);
  260|      0|    if(debt_pct)
  ------------------
  |  Branch (260:8): [True: 0, False: 0]
  ------------------
  261|      0|      wait_us += (r->step_us * debt_pct / 100);
  262|      0|  }
  263|       |
  264|      0|  elapsed_us = curlx_ptimediff_us(pts, &r->ts);
  265|      0|  if(elapsed_us >= wait_us)
  ------------------
  |  Branch (265:6): [True: 0, False: 0]
  ------------------
  266|      0|    return 0;
  267|      0|  wait_us -= elapsed_us;
  268|      0|  return (wait_us + 999) / 1000; /* in milliseconds */
  269|      0|}
Curl_rlimit_next_step_ms:
  273|    188|{
  274|    188|  if(!r->blocked && r->rate_per_step) {
  ------------------
  |  Branch (274:6): [True: 188, False: 0]
  |  Branch (274:21): [True: 94, False: 94]
  ------------------
  275|     94|    timediff_t elapsed_us, next_us;
  276|       |
  277|     94|    elapsed_us = curlx_ptimediff_us(pts, &r->ts) + r->spare_us;
  278|     94|    if(r->step_us > elapsed_us) {
  ------------------
  |  Branch (278:8): [True: 94, False: 0]
  ------------------
  279|     94|      next_us = r->step_us - elapsed_us;
  280|     94|      return (next_us + 999) / 1000; /* in milliseconds */
  281|     94|    }
  282|     94|  }
  283|     94|  return 0;
  284|    188|}
Curl_rlimit_block:
  289|  19.3k|{
  290|  19.3k|  if(!activate == !r->blocked)
  ------------------
  |  Branch (290:6): [True: 19.3k, False: 0]
  ------------------
  291|  19.3k|    return;
  292|       |
  293|      0|  r->ts = *pts;
  294|      0|  r->blocked = activate;
  295|      0|  if(!r->blocked) {
  ------------------
  |  Branch (295:6): [True: 0, False: 0]
  ------------------
  296|       |    /* Start rate limiting fresh. The amount of time this was blocked
  297|       |     * does not generate extra tokens. */
  298|      0|    Curl_rlimit_start(r, pts, -1);
  299|      0|  }
  300|      0|  else {
  301|      0|    r->tokens = 0;
  302|      0|  }
  303|      0|}
ratelimit.c:rlimit_tune_steps:
   78|  20.3k|{
   79|  20.3k|  int64_t tokens_last, tokens_main, msteps;
   80|       |
   81|       |  /* Tune the ratelimit at the start *if* we know how many tokens
   82|       |   * are expected to be consumed in total.
   83|       |   * The reason for tuning is that rlimit provides tokens to be consumed
   84|       |   * per "step" which starts out to be a second. The tokens may be consumed
   85|       |   * in full at the beginning of a step. The remainder of the second will
   86|       |   * have no tokens available, effectively blocking the consumption and
   87|       |   * so keeping the "step average" in line.
   88|       |   * This works will up to the last step. When no more tokens are needed,
   89|       |   * no wait will happen and the last step would be too fast. This is
   90|       |   * especially noticeable when only a few steps are needed.
   91|       |   *
   92|       |   * Example: downloading 1.5kb with a ratelimit of 1k could be done in
   93|       |   * roughly 1 second (1k in the first second and the 0.5 at the start of
   94|       |   * the second one).
   95|       |   *
   96|       |   * The tuning tries to make the last step small, using only
   97|       |   * 1 percent of the total tokens (at least 1). The rest of the tokens
   98|       |   * are to be consumed in the steps before by adjusting the duration of
   99|       |   * the step and the amount of tokens it provides. */
  100|  20.3k|  if(!r->rate_per_step ||
  ------------------
  |  Branch (100:6): [True: 20.2k, False: 47]
  ------------------
  101|     47|     (tokens_total <= 1) ||
  ------------------
  |  Branch (101:6): [True: 47, False: 0]
  ------------------
  102|      0|     (tokens_total > (INT64_MAX / 1000)))
  ------------------
  |  Branch (102:6): [True: 0, False: 0]
  ------------------
  103|  20.3k|    return;
  104|       |
  105|       |  /* Calculate tokens for the last step and the ones before. */
  106|      0|  tokens_last = tokens_total / 100;
  107|      0|  if(!tokens_last) /* less than 100 total, use 1 */
  ------------------
  |  Branch (107:6): [True: 0, False: 0]
  ------------------
  108|      0|    tokens_last = 1;
  109|      0|  else if(tokens_last > CURL_RLIMIT_MIN_RATE)
  ------------------
  |  |   29|      0|#define CURL_RLIMIT_MIN_RATE    (4 * 1024)  /* minimum step rate */
  ------------------
  |  Branch (109:11): [True: 0, False: 0]
  ------------------
  110|      0|    tokens_last = CURL_RLIMIT_MIN_RATE;
  ------------------
  |  |   29|      0|#define CURL_RLIMIT_MIN_RATE    (4 * 1024)  /* minimum step rate */
  ------------------
  111|      0|  DEBUGASSERT(tokens_last);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (111:3): [True: 0, False: 0]
  |  Branch (111:3): [True: 0, False: 0]
  ------------------
  112|      0|  tokens_main = tokens_total - tokens_last;
  113|      0|  DEBUGASSERT(tokens_main);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (113:3): [True: 0, False: 0]
  |  Branch (113:3): [True: 0, False: 0]
  ------------------
  114|       |
  115|       |  /* how many milli-steps will it take to consume those, give the
  116|       |  * original rate limit per second? */
  117|      0|  DEBUGASSERT(r->step_us == CURL_US_PER_SEC);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (117:3): [True: 0, False: 0]
  |  Branch (117:3): [True: 0, False: 0]
  ------------------
  118|       |
  119|      0|  msteps = (tokens_main * 1000 / r->rate_per_step);
  120|      0|  if(msteps < CURL_RLIMIT_STEP_MIN_MS) {
  ------------------
  |  |   30|      0|#define CURL_RLIMIT_STEP_MIN_MS 2  /* minimum step duration */
  ------------------
  |  Branch (120:6): [True: 0, False: 0]
  ------------------
  121|       |    /* Steps this small will not work. Do not tune. */
  122|      0|    return;
  123|      0|  }
  124|      0|  else if(msteps < 1000) {
  ------------------
  |  Branch (124:11): [True: 0, False: 0]
  ------------------
  125|       |    /* It needs less than one step to provide the needed tokens.
  126|       |     * Make it exactly that long and with exactly those tokens. */
  127|      0|    r->step_us = (timediff_t)msteps * 1000;
  128|      0|    r->rate_per_step = tokens_main;
  129|      0|    r->tokens = r->rate_per_step;
  130|      0|  }
  131|      0|  else {
  132|       |    /* More than 1 step. Spread the remainder milli steps and
  133|       |     * the tokens they need to provide across all steps. If integer
  134|       |     * arithmetic can do it. */
  135|      0|    curl_off_t ms_unaccounted = (msteps % 1000);
  136|      0|    curl_off_t mstep_inc = (ms_unaccounted / (msteps / 1000));
  137|      0|    if(mstep_inc) {
  ------------------
  |  Branch (137:8): [True: 0, False: 0]
  ------------------
  138|      0|      curl_off_t rate_inc = ((r->rate_per_step * mstep_inc) / 1000);
  139|      0|      if(rate_inc) {
  ------------------
  |  Branch (139:10): [True: 0, False: 0]
  ------------------
  140|      0|        r->step_us = CURL_US_PER_SEC + ((timediff_t)mstep_inc * 1000);
  ------------------
  |  |   30|      0|#define CURL_US_PER_SEC         1000000
  ------------------
  141|      0|        r->rate_per_step += rate_inc;
  142|      0|        r->tokens = r->rate_per_step;
  143|      0|        if(r->burst_per_step) {
  ------------------
  |  Branch (143:12): [True: 0, False: 0]
  ------------------
  144|      0|          curl_off_t burst_inc = ((r->burst_per_step * mstep_inc) / 1000);
  145|      0|          if(burst_inc)
  ------------------
  |  Branch (145:14): [True: 0, False: 0]
  ------------------
  146|      0|            r->burst_per_step += burst_inc;
  147|      0|        }
  148|      0|      }
  149|      0|    }
  150|      0|  }
  151|      0|}
ratelimit.c:rlimit_update:
   34|    188|{
   35|    188|  timediff_t elapsed_us, elapsed_steps;
   36|    188|  int64_t token_gain;
   37|       |
   38|    188|  DEBUGASSERT(r->rate_per_step);
  ------------------
  |  | 1016|    188|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (38:3): [True: 0, False: 188]
  |  Branch (38:3): [True: 188, False: 0]
  ------------------
   39|    188|  if((r->ts.tv_sec == pts->tv_sec) && (r->ts.tv_usec == pts->tv_usec))
  ------------------
  |  Branch (39:6): [True: 188, False: 0]
  |  Branch (39:39): [True: 0, False: 188]
  ------------------
   40|      0|    return;
   41|       |
   42|    188|  elapsed_us = curlx_ptimediff_us(pts, &r->ts);
   43|    188|  if(elapsed_us < 0) { /* not going back in time */
  ------------------
  |  Branch (43:6): [True: 0, False: 188]
  ------------------
   44|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (44:5): [Folded, False: 0]
  |  Branch (44:5): [Folded, False: 0]
  ------------------
   45|      0|    return;
   46|      0|  }
   47|       |
   48|    188|  elapsed_us += r->spare_us;
   49|    188|  if(elapsed_us < r->step_us)
  ------------------
  |  Branch (49:6): [True: 188, False: 0]
  ------------------
   50|    188|    return;
   51|       |
   52|       |  /* we do the update */
   53|      0|  r->ts = *pts;
   54|      0|  elapsed_steps = elapsed_us / r->step_us;
   55|      0|  r->spare_us = elapsed_us % r->step_us;
   56|       |
   57|       |  /* How many tokens did we gain since the last update? */
   58|      0|  if(r->rate_per_step > (INT64_MAX / elapsed_steps))
  ------------------
  |  Branch (58:6): [True: 0, False: 0]
  ------------------
   59|      0|    token_gain = INT64_MAX;
   60|      0|  else {
   61|      0|    token_gain = r->rate_per_step * elapsed_steps;
   62|      0|  }
   63|       |
   64|      0|  if((INT64_MAX - token_gain) > r->tokens)
  ------------------
  |  Branch (64:6): [True: 0, False: 0]
  ------------------
   65|      0|    r->tokens += token_gain;
   66|      0|  else
   67|      0|    r->tokens = INT64_MAX;
   68|       |
   69|       |  /* Limit the token again by the burst rate (if set), so we
   70|       |   * do not suddenly have a huge number of tokens after inactivity. */
   71|      0|  if(r->burst_per_step && (r->tokens > r->burst_per_step)) {
  ------------------
  |  Branch (71:6): [True: 0, False: 0]
  |  Branch (71:27): [True: 0, False: 0]
  ------------------
   72|      0|    r->tokens = r->burst_per_step;
   73|      0|  }
   74|      0|}

Curl_req_init:
   38|  19.7k|{
   39|  19.7k|  memset(req, 0, sizeof(*req));
   40|  19.7k|}
Curl_req_soft_reset:
   44|  10.7k|{
   45|  10.7k|  CURLcode result;
   46|       |
   47|  10.7k|  req->done = FALSE;
  ------------------
  |  |  989|  10.7k|#define FALSE false
  ------------------
   48|  10.7k|  req->upload_done = FALSE;
  ------------------
  |  |  989|  10.7k|#define FALSE false
  ------------------
   49|  10.7k|  req->upload_aborted = FALSE;
  ------------------
  |  |  989|  10.7k|#define FALSE false
  ------------------
   50|  10.7k|  req->download_done = FALSE;
  ------------------
  |  |  989|  10.7k|#define FALSE false
  ------------------
   51|  10.7k|  req->eos_written = FALSE;
  ------------------
  |  |  989|  10.7k|#define FALSE false
  ------------------
   52|  10.7k|  req->eos_read = FALSE;
  ------------------
  |  |  989|  10.7k|#define FALSE false
  ------------------
   53|  10.7k|  req->eos_sent = FALSE;
  ------------------
  |  |  989|  10.7k|#define FALSE false
  ------------------
   54|  10.7k|  req->refused_stream = FALSE;
  ------------------
  |  |  989|  10.7k|#define FALSE false
  ------------------
   55|  10.7k|  req->ignorebody = FALSE;
  ------------------
  |  |  989|  10.7k|#define FALSE false
  ------------------
   56|  10.7k|  req->bytecount = 0;
   57|  10.7k|  req->writebytecount = 0;
   58|  10.7k|  req->header = FALSE;
  ------------------
  |  |  989|  10.7k|#define FALSE false
  ------------------
   59|  10.7k|  req->headerline = 0;
   60|  10.7k|  req->headerbytecount = 0;
   61|  10.7k|  req->allheadercount = 0;
   62|  10.7k|  req->deductheadercount = 0;
   63|  10.7k|  req->httpversion_sent = 0;
   64|  10.7k|  req->httpversion = 0;
   65|  10.7k|  req->sendbuf_hds_len = 0;
   66|       |
   67|  10.7k|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1359|  10.7k|  do {                      \
  |  | 1360|  10.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  10.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  10.7k|    (ptr) = NULL;           \
  |  | 1362|  10.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 10.7k]
  |  |  ------------------
  ------------------
   68|  10.7k|#ifndef CURL_DISABLE_PROXY
   69|  10.7k|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1359|  10.7k|  do {                      \
  |  | 1360|  10.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  10.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  10.7k|    (ptr) = NULL;           \
  |  | 1362|  10.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 10.7k]
  |  |  ------------------
  ------------------
   70|  10.7k|#endif
   71|       |
   72|  10.7k|  result = Curl_client_start(data);
   73|  10.7k|  if(result)
  ------------------
  |  Branch (73:6): [True: 0, False: 10.7k]
  ------------------
   74|      0|    return result;
   75|       |
   76|  10.7k|  if(!req->sendbuf_init) {
  ------------------
  |  Branch (76:6): [True: 9.39k, False: 1.38k]
  ------------------
   77|  9.39k|    Curl_bufq_init2(&req->sendbuf, data->set.upload_buffer_size, 1,
   78|  9.39k|                    BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|  9.39k|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
   79|  9.39k|    req->sendbuf_init = TRUE;
  ------------------
  |  |  986|  9.39k|#define TRUE true
  ------------------
   80|  9.39k|  }
   81|  1.38k|  else {
   82|  1.38k|    Curl_bufq_reset(&req->sendbuf);
   83|  1.38k|    if(data->set.upload_buffer_size != req->sendbuf.chunk_size) {
  ------------------
  |  Branch (83:8): [True: 0, False: 1.38k]
  ------------------
   84|      0|      Curl_bufq_free(&req->sendbuf);
   85|      0|      Curl_bufq_init2(&req->sendbuf, data->set.upload_buffer_size, 1,
   86|      0|                      BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|      0|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
   87|      0|    }
   88|  1.38k|  }
   89|       |
   90|  10.7k|  return CURLE_OK;
   91|  10.7k|}
Curl_req_start:
   95|  9.39k|{
   96|  9.39k|  req->start = *Curl_pgrs_now(data);
   97|  9.39k|  return Curl_req_soft_reset(req, data);
   98|  9.39k|}
Curl_req_done:
  104|  2.22k|{
  105|  2.22k|  (void)req;
  106|  2.22k|  if(!aborted)
  ------------------
  |  Branch (106:6): [True: 533, False: 1.69k]
  ------------------
  107|    533|    (void)req_flush(data);
  108|  2.22k|  Curl_client_reset(data);
  109|  2.22k|  return CURLE_OK;
  110|  2.22k|}
Curl_req_hard_reset:
  113|  9.66k|{
  114|  9.66k|  struct curltime t0 = { 0, 0 };
  115|       |
  116|  9.66k|  curlx_safefree(req->newurl);
  ------------------
  |  | 1359|  9.66k|  do {                      \
  |  | 1360|  9.66k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.66k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.66k|    (ptr) = NULL;           \
  |  | 1362|  9.66k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.66k]
  |  |  ------------------
  ------------------
  117|  9.66k|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1359|  9.66k|  do {                      \
  |  | 1360|  9.66k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.66k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.66k|    (ptr) = NULL;           \
  |  | 1362|  9.66k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.66k]
  |  |  ------------------
  ------------------
  118|  9.66k|#ifndef CURL_DISABLE_PROXY
  119|  9.66k|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1359|  9.66k|  do {                      \
  |  | 1360|  9.66k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.66k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.66k|    (ptr) = NULL;           \
  |  | 1362|  9.66k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.66k]
  |  |  ------------------
  ------------------
  120|  9.66k|#endif
  121|  9.66k|#ifndef CURL_DISABLE_COOKIES
  122|  9.66k|  curlx_safefree(req->cookiehost);
  ------------------
  |  | 1359|  9.66k|  do {                      \
  |  | 1360|  9.66k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.66k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.66k|    (ptr) = NULL;           \
  |  | 1362|  9.66k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.66k]
  |  |  ------------------
  ------------------
  123|  9.66k|#endif
  124|  9.66k|  Curl_client_reset(data);
  125|  9.66k|  if(req->sendbuf_init)
  ------------------
  |  Branch (125:6): [True: 0, False: 9.66k]
  ------------------
  126|      0|    Curl_bufq_reset(&req->sendbuf);
  127|       |
  128|       |  /* clear any resolve data */
  129|  9.66k|  Curl_resolv_destroy_all(data);
  130|       |  /* Can no longer memset() this struct as we need to keep some state */
  131|  9.66k|  req->size = -1;
  132|  9.66k|  req->maxdownload = -1;
  133|  9.66k|  req->bytecount = 0;
  134|  9.66k|  req->writebytecount = 0;
  135|  9.66k|  req->start = t0;
  136|  9.66k|  req->headerbytecount = 0;
  137|  9.66k|  req->allheadercount = 0;
  138|  9.66k|  req->deductheadercount = 0;
  139|  9.66k|  req->headerline = 0;
  140|  9.66k|  req->offset = 0;
  141|  9.66k|  req->httpcode = 0;
  142|  9.66k|  req->io_flags = 0;
  143|  9.66k|  req->upgr101 = UPGR101_NONE;
  144|  9.66k|  req->sendbuf_hds_len = 0;
  145|  9.66k|  req->timeofdoc = 0;
  146|  9.66k|  req->location = NULL;
  147|  9.66k|  req->newurl = NULL;
  148|  9.66k|#ifndef CURL_DISABLE_COOKIES
  149|  9.66k|  req->setcookies = 0;
  150|  9.66k|#endif
  151|  9.66k|  req->header = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  152|  9.66k|  req->content_range = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  153|  9.66k|  req->download_done = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  154|  9.66k|  req->eos_written = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  155|  9.66k|  req->eos_read = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  156|  9.66k|  req->eos_sent = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  157|  9.66k|  req->refused_stream = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  158|  9.66k|  req->rewind_read = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  159|  9.66k|  req->upload_done = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  160|  9.66k|  req->upload_aborted = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  161|  9.66k|  req->ignorebody = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  162|  9.66k|  req->http_bodyless = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  163|  9.66k|  req->chunk = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  164|  9.66k|  req->resp_trailer = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  165|  9.66k|  req->ignore_cl = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  166|  9.66k|  req->upload_chunky = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  167|  9.66k|  req->no_body = data->set.opt_no_body;
  168|  9.66k|  req->authneg = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  169|       |  /* Unpause all directions */
  170|  9.66k|  Curl_rlimit_block(&data->progress.dl.rlimit, FALSE, &t0);
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  171|       |  Curl_rlimit_block(&data->progress.ul.rlimit, FALSE, &t0);
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
  172|  9.66k|}
Curl_req_free:
  175|  19.7k|{
  176|  19.7k|  curlx_safefree(req->newurl);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  177|  19.7k|  curlx_safefree(req->hd_auth);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  178|  19.7k|#ifndef CURL_DISABLE_PROXY
  179|  19.7k|  curlx_safefree(req->hd_proxy_auth);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  180|  19.7k|#endif
  181|  19.7k|  if(req->sendbuf_init)
  ------------------
  |  Branch (181:6): [True: 9.39k, False: 10.3k]
  ------------------
  182|  9.39k|    Curl_bufq_free(&req->sendbuf);
  183|  19.7k|  Curl_client_cleanup(data);
  184|  19.7k|}
Curl_req_send:
  376|  1.94k|{
  377|  1.94k|  CURLcode result = CURLE_OK;
  378|  1.94k|  const char *buf;
  379|  1.94k|  size_t blen, nwritten;
  380|       |
  381|  1.94k|  if(!data || !data->conn)
  ------------------
  |  Branch (381:6): [True: 0, False: 1.94k]
  |  Branch (381:15): [True: 0, False: 1.94k]
  ------------------
  382|      0|    return CURLE_FAILED_INIT;
  383|       |
  384|  1.94k|  data->req.httpversion_sent = httpversion;
  385|  1.94k|  buf = curlx_dyn_ptr(req);
  386|  1.94k|  blen = curlx_dyn_len(req);
  387|       |  /* if the sendbuf is empty and the request without body and
  388|       |   * the length to send fits info a sendbuf chunk, we send it directly.
  389|       |   * If `blen` is larger than `chunk_size`, we can not. Because we
  390|       |   * might have to retry a blocked send later from sendbuf and that
  391|       |   * would result in retry sends with a shrunken length. That is trouble. */
  392|  1.94k|  if(Curl_bufq_is_empty(&data->req.sendbuf) &&
  ------------------
  |  Branch (392:6): [True: 1.94k, False: 0]
  ------------------
  393|  1.94k|     !Curl_creader_total_length(data) &&
  ------------------
  |  Branch (393:6): [True: 1.51k, False: 427]
  ------------------
  394|  1.51k|     (blen <= data->req.sendbuf.chunk_size)) {
  ------------------
  |  Branch (394:6): [True: 1.51k, False: 1]
  ------------------
  395|  1.51k|    data->req.eos_read = TRUE;
  ------------------
  |  |  986|  1.51k|#define TRUE true
  ------------------
  396|  1.51k|    result = xfer_send(data, buf, blen, blen, &nwritten);
  397|  1.51k|    if(result) {
  ------------------
  |  Branch (397:8): [True: 14, False: 1.50k]
  ------------------
  398|     14|      if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (398:10): [True: 0, False: 14]
  ------------------
  399|      0|        nwritten = 0;
  400|      0|        result = CURLE_OK;
  401|      0|      }
  402|     14|      else
  403|     14|        goto out;
  404|     14|    }
  405|  1.50k|    buf += nwritten;
  406|  1.50k|    blen -= nwritten;
  407|  1.50k|    if(!blen) {
  ------------------
  |  Branch (407:8): [True: 1.50k, False: 0]
  ------------------
  408|  1.50k|      result = req_set_upload_done(data);
  409|  1.50k|      if(result)
  ------------------
  |  Branch (409:10): [True: 0, False: 1.50k]
  ------------------
  410|      0|        goto out;
  411|  1.50k|    }
  412|  1.50k|  }
  413|       |
  414|  1.93k|  if(blen) {
  ------------------
  |  Branch (414:6): [True: 428, False: 1.50k]
  ------------------
  415|       |    /* Either we have a request body, or we could not send the complete
  416|       |     * request in one go. Buffer the remainder and try to add as much
  417|       |     * body bytes as room is left in the buffer. Then flush. */
  418|    428|    result = req_send_buffer_add(data, buf, blen, blen);
  419|    428|    if(!result)
  ------------------
  |  Branch (419:8): [True: 428, False: 0]
  ------------------
  420|    428|      result = Curl_req_send_more(data);
  421|    428|  }
  422|       |
  423|  1.94k|out:
  424|  1.94k|  return result;
  425|  1.93k|}
Curl_req_sendbuf_empty:
  428|  16.0k|{
  429|  16.0k|  return !data->req.sendbuf_init || Curl_bufq_is_empty(&data->req.sendbuf);
  ------------------
  |  Branch (429:10): [True: 0, False: 16.0k]
  |  Branch (429:37): [True: 16.0k, False: 0]
  ------------------
  430|  16.0k|}
Curl_req_want_send:
  433|  17.5k|{
  434|       |  /* Not done and upload not blocked and either one of
  435|       |   * - REQ_IO_SEND
  436|       |   * - request has buffered data to send
  437|       |   * - connection has pending data to send */
  438|  17.5k|  return !data->req.done &&
  ------------------
  |  Branch (438:10): [True: 17.5k, False: 0]
  ------------------
  439|  17.5k|         !Curl_rlimit_is_blocked(&data->progress.ul.rlimit) &&
  ------------------
  |  Branch (439:10): [True: 17.5k, False: 0]
  ------------------
  440|  17.5k|         (CURL_REQ_WANT_SEND(data) ||
  ------------------
  |  |   39|  35.1k|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  17.5k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 1.56k, False: 16.0k]
  |  |  ------------------
  ------------------
  441|  16.0k|          !Curl_req_sendbuf_empty(data) ||
  ------------------
  |  Branch (441:11): [True: 0, False: 16.0k]
  ------------------
  442|  16.0k|          Curl_xfer_needs_flush(data));
  ------------------
  |  Branch (442:11): [True: 0, False: 16.0k]
  ------------------
  443|  17.5k|}
Curl_req_done_sending:
  454|  1.64k|{
  455|  1.64k|  return data->req.upload_done && !Curl_req_want_send(data);
  ------------------
  |  Branch (455:10): [True: 1, False: 1.64k]
  |  Branch (455:35): [True: 1, False: 0]
  ------------------
  456|  1.64k|}
Curl_req_send_more:
  459|  1.25k|{
  460|  1.25k|  CURLcode result;
  461|       |
  462|       |  /* Fill our send buffer if more from client can be read. */
  463|  1.25k|  if(!data->req.upload_aborted &&
  ------------------
  |  Branch (463:6): [True: 1.25k, False: 0]
  ------------------
  464|  1.25k|     !data->req.eos_read &&
  ------------------
  |  Branch (464:6): [True: 1.21k, False: 33]
  ------------------
  465|  1.21k|     !Curl_xfer_send_is_paused(data) &&
  ------------------
  |  Branch (465:6): [True: 1.21k, False: 0]
  ------------------
  466|  1.21k|     !Curl_bufq_is_full(&data->req.sendbuf)) {
  ------------------
  |  Branch (466:6): [True: 1.20k, False: 8]
  ------------------
  467|  1.20k|    size_t nread;
  468|  1.20k|    result = Curl_bufq_sipn(&data->req.sendbuf, 0,
  469|  1.20k|                            add_from_client, data, &nread);
  470|  1.20k|    if(result && result != CURLE_AGAIN)
  ------------------
  |  Branch (470:8): [True: 533, False: 676]
  |  Branch (470:18): [True: 22, False: 511]
  ------------------
  471|     22|      return result;
  472|  1.20k|  }
  473|       |
  474|  1.22k|  result = req_flush(data);
  475|  1.22k|  if(result == CURLE_AGAIN)
  ------------------
  |  Branch (475:6): [True: 56, False: 1.17k]
  ------------------
  476|     56|    result = CURLE_OK;
  477|       |
  478|  1.22k|  return result;
  479|  1.25k|}
Curl_req_stop_send_recv:
  493|    533|{
  494|       |  /* stop receiving and ALL sending as well, including PAUSE and HOLD.
  495|       |   * We might still be paused on receive client writes though, so
  496|       |   * keep those bits around. */
  497|    533|  CURLcode result = CURLE_OK;
  498|    533|  if(CURL_REQ_WANT_SEND(data))
  ------------------
  |  |   39|    533|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|    533|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 0, False: 533]
  |  |  ------------------
  ------------------
  499|      0|    result = Curl_req_abort_sending(data);
  500|    533|  CURL_REQ_CLEAR_IO(data);
  ------------------
  |  |   51|    533|  ((d)->req.io_flags &= (uint8_t)~(REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   35|    533|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |                 ((d)->req.io_flags &= (uint8_t)~(REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   36|    533|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  501|    533|  return result;
  502|    533|}
request.c:req_flush:
  308|  1.76k|{
  309|  1.76k|  CURLcode result;
  310|       |
  311|  1.76k|  if(!data || !data->conn)
  ------------------
  |  Branch (311:6): [True: 0, False: 1.76k]
  |  Branch (311:15): [True: 0, False: 1.76k]
  ------------------
  312|      0|    return CURLE_FAILED_INIT;
  313|       |
  314|  1.76k|  if(!Curl_bufq_is_empty(&data->req.sendbuf)) {
  ------------------
  |  Branch (314:6): [True: 665, False: 1.09k]
  ------------------
  315|    665|    result = req_send_buffer_flush(data);
  316|    665|    if(result)
  ------------------
  |  Branch (316:8): [True: 58, False: 607]
  ------------------
  317|     58|      return result;
  318|    607|    if(!Curl_bufq_is_empty(&data->req.sendbuf)) {
  ------------------
  |  Branch (318:8): [True: 0, False: 607]
  ------------------
  319|      0|      DEBUGF(infof(data, "Curl_req_flush(len=%zu) -> EAGAIN",
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  320|      0|                   Curl_bufq_len(&data->req.sendbuf)));
  321|      0|      return CURLE_AGAIN;
  322|      0|    }
  323|    607|  }
  324|  1.09k|  else if(Curl_xfer_needs_flush(data)) {
  ------------------
  |  Branch (324:11): [True: 0, False: 1.09k]
  ------------------
  325|      0|    DEBUGF(infof(data, "Curl_req_flush(), xfer send_pending"));
  ------------------
  |  | 1002|      0|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
  326|      0|    return Curl_xfer_flush(data);
  327|      0|  }
  328|       |
  329|  1.70k|  if(data->req.eos_read && !data->req.eos_sent) {
  ------------------
  |  Branch (329:6): [True: 925, False: 778]
  |  Branch (329:28): [True: 52, False: 873]
  ------------------
  330|     52|    char tmp = 0;
  331|     52|    size_t nwritten;
  332|     52|    result = xfer_send(data, &tmp, 0, 0, &nwritten);
  333|     52|    if(result)
  ------------------
  |  Branch (333:8): [True: 2, False: 50]
  ------------------
  334|      2|      return result;
  335|     50|    DEBUGASSERT(data->req.eos_sent);
  ------------------
  |  | 1016|     50|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (335:5): [True: 0, False: 50]
  |  Branch (335:5): [True: 50, False: 0]
  ------------------
  336|     50|  }
  337|       |
  338|  1.70k|  if(!data->req.upload_done && data->req.eos_read && data->req.eos_sent) {
  ------------------
  |  Branch (338:6): [True: 1.16k, False: 533]
  |  Branch (338:32): [True: 390, False: 778]
  |  Branch (338:54): [True: 390, False: 0]
  ------------------
  339|    390|    DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf));
  ------------------
  |  | 1016|    390|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (339:5): [True: 0, False: 390]
  |  Branch (339:5): [True: 390, False: 0]
  ------------------
  340|    390|    return req_set_upload_done(data);
  341|    390|  }
  342|  1.31k|  return CURLE_OK;
  343|  1.70k|}
request.c:req_send_buffer_flush:
  244|    665|{
  245|    665|  CURLcode result = CURLE_OK;
  246|    665|  const unsigned char *buf;
  247|    665|  size_t blen;
  248|       |
  249|  1.27k|  while(Curl_bufq_peek(&data->req.sendbuf, &buf, &blen)) {
  ------------------
  |  Branch (249:9): [True: 666, False: 607]
  ------------------
  250|    666|    size_t nwritten, hds_len = CURLMIN(data->req.sendbuf_hds_len, blen);
  ------------------
  |  | 1315|    666|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 664, False: 2]
  |  |  ------------------
  ------------------
  251|    666|    result = xfer_send(data, (const char *)buf, blen, hds_len, &nwritten);
  252|    666|    if(result)
  ------------------
  |  Branch (252:8): [True: 58, False: 608]
  ------------------
  253|     58|      break;
  254|       |
  255|    608|    Curl_bufq_skip(&data->req.sendbuf, nwritten);
  256|    608|    if(hds_len) {
  ------------------
  |  Branch (256:8): [True: 425, False: 183]
  ------------------
  257|    425|      data->req.sendbuf_hds_len -= CURLMIN(hds_len, nwritten);
  ------------------
  |  | 1315|    425|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 423, False: 2]
  |  |  ------------------
  ------------------
  258|    425|    }
  259|       |    /* leave if we could not send all. Maybe network blocking or
  260|       |     * speed limits on transfer */
  261|    608|    if(nwritten < blen)
  ------------------
  |  Branch (261:8): [True: 0, False: 608]
  ------------------
  262|      0|      break;
  263|    608|  }
  264|    665|  return result;
  265|    665|}
request.c:xfer_send:
  189|  2.23k|{
  190|  2.23k|  CURLcode result = CURLE_OK;
  191|  2.23k|  bool eos = FALSE;
  ------------------
  |  |  989|  2.23k|#define FALSE false
  ------------------
  192|       |
  193|  2.23k|  *pnwritten = 0;
  194|  2.23k|  DEBUGASSERT(hds_len <= blen);
  ------------------
  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (194:3): [True: 0, False: 2.23k]
  |  Branch (194:3): [True: 2.23k, False: 0]
  ------------------
  195|  2.23k|#ifdef DEBUGBUILD
  196|  2.23k|  {
  197|       |    /* Allow debug builds to override this logic to force short initial
  198|       |       sends */
  199|  2.23k|    size_t body_len = blen - hds_len;
  200|  2.23k|    if(body_len) {
  ------------------
  |  Branch (200:8): [True: 664, False: 1.57k]
  ------------------
  201|    664|      const char *p = getenv("CURL_SMALLREQSEND");
  202|    664|      if(p) {
  ------------------
  |  Branch (202:10): [True: 0, False: 664]
  ------------------
  203|      0|        curl_off_t body_small;
  204|      0|        if(!curlx_str_number(&p, &body_small, body_len))
  ------------------
  |  Branch (204:12): [True: 0, False: 0]
  ------------------
  205|      0|          blen = hds_len + (size_t)body_small;
  206|      0|      }
  207|    664|    }
  208|  2.23k|  }
  209|  2.23k|#endif
  210|       |  /* Make sure this does not send more body bytes than what the max send
  211|       |     speed says. The headers do not count to the max speed. */
  212|  2.23k|  if(data->set.max_send_speed) {
  ------------------
  |  Branch (212:6): [True: 0, False: 2.23k]
  ------------------
  213|      0|    size_t body_bytes = blen - hds_len;
  214|      0|    if((curl_off_t)body_bytes > data->set.max_send_speed)
  ------------------
  |  Branch (214:8): [True: 0, False: 0]
  ------------------
  215|      0|      blen = hds_len + (size_t)data->set.max_send_speed;
  216|      0|  }
  217|       |
  218|  2.23k|  if(data->req.eos_read &&
  ------------------
  |  Branch (218:6): [True: 1.95k, False: 283]
  ------------------
  219|  1.95k|    (Curl_bufq_is_empty(&data->req.sendbuf) ||
  ------------------
  |  Branch (219:6): [True: 1.57k, False: 383]
  ------------------
  220|  1.95k|     Curl_bufq_len(&data->req.sendbuf) == blen)) {
  ------------------
  |  Branch (220:6): [True: 383, False: 0]
  ------------------
  221|  1.95k|    DEBUGF(infof(data, "sending last upload chunk of %zu bytes", blen));
  ------------------
  |  | 1002|  14.1k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 1.95k, False: 0]
  |  |  |  Branch (1002:19): [True: 143, False: 1.81k]
  |  |  |  Branch (1002:19): [True: 143, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
  222|  1.95k|    eos = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
  223|  1.95k|  }
  224|  2.23k|  result = Curl_xfer_try_send(data, buf, blen, eos, pnwritten);
  225|  2.23k|  if(!result) {
  ------------------
  |  Branch (225:6): [True: 2.16k, False: 74]
  ------------------
  226|  2.16k|    if(eos && (blen == *pnwritten))
  ------------------
  |  Branch (226:8): [True: 1.89k, False: 268]
  |  Branch (226:15): [True: 1.89k, False: 0]
  ------------------
  227|  1.89k|      data->req.eos_sent = TRUE;
  ------------------
  |  |  986|  1.89k|#define TRUE true
  ------------------
  228|  2.16k|    if(*pnwritten) {
  ------------------
  |  Branch (228:8): [True: 2.11k, False: 50]
  ------------------
  229|  2.11k|      if(hds_len)
  ------------------
  |  Branch (229:10): [True: 1.92k, False: 183]
  ------------------
  230|  1.92k|        Curl_debug(data, CURLINFO_HEADER_OUT, buf,
  231|  1.92k|                   CURLMIN(hds_len, *pnwritten));
  ------------------
  |  | 1315|  1.92k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 423, False: 1.50k]
  |  |  ------------------
  ------------------
  232|  2.11k|      if(*pnwritten > hds_len) {
  ------------------
  |  Branch (232:10): [True: 606, False: 1.50k]
  ------------------
  233|    606|        size_t body_len = *pnwritten - hds_len;
  234|    606|        Curl_debug(data, CURLINFO_DATA_OUT, buf + hds_len, body_len);
  235|    606|        data->req.writebytecount += body_len;
  236|    606|        Curl_pgrs_upload_inc(data, body_len);
  237|    606|      }
  238|  2.11k|    }
  239|  2.16k|  }
  240|  2.23k|  return result;
  241|  2.23k|}
request.c:req_set_upload_done:
  268|  1.89k|{
  269|  1.89k|  DEBUGASSERT(!data->req.upload_done);
  ------------------
  |  | 1016|  1.89k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (269:3): [True: 0, False: 1.89k]
  |  Branch (269:3): [True: 1.89k, False: 0]
  ------------------
  270|  1.89k|  data->req.upload_done = TRUE;
  ------------------
  |  |  986|  1.89k|#define TRUE true
  ------------------
  271|  1.89k|  CURL_REQ_CLEAR_SEND(data);
  ------------------
  |  |   47|  1.89k|  ((d)->req.io_flags &= (uint8_t)~REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  1.89k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  272|       |
  273|  1.89k|  if(data->mstate >= MSTATE_DID)
  ------------------
  |  Branch (273:6): [True: 60, False: 1.83k]
  ------------------
  274|     60|    Curl_pgrsTime(data, TIMER_POSTRANSFER);
  275|  1.89k|  Curl_creader_done(data, data->req.upload_aborted);
  276|       |
  277|  1.89k|  if(data->req.upload_aborted) {
  ------------------
  |  Branch (277:6): [True: 0, False: 1.89k]
  ------------------
  278|       |    /* If we have not already sent EOS, clear buffer and read flag,
  279|       |     * so we no longer flush anything. If EOS has been sent, our
  280|       |     * sendbuf should be empty. */
  281|      0|    if(!data->req.eos_sent) {
  ------------------
  |  Branch (281:8): [True: 0, False: 0]
  ------------------
  282|      0|      Curl_bufq_reset(&data->req.sendbuf);
  283|      0|      data->req.eos_read = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  284|      0|    }
  285|      0|    else
  286|      0|      DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf));
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (286:7): [True: 0, False: 0]
  |  Branch (286:7): [True: 0, False: 0]
  ------------------
  287|       |
  288|      0|    if(data->req.writebytecount)
  ------------------
  |  Branch (288:8): [True: 0, False: 0]
  ------------------
  289|      0|      infof(data, "abort upload after having sent %" FMT_OFF_T " bytes",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  290|      0|            data->req.writebytecount);
  291|      0|    else
  292|      0|      infof(data, "abort upload");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  293|      0|  }
  294|  1.89k|  else if(data->req.writebytecount)
  ------------------
  |  Branch (294:11): [True: 389, False: 1.50k]
  ------------------
  295|    389|    infof(data, "upload completely sent off: %" FMT_OFF_T " bytes",
  ------------------
  |  |  143|    389|  do {                               \
  |  |  144|    389|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    389|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 389, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 22, False: 367]
  |  |  |  |  ------------------
  |  |  |  |  323|    389|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 22, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     22|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    389|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    389|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 389]
  |  |  ------------------
  ------------------
  296|  1.89k|          data->req.writebytecount);
  297|  1.50k|  else if(!data->req.download_done) {
  ------------------
  |  Branch (297:11): [True: 1.50k, False: 0]
  ------------------
  298|  1.50k|    DEBUGASSERT(Curl_bufq_is_empty(&data->req.sendbuf));
  ------------------
  |  | 1016|  1.50k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (298:5): [True: 0, False: 1.50k]
  |  Branch (298:5): [True: 1.50k, False: 0]
  ------------------
  299|  1.50k|    infof(data, Curl_creader_total_length(data) ?
  ------------------
  |  |  143|  1.50k|  do {                               \
  |  |  144|  1.50k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  1.50k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.50k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 114, False: 1.39k]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.50k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 114, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    114|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.50k|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 114]
  |  |  ------------------
  |  |  146|  1.50k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.50k]
  |  |  ------------------
  ------------------
  300|  1.50k|          "We are completely uploaded and fine" :
  301|  1.50k|          "Request completely sent off");
  302|  1.50k|  }
  303|       |
  304|  1.89k|  return CURLE_OK;
  305|  1.89k|}
request.c:req_send_buffer_add:
  362|    428|{
  363|    428|  CURLcode result = CURLE_OK;
  364|    428|  size_t n;
  365|    428|  result = Curl_bufq_cwrite(&data->req.sendbuf, buf, blen, &n);
  366|    428|  if(result)
  ------------------
  |  Branch (366:6): [True: 0, False: 428]
  ------------------
  367|      0|    return result;
  368|       |  /* We rely on a SOFTLIMIT on sendbuf, so it can take all data in */
  369|    428|  DEBUGASSERT(n == blen);
  ------------------
  |  | 1016|    428|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (369:3): [True: 0, False: 428]
  |  Branch (369:3): [True: 428, False: 0]
  ------------------
  370|    428|  data->req.sendbuf_hds_len += hds_len;
  371|    428|  return CURLE_OK;
  372|    428|}
request.c:add_from_client:
  348|  1.20k|{
  349|  1.20k|  struct Curl_easy *data = reader_ctx;
  350|  1.20k|  CURLcode result;
  351|  1.20k|  bool eos;
  352|       |
  353|  1.20k|  result = Curl_client_read(data, (char *)buf, buflen, pnread, &eos);
  354|  1.20k|  if(!result && eos)
  ------------------
  |  Branch (354:6): [True: 676, False: 533]
  |  Branch (354:17): [True: 402, False: 274]
  ------------------
  355|    402|    data->req.eos_read = TRUE;
  ------------------
  |  |  986|    402|#define TRUE true
  ------------------
  356|  1.20k|  return result;
  357|  1.20k|}

Curl_poll:
  184|    395|{
  185|    395|#ifdef HAVE_POLL
  186|    395|  int pending_ms;
  187|       |#else
  188|       |  fd_set fds_read;
  189|       |  fd_set fds_write;
  190|       |  fd_set fds_err;
  191|       |  curl_socket_t maxfd;
  192|       |#endif
  193|    395|  bool fds_none = TRUE;
  ------------------
  |  |  986|    395|#define TRUE true
  ------------------
  194|    395|  unsigned int i;
  195|    395|  int r;
  196|       |
  197|    395|  if(ufds) {
  ------------------
  |  Branch (197:6): [True: 395, False: 0]
  ------------------
  198|    395|    for(i = 0; i < nfds; i++) {
  ------------------
  |  Branch (198:16): [True: 395, False: 0]
  ------------------
  199|    395|      if(ufds[i].fd != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|    395|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (199:10): [True: 395, False: 0]
  ------------------
  200|    395|        fds_none = FALSE;
  ------------------
  |  |  989|    395|#define FALSE false
  ------------------
  201|    395|        break;
  202|    395|      }
  203|    395|    }
  204|    395|  }
  205|    395|  if(fds_none) {
  ------------------
  |  Branch (205:6): [True: 0, False: 395]
  ------------------
  206|       |    /* no sockets, wait */
  207|      0|    return curlx_wait_ms(timeout_ms);
  208|      0|  }
  209|       |
  210|       |  /* Avoid initial timestamp, avoid curlx_now() call, when elapsed
  211|       |     time in this function does not need to be measured. This happens
  212|       |     when function is called with a zero timeout or a negative timeout
  213|       |     value indicating a blocking call should be performed. */
  214|       |
  215|    395|#ifdef HAVE_POLL
  216|       |
  217|       |  /* prevent overflow, timeout_ms is typecast to int. */
  218|    395|#if TIMEDIFF_T_MAX > INT_MAX
  219|    395|  if(timeout_ms > INT_MAX)
  ------------------
  |  Branch (219:6): [True: 0, False: 395]
  ------------------
  220|      0|    timeout_ms = INT_MAX;
  221|    395|#endif
  222|    395|  if(timeout_ms > 0)
  ------------------
  |  Branch (222:6): [True: 0, False: 395]
  ------------------
  223|      0|    pending_ms = (int)timeout_ms;
  224|    395|  else if(timeout_ms < 0)
  ------------------
  |  Branch (224:11): [True: 0, False: 395]
  ------------------
  225|      0|    pending_ms = -1;
  226|    395|  else
  227|    395|    pending_ms = 0;
  228|    395|  r = poll(ufds, nfds, pending_ms);
  229|    395|  if(r <= 0) {
  ------------------
  |  Branch (229:6): [True: 205, False: 190]
  ------------------
  230|    205|    if((r == -1) && (SOCKERRNO == SOCKEINTR))
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
                  if((r == -1) && (SOCKERRNO == SOCKEINTR))
  ------------------
  |  | 1139|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (230:8): [True: 0, False: 205]
  |  Branch (230:21): [True: 0, False: 0]
  ------------------
  231|       |      /* make EINTR from select or poll not a "lethal" error */
  232|      0|      r = 0;
  233|    205|    return r;
  234|    205|  }
  235|       |
  236|    760|  for(i = 0; i < nfds; i++) {
  ------------------
  |  Branch (236:14): [True: 570, False: 190]
  ------------------
  237|    570|    if(ufds[i].fd == CURL_SOCKET_BAD)
  ------------------
  |  |  147|    570|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (237:8): [True: 0, False: 570]
  ------------------
  238|      0|      continue;
  239|    570|    if(ufds[i].revents & POLLHUP)
  ------------------
  |  Branch (239:8): [True: 0, False: 570]
  ------------------
  240|      0|      ufds[i].revents |= POLLIN;
  241|    570|    if(ufds[i].revents & POLLERR)
  ------------------
  |  Branch (241:8): [True: 0, False: 570]
  ------------------
  242|      0|      ufds[i].revents |= POLLIN | POLLOUT;
  243|    570|  }
  244|       |
  245|       |#else /* !HAVE_POLL */
  246|       |
  247|       |  FD_ZERO(&fds_read);
  248|       |  FD_ZERO(&fds_write);
  249|       |  FD_ZERO(&fds_err);
  250|       |  maxfd = (curl_socket_t)-1;
  251|       |
  252|       |  for(i = 0; i < nfds; i++) {
  253|       |    ufds[i].revents = 0;
  254|       |    if(ufds[i].fd == CURL_SOCKET_BAD)
  255|       |      continue;
  256|       |    VERIFY_SOCK(ufds[i].fd);
  257|       |    if(ufds[i].events & (POLLIN | POLLOUT | POLLPRI |
  258|       |                         POLLRDNORM | POLLWRNORM | POLLRDBAND)) {
  259|       |      if(ufds[i].fd > maxfd)
  260|       |        maxfd = ufds[i].fd;
  261|       |      if(ufds[i].events & (POLLRDNORM | POLLIN))
  262|       |        FD_SET(ufds[i].fd, &fds_read);
  263|       |      if(ufds[i].events & (POLLWRNORM | POLLOUT))
  264|       |        FD_SET(ufds[i].fd, &fds_write);
  265|       |      if(ufds[i].events & (POLLRDBAND | POLLPRI))
  266|       |        FD_SET(ufds[i].fd, &fds_err);
  267|       |    }
  268|       |  }
  269|       |
  270|       |  /* Note also that Winsock ignores the first argument, so we do not worry
  271|       |     about the fact that maxfd is computed incorrectly with Winsock (since
  272|       |     curl_socket_t is unsigned in such cases and thus -1 is the largest
  273|       |     value). */
  274|       |  r = our_select(maxfd, &fds_read, &fds_write, &fds_err, timeout_ms);
  275|       |  if(r <= 0) {
  276|       |    if((r == -1) && (SOCKERRNO == SOCKEINTR))
  277|       |      /* make EINTR from select or poll not a "lethal" error */
  278|       |      r = 0;
  279|       |    return r;
  280|       |  }
  281|       |
  282|       |  r = 0;
  283|       |  for(i = 0; i < nfds; i++) {
  284|       |    ufds[i].revents = 0;
  285|       |    if(ufds[i].fd == CURL_SOCKET_BAD)
  286|       |      continue;
  287|       |    if(FD_ISSET(ufds[i].fd, &fds_read)) {
  288|       |      if(ufds[i].events & POLLRDNORM)
  289|       |        ufds[i].revents |= POLLRDNORM;
  290|       |      if(ufds[i].events & POLLIN)
  291|       |        ufds[i].revents |= POLLIN;
  292|       |    }
  293|       |    if(FD_ISSET(ufds[i].fd, &fds_write)) {
  294|       |      if(ufds[i].events & POLLWRNORM)
  295|       |        ufds[i].revents |= POLLWRNORM;
  296|       |      if(ufds[i].events & POLLOUT)
  297|       |        ufds[i].revents |= POLLOUT;
  298|       |    }
  299|       |    if(FD_ISSET(ufds[i].fd, &fds_err)) {
  300|       |      if(ufds[i].events & POLLRDBAND)
  301|       |        ufds[i].revents |= POLLRDBAND;
  302|       |      if(ufds[i].events & POLLPRI)
  303|       |        ufds[i].revents |= POLLPRI;
  304|       |    }
  305|       |    if(ufds[i].revents)
  306|       |      r++;
  307|       |  }
  308|       |
  309|       |#endif /* HAVE_POLL */
  310|       |
  311|    190|  return r;
  312|    395|}
Curl_pollfds_init:
  317|   128k|{
  318|   128k|  DEBUGASSERT(cpfds);
  ------------------
  |  | 1016|   128k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (318:3): [True: 0, False: 128k]
  |  Branch (318:3): [True: 128k, False: 0]
  ------------------
  319|   128k|  memset(cpfds, 0, sizeof(*cpfds));
  320|   128k|  if(static_pfds && static_count) {
  ------------------
  |  Branch (320:6): [True: 128k, False: 0]
  |  Branch (320:21): [True: 128k, False: 0]
  ------------------
  321|   128k|    cpfds->pfds = static_pfds;
  322|   128k|    cpfds->count = static_count;
  323|   128k|  }
  324|   128k|}
Curl_pollfds_cleanup:
  332|   128k|{
  333|   128k|  DEBUGASSERT(cpfds);
  ------------------
  |  | 1016|   128k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (333:3): [True: 0, False: 128k]
  |  Branch (333:3): [True: 128k, False: 0]
  ------------------
  334|   128k|  if(cpfds->allocated_pfds) {
  ------------------
  |  Branch (334:6): [True: 0, False: 128k]
  ------------------
  335|      0|    curlx_safefree(cpfds->pfds);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  336|      0|    cpfds->count = 0;
  337|       |    cpfds->allocated_pfds = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  338|      0|  }
  339|   128k|  cpfds->n = 0;
  340|   128k|}
Curl_pollfds_add_sock:
  384|    395|{
  385|       |  return cpfds_add_sock(cpfds, sock, events, FALSE);
  ------------------
  |  |  989|    395|#define FALSE false
  ------------------
  386|    395|}
Curl_pollfds_add_ps:
  390|    790|{
  391|    790|  size_t i;
  392|       |
  393|    790|  DEBUGASSERT(cpfds);
  ------------------
  |  | 1016|    790|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (393:3): [True: 0, False: 790]
  |  Branch (393:3): [True: 790, False: 0]
  ------------------
  394|    790|  DEBUGASSERT(ps);
  ------------------
  |  | 1016|    790|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (394:3): [True: 0, False: 790]
  |  Branch (394:3): [True: 790, False: 0]
  ------------------
  395|  1.58k|  for(i = 0; i < ps->n; i++) {
  ------------------
  |  Branch (395:14): [True: 790, False: 790]
  ------------------
  396|    790|    short events = 0;
  397|    790|    if(ps->actions[i] & CURL_POLL_IN)
  ------------------
  |  |  283|    790|#define CURL_POLL_IN     1
  ------------------
  |  Branch (397:8): [True: 790, False: 0]
  ------------------
  398|    790|      events |= POLLIN;
  399|    790|    if(ps->actions[i] & CURL_POLL_OUT)
  ------------------
  |  |  284|    790|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (399:8): [True: 65, False: 725]
  ------------------
  400|     65|      events |= POLLOUT;
  401|    790|    if(events && cpfds_add_sock(cpfds, ps->sockets[i], events, TRUE))
  ------------------
  |  |  986|    790|#define TRUE true
  ------------------
  |  Branch (401:8): [True: 790, False: 0]
  |  Branch (401:18): [True: 0, False: 790]
  ------------------
  402|      0|      return CURLE_OUT_OF_MEMORY;
  403|    790|  }
  404|    790|  return CURLE_OK;
  405|    790|}
Curl_pollset_reset:
  464|   622k|{
  465|   622k|#ifdef DEBUGBUILD
  466|   622k|  DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC);
  ------------------
  |  | 1016|   622k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (466:3): [True: 0, False: 622k]
  |  Branch (466:3): [True: 622k, False: 0]
  ------------------
  467|   622k|#endif
  468|   622k|  ps->n = 0;
  469|   622k|}
Curl_pollset_init:
  472|   242k|{
  473|   242k|#ifdef DEBUGBUILD
  474|   242k|  ps->init = CURL_EASY_POLLSET_MAGIC;
  ------------------
  |  |  121|   242k|#define CURL_EASY_POLLSET_MAGIC  0x7a657370
  ------------------
  475|   242k|#endif
  476|   242k|  ps->sockets = ps->def_sockets;
  477|   242k|  ps->actions = ps->def_actions;
  478|   242k|  ps->count = CURL_ARRAYSIZE(ps->def_sockets);
  ------------------
  |  | 1326|   242k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  479|   242k|  ps->n = 0;
  480|   242k|  Curl_pollset_reset(ps);
  481|   242k|}
Curl_pollset_create:
  484|  4.18k|{
  485|  4.18k|  struct easy_pollset *ps = curlx_calloc(1, sizeof(*ps));
  ------------------
  |  | 1500|  4.18k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  486|  4.18k|  if(ps)
  ------------------
  |  Branch (486:6): [True: 4.18k, False: 4]
  ------------------
  487|  4.18k|    Curl_pollset_init(ps);
  488|  4.18k|  return ps;
  489|  4.18k|}
Curl_pollset_cleanup:
  492|   242k|{
  493|   242k|#ifdef DEBUGBUILD
  494|   242k|  DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC);
  ------------------
  |  | 1016|   242k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (494:3): [True: 0, False: 242k]
  |  Branch (494:3): [True: 242k, False: 0]
  ------------------
  495|   242k|#endif
  496|   242k|  if(ps->sockets != ps->def_sockets) {
  ------------------
  |  Branch (496:6): [True: 0, False: 242k]
  ------------------
  497|      0|    curlx_free(ps->sockets);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  498|      0|    ps->sockets = ps->def_sockets;
  499|      0|  }
  500|   242k|  if(ps->actions != ps->def_actions) {
  ------------------
  |  Branch (500:6): [True: 0, False: 242k]
  ------------------
  501|      0|    curlx_free(ps->actions);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  502|      0|    ps->actions = ps->def_actions;
  503|      0|  }
  504|   242k|  ps->count = CURL_ARRAYSIZE(ps->def_sockets);
  ------------------
  |  | 1326|   242k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  505|   242k|  Curl_pollset_reset(ps);
  506|   242k|}
Curl_pollset_move:
  509|  24.7k|{
  510|  24.7k|  Curl_pollset_cleanup(to); /* deallocate anything in to */
  511|  24.7k|  if(from->sockets != from->def_sockets) {
  ------------------
  |  Branch (511:6): [True: 0, False: 24.7k]
  ------------------
  512|      0|    DEBUGASSERT(from->actions != from->def_actions);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (512:5): [True: 0, False: 0]
  |  Branch (512:5): [True: 0, False: 0]
  ------------------
  513|      0|    to->sockets = from->sockets;
  514|      0|    to->actions = from->actions;
  515|      0|    to->count = from->count;
  516|      0|    to->n = from->n;
  517|      0|    Curl_pollset_init(from);
  518|      0|  }
  519|  24.7k|  else {
  520|  24.7k|    DEBUGASSERT(to->sockets == to->def_sockets);
  ------------------
  |  | 1016|  24.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (520:5): [True: 0, False: 24.7k]
  |  Branch (520:5): [True: 24.7k, False: 0]
  ------------------
  521|  24.7k|    DEBUGASSERT(to->actions == to->def_actions);
  ------------------
  |  | 1016|  24.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (521:5): [True: 0, False: 24.7k]
  |  Branch (521:5): [True: 24.7k, False: 0]
  ------------------
  522|  24.7k|    memcpy(to->sockets, from->sockets, to->count * sizeof(to->sockets[0]));
  523|  24.7k|    memcpy(to->actions, from->actions, to->count * sizeof(to->actions[0]));
  524|  24.7k|    to->n = from->n;
  525|  24.7k|    Curl_pollset_init(from);
  526|  24.7k|  }
  527|  24.7k|}
Curl_pollset_change:
  535|   194k|{
  536|   194k|  unsigned int i;
  537|       |
  538|   194k|#ifdef DEBUGBUILD
  539|   194k|  DEBUGASSERT(ps->init == CURL_EASY_POLLSET_MAGIC);
  ------------------
  |  | 1016|   194k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (539:3): [True: 0, False: 194k]
  |  Branch (539:3): [True: 194k, False: 0]
  ------------------
  540|   194k|#endif
  541|       |
  542|   194k|  DEBUGASSERT(VALID_SOCK(sock));
  ------------------
  |  | 1016|   194k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (542:3): [True: 0, False: 194k]
  |  Branch (542:3): [True: 194k, False: 0]
  ------------------
  543|   194k|  if(!VALID_SOCK(sock))
  ------------------
  |  |   88|   194k|#define VALID_SOCK(s) ((s) >= 0)
  ------------------
  |  Branch (543:6): [True: 0, False: 194k]
  ------------------
  544|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  545|       |
  546|   194k|  DEBUGASSERT(add_flags <= (CURL_POLL_IN | CURL_POLL_OUT));
  ------------------
  |  | 1016|   194k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (546:3): [True: 0, False: 194k]
  |  Branch (546:3): [True: 194k, False: 0]
  ------------------
  547|   194k|  DEBUGASSERT(remove_flags <= (CURL_POLL_IN | CURL_POLL_OUT));
  ------------------
  |  | 1016|   194k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (547:3): [True: 0, False: 194k]
  |  Branch (547:3): [True: 194k, False: 0]
  ------------------
  548|   194k|  DEBUGASSERT((add_flags & remove_flags) == 0); /* no overlap */
  ------------------
  |  | 1016|   194k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (548:3): [True: 0, False: 194k]
  |  Branch (548:3): [True: 194k, False: 0]
  ------------------
  549|   194k|  for(i = 0; i < ps->n; ++i) {
  ------------------
  |  Branch (549:14): [True: 68.3k, False: 126k]
  ------------------
  550|  68.3k|    if(ps->sockets[i] == sock) {
  ------------------
  |  Branch (550:8): [True: 68.3k, False: 0]
  ------------------
  551|  68.3k|      ps->actions[i] &= (unsigned char)(~remove_flags);
  552|  68.3k|      ps->actions[i] |= (unsigned char)add_flags;
  553|       |      /* all gone? remove socket */
  554|  68.3k|      if(!ps->actions[i]) {
  ------------------
  |  Branch (554:10): [True: 0, False: 68.3k]
  ------------------
  555|      0|        if((i + 1) < ps->n) {
  ------------------
  |  Branch (555:12): [True: 0, False: 0]
  ------------------
  556|      0|          memmove(&ps->sockets[i], &ps->sockets[i + 1],
  557|      0|                  (ps->n - (i + 1)) * sizeof(ps->sockets[0]));
  558|      0|          memmove(&ps->actions[i], &ps->actions[i + 1],
  559|      0|                  (ps->n - (i + 1)) * sizeof(ps->actions[0]));
  560|      0|        }
  561|      0|        --ps->n;
  562|      0|      }
  563|  68.3k|      return CURLE_OK;
  564|  68.3k|    }
  565|  68.3k|  }
  566|       |  /* not present */
  567|   126k|  if(add_flags) {
  ------------------
  |  Branch (567:6): [True: 126k, False: 0]
  ------------------
  568|   126k|    if(i >= ps->count) { /* need to grow */
  ------------------
  |  Branch (568:8): [True: 0, False: 126k]
  ------------------
  569|      0|      unsigned int new_count = CURLMAX(ps->count * 2, 8);
  ------------------
  |  | 1314|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1314:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  570|      0|      curl_socket_t *nsockets;
  571|      0|      unsigned char *nactions;
  572|       |
  573|      0|      CURL_TRC_M(data, "growing pollset capacity from %u to %u",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  574|      0|                 ps->count, new_count);
  575|      0|      if(new_count <= ps->count)
  ------------------
  |  Branch (575:10): [True: 0, False: 0]
  ------------------
  576|      0|        return CURLE_OUT_OF_MEMORY;
  577|      0|      nsockets = curlx_calloc(new_count, sizeof(nsockets[0]));
  ------------------
  |  | 1500|      0|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  578|      0|      if(!nsockets)
  ------------------
  |  Branch (578:10): [True: 0, False: 0]
  ------------------
  579|      0|        return CURLE_OUT_OF_MEMORY;
  580|      0|      nactions = curlx_calloc(new_count, sizeof(nactions[0]));
  ------------------
  |  | 1500|      0|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  581|      0|      if(!nactions) {
  ------------------
  |  Branch (581:10): [True: 0, False: 0]
  ------------------
  582|      0|        curlx_free(nsockets);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  583|      0|        return CURLE_OUT_OF_MEMORY;
  584|      0|      }
  585|      0|      memcpy(nsockets, ps->sockets, ps->count * sizeof(ps->sockets[0]));
  586|      0|      memcpy(nactions, ps->actions, ps->count * sizeof(ps->actions[0]));
  587|      0|      if(ps->sockets != ps->def_sockets)
  ------------------
  |  Branch (587:10): [True: 0, False: 0]
  ------------------
  588|      0|        curlx_free(ps->sockets);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  589|      0|      ps->sockets = nsockets;
  590|      0|      if(ps->actions != ps->def_actions)
  ------------------
  |  Branch (590:10): [True: 0, False: 0]
  ------------------
  591|      0|        curlx_free(ps->actions);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  592|      0|      ps->actions = nactions;
  593|      0|      ps->count = new_count;
  594|      0|    }
  595|   126k|    DEBUGASSERT(i < ps->count);
  ------------------
  |  | 1016|   126k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (595:5): [True: 0, False: 126k]
  |  Branch (595:5): [True: 126k, False: 0]
  ------------------
  596|   126k|    if(i < ps->count) {
  ------------------
  |  Branch (596:8): [True: 126k, False: 0]
  ------------------
  597|   126k|      ps->sockets[i] = sock;
  598|   126k|      ps->actions[i] = (unsigned char)add_flags;
  599|   126k|      ps->n = i + 1;
  600|   126k|    }
  601|   126k|  }
  602|   126k|  return CURLE_OK;
  603|   126k|}
Curl_pollset_set:
  608|  8.50k|{
  609|  8.50k|  return Curl_pollset_change(data, ps, sock,
  610|  8.50k|                             (do_in ? CURL_POLL_IN : 0) |
  ------------------
  |  |  283|  8.50k|#define CURL_POLL_IN     1
  ------------------
  |  Branch (610:31): [True: 8.50k, False: 0]
  ------------------
  611|  8.50k|                             (do_out ? CURL_POLL_OUT : 0),
  ------------------
  |  |  284|    676|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (611:31): [True: 676, False: 7.83k]
  ------------------
  612|  8.50k|                             (!do_in ? CURL_POLL_IN : 0) |
  ------------------
  |  |  283|      0|#define CURL_POLL_IN     1
  ------------------
  |  Branch (612:31): [True: 0, False: 8.50k]
  ------------------
  613|  8.50k|                             (!do_out ? CURL_POLL_OUT : 0));
  ------------------
  |  |  284|  7.83k|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (613:31): [True: 7.83k, False: 676]
  ------------------
  614|  8.50k|}
Curl_pollset_remove:
  617|    395|{
  618|    395|  unsigned int i;
  619|    395|  for(i = 0; i < ps->n; ++i) {
  ------------------
  |  Branch (619:14): [True: 395, False: 0]
  ------------------
  620|    395|    if(ps->sockets[i] == sock) {
  ------------------
  |  Branch (620:8): [True: 395, False: 0]
  ------------------
  621|    395|      if((i + 1) < ps->n) {
  ------------------
  |  Branch (621:10): [True: 0, False: 395]
  ------------------
  622|      0|        memmove(&ps->sockets[i], &ps->sockets[i + 1],
  623|      0|                (ps->n - (i + 1)) * sizeof(ps->sockets[0]));
  624|      0|        memmove(&ps->actions[i], &ps->actions[i + 1],
  625|      0|                (ps->n - (i + 1)) * sizeof(ps->actions[0]));
  626|      0|      }
  627|    395|      --ps->n;
  628|    395|      return;
  629|    395|    }
  630|    395|  }
  631|    395|}
Curl_pollset_check:
  682|  67.4k|{
  683|  67.4k|  unsigned int i;
  684|       |
  685|  67.4k|  (void)data;
  686|  67.4k|  DEBUGASSERT(VALID_SOCK(sock));
  ------------------
  |  | 1016|  67.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (686:3): [True: 0, False: 67.4k]
  |  Branch (686:3): [True: 67.4k, False: 0]
  ------------------
  687|  67.4k|  for(i = 0; i < ps->n; ++i) {
  ------------------
  |  Branch (687:14): [True: 8.50k, False: 58.9k]
  ------------------
  688|  8.50k|    if(ps->sockets[i] == sock) {
  ------------------
  |  Branch (688:8): [True: 8.50k, False: 0]
  ------------------
  689|  8.50k|      *pwant_read = !!(ps->actions[i] & CURL_POLL_IN);
  ------------------
  |  |  283|  8.50k|#define CURL_POLL_IN     1
  ------------------
  690|  8.50k|      *pwant_write = !!(ps->actions[i] & CURL_POLL_OUT);
  ------------------
  |  |  284|  8.50k|#define CURL_POLL_OUT    2
  ------------------
  691|  8.50k|      return;
  692|  8.50k|    }
  693|  8.50k|  }
  694|  58.9k|  *pwant_read = *pwant_write = FALSE;
  ------------------
  |  |  989|  58.9k|#define FALSE false
  ------------------
  695|  58.9k|}
Curl_pollset_want_recv:
  700|  8.50k|{
  701|  8.50k|  unsigned int i;
  702|  8.50k|  (void)data;
  703|  8.50k|  for(i = 0; i < ps->n; ++i) {
  ------------------
  |  Branch (703:14): [True: 8.50k, False: 0]
  ------------------
  704|  8.50k|    if((ps->sockets[i] == sock) && (ps->actions[i] & CURL_POLL_IN))
  ------------------
  |  |  283|  8.50k|#define CURL_POLL_IN     1
  ------------------
  |  Branch (704:8): [True: 8.50k, False: 0]
  |  Branch (704:36): [True: 8.50k, False: 0]
  ------------------
  705|  8.50k|      return TRUE;
  ------------------
  |  |  986|  8.50k|#define TRUE true
  ------------------
  706|  8.50k|  }
  707|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  708|  8.50k|}
select.c:cpfds_add_sock:
  362|  1.18k|{
  363|  1.18k|  int i;
  364|       |
  365|  1.18k|  if(fold && cpfds->n <= INT_MAX) {
  ------------------
  |  Branch (365:6): [True: 790, False: 395]
  |  Branch (365:14): [True: 790, False: 0]
  ------------------
  366|  1.18k|    for(i = (int)cpfds->n - 1; i >= 0; --i) {
  ------------------
  |  Branch (366:32): [True: 395, False: 790]
  ------------------
  367|    395|      if(sock == cpfds->pfds[i].fd) {
  ------------------
  |  Branch (367:10): [True: 0, False: 395]
  ------------------
  368|      0|        cpfds->pfds[i].events |= events;
  369|      0|        return CURLE_OK;
  370|      0|      }
  371|    395|    }
  372|    790|  }
  373|       |  /* not folded, add new entry */
  374|  1.18k|  if(cpfds->n >= cpfds->count && cpfds_increase(cpfds, 100))
  ------------------
  |  Branch (374:6): [True: 0, False: 1.18k]
  |  Branch (374:34): [True: 0, False: 0]
  ------------------
  375|      0|    return CURLE_OUT_OF_MEMORY;
  376|  1.18k|  cpfds->pfds[cpfds->n].fd = sock;
  377|  1.18k|  cpfds->pfds[cpfds->n].events = events;
  378|  1.18k|  ++cpfds->n;
  379|  1.18k|  return CURLE_OK;
  380|  1.18k|}

Curl_client_cleanup:
   66|  19.7k|{
   67|  19.7k|  cl_reset_reader(data);
   68|  19.7k|  cl_reset_writer(data);
   69|       |
   70|  19.7k|  data->req.bytecount = 0;
   71|  19.7k|  data->req.headerline = 0;
   72|  19.7k|}
Curl_client_reset:
   75|  22.9k|{
   76|  22.9k|  if(data->req.rewind_read) {
  ------------------
  |  Branch (76:6): [True: 0, False: 22.9k]
  ------------------
   77|       |    /* already requested */
   78|      0|    CURL_TRC_READ(data, "client_reset, will rewind reader");
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
   79|      0|  }
   80|  22.9k|  else {
   81|  22.9k|    CURL_TRC_READ(data, "client_reset, clear readers");
  ------------------
  |  |  163|  22.9k|  do {                                                    \
  |  |  164|  22.9k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|  22.9k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  45.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 22.9k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 2.34k, False: 20.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  45.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 2.34k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  2.34k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  22.9k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  2.34k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 519, False: 1.82k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  22.9k|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|  22.9k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 22.9k]
  |  |  ------------------
  ------------------
   82|  22.9k|    cl_reset_reader(data);
   83|  22.9k|  }
   84|  22.9k|  cl_reset_writer(data);
   85|       |
   86|  22.9k|  data->req.bytecount = 0;
   87|  22.9k|  data->req.headerline = 0;
   88|  22.9k|}
Curl_client_start:
   91|  10.7k|{
   92|  10.7k|  if(data->req.rewind_read) {
  ------------------
  |  Branch (92:6): [True: 0, False: 10.7k]
  ------------------
   93|      0|    struct Curl_creader *r = data->req.reader.stack;
   94|      0|    CURLcode result = CURLE_OK;
   95|       |
   96|      0|    CURL_TRC_READ(data, "client start, rewind readers");
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
   97|      0|    while(r) {
  ------------------
  |  Branch (97:11): [True: 0, False: 0]
  ------------------
   98|      0|      result = r->crt->cntrl(data, r, CURL_CRCNTRL_REWIND);
   99|      0|      if(result) {
  ------------------
  |  Branch (99:10): [True: 0, False: 0]
  ------------------
  100|      0|        failf(data, "rewind of client reader '%s' failed: %d",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  101|      0|              r->crt->name, (int)result);
  102|      0|        return result;
  103|      0|      }
  104|      0|      r = r->next;
  105|      0|    }
  106|      0|    data->req.rewind_read = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  107|      0|    cl_reset_reader(data);
  108|      0|  }
  109|  10.7k|  return CURLE_OK;
  110|  10.7k|}
Curl_creader_will_rewind:
  113|     76|{
  114|     76|  return (bool)data->req.rewind_read;
  115|     76|}
Curl_cwriter_def_init:
  124|  28.1k|{
  125|  28.1k|  (void)data;
  126|  28.1k|  (void)writer;
  127|  28.1k|  return CURLE_OK;
  128|  28.1k|}
Curl_cwriter_def_flush:
  139|  23.9k|{
  140|  23.9k|  return Curl_cwriter_flush(data, writer->next, eos);
  ------------------
  |  |  192|  23.9k|  ((w) ? (w)->cwt->do_flush((d), (w), (eos)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (192:4): [True: 23.9k, False: 0]
  |  |  ------------------
  ------------------
  141|  23.9k|}
Curl_cwriter_def_close:
  145|  28.1k|{
  146|  28.1k|  (void)data;
  147|  28.1k|  (void)writer;
  148|  28.1k|}
Curl_client_write:
  369|  36.7k|{
  370|  36.7k|  CURLcode result;
  371|       |
  372|       |  /* it is one of those, at least */
  373|  36.7k|  DEBUGASSERT(type &
  ------------------
  |  | 1016|  36.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (373:3): [True: 0, False: 36.7k]
  |  Branch (373:3): [True: 36.7k, False: 0]
  ------------------
  374|  36.7k|              (CLIENTWRITE_BODY | CLIENTWRITE_HEADER | CLIENTWRITE_INFO));
  375|       |  /* BODY is only BODY (with optional EOS) */
  376|  36.7k|  DEBUGASSERT(!(type & CLIENTWRITE_BODY) ||
  ------------------
  |  | 1016|  36.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (376:3): [True: 36.7k, False: 0]
  |  Branch (376:3): [True: 0, False: 0]
  |  Branch (376:3): [True: 36.0k, False: 650]
  |  Branch (376:3): [True: 650, False: 0]
  ------------------
  377|  36.7k|              ((type & ~(CLIENTWRITE_BODY | CLIENTWRITE_EOS)) == 0));
  378|       |  /* INFO is only INFO (with optional EOS) */
  379|  36.7k|  DEBUGASSERT(!(type & CLIENTWRITE_INFO) ||
  ------------------
  |  | 1016|  36.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (379:3): [True: 36.7k, False: 0]
  |  Branch (379:3): [True: 0, False: 0]
  |  Branch (379:3): [True: 36.7k, False: 0]
  |  Branch (379:3): [True: 0, False: 0]
  ------------------
  380|  36.7k|              ((type & ~(CLIENTWRITE_INFO | CLIENTWRITE_EOS)) == 0));
  381|       |
  382|  36.7k|  if(!data->req.writer.stack) {
  ------------------
  |  Branch (382:6): [True: 0, False: 36.7k]
  ------------------
  383|      0|    result = do_init_writer_stack(data);
  384|      0|    if(result)
  ------------------
  |  Branch (384:8): [True: 0, False: 0]
  ------------------
  385|      0|      return result;
  386|      0|    DEBUGASSERT(data->req.writer.stack);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (386:5): [True: 0, False: 0]
  |  Branch (386:5): [True: 0, False: 0]
  ------------------
  387|      0|  }
  388|       |
  389|  36.7k|  result = Curl_cwriter_write(data, data->req.writer.stack, type, buf, len);
  ------------------
  |  |  189|  36.7k|  ((w) ? (w)->cwt->do_write((d), (w), (t), (b), (n)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (189:4): [True: 36.7k, False: 0]
  |  |  ------------------
  ------------------
  390|  36.7k|  CURL_TRC_WRITE(data, "client_write(type=%x, len=%zu) -> %d",
  ------------------
  |  |  158|  36.7k|  do {                                                     \
  |  |  159|  36.7k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|  36.7k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  73.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 36.7k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 16.2k, False: 20.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  73.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 16.2k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  16.2k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  36.7k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  16.2k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 14.0k, False: 2.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  36.7k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  36.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 36.7k]
  |  |  ------------------
  ------------------
  391|  36.7k|                 (unsigned int)type, len, (int)result);
  392|  36.7k|  return result;
  393|  36.7k|}
Curl_client_flush:
  396|  7.98k|{
  397|  7.98k|  CURLcode result;
  398|       |
  399|  7.98k|  if(!data->req.writer.stack) {
  ------------------
  |  Branch (399:6): [True: 0, False: 7.98k]
  ------------------
  400|      0|    result = do_init_writer_stack(data);
  401|      0|    if(result)
  ------------------
  |  Branch (401:8): [True: 0, False: 0]
  ------------------
  402|      0|      return result;
  403|      0|    DEBUGASSERT(data->req.writer.stack);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (403:5): [True: 0, False: 0]
  |  Branch (403:5): [True: 0, False: 0]
  ------------------
  404|      0|  }
  405|       |
  406|  7.98k|  result = Curl_cwriter_flush(data, data->req.writer.stack, eos);
  ------------------
  |  |  192|  7.98k|  ((w) ? (w)->cwt->do_flush((d), (w), (eos)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (192:4): [True: 7.98k, False: 0]
  |  |  ------------------
  ------------------
  407|  7.98k|  CURL_TRC_WRITE(data, "client_flush(eos=%d) -> %d", eos, (int)result);
  ------------------
  |  |  158|  7.98k|  do {                                                     \
  |  |  159|  7.98k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|  7.98k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  15.9k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7.98k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 725, False: 7.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  15.9k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 725, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    725|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  7.98k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    725|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 114, False: 611]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  7.98k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  7.98k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 7.98k]
  |  |  ------------------
  ------------------
  408|  7.98k|  return result;
  409|  7.98k|}
Curl_cwriter_create:
  416|  37.5k|{
  417|  37.5k|  struct Curl_cwriter *writer = NULL;
  418|  37.5k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  419|  37.5k|  void *p;
  420|       |
  421|  37.5k|  DEBUGASSERT(cwt->cwriter_size >= sizeof(struct Curl_cwriter));
  ------------------
  |  | 1016|  37.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (421:3): [True: 0, False: 37.5k]
  |  Branch (421:3): [True: 37.5k, False: 0]
  ------------------
  422|  37.5k|  p = curlx_calloc(1, cwt->cwriter_size);
  ------------------
  |  | 1500|  37.5k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  423|  37.5k|  if(!p)
  ------------------
  |  Branch (423:6): [True: 10, False: 37.5k]
  ------------------
  424|     10|    goto out;
  425|       |
  426|  37.5k|  writer = (struct Curl_cwriter *)p;
  427|  37.5k|  writer->cwt = cwt;
  428|  37.5k|  writer->ctx = p;
  429|  37.5k|  writer->phase = phase;
  430|  37.5k|  result = cwt->do_init(data, writer);
  431|       |
  432|  37.5k|out:
  433|  37.5k|  *pwriter = result ? NULL : writer;
  ------------------
  |  Branch (433:14): [True: 10, False: 37.5k]
  ------------------
  434|  37.5k|  if(result)
  ------------------
  |  Branch (434:6): [True: 10, False: 37.5k]
  ------------------
  435|     10|    curlx_free(writer);
  ------------------
  |  | 1503|     10|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  436|  37.5k|  return result;
  437|  37.5k|}
Curl_cwriter_free:
  441|      8|{
  442|      8|  if(writer) {
  ------------------
  |  Branch (442:6): [True: 8, False: 0]
  ------------------
  443|      8|    writer->cwt->do_close(data, writer);
  444|      8|    curlx_free(writer);
  ------------------
  |  | 1503|      8|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  445|      8|  }
  446|      8|}
Curl_cwriter_add:
  477|  9.37k|{
  478|  9.37k|  CURLcode result;
  479|  9.37k|  struct Curl_cwriter **anchor = &data->req.writer.stack;
  480|       |
  481|  9.37k|  if(!*anchor) {
  ------------------
  |  Branch (481:6): [True: 9.37k, False: 0]
  ------------------
  482|  9.37k|    result = do_init_writer_stack(data);
  483|  9.37k|    if(result)
  ------------------
  |  Branch (483:8): [True: 8, False: 9.37k]
  ------------------
  484|      8|      return result;
  485|  9.37k|  }
  486|       |
  487|  9.37k|  if(writer->cwt->flags & CURL_CW_FLAG_BLOWUP) {
  ------------------
  |  |  115|  9.37k|#define CURL_CW_FLAG_BLOWUP     (1U << 0)
  ------------------
  |  Branch (487:6): [True: 0, False: 9.37k]
  ------------------
  488|       |    /* On adding a writer that may blow up write sizes, e.g. zip bombs,
  489|       |     * add the pause writer. Do this first as any failure will make the
  490|       |     * caller destroy the writer again. */
  491|      0|    result = cwriter_ensure_pause_writer(data);
  492|      0|    if(result)
  ------------------
  |  Branch (492:8): [True: 0, False: 0]
  ------------------
  493|      0|      return result;
  494|      0|  }
  495|       |
  496|  9.37k|  cwriter_add(data, writer);
  497|  9.37k|  return CURLE_OK;
  498|  9.37k|}
Curl_cwriter_get_by_name:
  502|  11.3k|{
  503|  11.3k|  struct Curl_cwriter *writer;
  504|  13.2k|  for(writer = data->req.writer.stack; writer; writer = writer->next) {
  ------------------
  |  Branch (504:40): [True: 3.91k, False: 9.38k]
  ------------------
  505|  3.91k|    if(!strcmp(name, writer->cwt->name))
  ------------------
  |  Branch (505:8): [True: 1.95k, False: 1.95k]
  ------------------
  506|  1.95k|      return writer;
  507|  3.91k|  }
  508|  9.38k|  return NULL;
  509|  11.3k|}
Curl_cwriter_get_by_type:
  513|  9.37k|{
  514|  9.37k|  struct Curl_cwriter *writer;
  515|  33.3k|  for(writer = data->req.writer.stack; writer; writer = writer->next) {
  ------------------
  |  Branch (515:40): [True: 31.9k, False: 1.38k]
  ------------------
  516|  31.9k|    if(writer->cwt == cwt)
  ------------------
  |  Branch (516:8): [True: 7.98k, False: 23.9k]
  ------------------
  517|  7.98k|      return writer;
  518|  31.9k|  }
  519|  1.38k|  return NULL;
  520|  9.37k|}
Curl_creader_read:
  532|  1.20k|{
  533|  1.20k|  *nread = 0;
  534|  1.20k|  *eos = FALSE;
  ------------------
  |  |  989|  1.20k|#define FALSE false
  ------------------
  535|  1.20k|  if(!reader)
  ------------------
  |  Branch (535:6): [True: 0, False: 1.20k]
  ------------------
  536|      0|    return CURLE_READ_ERROR;
  537|  1.20k|  return reader->crt->do_read(data, reader, buf, blen, nread, eos);
  538|  1.20k|}
Curl_creader_def_init:
  551|  8.71k|{
  552|  8.71k|  (void)data;
  553|  8.71k|  (void)reader;
  554|  8.71k|  return CURLE_OK;
  555|  8.71k|}
Curl_creader_def_close:
  559|  8.76k|{
  560|  8.76k|  (void)data;
  561|  8.76k|  (void)reader;
  562|  8.76k|}
Curl_creader_def_done:
  624|  1.89k|{
  625|  1.89k|  (void)data;
  626|  1.89k|  (void)reader;
  627|  1.89k|  (void)premature;
  628|  1.89k|}
Curl_creader_create:
  955|  9.13k|{
  956|  9.13k|  struct Curl_creader *reader = NULL;
  957|  9.13k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  958|  9.13k|  void *p;
  959|       |
  960|  9.13k|  DEBUGASSERT(crt->creader_size >= sizeof(struct Curl_creader));
  ------------------
  |  | 1016|  9.13k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (960:3): [True: 0, False: 9.13k]
  |  Branch (960:3): [True: 9.13k, False: 0]
  ------------------
  961|  9.13k|  p = curlx_calloc(1, crt->creader_size);
  ------------------
  |  | 1500|  9.13k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  962|  9.13k|  if(!p)
  ------------------
  |  Branch (962:6): [True: 1, False: 9.13k]
  ------------------
  963|      1|    goto out;
  964|       |
  965|  9.13k|  reader = (struct Curl_creader *)p;
  966|  9.13k|  reader->crt = crt;
  967|  9.13k|  reader->ctx = p;
  968|  9.13k|  reader->phase = phase;
  969|  9.13k|  result = crt->do_init(data, reader);
  970|       |
  971|  9.13k|out:
  972|  9.13k|  *preader = result ? NULL : reader;
  ------------------
  |  Branch (972:14): [True: 1, False: 9.13k]
  ------------------
  973|  9.13k|  if(result)
  ------------------
  |  Branch (973:6): [True: 1, False: 9.13k]
  ------------------
  974|      1|    curlx_free(reader);
  ------------------
  |  | 1503|      1|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  975|  9.13k|  return result;
  976|  9.13k|}
Curl_creader_set_fread:
 1163|     44|{
 1164|     44|  CURLcode result;
 1165|     44|  struct Curl_creader *r;
 1166|     44|  struct cr_in_ctx *ctx;
 1167|       |
 1168|     44|  result = Curl_creader_create(&r, data, &cr_in, CURL_CR_CLIENT);
 1169|     44|  if(result || !r)
  ------------------
  |  Branch (1169:6): [True: 0, False: 44]
  |  Branch (1169:16): [True: 0, False: 44]
  ------------------
 1170|      0|    goto out;
 1171|     44|  ctx = r->ctx;
 1172|     44|  ctx->total_len = len;
 1173|       |
 1174|     44|  cl_reset_reader(data);
 1175|     44|  result = do_init_reader_stack(data, r);
 1176|     44|out:
 1177|     44|  CURL_TRC_READ(data, "add fread reader, len=%" FMT_OFF_T " -> %d",
  ------------------
  |  |  163|     44|  do {                                                    \
  |  |  164|     44|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|     44|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     88|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 44, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 9, False: 35]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     88|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 9, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      9|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|     44|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      9|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|     44|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|     44|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 44]
  |  |  ------------------
  ------------------
 1178|     44|                len, (int)result);
 1179|     44|  return result;
 1180|     44|}
Curl_creader_set:
 1204|    376|{
 1205|    376|  DEBUGASSERT(r);
  ------------------
  |  | 1016|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1205:3): [True: 0, False: 376]
  |  Branch (1205:3): [True: 376, False: 0]
  ------------------
 1206|    376|  DEBUGASSERT(r->crt);
  ------------------
  |  | 1016|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1206:3): [True: 0, False: 376]
  |  Branch (1206:3): [True: 376, False: 0]
  ------------------
 1207|    376|  DEBUGASSERT(r->phase == CURL_CR_CLIENT);
  ------------------
  |  | 1016|    376|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1207:3): [True: 0, False: 376]
  |  Branch (1207:3): [True: 376, False: 0]
  ------------------
 1208|       |
 1209|    376|  cl_reset_reader(data);
 1210|    376|  return do_init_reader_stack(data, r);
 1211|    376|}
Curl_client_read:
 1215|  1.20k|{
 1216|  1.20k|  CURLcode result;
 1217|       |
 1218|  1.20k|  DEBUGASSERT(buf);
  ------------------
  |  | 1016|  1.20k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1218:3): [True: 0, False: 1.20k]
  |  Branch (1218:3): [True: 1.20k, False: 0]
  ------------------
 1219|  1.20k|  DEBUGASSERT(blen);
  ------------------
  |  | 1016|  1.20k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1219:3): [True: 0, False: 1.20k]
  |  Branch (1219:3): [True: 1.20k, False: 0]
  ------------------
 1220|  1.20k|  DEBUGASSERT(nread);
  ------------------
  |  | 1016|  1.20k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1220:3): [True: 0, False: 1.20k]
  |  Branch (1220:3): [True: 1.20k, False: 0]
  ------------------
 1221|  1.20k|  DEBUGASSERT(eos);
  ------------------
  |  | 1016|  1.20k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1221:3): [True: 0, False: 1.20k]
  |  Branch (1221:3): [True: 1.20k, False: 0]
  ------------------
 1222|  1.20k|  *nread = 0;
 1223|       |
 1224|  1.20k|  if(!data->req.reader.stack) {
  ------------------
  |  Branch (1224:6): [True: 0, False: 1.20k]
  ------------------
 1225|      0|    result = Curl_creader_set_fread(data, data->state.infilesize);
 1226|      0|    if(result)
  ------------------
  |  Branch (1226:8): [True: 0, False: 0]
  ------------------
 1227|      0|      return result;
 1228|      0|    DEBUGASSERT(data->req.reader.stack);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1228:5): [True: 0, False: 0]
  |  Branch (1228:5): [True: 0, False: 0]
  ------------------
 1229|      0|  }
 1230|  1.20k|  if(!data->req.reader_started) {
  ------------------
  |  Branch (1230:6): [True: 428, False: 781]
  ------------------
 1231|    428|    Curl_rlimit_start(&data->progress.ul.rlimit, Curl_pgrs_now(data), -1);
 1232|    428|    data->req.reader_started = TRUE;
  ------------------
  |  |  986|    428|#define TRUE true
  ------------------
 1233|    428|  }
 1234|       |
 1235|  1.20k|  if(Curl_rlimit_active(&data->progress.ul.rlimit) &&
  ------------------
  |  Branch (1235:6): [True: 0, False: 1.20k]
  ------------------
 1236|      0|     !(data->conn->scheme->flags & PROTOPT_NONETWORK)) {
  ------------------
  |  |  221|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (1236:6): [True: 0, False: 0]
  ------------------
 1237|      0|    curl_off_t ul_avail = Curl_rlimit_avail(&data->progress.ul.rlimit, NULL);
 1238|      0|    if(ul_avail <= 0) {
  ------------------
  |  Branch (1238:8): [True: 0, False: 0]
  ------------------
 1239|      0|      result = CURLE_OK;
 1240|      0|      *eos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1241|      0|      goto out;
 1242|      0|    }
 1243|      0|    if(ul_avail < (curl_off_t)blen)
  ------------------
  |  Branch (1243:8): [True: 0, False: 0]
  ------------------
 1244|      0|      blen = (size_t)ul_avail;
 1245|      0|  }
 1246|  1.20k|  result = Curl_creader_read(data, data->req.reader.stack, buf, blen,
 1247|  1.20k|                             nread, eos);
 1248|       |
 1249|  1.20k|out:
 1250|  1.20k|  CURL_TRC_READ(data, "client_read(len=%zu) -> %d, nread=%zu, eos=%d",
  ------------------
  |  |  163|  1.20k|  do {                                                    \
  |  |  164|  1.20k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|  1.20k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  2.41k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.20k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 584, False: 625]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.41k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 584, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    584|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  1.20k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    584|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 584]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|  1.20k|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|  1.20k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 1.20k]
  |  |  ------------------
  ------------------
 1251|  1.20k|                blen, (int)result, *nread, *eos);
 1252|  1.20k|  return result;
 1253|  1.20k|}
Curl_creader_set_null:
 1306|  8.71k|{
 1307|  8.71k|  struct Curl_creader *r;
 1308|  8.71k|  CURLcode result;
 1309|       |
 1310|  8.71k|  result = Curl_creader_create(&r, data, &cr_null, CURL_CR_CLIENT);
 1311|  8.71k|  if(result)
  ------------------
  |  Branch (1311:6): [True: 1, False: 8.70k]
  ------------------
 1312|      1|    return result;
 1313|       |
 1314|  8.70k|  cl_reset_reader(data);
 1315|  8.70k|  return do_init_reader_stack(data, r);
 1316|  8.71k|}
Curl_creader_set_buf:
 1421|      7|{
 1422|      7|  CURLcode result;
 1423|      7|  struct Curl_creader *r;
 1424|      7|  struct cr_buf_ctx *ctx;
 1425|       |
 1426|      7|  result = Curl_creader_create(&r, data, &cr_buf, CURL_CR_CLIENT);
 1427|      7|  if(result)
  ------------------
  |  Branch (1427:6): [True: 0, False: 7]
  ------------------
 1428|      0|    goto out;
 1429|      7|  ctx = r->ctx;
 1430|      7|  ctx->buf = buf;
 1431|      7|  ctx->blen = blen;
 1432|      7|  ctx->index = 0;
 1433|       |
 1434|      7|  cl_reset_reader(data);
 1435|      7|  result = do_init_reader_stack(data, r);
 1436|      7|out:
 1437|      7|  CURL_TRC_READ(data, "add buf reader, len=%zu -> %d", blen, (int)result);
  ------------------
  |  |  163|      7|  do {                                                    \
  |  |  164|      7|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|      7|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     14|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     14|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      7|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      7|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      7|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 7]
  |  |  ------------------
  ------------------
 1438|      7|  return result;
 1439|      7|}
Curl_creader_total_length:
 1442|  6.32k|{
 1443|  6.32k|  struct Curl_creader *r = data->req.reader.stack;
 1444|  6.32k|  return r ? r->crt->total_length(data, r) : -1;
  ------------------
  |  Branch (1444:10): [True: 6.32k, False: 0]
  ------------------
 1445|  6.32k|}
Curl_creader_done:
 1483|  1.89k|{
 1484|  1.89k|  struct Curl_creader *reader = data->req.reader.stack;
 1485|  3.78k|  while(reader) {
  ------------------
  |  Branch (1485:9): [True: 1.89k, False: 1.89k]
  ------------------
 1486|  1.89k|    reader->crt->done(data, reader, premature);
 1487|  1.89k|    reader = reader->next;
 1488|  1.89k|  }
 1489|  1.89k|}
Curl_creader_get_by_type:
 1493|    749|{
 1494|    749|  struct Curl_creader *r;
 1495|  1.49k|  for(r = data->req.reader.stack; r; r = r->next) {
  ------------------
  |  Branch (1495:35): [True: 749, False: 749]
  ------------------
 1496|    749|    if(r->crt == crt)
  ------------------
  |  Branch (1496:8): [True: 0, False: 749]
  ------------------
 1497|      0|      return r;
 1498|    749|  }
 1499|    749|  return NULL;
 1500|    749|}
sendf.c:cl_reset_reader:
   54|  51.8k|{
   55|  51.8k|  struct Curl_creader *reader = data->req.reader.stack;
   56|  51.8k|  data->req.reader_started = FALSE;
  ------------------
  |  |  989|  51.8k|#define FALSE false
  ------------------
   57|  60.9k|  while(reader) {
  ------------------
  |  Branch (57:9): [True: 9.13k, False: 51.8k]
  ------------------
   58|  9.13k|    data->req.reader.stack = reader->next;
   59|  9.13k|    reader->crt->do_close(data, reader);
   60|  9.13k|    curlx_free(reader);
  ------------------
  |  | 1503|  9.13k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   61|  9.13k|    reader = data->req.reader.stack;
   62|  9.13k|  }
   63|  51.8k|}
sendf.c:cl_reset_writer:
   42|  42.6k|{
   43|  42.6k|  struct Curl_cwriter *writer = data->req.writer.stack;
   44|  80.1k|  while(writer) {
  ------------------
  |  Branch (44:9): [True: 37.4k, False: 42.6k]
  ------------------
   45|  37.4k|    data->req.writer.stack = writer->next;
   46|  37.4k|    writer->cwt->do_close(data, writer);
   47|  37.4k|    curlx_free(writer);
  ------------------
  |  | 1503|  37.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   48|  37.4k|    writer = data->req.writer.stack;
   49|  37.4k|  }
   50|       |  data->req.writer.paused = FALSE;
  ------------------
  |  |  989|  42.6k|#define FALSE false
  ------------------
   51|  42.6k|}
sendf.c:do_init_writer_stack:
  339|  9.37k|{
  340|  9.37k|  struct Curl_cwriter *writer;
  341|  9.37k|  CURLcode result;
  342|       |
  343|  9.37k|  DEBUGASSERT(!data->req.writer.stack);
  ------------------
  |  | 1016|  9.37k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (343:3): [True: 0, False: 9.37k]
  |  Branch (343:3): [True: 9.37k, False: 0]
  ------------------
  344|  9.37k|  result = Curl_cwriter_create(&data->req.writer.stack,
  345|  9.37k|                               data, &Curl_cwt_out, CURL_CW_CLIENT);
  346|  9.37k|  if(result)
  ------------------
  |  Branch (346:6): [True: 2, False: 9.37k]
  ------------------
  347|      2|    return result;
  348|       |
  349|  9.37k|  result = Curl_cwriter_create(&writer, data, &cw_download, CURL_CW_PROTOCOL);
  350|  9.37k|  if(result)
  ------------------
  |  Branch (350:6): [True: 1, False: 9.37k]
  ------------------
  351|      1|    return result;
  352|  9.37k|  cwriter_add(data, writer);
  353|       |
  354|  9.37k|  result = Curl_cwriter_create(&writer, data, &cw_raw, CURL_CW_RAW);
  355|  9.37k|  if(result)
  ------------------
  |  Branch (355:6): [True: 5, False: 9.37k]
  ------------------
  356|      5|    return result;
  357|  9.37k|  cwriter_add(data, writer);
  358|       |
  359|  9.37k|  return result;
  360|  9.37k|}
sendf.c:cw_download_write:
  170|  36.6k|{
  171|  36.6k|  struct cw_download_ctx *ctx = writer->ctx;
  172|  36.6k|  CURLcode result;
  173|  36.6k|  size_t nwrite, excess_len = 0;
  174|  36.6k|  bool is_connect = !!(type & CLIENTWRITE_CONNECT);
  ------------------
  |  |   47|  36.6k|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  175|       |
  176|  36.6k|  if(!ctx->started_response &&
  ------------------
  |  Branch (176:6): [True: 33.4k, False: 3.20k]
  ------------------
  177|  33.4k|     !(type & CLIENTWRITE_CONNECT) &&
  ------------------
  |  |   47|  33.4k|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  |  Branch (177:6): [True: 881, False: 32.5k]
  ------------------
  178|    881|     (!(type & CLIENTWRITE_INFO) || data->req.upload_done)) {
  ------------------
  |  |   44|    881|#define CLIENTWRITE_INFO    (1 << 1) /* meta information, not a HEADER */
  ------------------
  |  Branch (178:7): [True: 881, False: 0]
  |  Branch (178:37): [True: 0, False: 0]
  ------------------
  179|    881|    Curl_pgrsTime(data, TIMER_STARTTRANSFER);
  180|    881|    ctx->started_response = TRUE;
  ------------------
  |  |  986|    881|#define TRUE true
  ------------------
  181|    881|  }
  182|       |
  183|  36.6k|  if(!(type & CLIENTWRITE_BODY)) {
  ------------------
  |  |   43|  36.6k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (183:6): [True: 36.0k, False: 650]
  ------------------
  184|  36.0k|    if(is_connect && data->set.suppress_connect_headers)
  ------------------
  |  Branch (184:8): [True: 32.5k, False: 3.43k]
  |  Branch (184:22): [True: 0, False: 32.5k]
  ------------------
  185|      0|      return CURLE_OK;
  186|  36.0k|#ifdef DEBUGBUILD
  187|  36.0k|    if(is_connect && getenv("CURL_DBG_SUPPRESS_CONNECT_HDS"))
  ------------------
  |  Branch (187:8): [True: 32.5k, False: 3.43k]
  |  Branch (187:22): [True: 0, False: 32.5k]
  ------------------
  188|      0|      return CURLE_OK;
  189|  36.0k|#endif
  190|  36.0k|    result = Curl_cwriter_write(data, writer->next, type, buf, nbytes);
  ------------------
  |  |  189|  36.0k|  ((w) ? (w)->cwt->do_write((d), (w), (t), (b), (n)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (189:4): [True: 36.0k, False: 0]
  |  |  ------------------
  ------------------
  191|  36.0k|    CURL_TRC_WRITE(data, "download_write header(type=%x, blen=%zu) -> %d",
  ------------------
  |  |  158|  36.0k|  do {                                                     \
  |  |  159|  36.0k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|  36.0k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  72.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 36.0k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 16.1k, False: 19.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  72.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 16.1k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  16.1k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  36.0k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  16.1k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 14.0k, False: 2.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|  36.0k|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|  36.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 36.0k]
  |  |  ------------------
  ------------------
  192|  36.0k|                   (unsigned int)type, nbytes, (int)result);
  193|  36.0k|    return result;
  194|  36.0k|  }
  195|       |
  196|    650|  if(!ctx->started_body &&
  ------------------
  |  Branch (196:6): [True: 552, False: 98]
  ------------------
  197|    552|     !(type & (CLIENTWRITE_INFO | CLIENTWRITE_CONNECT))) {
  ------------------
  |  |   44|    552|#define CLIENTWRITE_INFO    (1 << 1) /* meta information, not a HEADER */
  ------------------
                   !(type & (CLIENTWRITE_INFO | CLIENTWRITE_CONNECT))) {
  ------------------
  |  |   47|    552|#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */
  ------------------
  |  Branch (197:6): [True: 552, False: 0]
  ------------------
  198|    552|    Curl_rlimit_start(&data->progress.dl.rlimit, Curl_pgrs_now(data),
  199|    552|                      data->req.size);
  200|    552|    ctx->started_body = TRUE;
  ------------------
  |  |  986|    552|#define TRUE true
  ------------------
  201|    552|  }
  202|       |
  203|       |  /* Here, we deal with REAL BODY bytes. All filtering and transfer
  204|       |   * encodings have been applied and only the true content, e.g. BODY,
  205|       |   * bytes are passed here.
  206|       |   * This allows us to check sizes, update stats, etc. independent
  207|       |   * from the protocol in play. */
  208|       |
  209|    650|  if(data->req.no_body && nbytes > 0) {
  ------------------
  |  Branch (209:6): [True: 7, False: 643]
  |  Branch (209:27): [True: 0, False: 7]
  ------------------
  210|       |    /* BODY arrives although we want none, bail out */
  211|      0|    streamclose(data->conn);
  ------------------
  |  |   71|      0|#define streamclose(x) Curl_conncontrol((x), CONNCTRL_STREAM_CLOSE)
  |  |  ------------------
  |  |  |  |   67|      0|#define CONNCTRL_STREAM_CLOSE    2
  |  |  ------------------
  ------------------
  212|      0|    CURL_TRC_WRITE(data, "download_write body(type=%x, blen=%zu), "
  ------------------
  |  |  158|      0|  do {                                                     \
  |  |  159|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|      0|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  213|      0|                   "did not want a BODY", (unsigned int)type, nbytes);
  214|      0|    data->req.download_done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  215|      0|    if(data->info.header_size)
  ------------------
  |  Branch (215:8): [True: 0, False: 0]
  ------------------
  216|       |      /* if headers have been received, this is fine */
  217|      0|      return CURLE_OK;
  218|      0|    return CURLE_WEIRD_SERVER_REPLY;
  219|      0|  }
  220|       |
  221|       |  /* Determine if we see any bytes in excess to what is allowed.
  222|       |   * We write the allowed bytes and handle excess further below.
  223|       |   * This gives deterministic BODY writes on varying buffer receive
  224|       |   * lengths. */
  225|    650|  nwrite = nbytes;
  226|    650|  if(data->req.maxdownload != -1) {
  ------------------
  |  Branch (226:6): [True: 0, False: 650]
  ------------------
  227|      0|    size_t wmax = get_max_body_write_len(data, data->req.maxdownload);
  228|      0|    if(nwrite > wmax) {
  ------------------
  |  Branch (228:8): [True: 0, False: 0]
  ------------------
  229|      0|      excess_len = nbytes - wmax;
  230|      0|      nwrite = wmax;
  231|      0|    }
  232|       |
  233|      0|    if(nwrite == wmax) {
  ------------------
  |  Branch (233:8): [True: 0, False: 0]
  ------------------
  234|      0|      data->req.download_done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  235|      0|    }
  236|       |
  237|      0|    if((type & CLIENTWRITE_EOS) && !data->req.no_body &&
  ------------------
  |  |   50|      0|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  |  Branch (237:8): [True: 0, False: 0]
  |  Branch (237:36): [True: 0, False: 0]
  ------------------
  238|      0|       (data->req.size > data->req.bytecount)) {
  ------------------
  |  Branch (238:8): [True: 0, False: 0]
  ------------------
  239|      0|      failf(data, "end of response with %" FMT_OFF_T " bytes missing",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  240|      0|            data->req.size - data->req.bytecount);
  241|      0|      return CURLE_PARTIAL_FILE;
  242|      0|    }
  243|      0|  }
  244|       |
  245|       |  /* Error on too large filesize is handled below, after writing
  246|       |   * the permitted bytes */
  247|    650|  if(data->set.max_filesize && !data->req.ignorebody) {
  ------------------
  |  Branch (247:6): [True: 1, False: 649]
  |  Branch (247:32): [True: 1, False: 0]
  ------------------
  248|      1|    size_t wmax = get_max_body_write_len(data, data->set.max_filesize);
  249|      1|    if(nwrite > wmax) {
  ------------------
  |  Branch (249:8): [True: 0, False: 1]
  ------------------
  250|      0|      nwrite = wmax;
  251|      0|    }
  252|      1|  }
  253|       |
  254|    650|  if(!data->req.ignorebody && (nwrite || (type & CLIENTWRITE_EOS))) {
  ------------------
  |  |   50|    533|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  |  Branch (254:6): [True: 650, False: 0]
  |  Branch (254:32): [True: 117, False: 533]
  |  Branch (254:42): [True: 533, False: 0]
  ------------------
  255|    650|    result = Curl_cwriter_write(data, writer->next, type, buf, nwrite);
  ------------------
  |  |  189|    650|  ((w) ? (w)->cwt->do_write((d), (w), (t), (b), (n)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (189:4): [True: 650, False: 0]
  |  |  ------------------
  ------------------
  256|    650|    CURL_TRC_WRITE(data, "download_write body(type=%x, blen=%zu) -> %d",
  ------------------
  |  |  158|    650|  do {                                                     \
  |  |  159|    650|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|    650|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.30k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 650, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 44, False: 606]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.30k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 44, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     44|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|    650|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     44|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 3, False: 41]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|    650|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|    650|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 650]
  |  |  ------------------
  ------------------
  257|    650|                   (unsigned int)type, nbytes, (int)result);
  258|    650|    if(result)
  ------------------
  |  Branch (258:8): [True: 0, False: 650]
  ------------------
  259|      0|      return result;
  260|    650|  }
  261|       |
  262|       |  /* Update stats, write and report progress */
  263|    650|  if(nwrite) {
  ------------------
  |  Branch (263:6): [True: 117, False: 533]
  ------------------
  264|    117|    data->req.bytecount += nwrite;
  265|    117|    Curl_pgrs_download_inc(data, nwrite);
  266|    117|  }
  267|       |
  268|    650|  if(excess_len) {
  ------------------
  |  Branch (268:6): [True: 0, False: 650]
  ------------------
  269|      0|    if(!data->req.ignorebody) {
  ------------------
  |  Branch (269:8): [True: 0, False: 0]
  ------------------
  270|      0|      infof(data,
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  271|      0|            "Excess found writing body:"
  272|      0|            " excess = %zu"
  273|      0|            ", size = %" FMT_OFF_T
  274|      0|            ", maxdownload = %" FMT_OFF_T
  275|      0|            ", bytecount = %" FMT_OFF_T,
  276|      0|            excess_len, data->req.size, data->req.maxdownload,
  277|      0|            data->req.bytecount);
  278|      0|      connclose(data->conn);
  ------------------
  |  |   72|      0|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   66|      0|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
  279|      0|    }
  280|      0|  }
  281|    650|  else if((nwrite < nbytes) && !data->req.ignorebody) {
  ------------------
  |  Branch (281:11): [True: 0, False: 650]
  |  Branch (281:32): [True: 0, False: 0]
  ------------------
  282|      0|    failf(data, "Exceeded the maximum allowed file size "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  283|      0|          "(%" FMT_OFF_T ") with %" FMT_OFF_T " bytes",
  284|      0|          data->set.max_filesize, data->req.bytecount);
  285|      0|    return CURLE_FILESIZE_EXCEEDED;
  286|      0|  }
  287|       |
  288|    650|  return CURLE_OK;
  289|    650|}
sendf.c:get_max_body_write_len:
  151|      1|{
  152|      1|  if(limit != -1) {
  ------------------
  |  Branch (152:6): [True: 1, False: 0]
  ------------------
  153|       |    /* How much more are we allowed to write? */
  154|      1|    return curlx_sotouz_range(limit - data->req.bytecount, 0, SIZE_MAX);
  155|      1|  }
  156|      0|  return SIZE_MAX;
  157|      1|}
sendf.c:cw_raw_write:
  307|  36.7k|{
  308|  36.7k|  if(type & CLIENTWRITE_BODY && data->set.verbose && !data->req.ignorebody) {
  ------------------
  |  |   43|  73.4k|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  |  Branch (308:6): [True: 650, False: 36.0k]
  |  Branch (308:33): [True: 44, False: 606]
  |  Branch (308:54): [True: 44, False: 0]
  ------------------
  309|     44|    Curl_debug(data, CURLINFO_DATA_IN, buf, nbytes);
  310|     44|  }
  311|  36.7k|  return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
  ------------------
  |  |  189|  36.7k|  ((w) ? (w)->cwt->do_write((d), (w), (t), (b), (n)) : CURLE_WRITE_ERROR)
  |  |  ------------------
  |  |  |  Branch (189:4): [True: 36.7k, False: 0]
  |  |  ------------------
  ------------------
  312|  36.7k|}
sendf.c:cwriter_add:
  327|  28.1k|{
  328|  28.1k|  struct Curl_cwriter **anchor = &data->req.writer.stack;
  329|       |
  330|       |  /* Insert the writer as first in its phase.
  331|       |   * Skip existing writers of lower phases. */
  332|  37.4k|  while(*anchor && (*anchor)->phase < writer->phase)
  ------------------
  |  Branch (332:9): [True: 37.4k, False: 0]
  |  Branch (332:20): [True: 9.37k, False: 28.1k]
  ------------------
  333|  9.37k|    anchor = &(*anchor)->next;
  334|  28.1k|  writer->next = *anchor;
  335|  28.1k|  *anchor = writer;
  336|  28.1k|}
sendf.c:cr_in_init:
  645|     44|{
  646|     44|  struct cr_in_ctx *ctx = reader->ctx;
  647|     44|  ctx->read_cb = data->state.fread_func;
  648|     44|  ctx->cb_user_data = data->state.in;
  649|     44|  ctx->use_fread = !data->set.is_fread_set;
  650|     44|  ctx->total_len = -1;
  651|     44|  ctx->read_len = 0;
  652|     44|  return CURLE_OK;
  653|     44|}
sendf.c:cr_in_read:
  660|     92|{
  661|     92|  struct cr_in_ctx *ctx = reader->ctx;
  662|     92|  CURLcode result = CURLE_OK;
  663|     92|  size_t nread;
  664|       |
  665|     92|  ctx->is_paused = FALSE;
  ------------------
  |  |  989|     92|#define FALSE false
  ------------------
  666|       |
  667|       |  /* Once we have errored, we will return the same error forever */
  668|     92|  if(ctx->errored) {
  ------------------
  |  Branch (668:6): [True: 0, False: 92]
  ------------------
  669|      0|    *pnread = 0;
  670|      0|    *peos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  671|      0|    return ctx->error_result;
  672|      0|  }
  673|     92|  if(ctx->seen_eos) {
  ------------------
  |  Branch (673:6): [True: 0, False: 92]
  ------------------
  674|      0|    *pnread = 0;
  675|      0|    *peos = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  676|      0|    return CURLE_OK;
  677|      0|  }
  678|       |  /* respect length limitations */
  679|     92|  if(ctx->total_len >= 0) {
  ------------------
  |  Branch (679:6): [True: 28, False: 64]
  ------------------
  680|     28|    blen = curlx_sotouz_range(ctx->total_len - ctx->read_len, 0, blen);
  681|     28|  }
  682|     92|  nread = 0;
  683|     92|  if(ctx->read_cb && blen) {
  ------------------
  |  Branch (683:6): [True: 92, False: 0]
  |  Branch (683:22): [True: 92, False: 0]
  ------------------
  684|     92|    struct Curl_mapi_guard guard;
  685|     92|    CURL_CBAPI_START(&guard, data, easy_cr_in_read);
  ------------------
  |  |  201|     92|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
  686|     92|    nread = ctx->read_cb(buf, 1, blen, ctx->cb_user_data);
  687|     92|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|     92|  Curl_cbapi_leave(g)
  ------------------
  688|     92|    ctx->has_used_cb = TRUE;
  ------------------
  |  |  986|     92|#define TRUE true
  ------------------
  689|     92|    if(ctx->use_fread && ferror((FILE *)ctx->cb_user_data)) {
  ------------------
  |  Branch (689:8): [True: 0, False: 92]
  |  Branch (689:26): [True: 0, False: 0]
  ------------------
  690|      0|      failf(data, "Error reading upload data");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  691|      0|      ctx->errored = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  692|      0|      ctx->error_result = CURLE_READ_ERROR;
  693|      0|      *pnread = 0;
  694|      0|      *peos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  695|      0|      return CURLE_READ_ERROR;
  696|      0|    }
  697|     92|  }
  698|       |
  699|     92|  switch(nread) {
  700|     44|  case 0:
  ------------------
  |  Branch (700:3): [True: 44, False: 48]
  ------------------
  701|     44|    if((ctx->total_len >= 0) && (ctx->read_len < ctx->total_len)) {
  ------------------
  |  Branch (701:8): [True: 14, False: 30]
  |  Branch (701:33): [True: 14, False: 0]
  ------------------
  702|     14|      failf(data, "client read function EOF fail, "
  ------------------
  |  |   62|     14|#define failf Curl_failf
  ------------------
  703|     14|            "only %" FMT_OFF_T "/%" FMT_OFF_T " of needed bytes read",
  704|     14|            ctx->read_len, ctx->total_len);
  705|     14|      result = CURLE_READ_ERROR;
  706|     14|      break;
  707|     14|    }
  708|     30|    *pnread = 0;
  709|     30|    *peos = TRUE;
  ------------------
  |  |  986|     30|#define TRUE true
  ------------------
  710|     30|    ctx->seen_eos = TRUE;
  ------------------
  |  |  986|     30|#define TRUE true
  ------------------
  711|     30|    break;
  712|       |
  713|      0|  case CURL_READFUNC_ABORT:
  ------------------
  |  |  392|      0|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  |  Branch (713:3): [True: 0, False: 92]
  ------------------
  714|      0|    failf(data, "operation aborted by callback");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  715|      0|    *pnread = 0;
  716|      0|    *peos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  717|      0|    ctx->errored = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  718|      0|    ctx->error_result = CURLE_ABORTED_BY_CALLBACK;
  719|      0|    result = CURLE_ABORTED_BY_CALLBACK;
  720|      0|    break;
  721|       |
  722|      0|  case CURL_READFUNC_PAUSE:
  ------------------
  |  |  395|      0|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  |  Branch (722:3): [True: 0, False: 92]
  ------------------
  723|      0|    if(data->conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  221|      0|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (723:8): [True: 0, False: 0]
  ------------------
  724|       |      /* protocols that work without network cannot be paused. This is
  725|       |         actually only file:// now, and it cannot pause since the transfer
  726|       |         is not done using the "normal" procedure. */
  727|      0|      failf(data, "Read callback asked for PAUSE when not supported");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  728|      0|      result = CURLE_READ_ERROR;
  729|      0|      break;
  730|      0|    }
  731|       |    /* CURL_READFUNC_PAUSE pauses read callbacks that feed socket writes */
  732|      0|    CURL_TRC_READ(data, "cr_in_read, callback returned CURL_READFUNC_PAUSE");
  ------------------
  |  |  163|      0|  do {                                                    \
  |  |  164|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      0|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  733|      0|    ctx->is_paused = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  734|      0|    *pnread = 0;
  735|      0|    *peos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  736|      0|    result = Curl_xfer_pause_send(data, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  737|      0|    break; /* nothing was read */
  738|       |
  739|     48|  default:
  ------------------
  |  Branch (739:3): [True: 48, False: 44]
  ------------------
  740|     48|    if(nread > blen) {
  ------------------
  |  Branch (740:8): [True: 0, False: 48]
  ------------------
  741|       |      /* the read function returned a too large value */
  742|      0|      failf(data, "read function returned funny value");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  743|      0|      *pnread = 0;
  744|      0|      *peos = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  745|      0|      ctx->errored = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  746|      0|      ctx->error_result = CURLE_READ_ERROR;
  747|      0|      result = CURLE_READ_ERROR;
  748|      0|      break;
  749|      0|    }
  750|     48|    ctx->read_len += nread;
  751|     48|    if(ctx->total_len >= 0)
  ------------------
  |  Branch (751:8): [True: 14, False: 34]
  ------------------
  752|     14|      ctx->seen_eos = (ctx->read_len >= ctx->total_len);
  753|     48|    *pnread = nread;
  754|     48|    *peos = (bool)ctx->seen_eos;
  755|     48|    break;
  756|     92|  }
  757|     92|  CURL_TRC_READ(data, "cr_in_read(len=%zu, total=%" FMT_OFF_T
  ------------------
  |  |  163|     92|  do {                                                    \
  |  |  164|     92|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|     92|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    184|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 92, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 20, False: 72]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    184|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 20, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     20|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|     92|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     20|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|     92|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|     92|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 92]
  |  |  ------------------
  ------------------
  758|     92|                ", read=%" FMT_OFF_T ") -> %d, nread=%zu, eos=%d",
  759|     92|                blen, ctx->total_len, ctx->read_len, (int)result,
  760|     92|                *pnread, *peos);
  761|     92|  return result;
  762|     92|}
sendf.c:cr_in_total_length:
  774|    176|{
  775|    176|  struct cr_in_ctx *ctx = reader->ctx;
  776|    176|  (void)data;
  777|    176|  return ctx->total_len;
  778|    176|}
sendf.c:do_init_reader_stack:
 1129|  9.13k|{
 1130|  9.13k|  CURLcode result = CURLE_OK;
 1131|  9.13k|  curl_off_t clen;
 1132|       |
 1133|  9.13k|  DEBUGASSERT(r);
  ------------------
  |  | 1016|  9.13k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1133:3): [True: 0, False: 9.13k]
  |  Branch (1133:3): [True: 9.13k, False: 0]
  ------------------
 1134|  9.13k|  DEBUGASSERT(r->crt);
  ------------------
  |  | 1016|  9.13k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1134:3): [True: 0, False: 9.13k]
  |  Branch (1134:3): [True: 9.13k, False: 0]
  ------------------
 1135|  9.13k|  DEBUGASSERT(r->phase == CURL_CR_CLIENT);
  ------------------
  |  | 1016|  9.13k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1135:3): [True: 0, False: 9.13k]
  |  Branch (1135:3): [True: 9.13k, False: 0]
  ------------------
 1136|  9.13k|  DEBUGASSERT(!data->req.reader.stack);
  ------------------
  |  | 1016|  9.13k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1136:3): [True: 0, False: 9.13k]
  |  Branch (1136:3): [True: 9.13k, False: 0]
  ------------------
 1137|       |
 1138|  9.13k|  data->req.reader.stack = r;
 1139|  9.13k|  clen = r->crt->total_length(data, r);
 1140|       |  /* if we do not have 0 length init, and CRLF conversion is wanted,
 1141|       |   * add the reader for it */
 1142|  9.13k|  if(clen &&
  ------------------
  |  Branch (1142:6): [True: 427, False: 8.70k]
  ------------------
 1143|    427|#ifdef CURL_PREFER_LF_LINEENDS
 1144|    427|    (data->set.crlf || data->state.prefer_ascii)
  ------------------
  |  Branch (1144:6): [True: 0, False: 427]
  |  Branch (1144:24): [True: 0, False: 427]
  ------------------
 1145|       |#else
 1146|       |    data->set.crlf
 1147|       |#endif
 1148|  9.13k|    ) {
 1149|      0|    result = cr_lc_add(data);
 1150|      0|    if(result) {
  ------------------
  |  Branch (1150:8): [True: 0, False: 0]
  ------------------
 1151|       |      /* Adding the line-conversion reader failed. Undo the publication of
 1152|       |       * `r` so no freed reader remains reachable from
 1153|       |       * `data->req.reader.stack`, and free the readers already installed. */
 1154|      0|      cl_reset_reader(data);
 1155|      0|      return result;
 1156|      0|    }
 1157|      0|  }
 1158|       |
 1159|  9.13k|  return result;
 1160|  9.13k|}
sendf.c:cr_null_read:
 1272|      1|{
 1273|      1|  (void)data;
 1274|      1|  (void)reader;
 1275|      1|  (void)buf;
 1276|      1|  (void)blen;
 1277|      1|  *pnread = 0;
 1278|       |  *peos = TRUE;
  ------------------
  |  |  986|      1|#define TRUE true
  ------------------
 1279|      1|  return CURLE_OK;
 1280|      1|}
sendf.c:cr_null_total_length:
 1284|  13.3k|{
 1285|       |  /* this reader changes length depending on input */
 1286|  13.3k|  (void)data;
 1287|  13.3k|  (void)reader;
 1288|  13.3k|  return 0;
 1289|  13.3k|}
sendf.c:cr_buf_read:
 1329|      7|{
 1330|      7|  struct cr_buf_ctx *ctx = reader->ctx;
 1331|      7|  size_t nread = ctx->blen - ctx->index;
 1332|       |
 1333|      7|  if(!nread || !ctx->buf) {
  ------------------
  |  Branch (1333:6): [True: 0, False: 7]
  |  Branch (1333:16): [True: 0, False: 7]
  ------------------
 1334|      0|    *pnread = 0;
 1335|      0|    *peos = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1336|      0|  }
 1337|      7|  else {
 1338|      7|    if(nread > blen)
  ------------------
  |  Branch (1338:8): [True: 0, False: 7]
  ------------------
 1339|      0|      nread = blen;
 1340|      7|    memcpy(buf, ctx->buf + ctx->index, nread);
 1341|      7|    *pnread = nread;
 1342|      7|    ctx->index += nread;
 1343|      7|    *peos = (ctx->index == ctx->blen);
 1344|      7|  }
 1345|      7|  CURL_TRC_READ(data, "cr_buf_read(len=%zu) -> 0, nread=%zu, eos=%d",
  ------------------
  |  |  163|      7|  do {                                                    \
  |  |  164|      7|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
  |  |  ------------------
  |  |  |  |  329|      7|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     14|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 7, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     14|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      7|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  165|      7|      Curl_trc_read(data, __VA_ARGS__);                   \
  |  |  166|      7|  } while(0)
  |  |  ------------------
  |  |  |  Branch (166:11): [Folded, False: 7]
  |  |  ------------------
  ------------------
 1346|      7|                blen, *pnread, *peos);
 1347|      7|  return CURLE_OK;
 1348|      7|}
sendf.c:cr_buf_total_length:
 1376|     28|{
 1377|     28|  struct cr_buf_ctx *ctx = reader->ctx;
 1378|     28|  (void)data;
 1379|     28|  return (curl_off_t)ctx->blen;
 1380|     28|}

Curl_setstropt:
   81|  77.4k|{
   82|  77.4k|  size_t slen = s ? strlen(s) : 0;
  ------------------
  |  Branch (82:17): [True: 77.4k, False: 0]
  ------------------
   83|  77.4k|  DEBUGASSERT((unsigned)id <= UINT8_MAX);
  ------------------
  |  | 1016|  77.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (83:3): [True: 0, False: 77.4k]
  |  Branch (83:3): [True: 77.4k, False: 0]
  ------------------
   84|  77.4k|  if(s && (slen > CURL_MAX_INPUT_LENGTH))
  ------------------
  |  |   45|  77.4k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (84:6): [True: 77.4k, False: 0]
  |  Branch (84:11): [True: 0, False: 77.4k]
  ------------------
   85|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
   86|       |
   87|  77.4k|  return CURL_EASY_STR_SET(data, (uint8_t)id, s, slen);
  ------------------
  |  | 1208|  77.4k|  Curl_u8_strset_setx(&(d)->set.strings, (uint8_t)(id), s, slen)
  ------------------
   88|  77.4k|}
Curl_setblobopt:
   92|  9.91k|{
   93|       |  /* free the previous storage at `blobp' and replace by a dynamic storage
   94|       |     copy of blob. If CURL_BLOB_COPY is set, the data is copied. */
   95|       |
   96|  9.91k|  curlx_safefree(*blobp);
  ------------------
  |  | 1359|  9.91k|  do {                      \
  |  | 1360|  9.91k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.91k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.91k|    (ptr) = NULL;           \
  |  | 1362|  9.91k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.91k]
  |  |  ------------------
  ------------------
   97|       |
   98|  9.91k|  if(blob) {
  ------------------
  |  Branch (98:6): [True: 9.91k, False: 0]
  ------------------
   99|  9.91k|    struct curl_blob *nblob;
  100|  9.91k|    if(!blob->data || !blob->len || (blob->len > CURL_MAX_INPUT_LENGTH))
  ------------------
  |  |   45|  9.91k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (100:8): [True: 0, False: 9.91k]
  |  Branch (100:23): [True: 0, False: 9.91k]
  |  Branch (100:37): [True: 0, False: 9.91k]
  ------------------
  101|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  102|  9.91k|    nblob = (struct curl_blob *)
  103|  9.91k|      curlx_malloc(sizeof(struct curl_blob) +
  ------------------
  |  | 1498|  19.8k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  |  |  ------------------
  |  |  |  Branch (1498:52): [True: 0, False: 9.91k]
  |  |  ------------------
  ------------------
  104|  9.91k|                   ((blob->flags & CURL_BLOB_COPY) ? blob->len : 0));
  105|  9.91k|    if(!nblob)
  ------------------
  |  Branch (105:8): [True: 31, False: 9.88k]
  ------------------
  106|     31|      return CURLE_OUT_OF_MEMORY;
  107|  9.88k|    *nblob = *blob;
  108|  9.88k|    if(blob->flags & CURL_BLOB_COPY) {
  ------------------
  |  |   31|  9.88k|#define CURL_BLOB_COPY   1 /* tell libcurl to copy the data */
  ------------------
  |  Branch (108:8): [True: 0, False: 9.88k]
  ------------------
  109|       |      /* put the data after the blob struct in memory */
  110|      0|      nblob->data = (char *)nblob + sizeof(struct curl_blob);
  111|      0|      memcpy(nblob->data, blob->data, blob->len);
  112|      0|    }
  113|       |
  114|  9.88k|    *blobp = nblob;
  115|  9.88k|    return CURLE_OK;
  116|  9.91k|  }
  117|       |
  118|      0|  return CURLE_OK;
  119|  9.91k|}
Curl_setopt_SSLVERSION:
  291|  39.4k|{
  292|       |  /*
  293|       |   * Set explicit SSL version to try to connect with, as some SSL
  294|       |   * implementations are lame.
  295|       |   */
  296|  39.4k|  {
  297|  39.4k|    long version, version_max;
  298|  39.4k|    struct ssl_easy_config *sslc = &data->set.ssl;
  299|  39.4k|#ifndef CURL_DISABLE_PROXY
  300|  39.4k|    if(option != CURLOPT_SSLVERSION)
  ------------------
  |  Branch (300:8): [True: 19.7k, False: 19.7k]
  ------------------
  301|  19.7k|      sslc = &data->set.proxy_ssl;
  302|       |#else
  303|       |    (void)option; /* unused */
  304|       |#endif
  305|  39.4k|    version = C_SSLVERSION_VALUE(arg);
  ------------------
  |  |  170|  39.4k|#define C_SSLVERSION_VALUE(x)     ((x) & 0xffff)
  ------------------
  306|  39.4k|    version_max = (long)C_SSLVERSION_MAX_VALUE(arg);
  ------------------
  |  |  171|  39.4k|#define C_SSLVERSION_MAX_VALUE(x) ((unsigned long)(x) & 0xffff0000)
  ------------------
  307|       |
  308|  39.4k|    if(version < CURL_SSLVERSION_DEFAULT ||
  ------------------
  |  | 2394|  78.9k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  |  Branch (308:8): [True: 0, False: 39.4k]
  ------------------
  309|  39.4k|       version == CURL_SSLVERSION_SSLv2 ||
  ------------------
  |  | 2396|  78.9k|#define CURL_SSLVERSION_SSLv2   2L
  ------------------
  |  Branch (309:8): [True: 0, False: 39.4k]
  ------------------
  310|  39.4k|       version == CURL_SSLVERSION_SSLv3 ||
  ------------------
  |  | 2397|  78.9k|#define CURL_SSLVERSION_SSLv3   3L
  ------------------
  |  Branch (310:8): [True: 0, False: 39.4k]
  ------------------
  311|  39.4k|       version >= CURL_SSLVERSION_LAST ||
  ------------------
  |  | 2403|  78.9k|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  ------------------
  |  Branch (311:8): [True: 0, False: 39.4k]
  ------------------
  312|  39.4k|       version_max < CURL_SSLVERSION_MAX_NONE ||
  ------------------
  |  | 2405|  78.9k|#define CURL_SSLVERSION_MAX_NONE 0L
  ------------------
  |  Branch (312:8): [True: 0, False: 39.4k]
  ------------------
  313|  39.4k|       version_max >= CURL_SSLVERSION_MAX_LAST)
  ------------------
  |  | 2413|  39.4k|#define CURL_SSLVERSION_MAX_LAST    (CURL_SSLVERSION_LAST    << 16)
  |  |  ------------------
  |  |  |  | 2403|  39.4k|#define CURL_SSLVERSION_LAST    8L /* never use, keep last */
  |  |  ------------------
  ------------------
  |  Branch (313:8): [True: 0, False: 39.4k]
  ------------------
  314|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  315|  39.4k|    if(version == CURL_SSLVERSION_DEFAULT)
  ------------------
  |  | 2394|  39.4k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  |  Branch (315:8): [True: 39.4k, False: 0]
  ------------------
  316|  39.4k|      version = CURL_SSLVERSION_TLSv1_2;
  ------------------
  |  | 2400|  39.4k|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  317|       |
  318|  39.4k|    sslc->version = (unsigned char)version;
  319|  39.4k|    sslc->version_max = (unsigned int)version_max;
  320|  39.4k|  }
  321|      0|  return CURLE_OK;
  322|  39.4k|}
Curl_vsetopt:
 2901|   310k|{
 2902|   310k|  if(option < CURLOPTTYPE_OBJECTPOINT)
  ------------------
  |  | 1124|   310k|#define CURLOPTTYPE_OBJECTPOINT   10000
  ------------------
  |  Branch (2902:6): [True: 89.3k, False: 221k]
  ------------------
 2903|  89.3k|    return setopt_long(data, option, va_arg(param, long));
 2904|   221k|  else if(option < CURLOPTTYPE_FUNCTIONPOINT) {
  ------------------
  |  | 1125|   221k|#define CURLOPTTYPE_FUNCTIONPOINT 20000
  ------------------
  |  Branch (2904:11): [True: 165k, False: 55.5k]
  ------------------
 2905|       |    /* unfortunately, different pointer types cannot be identified any other
 2906|       |       way than being listed explicitly */
 2907|   165k|    switch(option) {
 2908|    772|    case CURLOPT_HTTPHEADER:
  ------------------
  |  Branch (2908:5): [True: 772, False: 164k]
  ------------------
 2909|    772|    case CURLOPT_QUOTE:
  ------------------
  |  Branch (2909:5): [True: 0, False: 165k]
  ------------------
 2910|    772|    case CURLOPT_POSTQUOTE:
  ------------------
  |  Branch (2910:5): [True: 0, False: 165k]
  ------------------
 2911|    772|    case CURLOPT_TELNETOPTIONS:
  ------------------
  |  Branch (2911:5): [True: 0, False: 165k]
  ------------------
 2912|    772|    case CURLOPT_PREQUOTE:
  ------------------
  |  Branch (2912:5): [True: 0, False: 165k]
  ------------------
 2913|    772|    case CURLOPT_HTTP200ALIASES:
  ------------------
  |  Branch (2913:5): [True: 0, False: 165k]
  ------------------
 2914|    772|    case CURLOPT_MAIL_RCPT:
  ------------------
  |  Branch (2914:5): [True: 0, False: 165k]
  ------------------
 2915|    772|    case CURLOPT_RESOLVE:
  ------------------
  |  Branch (2915:5): [True: 0, False: 165k]
  ------------------
 2916|    772|    case CURLOPT_PROXYHEADER:
  ------------------
  |  Branch (2916:5): [True: 0, False: 165k]
  ------------------
 2917|  18.3k|    case CURLOPT_CONNECT_TO:
  ------------------
  |  Branch (2917:5): [True: 17.5k, False: 147k]
  ------------------
 2918|  18.3k|      return setopt_slist(data, option, va_arg(param, struct curl_slist *));
 2919|      0|    case CURLOPT_HTTPPOST:         /* curl_httppost * */
  ------------------
  |  Branch (2919:5): [True: 0, False: 165k]
  ------------------
 2920|  2.02k|    case CURLOPT_MIMEPOST:         /* curl_mime * */
  ------------------
  |  Branch (2920:5): [True: 2.02k, False: 163k]
  ------------------
 2921|  2.02k|    case CURLOPT_STDERR:           /* FILE * */
  ------------------
  |  Branch (2921:5): [True: 0, False: 165k]
  ------------------
 2922|  2.02k|    case CURLOPT_SHARE:            /* CURLSH * */
  ------------------
  |  Branch (2922:5): [True: 0, False: 165k]
  ------------------
 2923|  2.02k|    case CURLOPT_CURLU:            /* CURLU * */
  ------------------
  |  Branch (2923:5): [True: 0, False: 165k]
  ------------------
 2924|  2.02k|      return setopt_pointers(data, option, param);
 2925|      0|    case CURLOPT_STREAM_DEPENDS:   /* CURL * */
  ------------------
  |  Branch (2925:5): [True: 0, False: 165k]
  ------------------
 2926|      0|    case CURLOPT_STREAM_DEPENDS_E: /* CURL * */
  ------------------
  |  Branch (2926:5): [True: 0, False: 165k]
  ------------------
 2927|      0|      return CURLE_OK;
 2928|   145k|    default:
  ------------------
  |  Branch (2928:5): [True: 145k, False: 20.3k]
  ------------------
 2929|   145k|      break;
 2930|   165k|    }
 2931|       |    /* the char pointer options */
 2932|   145k|    return setopt_cptr(data, option, va_arg(param, char *));
 2933|   165k|  }
 2934|  55.5k|  else if(option < CURLOPTTYPE_OFF_T)
  ------------------
  |  | 1126|  55.5k|#define CURLOPTTYPE_OFF_T         30000
  ------------------
  |  Branch (2934:11): [True: 42.9k, False: 12.5k]
  ------------------
 2935|  42.9k|    return setopt_func(data, option, param);
 2936|  12.5k|  else if(option < CURLOPTTYPE_BLOB)
  ------------------
  |  | 1127|  12.5k|#define CURLOPTTYPE_BLOB          40000
  ------------------
  |  Branch (2936:11): [True: 2.66k, False: 9.91k]
  ------------------
 2937|  2.66k|    return setopt_offt(data, option, va_arg(param, curl_off_t));
 2938|  9.91k|  return setopt_blob(data, option, va_arg(param, struct curl_blob *));
 2939|   310k|}
curl_easy_setopt:
 2950|   310k|{
 2951|   310k|  struct Curl_eapi_guard guard;
 2952|   310k|  CURLcode result;
 2953|       |
 2954|   310k|  if(CURL_EAPI_ENTER(&guard, curl, easy_setopt, &result)) {
  ------------------
  |  |  163|   310k|  Curl_eapi_enter(g, curl, CURL_EAPI_FN_##fn, r) && (curl)
  |  |  ------------------
  |  |  |  Branch (163:3): [True: 310k, False: 0]
  |  |  |  Branch (163:53): [True: 310k, False: 0]
  |  |  ------------------
  ------------------
 2955|   310k|    struct Curl_easy *data = curl;
 2956|   310k|    va_list arg;
 2957|       |
 2958|   310k|    va_start(arg, option);
 2959|       |
 2960|   310k|    result = Curl_vsetopt(data, option, arg);
 2961|       |
 2962|   310k|    va_end(arg);
 2963|   310k|    if(result == CURLE_BAD_FUNCTION_ARGUMENT)
  ------------------
  |  Branch (2963:8): [True: 2.37k, False: 308k]
  ------------------
 2964|  2.37k|      failf(data, "setopt 0x%x got bad argument", (unsigned int)option);
  ------------------
  |  |   62|  2.37k|#define failf Curl_failf
  ------------------
 2965|   310k|  }
 2966|   310k|  CURL_EAPI_LEAVE(&guard);
  ------------------
  |  |  165|   310k|  Curl_eapi_leave(g)
  ------------------
 2967|   310k|  return result;
 2968|   310k|}
setopt.c:setopt_long:
 1261|  89.3k|{
 1262|  89.3k|  typedef CURLcode (*setoptfunc)(struct Curl_easy *data,
 1263|  89.3k|                                 CURLoption option, long arg);
 1264|  89.3k|  static const setoptfunc setopt_call[] = {
 1265|  89.3k|    setopt_long_bool,
 1266|  89.3k|    setopt_long_net,
 1267|  89.3k|    setopt_long_http,
 1268|  89.3k|    setopt_long_proxy,
 1269|  89.3k|    setopt_long_ssl,
 1270|  89.3k|    setopt_long_proto,
 1271|  89.3k|    setopt_long_misc
 1272|  89.3k|  };
 1273|  89.3k|  size_t i;
 1274|       |
 1275|   171k|  for(i = 0; i < CURL_ARRAYSIZE(setopt_call); i++) {
  ------------------
  |  | 1326|   171k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (1275:14): [True: 171k, False: 0]
  ------------------
 1276|   171k|    CURLcode result = setopt_call[i](data, option, arg);
 1277|   171k|    if(result != CURLE_UNKNOWN_OPTION)
  ------------------
  |  Branch (1277:8): [True: 89.3k, False: 82.4k]
  ------------------
 1278|  89.3k|      return result;
 1279|   171k|  }
 1280|      0|  return CURLE_UNKNOWN_OPTION;
 1281|  89.3k|}
setopt.c:setopt_long_bool:
  342|  89.3k|{
  343|  89.3k|  bool enabled = !!arg;
  344|  89.3k|  int ok = 1;
  345|  89.3k|  struct UserDefined *s = &data->set;
  346|  89.3k|  switch(option) {
  347|    195|  case CURLOPT_FORBID_REUSE:
  ------------------
  |  Branch (347:3): [True: 195, False: 89.1k]
  ------------------
  348|       |    /*
  349|       |     * When this transfer is done, it must not be left to be reused by a
  350|       |     * subsequent transfer but shall be closed immediately.
  351|       |     */
  352|    195|    s->reuse_forbid = enabled;
  353|    195|    break;
  354|    239|  case CURLOPT_FRESH_CONNECT:
  ------------------
  |  Branch (354:3): [True: 239, False: 89.1k]
  ------------------
  355|       |    /*
  356|       |     * This transfer shall not use a previously cached connection but
  357|       |     * should be made with a fresh new connect!
  358|       |     */
  359|    239|    s->reuse_fresh = enabled;
  360|    239|    break;
  361|    985|  case CURLOPT_VERBOSE:
  ------------------
  |  Branch (361:3): [True: 985, False: 88.3k]
  ------------------
  362|       |    /*
  363|       |     * Verbose means infof() calls that give a lot of information about
  364|       |     * the connection and transfer procedures as well as internal choices.
  365|       |     */
  366|    985|    s->verbose = enabled;
  367|    985|    break;
  368|    471|  case CURLOPT_HEADER:
  ------------------
  |  Branch (368:3): [True: 471, False: 88.8k]
  ------------------
  369|       |    /*
  370|       |     * Set to include the header in the general data output stream.
  371|       |     */
  372|    471|    s->include_header = enabled;
  373|    471|    break;
  374|      0|  case CURLOPT_NOPROGRESS:
  ------------------
  |  Branch (374:3): [True: 0, False: 89.3k]
  ------------------
  375|       |    /*
  376|       |     * Shut off the internal supported progress meter
  377|       |     */
  378|      0|    data->progress.hide = enabled;
  379|      0|    break;
  380|    451|  case CURLOPT_NOBODY:
  ------------------
  |  Branch (380:3): [True: 451, False: 88.8k]
  ------------------
  381|       |    /*
  382|       |     * Do not include the body part in the output data stream.
  383|       |     */
  384|    451|    s->opt_no_body = enabled;
  385|    451|#ifndef CURL_DISABLE_HTTP
  386|    451|    if(s->opt_no_body)
  ------------------
  |  Branch (386:8): [True: 233, False: 218]
  ------------------
  387|       |      /* in HTTP lingo, no body means using the HEAD request... */
  388|    233|      s->method = HTTPREQ_HEAD;
  389|    218|    else if(s->method == HTTPREQ_HEAD)
  ------------------
  |  Branch (389:13): [True: 99, False: 119]
  ------------------
  390|     99|      s->method = HTTPREQ_GET;
  391|    451|#endif
  392|    451|    break;
  393|    247|  case CURLOPT_FAILONERROR:
  ------------------
  |  Branch (393:3): [True: 247, False: 89.0k]
  ------------------
  394|       |    /*
  395|       |     * Do not output the >=400 error code HTML-page, but instead only
  396|       |     * return error.
  397|       |     */
  398|    247|    s->http_fail_on_error = enabled;
  399|    247|    break;
  400|    225|  case CURLOPT_KEEP_SENDING_ON_ERROR:
  ------------------
  |  Branch (400:3): [True: 225, False: 89.1k]
  ------------------
  401|    225|    s->http_keep_sending_on_error = enabled;
  402|    225|    break;
  403|    452|  case CURLOPT_UPLOAD:
  ------------------
  |  Branch (403:3): [True: 452, False: 88.8k]
  ------------------
  404|    452|  case CURLOPT_PUT:
  ------------------
  |  Branch (404:3): [True: 0, False: 89.3k]
  ------------------
  405|       |    /*
  406|       |     * We want to send data to the remote host. If this is HTTP, that equals
  407|       |     * using the PUT request.
  408|       |     */
  409|    452|    if(enabled) {
  ------------------
  |  Branch (409:8): [True: 310, False: 142]
  ------------------
  410|       |      /* If this is HTTP, PUT is what is needed to "upload" */
  411|    310|      s->method = HTTPREQ_PUT;
  412|    310|      s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  |  989|    310|#define FALSE false
  ------------------
  413|    310|    }
  414|    142|    else
  415|       |      /* In HTTP, the opposite of upload is GET (unless NOBODY is true as
  416|       |         then this can be changed to HEAD later on) */
  417|    142|      s->method = HTTPREQ_GET;
  418|    452|    break;
  419|    230|  case CURLOPT_FILETIME:
  ------------------
  |  Branch (419:3): [True: 230, False: 89.1k]
  ------------------
  420|       |    /*
  421|       |     * Try to get the file time of the remote document. The time will
  422|       |     * later (possibly) become available using curl_easy_getinfo().
  423|       |     */
  424|    230|    s->get_filetime = enabled;
  425|    230|    break;
  426|      0|#ifndef CURL_DISABLE_HTTP
  427|    233|  case CURLOPT_HTTP09_ALLOWED:
  ------------------
  |  Branch (427:3): [True: 233, False: 89.1k]
  ------------------
  428|    233|    s->http09_allowed = enabled;
  429|    233|    break;
  430|      0|#ifndef CURL_DISABLE_COOKIES
  431|  1.35k|  case CURLOPT_COOKIESESSION:
  ------------------
  |  Branch (431:3): [True: 1.35k, False: 87.9k]
  ------------------
  432|       |    /*
  433|       |     * Set this option to TRUE to start a new "cookie session". It will
  434|       |     * prevent the forthcoming read-cookies-from-file actions to accept
  435|       |     * cookies that are marked as being session cookies, as they belong to a
  436|       |     * previous session.
  437|       |     */
  438|  1.35k|    s->cookiesession = enabled;
  439|  1.35k|    break;
  440|      0|#endif
  441|    731|  case CURLOPT_AUTOREFERER:
  ------------------
  |  Branch (441:3): [True: 731, False: 88.6k]
  ------------------
  442|       |    /*
  443|       |     * Switch on automatic referer that gets set if curl follows locations.
  444|       |     */
  445|    731|    s->http_auto_referer = enabled;
  446|    731|    break;
  447|    168|  case CURLOPT_TRANSFER_ENCODING:
  ------------------
  |  Branch (447:3): [True: 168, False: 89.1k]
  ------------------
  448|    168|    s->http_transfer_encoding = enabled;
  449|    168|    break;
  450|    205|  case CURLOPT_UNRESTRICTED_AUTH:
  ------------------
  |  Branch (450:3): [True: 205, False: 89.1k]
  ------------------
  451|       |    /*
  452|       |     * Send authentication (user+password) when following locations, even when
  453|       |     * hostname changed.
  454|       |     */
  455|    205|    s->allow_auth_to_other_hosts = enabled;
  456|    205|    break;
  457|    170|  case CURLOPT_HTTP_TRANSFER_DECODING:
  ------------------
  |  Branch (457:3): [True: 170, False: 89.1k]
  ------------------
  458|       |    /*
  459|       |     * disable libcurl transfer encoding is used
  460|       |     */
  461|    170|    s->http_te_skip = !enabled; /* reversed */
  462|    170|    break;
  463|    248|  case CURLOPT_HTTP_CONTENT_DECODING:
  ------------------
  |  Branch (463:3): [True: 248, False: 89.0k]
  ------------------
  464|       |    /*
  465|       |     * raw data passed to the application when content encoding is used
  466|       |     */
  467|    248|    s->http_ce_skip = !enabled; /* reversed */
  468|    248|    break;
  469|    540|  case CURLOPT_HTTPGET:
  ------------------
  |  Branch (469:3): [True: 540, False: 88.8k]
  ------------------
  470|       |    /*
  471|       |     * Set to force us do HTTP GET
  472|       |     */
  473|    540|    if(enabled) {
  ------------------
  |  Branch (473:8): [True: 498, False: 42]
  ------------------
  474|    498|      s->method = HTTPREQ_GET;
  475|    498|      s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  |  989|    498|#define FALSE false
  ------------------
  476|    498|    }
  477|    540|    break;
  478|    266|  case CURLOPT_POST:
  ------------------
  |  Branch (478:3): [True: 266, False: 89.0k]
  ------------------
  479|       |    /* Does this option serve a purpose anymore? Yes it does, when
  480|       |       CURLOPT_POSTFIELDS is not used and the POST data is read off the
  481|       |       callback! */
  482|    266|    if(enabled) {
  ------------------
  |  Branch (482:8): [True: 132, False: 134]
  ------------------
  483|    132|      s->method = HTTPREQ_POST;
  484|    132|      s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  |  989|    132|#define FALSE false
  ------------------
  485|    132|    }
  486|    134|    else
  487|    134|      s->method = HTTPREQ_GET;
  488|    266|    break;
  489|      0|#endif /* !CURL_DISABLE_HTTP */
  490|      0|#ifndef CURL_DISABLE_PROXY
  491|  7.65k|  case CURLOPT_HTTPPROXYTUNNEL:
  ------------------
  |  Branch (491:3): [True: 7.65k, False: 81.6k]
  ------------------
  492|       |    /*
  493|       |     * Tunnel operations through the proxy instead of normal proxy use
  494|       |     */
  495|  7.65k|    s->tunnel_thru_httpproxy = enabled;
  496|  7.65k|    break;
  497|      0|  case CURLOPT_HAPROXYPROTOCOL:
  ------------------
  |  Branch (497:3): [True: 0, False: 89.3k]
  ------------------
  498|       |    /*
  499|       |     * Set to send the HAProxy Proxy Protocol header
  500|       |     */
  501|      0|    s->haproxyprotocol = enabled;
  502|      0|    break;
  503|      0|  case CURLOPT_PROXY_SSL_VERIFYPEER:
  ------------------
  |  Branch (503:3): [True: 0, False: 89.3k]
  ------------------
  504|       |    /*
  505|       |     * Enable peer SSL verifying for proxy.
  506|       |     */
  507|      0|    s->proxy_ssl.verifypeer = enabled;
  508|       |
  509|       |    /* Update the current connection proxy_ssl_config. */
  510|      0|    Curl_ssl_conn_config_update(data, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  511|      0|    break;
  512|      0|  case CURLOPT_PROXY_SSL_VERIFYHOST:
  ------------------
  |  Branch (512:3): [True: 0, False: 89.3k]
  ------------------
  513|       |    /*
  514|       |     * Enable verification of the hostname in the peer certificate for proxy
  515|       |     */
  516|      0|    s->proxy_ssl.verifyhost = enabled;
  517|      0|    ok = 2;
  518|       |    /* Update the current connection proxy_ssl_config. */
  519|      0|    Curl_ssl_conn_config_update(data, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  520|      0|    break;
  521|      0|  case CURLOPT_PROXY_TRANSFER_MODE:
  ------------------
  |  Branch (521:3): [True: 0, False: 89.3k]
  ------------------
  522|       |    /*
  523|       |     * set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy
  524|       |     */
  525|      0|    s->proxy_transfer_mode = enabled;
  526|      0|    break;
  527|      0|#endif /* !CURL_DISABLE_PROXY */
  528|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
  529|       |  case CURLOPT_SOCKS5_GSSAPI_NEC:
  530|       |    /*
  531|       |     * Set flag for NEC SOCKS5 support
  532|       |     */
  533|       |    s->socks5_gssapi_nec = enabled;
  534|       |    break;
  535|       |#endif
  536|      0|#ifdef CURL_LIST_ONLY_PROTOCOL
  537|      0|  case CURLOPT_DIRLISTONLY:
  ------------------
  |  Branch (537:3): [True: 0, False: 89.3k]
  ------------------
  538|       |    /*
  539|       |     * An option that changes the command to one that asks for a list only, no
  540|       |     * file info details. Used for FTP, POP3 and SFTP.
  541|       |     */
  542|      0|    s->list_only = enabled;
  543|      0|    break;
  544|      0|#endif
  545|      0|  case CURLOPT_APPEND:
  ------------------
  |  Branch (545:3): [True: 0, False: 89.3k]
  ------------------
  546|       |    /*
  547|       |     * We want to upload and append to an existing file. Used for FTP and
  548|       |     * SFTP.
  549|       |     */
  550|      0|    s->remote_append = enabled;
  551|      0|    break;
  552|      0|#ifndef CURL_DISABLE_FTP
  553|      0|  case CURLOPT_FTP_USE_EPRT:
  ------------------
  |  Branch (553:3): [True: 0, False: 89.3k]
  ------------------
  554|      0|    s->ftp_use_eprt = enabled;
  555|      0|    break;
  556|      0|  case CURLOPT_FTP_USE_EPSV:
  ------------------
  |  Branch (556:3): [True: 0, False: 89.3k]
  ------------------
  557|      0|    s->ftp_use_epsv = enabled;
  558|      0|    break;
  559|      0|  case CURLOPT_FTP_USE_PRET:
  ------------------
  |  Branch (559:3): [True: 0, False: 89.3k]
  ------------------
  560|      0|    s->ftp_use_pret = enabled;
  561|      0|    break;
  562|      0|  case CURLOPT_FTP_SKIP_PASV_IP:
  ------------------
  |  Branch (562:3): [True: 0, False: 89.3k]
  ------------------
  563|       |    /*
  564|       |     * Enable or disable FTP_SKIP_PASV_IP, which will disable/enable the
  565|       |     * bypass of the IP address in PASV responses.
  566|       |     */
  567|      0|    s->ftp_skip_ip = enabled;
  568|      0|    break;
  569|      0|  case CURLOPT_WILDCARDMATCH:
  ------------------
  |  Branch (569:3): [True: 0, False: 89.3k]
  ------------------
  570|      0|    s->wildcard_enabled = enabled;
  571|      0|    break;
  572|      0|#endif
  573|      0|  case CURLOPT_CRLF:
  ------------------
  |  Branch (573:3): [True: 0, False: 89.3k]
  ------------------
  574|       |    /*
  575|       |     * Kludgy option to enable CRLF conversions. Subject for removal.
  576|       |     */
  577|      0|    s->crlf = enabled;
  578|      0|    break;
  579|      0|#ifndef CURL_DISABLE_TFTP
  580|      0|  case CURLOPT_TFTP_NO_OPTIONS:
  ------------------
  |  Branch (580:3): [True: 0, False: 89.3k]
  ------------------
  581|       |    /*
  582|       |     * Option that prevents libcurl from sending TFTP option requests to the
  583|       |     * server.
  584|       |     */
  585|      0|    s->tftp_no_options = enabled;
  586|      0|    break;
  587|      0|#endif /* !CURL_DISABLE_TFTP */
  588|      0|  case CURLOPT_TRANSFERTEXT:
  ------------------
  |  Branch (588:3): [True: 0, False: 89.3k]
  ------------------
  589|       |    /*
  590|       |     * This option was previously named 'FTPASCII'. Renamed to work with
  591|       |     * more protocols than merely FTP.
  592|       |     *
  593|       |     * Transfer using ASCII (instead of BINARY).
  594|       |     */
  595|      0|    s->prefer_ascii = enabled;
  596|      0|    break;
  597|  19.8k|  case CURLOPT_SSL_VERIFYPEER:
  ------------------
  |  Branch (597:3): [True: 19.8k, False: 69.5k]
  ------------------
  598|       |    /*
  599|       |     * Enable peer SSL verifying.
  600|       |     */
  601|  19.8k|    s->ssl.verifypeer = enabled;
  602|       |
  603|       |    /* Update the current connection ssl_config. */
  604|  19.8k|    Curl_ssl_conn_config_update(data, FALSE);
  ------------------
  |  |  989|  19.8k|#define FALSE false
  ------------------
  605|  19.8k|    break;
  606|      0|#ifndef CURL_DISABLE_DOH
  607|      0|  case CURLOPT_DOH_SSL_VERIFYPEER:
  ------------------
  |  Branch (607:3): [True: 0, False: 89.3k]
  ------------------
  608|       |    /*
  609|       |     * Enable peer SSL verifying for DoH.
  610|       |     */
  611|      0|    s->doh_verifypeer = enabled;
  612|      0|    break;
  613|      0|  case CURLOPT_DOH_SSL_VERIFYHOST:
  ------------------
  |  Branch (613:3): [True: 0, False: 89.3k]
  ------------------
  614|       |    /*
  615|       |     * Enable verification of the hostname in the peer certificate for DoH
  616|       |     */
  617|      0|    s->doh_verifyhost = enabled;
  618|      0|    ok = 2;
  619|      0|    break;
  620|      0|  case CURLOPT_DOH_SSL_VERIFYSTATUS:
  ------------------
  |  Branch (620:3): [True: 0, False: 89.3k]
  ------------------
  621|       |    /*
  622|       |     * Enable certificate status verifying for DoH.
  623|       |     */
  624|      0|    if(!Curl_ssl_cert_status_request())
  ------------------
  |  Branch (624:8): [True: 0, False: 0]
  ------------------
  625|      0|      return CURLE_NOT_BUILT_IN;
  626|       |
  627|      0|    s->doh_verifystatus = enabled;
  628|      0|    ok = 2;
  629|      0|    break;
  630|      0|#endif /* !CURL_DISABLE_DOH */
  631|  9.91k|  case CURLOPT_SSL_VERIFYHOST:
  ------------------
  |  Branch (631:3): [True: 9.91k, False: 79.4k]
  ------------------
  632|       |    /*
  633|       |     * Enable verification of the hostname in the peer certificate
  634|       |     */
  635|       |
  636|       |    /* Obviously people are not reading documentation and too many thought
  637|       |       this argument took a boolean when it was not and misused it.
  638|       |       Treat 1 and 2 the same */
  639|  9.91k|    s->ssl.verifyhost = enabled;
  640|  9.91k|    ok = 2;
  641|       |
  642|       |    /* Update the current connection ssl_config. */
  643|  9.91k|    Curl_ssl_conn_config_update(data, FALSE);
  ------------------
  |  |  989|  9.91k|#define FALSE false
  ------------------
  644|  9.91k|    break;
  645|      0|  case CURLOPT_SSL_VERIFYSTATUS:
  ------------------
  |  Branch (645:3): [True: 0, False: 89.3k]
  ------------------
  646|       |    /*
  647|       |     * Enable certificate status verifying.
  648|       |     */
  649|      0|    if(!Curl_ssl_cert_status_request())
  ------------------
  |  Branch (649:8): [True: 0, False: 0]
  ------------------
  650|      0|      return CURLE_NOT_BUILT_IN;
  651|       |
  652|      0|    s->ssl.verifystatus = enabled;
  653|       |
  654|       |    /* Update the current connection ssl_config. */
  655|      0|    Curl_ssl_conn_config_update(data, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  656|      0|    break;
  657|      0|  case CURLOPT_CERTINFO:
  ------------------
  |  Branch (657:3): [True: 0, False: 89.3k]
  ------------------
  658|      0|#ifdef USE_SSL
  659|      0|    if(Curl_ssl_supports(data, SSLSUPP_CERTINFO))
  ------------------
  |  |   37|      0|#define SSLSUPP_CERTINFO     (1 << 1) /* supports CURLOPT_CERTINFO */
  ------------------
  |  Branch (659:8): [True: 0, False: 0]
  ------------------
  660|      0|      s->ssl.certinfo = enabled;
  661|      0|    else
  662|      0|#endif
  663|      0|      return CURLE_NOT_BUILT_IN;
  664|      0|    break;
  665|      0|  case CURLOPT_NOSIGNAL:
  ------------------
  |  Branch (665:3): [True: 0, False: 89.3k]
  ------------------
  666|       |    /*
  667|       |     * The application asks not to set any signal() or alarm() handlers,
  668|       |     * even when using a timeout.
  669|       |     */
  670|      0|    s->no_signal = enabled;
  671|      0|    break;
  672|      0|  case CURLOPT_TCP_NODELAY:
  ------------------
  |  Branch (672:3): [True: 0, False: 89.3k]
  ------------------
  673|       |    /*
  674|       |     * Enable or disable TCP_NODELAY, which will disable/enable the Nagle
  675|       |     * algorithm
  676|       |     */
  677|      0|    s->tcp_nodelay = enabled;
  678|      0|    break;
  679|    155|  case CURLOPT_IGNORE_CONTENT_LENGTH:
  ------------------
  |  Branch (679:3): [True: 155, False: 89.1k]
  ------------------
  680|    155|    s->ignorecl = enabled;
  681|    155|    break;
  682|      0|  case CURLOPT_SSL_SESSIONID_CACHE:
  ------------------
  |  Branch (682:3): [True: 0, False: 89.3k]
  ------------------
  683|      0|    s->ssl.cache_session = enabled;
  684|      0|#ifndef CURL_DISABLE_PROXY
  685|      0|    s->proxy_ssl.cache_session = s->ssl.cache_session;
  686|      0|#endif
  687|      0|    break;
  688|       |#ifdef USE_SSH
  689|       |  case CURLOPT_SSH_COMPRESSION:
  690|       |    s->ssh_compression = enabled;
  691|       |    break;
  692|       |#endif /* !USE_SSH */
  693|      0|#ifndef CURL_DISABLE_SMTP
  694|      0|  case CURLOPT_MAIL_RCPT_ALLOWFAILS:
  ------------------
  |  Branch (694:3): [True: 0, False: 89.3k]
  ------------------
  695|       |    /* allow RCPT TO command to fail for some recipients */
  696|      0|    s->mail_rcpt_allowfails = enabled;
  697|      0|    break;
  698|      0|#endif /* !CURL_DISABLE_SMTP */
  699|      0|  case CURLOPT_SASL_IR:
  ------------------
  |  Branch (699:3): [True: 0, False: 89.3k]
  ------------------
  700|       |    /* Enable/disable SASL initial response */
  701|      0|    s->sasl_ir = enabled;
  702|      0|    break;
  703|      0|  case CURLOPT_TCP_KEEPALIVE:
  ------------------
  |  Branch (703:3): [True: 0, False: 89.3k]
  ------------------
  704|      0|    s->tcp_keepalive = enabled;
  705|      0|    break;
  706|      0|  case CURLOPT_TCP_FASTOPEN:
  ------------------
  |  Branch (706:3): [True: 0, False: 89.3k]
  ------------------
  707|      0|#if defined(CONNECT_DATA_IDEMPOTENT) || defined(MSG_FASTOPEN) || \
  708|      0|  defined(TCP_FASTOPEN_CONNECT)
  709|      0|    s->tcp_fastopen = enabled;
  710|      0|    break;
  711|       |#else
  712|       |    return CURLE_NOT_BUILT_IN;
  713|       |#endif
  714|      0|  case CURLOPT_SSL_ENABLE_ALPN:
  ------------------
  |  Branch (714:3): [True: 0, False: 89.3k]
  ------------------
  715|      0|    s->ssl_enable_alpn = enabled;
  716|      0|    break;
  717|    173|  case CURLOPT_PATH_AS_IS:
  ------------------
  |  Branch (717:3): [True: 173, False: 89.1k]
  ------------------
  718|    173|    s->path_as_is = enabled;
  719|    173|    break;
  720|      0|  case CURLOPT_PIPEWAIT:
  ------------------
  |  Branch (720:3): [True: 0, False: 89.3k]
  ------------------
  721|      0|    s->pipewait = enabled;
  722|      0|    break;
  723|      0|  case CURLOPT_SUPPRESS_CONNECT_HEADERS:
  ------------------
  |  Branch (723:3): [True: 0, False: 89.3k]
  ------------------
  724|      0|    s->suppress_connect_headers = enabled;
  725|      0|    break;
  726|      0|#ifndef CURL_DISABLE_SHUFFLE_DNS
  727|      0|  case CURLOPT_DNS_SHUFFLE_ADDRESSES:
  ------------------
  |  Branch (727:3): [True: 0, False: 89.3k]
  ------------------
  728|      0|    s->dns_shuffle_addresses = enabled;
  729|      0|    break;
  730|      0|#endif
  731|    171|  case CURLOPT_DISALLOW_USERNAME_IN_URL:
  ------------------
  |  Branch (731:3): [True: 171, False: 89.1k]
  ------------------
  732|    171|    s->disallow_username_in_url = enabled;
  733|    171|    break;
  734|      0|  case CURLOPT_QUICK_EXIT:
  ------------------
  |  Branch (734:3): [True: 0, False: 89.3k]
  ------------------
  735|      0|    s->quick_exit = enabled;
  736|      0|    break;
  737|  44.0k|  default:
  ------------------
  |  Branch (737:3): [True: 44.0k, False: 45.3k]
  ------------------
  738|  44.0k|    return CURLE_UNKNOWN_OPTION;
  739|  89.3k|  }
  740|  45.3k|  if((arg > ok) || (arg < 0))
  ------------------
  |  Branch (740:6): [True: 0, False: 45.3k]
  |  Branch (740:20): [True: 0, False: 45.3k]
  ------------------
  741|       |    /* reserve other values for future use */
  742|      0|    infof(data, "boolean setopt(%d) got unsupported argument %ld,"
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  743|  45.3k|          " treated as %d", (int)option, arg, enabled);
  744|       |
  745|  45.3k|  return CURLE_OK;
  746|  89.3k|}
setopt.c:setopt_long_net:
  761|  44.0k|{
  762|  44.0k|  CURLcode result = CURLE_OK;
  763|  44.0k|  struct UserDefined *s = &data->set;
  764|       |
  765|  44.0k|  switch(option) {
  766|      0|  case CURLOPT_DNS_CACHE_TIMEOUT:
  ------------------
  |  Branch (766:3): [True: 0, False: 44.0k]
  ------------------
  767|      0|    if(arg != -1)
  ------------------
  |  Branch (767:8): [True: 0, False: 0]
  ------------------
  768|      0|      return setopt_set_timeout_sec(&s->dns_cache_timeout_ms, arg);
  769|      0|    s->dns_cache_timeout_ms = -1;
  770|      0|    break;
  771|      0|  case CURLOPT_MAXCONNECTS:
  ------------------
  |  Branch (771:3): [True: 0, False: 44.0k]
  ------------------
  772|      0|    result = value_range(&arg, 0, 0, INT_MAX);
  773|      0|    if(!result)
  ------------------
  |  Branch (773:8): [True: 0, False: 0]
  ------------------
  774|      0|      s->maxconnects = arg ? (uint32_t)arg : DEFAULT_CONNCACHE_SIZE;
  ------------------
  |  |   38|      0|#define DEFAULT_CONNCACHE_SIZE 5
  ------------------
  |  Branch (774:24): [True: 0, False: 0]
  ------------------
  775|      0|    break;
  776|      0|  case CURLOPT_SERVER_RESPONSE_TIMEOUT:
  ------------------
  |  Branch (776:3): [True: 0, False: 44.0k]
  ------------------
  777|      0|    return setopt_set_timeout_sec(&s->server_response_timeout, arg);
  778|      0|  case CURLOPT_SERVER_RESPONSE_TIMEOUT_MS:
  ------------------
  |  Branch (778:3): [True: 0, False: 44.0k]
  ------------------
  779|      0|    return setopt_set_timeout_ms(&s->server_response_timeout, arg);
  780|      0|  case CURLOPT_LOW_SPEED_LIMIT:
  ------------------
  |  Branch (780:3): [True: 0, False: 44.0k]
  ------------------
  781|      0|    if(arg < 0)
  ------------------
  |  Branch (781:8): [True: 0, False: 0]
  ------------------
  782|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  783|      0|    else
  784|      0|      s->low_speed_limit = arg;
  785|      0|    break;
  786|      0|  case CURLOPT_LOW_SPEED_TIME:
  ------------------
  |  Branch (786:3): [True: 0, False: 44.0k]
  ------------------
  787|      0|    result = value_range(&arg, 0, 0, USHRT_MAX);
  788|      0|    if(!result)
  ------------------
  |  Branch (788:8): [True: 0, False: 0]
  ------------------
  789|      0|      s->low_speed_time = (uint16_t)arg;
  790|      0|    break;
  791|      0|  case CURLOPT_PORT:
  ------------------
  |  Branch (791:3): [True: 0, False: 44.0k]
  ------------------
  792|      0|    if((arg < 0) || (arg > 65535))
  ------------------
  |  Branch (792:8): [True: 0, False: 0]
  |  Branch (792:21): [True: 0, False: 0]
  ------------------
  793|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  794|      0|    s->use_port = (unsigned short)arg;
  795|      0|    break;
  796|      0|  case CURLOPT_TIMEOUT:
  ------------------
  |  Branch (796:3): [True: 0, False: 44.0k]
  ------------------
  797|      0|    return setopt_set_timeout_sec(&s->timeout, arg);
  798|  9.91k|  case CURLOPT_TIMEOUT_MS:
  ------------------
  |  Branch (798:3): [True: 9.91k, False: 34.1k]
  ------------------
  799|  9.91k|    return setopt_set_timeout_ms(&s->timeout, arg);
  800|      0|  case CURLOPT_CONNECTTIMEOUT:
  ------------------
  |  Branch (800:3): [True: 0, False: 44.0k]
  ------------------
  801|      0|    return setopt_set_timeout_sec(&s->connecttimeout, arg);
  802|  9.91k|  case CURLOPT_CONNECTTIMEOUT_MS:
  ------------------
  |  Branch (802:3): [True: 9.91k, False: 34.1k]
  ------------------
  803|  9.91k|    return setopt_set_timeout_ms(&s->connecttimeout, arg);
  804|      0|#ifndef CURL_DISABLE_BINDLOCAL
  805|      0|  case CURLOPT_LOCALPORT:
  ------------------
  |  Branch (805:3): [True: 0, False: 44.0k]
  ------------------
  806|      0|    if((arg < 0) || (arg > 65535))
  ------------------
  |  Branch (806:8): [True: 0, False: 0]
  |  Branch (806:21): [True: 0, False: 0]
  ------------------
  807|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  808|      0|    s->localport = curlx_sltous(arg);
  809|      0|    break;
  810|      0|  case CURLOPT_LOCALPORTRANGE:
  ------------------
  |  Branch (810:3): [True: 0, False: 44.0k]
  ------------------
  811|      0|    if((arg < 0) || (arg > 65535))
  ------------------
  |  Branch (811:8): [True: 0, False: 0]
  |  Branch (811:21): [True: 0, False: 0]
  ------------------
  812|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  813|      0|    s->localportrange = curlx_sltous(arg);
  814|      0|    break;
  815|      0|#endif
  816|    586|  case CURLOPT_BUFFERSIZE:
  ------------------
  |  Branch (816:3): [True: 586, False: 43.4k]
  ------------------
  817|    586|    result = value_range(&arg, 0, READBUFFER_MIN, READBUFFER_MAX);
  ------------------
  |  |  122|    586|#define READBUFFER_MIN  1024
  ------------------
                  result = value_range(&arg, 0, READBUFFER_MIN, READBUFFER_MAX);
  ------------------
  |  |  121|    586|#define READBUFFER_MAX  CURL_MAX_READ_SIZE
  |  |  ------------------
  |  |  |  |  257|    586|#define CURL_MAX_READ_SIZE (10 * 1024 * 1024)
  |  |  ------------------
  ------------------
  818|    586|    if(!result)
  ------------------
  |  Branch (818:8): [True: 465, False: 121]
  ------------------
  819|    465|      s->buffer_size = (unsigned int)arg;
  820|    586|    break;
  821|    532|  case CURLOPT_UPLOAD_BUFFERSIZE:
  ------------------
  |  Branch (821:3): [True: 532, False: 43.4k]
  ------------------
  822|    532|    result = value_range(&arg, 0, UPLOADBUFFER_MIN, UPLOADBUFFER_MAX);
  ------------------
  |  |  134|    532|#define UPLOADBUFFER_MIN     CURL_MAX_WRITE_SIZE
  |  |  ------------------
  |  |  |  |  267|    532|#define CURL_MAX_WRITE_SIZE 16384
  |  |  ------------------
  ------------------
                  result = value_range(&arg, 0, UPLOADBUFFER_MIN, UPLOADBUFFER_MAX);
  ------------------
  |  |  133|    532|#define UPLOADBUFFER_MAX     (2 * 1024 * 1024)
  ------------------
  823|    532|    if(!result)
  ------------------
  |  Branch (823:8): [True: 406, False: 126]
  ------------------
  824|    406|      s->upload_buffer_size = (unsigned int)arg;
  825|    532|    break;
  826|      0|  case CURLOPT_MAXFILESIZE:
  ------------------
  |  Branch (826:3): [True: 0, False: 44.0k]
  ------------------
  827|      0|    if(arg < 0)
  ------------------
  |  Branch (827:8): [True: 0, False: 0]
  ------------------
  828|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  829|      0|    else
  830|      0|      s->max_filesize = arg;
  831|      0|    break;
  832|      0|  case CURLOPT_IPRESOLVE:
  ------------------
  |  Branch (832:3): [True: 0, False: 44.0k]
  ------------------
  833|      0|    if((arg < CURL_IPRESOLVE_WHATEVER) || (arg > CURL_IPRESOLVE_V6))
  ------------------
  |  | 2329|      0|#define CURL_IPRESOLVE_WHATEVER 0L /* default, uses addresses to all IP
  ------------------
                  if((arg < CURL_IPRESOLVE_WHATEVER) || (arg > CURL_IPRESOLVE_V6))
  ------------------
  |  | 2332|      0|#define CURL_IPRESOLVE_V6       2L /* uses only IPv6 addresses/connections */
  ------------------
  |  Branch (833:8): [True: 0, False: 0]
  |  Branch (833:43): [True: 0, False: 0]
  ------------------
  834|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  835|      0|    else
  836|      0|      s->ipver = (unsigned char)arg;
  837|      0|    break;
  838|      0|  case CURLOPT_CONNECT_ONLY:
  ------------------
  |  Branch (838:3): [True: 0, False: 44.0k]
  ------------------
  839|      0|    if(arg < 0 || arg > 2)
  ------------------
  |  Branch (839:8): [True: 0, False: 0]
  |  Branch (839:19): [True: 0, False: 0]
  ------------------
  840|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  841|      0|    else {
  842|      0|      s->connect_only = !!arg;
  843|      0|      s->connect_only_ws = (arg == 2);
  844|      0|    }
  845|      0|    break;
  846|      0|#ifdef USE_IPV6
  847|      0|  case CURLOPT_ADDRESS_SCOPE:
  ------------------
  |  Branch (847:3): [True: 0, False: 44.0k]
  ------------------
  848|      0|#if SIZEOF_LONG > 4
  849|      0|    if((unsigned long)arg > UINT_MAX)
  ------------------
  |  Branch (849:8): [True: 0, False: 0]
  ------------------
  850|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  851|      0|    else
  852|      0|#endif
  853|      0|    s->scope_id = (unsigned int)arg;
  854|      0|    break;
  855|      0|#endif
  856|      0|  case CURLOPT_TCP_KEEPIDLE:
  ------------------
  |  Branch (856:3): [True: 0, False: 44.0k]
  ------------------
  857|      0|    result = value_range(&arg, 0, 0, INT_MAX);
  858|      0|    if(!result)
  ------------------
  |  Branch (858:8): [True: 0, False: 0]
  ------------------
  859|      0|      s->tcp_keepidle = (int)arg;
  860|      0|    break;
  861|      0|  case CURLOPT_TCP_KEEPINTVL:
  ------------------
  |  Branch (861:3): [True: 0, False: 44.0k]
  ------------------
  862|      0|    result = value_range(&arg, 0, 0, INT_MAX);
  863|      0|    if(!result)
  ------------------
  |  Branch (863:8): [True: 0, False: 0]
  ------------------
  864|      0|      s->tcp_keepintvl = (int)arg;
  865|      0|    break;
  866|      0|  case CURLOPT_TCP_KEEPCNT:
  ------------------
  |  Branch (866:3): [True: 0, False: 44.0k]
  ------------------
  867|      0|    result = value_range(&arg, 0, 0, INT_MAX);
  868|      0|    if(!result)
  ------------------
  |  Branch (868:8): [True: 0, False: 0]
  ------------------
  869|      0|      s->tcp_keepcnt = (int)arg;
  870|      0|    break;
  871|      0|  case CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS:
  ------------------
  |  Branch (871:3): [True: 0, False: 44.0k]
  ------------------
  872|      0|    return setopt_set_timeout_ms(&s->happy_eyeballs_timeout, arg);
  873|      0|  case CURLOPT_UPKEEP_INTERVAL_MS:
  ------------------
  |  Branch (873:3): [True: 0, False: 44.0k]
  ------------------
  874|      0|    return setopt_set_timeout_ms(&s->upkeep_interval_ms, arg);
  875|    521|  case CURLOPT_MAXAGE_CONN:
  ------------------
  |  Branch (875:3): [True: 521, False: 43.5k]
  ------------------
  876|    521|    return setopt_set_timeout_sec(&s->conn_max_idle_ms, arg);
  877|    459|  case CURLOPT_MAXLIFETIME_CONN:
  ------------------
  |  Branch (877:3): [True: 459, False: 43.5k]
  ------------------
  878|    459|    return setopt_set_timeout_sec(&s->conn_max_age_ms, arg);
  879|      0|  case CURLOPT_DNS_USE_GLOBAL_CACHE:
  ------------------
  |  Branch (879:3): [True: 0, False: 44.0k]
  ------------------
  880|       |    /* deprecated */
  881|      0|    break;
  882|  22.0k|  default:
  ------------------
  |  Branch (882:3): [True: 22.0k, False: 21.9k]
  ------------------
  883|  22.0k|    return CURLE_UNKNOWN_OPTION;
  884|  44.0k|  }
  885|  1.11k|  return result;
  886|  44.0k|}
setopt.c:setopt_set_timeout_sec:
   52|    980|{
   53|    980|  if(secs < 0)
  ------------------
  |  Branch (53:6): [True: 256, False: 724]
  ------------------
   54|    256|    return CURLE_BAD_FUNCTION_ARGUMENT;
   55|    724|#if LONG_MAX > (TIMEDIFF_T_MAX / 1000)
   56|    724|  if(secs > (TIMEDIFF_T_MAX / 1000)) {
  ------------------
  |  |   33|    724|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  539|    724|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
  |  Branch (56:6): [True: 239, False: 485]
  ------------------
   57|    239|    *ptimeout_ms = TIMEDIFF_T_MAX;
  ------------------
  |  |   33|    239|#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
  |  |  ------------------
  |  |  |  |  539|    239|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  ------------------
  ------------------
   58|    239|    return CURLE_OK;
   59|    239|  }
   60|    485|#endif
   61|    485|  *ptimeout_ms = (timediff_t)secs * 1000;
   62|    485|  return CURLE_OK;
   63|    724|}
setopt.c:value_range:
  749|  1.95k|{
  750|  1.95k|  if(*value < below_error)
  ------------------
  |  Branch (750:6): [True: 477, False: 1.47k]
  ------------------
  751|    477|    return CURLE_BAD_FUNCTION_ARGUMENT;
  752|  1.47k|  else if(*value < min)
  ------------------
  |  Branch (752:11): [True: 386, False: 1.08k]
  ------------------
  753|    386|    *value = min;
  754|  1.08k|  else if(*value > max)
  ------------------
  |  Branch (754:11): [True: 593, False: 495]
  ------------------
  755|    593|    *value = max;
  756|  1.47k|  return CURLE_OK;
  757|  1.95k|}
setopt.c:setopt_set_timeout_ms:
   66|  19.8k|{
   67|  19.8k|  if(ms < 0)
  ------------------
  |  Branch (67:6): [True: 0, False: 19.8k]
  ------------------
   68|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
   69|       |#if LONG_MAX > TIMEDIFF_T_MAX
   70|       |  if(ms > TIMEDIFF_T_MAX) {
   71|       |    *ptimeout_ms = TIMEDIFF_T_MAX;
   72|       |    return CURLE_OK;
   73|       |  }
   74|       |#endif
   75|  19.8k|  *ptimeout_ms = (timediff_t)ms;
   76|  19.8k|  return CURLE_OK;
   77|  19.8k|}
setopt.c:setopt_long_http:
 1008|  22.0k|{
 1009|  22.0k|#ifndef CURL_DISABLE_HTTP
 1010|  22.0k|  CURLcode result = CURLE_OK;
 1011|  22.0k|  struct UserDefined *s = &data->set;
 1012|       |
 1013|  22.0k|  switch(option) {
 1014|    296|  case CURLOPT_FOLLOWLOCATION:
  ------------------
  |  Branch (1014:3): [True: 296, False: 21.8k]
  ------------------
 1015|    296|    if((unsigned long)arg > 3)
  ------------------
  |  Branch (1015:8): [True: 208, False: 88]
  ------------------
 1016|    208|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1017|     88|    else
 1018|     88|      s->http_follow_mode = (unsigned char)arg;
 1019|    296|    break;
 1020|    402|  case CURLOPT_MAXREDIRS:
  ------------------
  |  Branch (1020:3): [True: 402, False: 21.6k]
  ------------------
 1021|    402|    result = value_range(&arg, -1, -1, 0x7fff);
 1022|    402|    if(!result)
  ------------------
  |  Branch (1022:8): [True: 301, False: 101]
  ------------------
 1023|    301|      s->maxredirs = (short)arg;
 1024|    402|    break;
 1025|    317|  case CURLOPT_POSTREDIR:
  ------------------
  |  Branch (1025:3): [True: 317, False: 21.7k]
  ------------------
 1026|    317|    if(arg < CURL_REDIR_GET_ALL)
  ------------------
  |  | 2429|    317|#define CURL_REDIR_GET_ALL  0L
  ------------------
  |  Branch (1026:8): [True: 124, False: 193]
  ------------------
 1027|    124|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1028|    193|    else {
 1029|    193|      s->post301 = !!(arg & CURL_REDIR_POST_301);
  ------------------
  |  | 2430|    193|#define CURL_REDIR_POST_301 1L
  ------------------
 1030|    193|      s->post302 = !!(arg & CURL_REDIR_POST_302);
  ------------------
  |  | 2431|    193|#define CURL_REDIR_POST_302 2L
  ------------------
 1031|    193|      s->post303 = !!(arg & CURL_REDIR_POST_303);
  ------------------
  |  | 2432|    193|#define CURL_REDIR_POST_303 4L
  ------------------
 1032|    193|    }
 1033|    317|    break;
 1034|      0|  case CURLOPT_HEADEROPT:
  ------------------
  |  Branch (1034:3): [True: 0, False: 22.0k]
  ------------------
 1035|      0|    s->sep_headers = !!(arg & CURLHEADER_SEPARATE);
  ------------------
  |  | 1041|      0|#define CURLHEADER_SEPARATE (1L << 0)
  ------------------
 1036|      0|    break;
 1037|    523|  case CURLOPT_HTTPAUTH:
  ------------------
  |  Branch (1037:3): [True: 523, False: 21.5k]
  ------------------
 1038|    523|    return httpauth(data, FALSE, (unsigned long)arg);
  ------------------
  |  |  989|    523|#define FALSE false
  ------------------
 1039|  9.91k|  case CURLOPT_HTTP_VERSION:
  ------------------
  |  Branch (1039:3): [True: 9.91k, False: 12.1k]
  ------------------
 1040|  9.91k|    return setopt_HTTP_VERSION(data, arg);
 1041|    431|  case CURLOPT_EXPECT_100_TIMEOUT_MS:
  ------------------
  |  Branch (1041:3): [True: 431, False: 21.6k]
  ------------------
 1042|    431|    result = value_range(&arg, 0, 0, 0xffff);
 1043|    431|    if(!result)
  ------------------
  |  Branch (1043:8): [True: 302, False: 129]
  ------------------
 1044|    302|      s->expect_100_timeout = (unsigned short)arg;
 1045|    431|    break;
 1046|      0|  case CURLOPT_STREAM_WEIGHT:
  ------------------
  |  Branch (1046:3): [True: 0, False: 22.0k]
  ------------------
 1047|      0|#if defined(USE_HTTP2) || defined(USE_HTTP3)
 1048|      0|    if((arg >= 1) && (arg <= 256))
  ------------------
  |  Branch (1048:8): [True: 0, False: 0]
  |  Branch (1048:22): [True: 0, False: 0]
  ------------------
 1049|      0|      s->weight = (int)arg;
 1050|      0|    break;
 1051|       |#else
 1052|       |    result = CURLE_NOT_BUILT_IN;
 1053|       |    break;
 1054|       |#endif
 1055|      0|#ifndef CURL_DISABLE_HTTPSIG
 1056|      0|  case CURLOPT_HTTPSIG_ALGORITHM:
  ------------------
  |  Branch (1056:3): [True: 0, False: 22.0k]
  ------------------
 1057|      0|    if(arg != CURLHTTPSIG_NONE &&
  ------------------
  |  |  858|      0|#define CURLHTTPSIG_NONE          0L
  ------------------
  |  Branch (1057:8): [True: 0, False: 0]
  ------------------
 1058|      0|       arg != CURLHTTPSIG_ED25519 &&
  ------------------
  |  |  859|      0|#define CURLHTTPSIG_ED25519       1L
  ------------------
  |  Branch (1058:8): [True: 0, False: 0]
  ------------------
 1059|      0|       arg != CURLHTTPSIG_HMAC_SHA256)
  ------------------
  |  |  860|      0|#define CURLHTTPSIG_HMAC_SHA256   2L
  ------------------
  |  Branch (1059:8): [True: 0, False: 0]
  ------------------
 1060|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1061|      0|    s->httpsig_algorithm = (uint8_t)arg;
 1062|      0|    if(arg)
  ------------------
  |  Branch (1062:8): [True: 0, False: 0]
  ------------------
 1063|      0|      s->httpauth = (uint32_t)CURLAUTH_HTTPSIG;
  ------------------
  |  |  848|      0|#define CURLAUTH_HTTPSIG      (((unsigned long)1) << 8)
  ------------------
 1064|      0|    else
 1065|      0|      s->httpauth &= ~(uint32_t)CURLAUTH_HTTPSIG;
  ------------------
  |  |  848|      0|#define CURLAUTH_HTTPSIG      (((unsigned long)1) << 8)
  ------------------
 1066|      0|    break;
 1067|      0|#endif
 1068|  10.2k|  default:
  ------------------
  |  Branch (1068:3): [True: 10.2k, False: 11.8k]
  ------------------
 1069|  10.2k|    return CURLE_UNKNOWN_OPTION;
 1070|  22.0k|  }
 1071|  1.44k|  return result;
 1072|       |#else
 1073|       |  (void)data;
 1074|       |  (void)option;
 1075|       |  (void)arg;
 1076|       |  return CURLE_UNKNOWN_OPTION;
 1077|       |#endif
 1078|  22.0k|}
setopt.c:httpauth:
  215|  1.04k|{
  216|  1.04k|  if(auth != CURLAUTH_NONE) {
  ------------------
  |  |  832|  1.04k|#define CURLAUTH_NONE         ((unsigned long)0)
  ------------------
  |  Branch (216:6): [True: 812, False: 229]
  ------------------
  217|    812|    int bitcheck = 0;
  218|    812|    bool authbits = FALSE;
  ------------------
  |  |  989|    812|#define FALSE false
  ------------------
  219|    812|    if(auth & CURLAUTH_DIGEST_IE) {
  ------------------
  |  |  841|    812|#define CURLAUTH_DIGEST_IE    (((unsigned long)1) << 4)
  ------------------
  |  Branch (219:8): [True: 309, False: 503]
  ------------------
  220|    309|      auth |= CURLAUTH_DIGEST; /* set standard digest bit */
  ------------------
  |  |  834|    309|#define CURLAUTH_DIGEST       (((unsigned long)1) << 1)
  ------------------
  221|    309|      auth &= ~CURLAUTH_DIGEST_IE; /* drop the legacy bit */
  ------------------
  |  |  841|    309|#define CURLAUTH_DIGEST_IE    (((unsigned long)1) << 4)
  ------------------
  222|    309|    }
  223|       |
  224|       |    /* switch off bits we cannot support */
  225|    812|    auth &= ~CURLAUTH_NTLM; /* no NTLM support */
  ------------------
  |  |  840|    812|#define CURLAUTH_NTLM         (((unsigned long)1) << 3)
  ------------------
  226|    812|#ifndef USE_SPNEGO
  227|    812|    auth &= ~CURLAUTH_NEGOTIATE; /* no Negotiate (SPNEGO) auth without GSS-API
  ------------------
  |  |  835|    812|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  ------------------
  228|       |                                    or SSPI */
  229|    812|#endif
  230|       |
  231|       |    /* check if any auth bit lower than CURLAUTH_ONLY is still set */
  232|  7.85k|    while(bitcheck < 31) {
  ------------------
  |  Branch (232:11): [True: 7.67k, False: 178]
  ------------------
  233|  7.67k|      if(auth & (1UL << bitcheck++)) {
  ------------------
  |  Branch (233:10): [True: 634, False: 7.04k]
  ------------------
  234|    634|        authbits = TRUE;
  ------------------
  |  |  986|    634|#define TRUE true
  ------------------
  235|    634|        break;
  236|    634|      }
  237|  7.67k|    }
  238|    812|    if(!authbits)
  ------------------
  |  Branch (238:8): [True: 178, False: 634]
  ------------------
  239|    178|      return CURLE_NOT_BUILT_IN; /* no supported types left! */
  240|    812|  }
  241|    863|  if(proxy)
  ------------------
  |  Branch (241:6): [True: 437, False: 426]
  ------------------
  242|    437|    data->set.proxyauth = (uint32_t)auth;
  243|    426|  else
  244|    426|    data->set.httpauth = (uint32_t)auth;
  245|    863|  return CURLE_OK;
  246|  1.04k|}
setopt.c:setopt_HTTP_VERSION:
  251|  9.91k|{
  252|       |  /*
  253|       |   * This sets a requested HTTP version to be used. The value is one of
  254|       |   * the listed enums in curl/curl.h.
  255|       |   */
  256|  9.91k|  switch(arg) {
  257|      0|  case CURL_HTTP_VERSION_NONE:
  ------------------
  |  | 2338|      0|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  |  Branch (257:3): [True: 0, False: 9.91k]
  ------------------
  258|       |    /* accepted */
  259|      0|    break;
  260|      0|  case CURL_HTTP_VERSION_1_0:
  ------------------
  |  | 2341|      0|#define CURL_HTTP_VERSION_1_0   1L /* please use HTTP 1.0 in the request */
  ------------------
  |  Branch (260:3): [True: 0, False: 9.91k]
  ------------------
  261|      0|  case CURL_HTTP_VERSION_1_1:
  ------------------
  |  | 2342|      0|#define CURL_HTTP_VERSION_1_1   2L /* please use HTTP 1.1 in the request */
  ------------------
  |  Branch (261:3): [True: 0, False: 9.91k]
  ------------------
  262|       |    /* accepted */
  263|      0|    break;
  264|      0|#ifdef USE_HTTP2
  265|      0|  case CURL_HTTP_VERSION_2_0:
  ------------------
  |  | 2343|      0|#define CURL_HTTP_VERSION_2_0   3L /* please use HTTP 2 in the request */
  ------------------
  |  Branch (265:3): [True: 0, False: 9.91k]
  ------------------
  266|      0|  case CURL_HTTP_VERSION_2TLS:
  ------------------
  |  | 2344|      0|#define CURL_HTTP_VERSION_2TLS  4L /* use version 2 for HTTPS, version 1.1 for
  ------------------
  |  Branch (266:3): [True: 0, False: 9.91k]
  ------------------
  267|      0|  case CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE:
  ------------------
  |  | 2346|      0|#define CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE 5L /* please use HTTP 2 without
  ------------------
  |  Branch (267:3): [True: 0, False: 9.91k]
  ------------------
  268|       |    /* accepted */
  269|      0|    break;
  270|      0|#endif
  271|      0|#ifdef USE_HTTP3
  272|      0|  case CURL_HTTP_VERSION_3:
  ------------------
  |  | 2348|      0|#define CURL_HTTP_VERSION_3     30L /* Use HTTP/3, fallback to HTTP/2 or
  ------------------
  |  Branch (272:3): [True: 0, False: 9.91k]
  ------------------
  273|  9.91k|  case CURL_HTTP_VERSION_3ONLY:
  ------------------
  |  | 2352|  9.91k|#define CURL_HTTP_VERSION_3ONLY 31L /* Use HTTP/3 without fallback. For
  ------------------
  |  Branch (273:3): [True: 9.91k, False: 0]
  ------------------
  274|       |    /* accepted */
  275|  9.91k|    break;
  276|      0|#endif
  277|      0|  default:
  ------------------
  |  Branch (277:3): [True: 0, False: 9.91k]
  ------------------
  278|       |    /* not accepted */
  279|      0|    if(arg < CURL_HTTP_VERSION_NONE)
  ------------------
  |  | 2338|      0|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  |  Branch (279:8): [True: 0, False: 0]
  ------------------
  280|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  281|      0|    return CURLE_UNSUPPORTED_PROTOCOL;
  282|  9.91k|  }
  283|  9.91k|  data->set.httpwant = (unsigned char)arg;
  284|  9.91k|  return CURLE_OK;
  285|  9.91k|}
setopt.c:setopt_long_proxy:
  958|  10.2k|{
  959|  10.2k|  struct UserDefined *s = &data->set;
  960|       |
  961|  10.2k|  switch(option) {
  962|      0|  case CURLOPT_PROXYPORT:
  ------------------
  |  Branch (962:3): [True: 0, False: 10.2k]
  ------------------
  963|      0|    if((arg < 0) || (arg > UINT16_MAX))
  ------------------
  |  Branch (963:8): [True: 0, False: 0]
  |  Branch (963:21): [True: 0, False: 0]
  ------------------
  964|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  965|      0|    if(arg != s->proxyport)
  ------------------
  |  Branch (965:8): [True: 0, False: 0]
  ------------------
  966|      0|      changeproxy(data);
  967|      0|    s->proxyport = (uint16_t)arg;
  968|      0|    break;
  969|    518|  case CURLOPT_PROXYAUTH:
  ------------------
  |  Branch (969:3): [True: 518, False: 9.69k]
  ------------------
  970|    518|    return httpauth(data, TRUE, (unsigned long)arg);
  ------------------
  |  |  986|    518|#define TRUE true
  ------------------
  971|  7.65k|  case CURLOPT_PROXYTYPE:
  ------------------
  |  Branch (971:3): [True: 7.65k, False: 2.55k]
  ------------------
  972|  7.65k|    if((arg < CURLPROXY_HTTP) || (arg > CURLPROXY_HTTPS3))
  ------------------
  |  |  792|  7.65k|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
                  if((arg < CURLPROXY_HTTP) || (arg > CURLPROXY_HTTPS3))
  ------------------
  |  |  807|  7.65k|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (972:8): [True: 0, False: 7.65k]
  |  Branch (972:34): [True: 0, False: 7.65k]
  ------------------
  973|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  974|  7.65k|#ifndef USE_PROXY_HTTP3
  975|  7.65k|    if(arg == CURLPROXY_HTTPS3)
  ------------------
  |  |  807|  7.65k|#define CURLPROXY_HTTPS3          8L /* HTTPS and attempt HTTP/3
  ------------------
  |  Branch (975:8): [True: 0, False: 7.65k]
  ------------------
  976|      0|      return CURLE_NOT_BUILT_IN;
  977|  7.65k|#endif
  978|  7.65k|    s->proxytype = (unsigned char)arg;
  979|  7.65k|    break;
  980|      0|  case CURLOPT_SOCKS5_AUTH: {
  ------------------
  |  Branch (980:3): [True: 0, False: 10.2k]
  ------------------
  981|      0|    unsigned long auth = (unsigned long)arg;
  982|      0|    if(auth & ~(CURLAUTH_BASIC | CURLAUTH_GSSAPI | CURLAUTH_ONLY))
  ------------------
  |  |  833|      0|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
                  if(auth & ~(CURLAUTH_BASIC | CURLAUTH_GSSAPI | CURLAUTH_ONLY))
  ------------------
  |  |  839|      0|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  835|      0|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
                  if(auth & ~(CURLAUTH_BASIC | CURLAUTH_GSSAPI | CURLAUTH_ONLY))
  ------------------
  |  |  849|      0|#define CURLAUTH_ONLY         (((unsigned long)1) << 31)
  ------------------
  |  Branch (982:8): [True: 0, False: 0]
  ------------------
  983|      0|      return CURLE_NOT_BUILT_IN;
  984|      0|    if((auth & CURLAUTH_ONLY) && !(auth & (CURLAUTH_BASIC | CURLAUTH_GSSAPI)))
  ------------------
  |  |  849|      0|#define CURLAUTH_ONLY         (((unsigned long)1) << 31)
  ------------------
                  if((auth & CURLAUTH_ONLY) && !(auth & (CURLAUTH_BASIC | CURLAUTH_GSSAPI)))
  ------------------
  |  |  833|      0|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
                  if((auth & CURLAUTH_ONLY) && !(auth & (CURLAUTH_BASIC | CURLAUTH_GSSAPI)))
  ------------------
  |  |  839|      0|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  835|      0|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
  |  Branch (984:8): [True: 0, False: 0]
  |  Branch (984:34): [True: 0, False: 0]
  ------------------
  985|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  986|      0|    s->socks5auth = (unsigned char)(auth & (CURLAUTH_BASIC | CURLAUTH_GSSAPI));
  ------------------
  |  |  833|      0|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
                  s->socks5auth = (unsigned char)(auth & (CURLAUTH_BASIC | CURLAUTH_GSSAPI));
  ------------------
  |  |  839|      0|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  835|      0|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
  987|      0|    s->socks5_auth_only = !!(auth & CURLAUTH_ONLY);
  ------------------
  |  |  849|      0|#define CURLAUTH_ONLY         (((unsigned long)1) << 31)
  ------------------
  988|      0|    break;
  989|      0|  }
  990|  2.03k|  default:
  ------------------
  |  Branch (990:3): [True: 2.03k, False: 8.17k]
  ------------------
  991|  2.03k|    return CURLE_UNKNOWN_OPTION;
  992|  10.2k|  }
  993|  7.65k|  return CURLE_OK;
  994|  10.2k|}
setopt.c:changeproxy:
  951|  17.5k|{
  952|  17.5k|  Curl_auth_digest_cleanup(&data->state.proxydigest);
  953|  17.5k|  memset(&data->state.authproxy, 0, sizeof(data->state.authproxy));
  954|  17.5k|}
setopt.c:setopt_long_ssl:
  890|  2.03k|{
  891|  2.03k|#ifdef USE_SSL
  892|  2.03k|  CURLcode result = CURLE_OK;
  893|  2.03k|  struct UserDefined *s = &data->set;
  894|  2.03k|  switch(option) {
  895|      0|  case CURLOPT_CA_CACHE_TIMEOUT:
  ------------------
  |  Branch (895:3): [True: 0, False: 2.03k]
  ------------------
  896|      0|    if(Curl_ssl_supports(data, SSLSUPP_CA_CACHE)) {
  ------------------
  |  |   44|      0|#define SSLSUPP_CA_CACHE     (1 << 8)
  ------------------
  |  Branch (896:8): [True: 0, False: 0]
  ------------------
  897|      0|      result = value_range(&arg, -1, -1, INT_MAX);
  898|      0|      if(!result)
  ------------------
  |  Branch (898:10): [True: 0, False: 0]
  ------------------
  899|      0|        s->ssl_ca_cache_timeout = (int)arg;
  900|      0|    }
  901|      0|    else
  902|      0|      result = CURLE_NOT_BUILT_IN;
  903|      0|    break;
  904|      0|  case CURLOPT_SSLVERSION:
  ------------------
  |  Branch (904:3): [True: 0, False: 2.03k]
  ------------------
  905|      0|#ifndef CURL_DISABLE_PROXY
  906|      0|  case CURLOPT_PROXY_SSLVERSION:
  ------------------
  |  Branch (906:3): [True: 0, False: 2.03k]
  ------------------
  907|      0|#endif
  908|      0|    return Curl_setopt_SSLVERSION(data, option, arg);
  909|      0|  case CURLOPT_SSL_FALSESTART:
  ------------------
  |  Branch (909:3): [True: 0, False: 2.03k]
  ------------------
  910|      0|    result = CURLE_NOT_BUILT_IN;
  911|      0|    break;
  912|      0|  case CURLOPT_USE_SSL:
  ------------------
  |  Branch (912:3): [True: 0, False: 2.03k]
  ------------------
  913|      0|    if((arg < CURLUSESSL_NONE) || (arg >= CURLUSESSL_LAST))
  ------------------
  |  |  934|      0|#define CURLUSESSL_NONE    0L /* do not attempt to use SSL */
  ------------------
  |  Branch (913:8): [True: 0, False: 0]
  |  Branch (913:35): [True: 0, False: 0]
  ------------------
  914|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
  915|      0|    else
  916|      0|      s->use_ssl = (unsigned char)arg;
  917|      0|    break;
  918|      0|  case CURLOPT_SSL_OPTIONS:
  ------------------
  |  Branch (918:3): [True: 0, False: 2.03k]
  ------------------
  919|      0|    s->ssl.ssl_options = (unsigned char)(arg & 0xff);
  920|      0|    break;
  921|      0|#ifndef CURL_DISABLE_PROXY
  922|      0|  case CURLOPT_PROXY_SSL_OPTIONS:
  ------------------
  |  Branch (922:3): [True: 0, False: 2.03k]
  ------------------
  923|      0|    s->proxy_ssl.ssl_options = (unsigned char)(arg & 0xff);
  924|      0|    break;
  925|      0|#endif
  926|      0|  case CURLOPT_SSL_ENABLE_NPN:
  ------------------
  |  Branch (926:3): [True: 0, False: 2.03k]
  ------------------
  927|      0|    break;
  928|      0|  case CURLOPT_SSLENGINE_DEFAULT:
  ------------------
  |  Branch (928:3): [True: 0, False: 2.03k]
  ------------------
  929|      0|#ifdef USE_OPENSSL
  930|      0|    if(Curl_ssl_backend() != CURLSSLBACKEND_OPENSSL)
  ------------------
  |  Branch (930:8): [True: 0, False: 0]
  ------------------
  931|      0|      return CURLE_NOT_BUILT_IN;
  932|      0|    data->set.engine_default = (arg == 1);
  933|       |#else
  934|       |    return CURLE_NOT_BUILT_IN;
  935|       |#endif
  936|      0|    break;
  937|  2.03k|  default:
  ------------------
  |  Branch (937:3): [True: 2.03k, False: 0]
  ------------------
  938|  2.03k|    return CURLE_UNKNOWN_OPTION;
  939|  2.03k|  }
  940|      0|  return result;
  941|       |#else  /* USE_SSL */
  942|       |  (void)data;
  943|       |  (void)option;
  944|       |  (void)arg;
  945|       |  return CURLE_UNKNOWN_OPTION;
  946|       |#endif /* !USE_SSL */
  947|  2.03k|}
setopt.c:setopt_long_proto:
 1082|  2.03k|{
 1083|  2.03k|  CURLcode result = CURLE_OK;
 1084|  2.03k|  struct UserDefined *s = &data->set;
 1085|       |
 1086|  2.03k|  switch(option) {
 1087|      0|#ifndef CURL_DISABLE_TFTP
 1088|      0|  case CURLOPT_TFTP_BLKSIZE:
  ------------------
  |  Branch (1088:3): [True: 0, False: 2.03k]
  ------------------
 1089|      0|    result = value_range(&arg, 0, TFTP_BLKSIZE_MIN, TFTP_BLKSIZE_MAX);
  ------------------
  |  |   30|      0|#define TFTP_BLKSIZE_MIN 8
  ------------------
                  result = value_range(&arg, 0, TFTP_BLKSIZE_MIN, TFTP_BLKSIZE_MAX);
  ------------------
  |  |   31|      0|#define TFTP_BLKSIZE_MAX 65464
  ------------------
 1090|      0|    if(!result)
  ------------------
  |  Branch (1090:8): [True: 0, False: 0]
  ------------------
 1091|      0|      s->tftp_blksize = (unsigned short)arg;
 1092|      0|    break;
 1093|      0|#endif
 1094|      0|#ifndef CURL_DISABLE_NETRC
 1095|      0|  case CURLOPT_NETRC:
  ------------------
  |  Branch (1095:3): [True: 0, False: 2.03k]
  ------------------
 1096|      0|    if((arg < CURL_NETRC_IGNORED) || (arg >= CURL_NETRC_LAST))
  ------------------
  |  | 2381|      0|#define CURL_NETRC_IGNORED  0L /* The .netrc is never read.
  ------------------
  |  Branch (1096:8): [True: 0, False: 0]
  |  Branch (1096:38): [True: 0, False: 0]
  ------------------
 1097|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1098|      0|    else
 1099|      0|      s->use_netrc = (unsigned char)arg;
 1100|      0|    break;
 1101|      0|#endif
 1102|      0|#ifndef CURL_DISABLE_FTP
 1103|      0|  case CURLOPT_FTP_FILEMETHOD:
  ------------------
  |  Branch (1103:3): [True: 0, False: 2.03k]
  ------------------
 1104|      0|    if((arg < CURLFTPMETHOD_DEFAULT) || (arg >= CURLFTPMETHOD_LAST))
  ------------------
  |  | 1029|      0|#define CURLFTPMETHOD_DEFAULT   0L /* let libcurl pick */
  ------------------
  |  Branch (1104:8): [True: 0, False: 0]
  |  Branch (1104:41): [True: 0, False: 0]
  ------------------
 1105|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1106|      0|    else
 1107|      0|      s->ftp_filemethod = (unsigned char)arg;
 1108|      0|    break;
 1109|      0|  case CURLOPT_FTP_SSL_CCC:
  ------------------
  |  Branch (1109:3): [True: 0, False: 2.03k]
  ------------------
 1110|      0|    if((arg < CURLFTPSSL_CCC_NONE) || (arg >= CURLFTPSSL_CCC_LAST))
  ------------------
  |  |  999|      0|#define CURLFTPSSL_CCC_NONE    0L /* do not send CCC */
  ------------------
  |  Branch (1110:8): [True: 0, False: 0]
  |  Branch (1110:39): [True: 0, False: 0]
  ------------------
 1111|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1112|      0|    else
 1113|      0|      s->ftp_ccc = (unsigned char)arg;
 1114|      0|    break;
 1115|      0|  case CURLOPT_FTPSSLAUTH:
  ------------------
  |  Branch (1115:3): [True: 0, False: 2.03k]
  ------------------
 1116|      0|    if((arg < CURLFTPAUTH_DEFAULT) || (arg >= CURLFTPAUTH_LAST))
  ------------------
  |  | 1008|      0|#define CURLFTPAUTH_DEFAULT 0L /* let libcurl decide */
  ------------------
  |  Branch (1116:8): [True: 0, False: 0]
  |  Branch (1116:39): [True: 0, False: 0]
  ------------------
 1117|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1118|      0|    else
 1119|      0|      s->ftpsslauth = (unsigned char)arg;
 1120|      0|    break;
 1121|      0|  case CURLOPT_ACCEPTTIMEOUT_MS:
  ------------------
  |  Branch (1121:3): [True: 0, False: 2.03k]
  ------------------
 1122|      0|    return setopt_set_timeout_ms(&s->accepttimeout, arg);
 1123|      0|#endif
 1124|      0|#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH)
 1125|      0|  case CURLOPT_FTP_CREATE_MISSING_DIRS:
  ------------------
  |  Branch (1125:3): [True: 0, False: 2.03k]
  ------------------
 1126|      0|    if((arg < CURLFTP_CREATE_DIR_NONE) || (arg > CURLFTP_CREATE_DIR_RETRY))
  ------------------
  |  | 1017|      0|#define CURLFTP_CREATE_DIR_NONE  0L /* do NOT create missing dirs! */
  ------------------
                  if((arg < CURLFTP_CREATE_DIR_NONE) || (arg > CURLFTP_CREATE_DIR_RETRY))
  ------------------
  |  | 1021|      0|#define CURLFTP_CREATE_DIR_RETRY 2L /* (FTP only) if CWD fails, try MKD and
  ------------------
  |  Branch (1126:8): [True: 0, False: 0]
  |  Branch (1126:43): [True: 0, False: 0]
  ------------------
 1127|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1128|      0|    else
 1129|      0|      s->ftp_create_missing_dirs = (unsigned char)arg;
 1130|      0|    break;
 1131|      0|  case CURLOPT_NEW_FILE_PERMS:
  ------------------
  |  Branch (1131:3): [True: 0, False: 2.03k]
  ------------------
 1132|      0|    if((arg < 0) || (arg > 0777))
  ------------------
  |  Branch (1132:8): [True: 0, False: 0]
  |  Branch (1132:21): [True: 0, False: 0]
  ------------------
 1133|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1134|      0|    else
 1135|      0|      s->new_file_perms = (unsigned int)arg;
 1136|      0|    break;
 1137|      0|#endif
 1138|      0|#ifndef CURL_DISABLE_RTSP
 1139|      0|  case CURLOPT_RTSP_REQUEST:
  ------------------
  |  Branch (1139:3): [True: 0, False: 2.03k]
  ------------------
 1140|      0|    return setopt_RTSP_REQUEST(data, arg);
 1141|      0|  case CURLOPT_RTSP_CLIENT_CSEQ:
  ------------------
  |  Branch (1141:3): [True: 0, False: 2.03k]
  ------------------
 1142|      0|    result = value_range(&arg, 0, 0, INT_MAX);
 1143|      0|    if(!result)
  ------------------
  |  Branch (1143:8): [True: 0, False: 0]
  ------------------
 1144|      0|      data->state.rtsp_next_client_CSeq = (uint32_t)arg;
 1145|      0|    break;
 1146|      0|  case CURLOPT_RTSP_SERVER_CSEQ:
  ------------------
  |  Branch (1146:3): [True: 0, False: 2.03k]
  ------------------
 1147|      0|    result = value_range(&arg, 0, 0, INT_MAX);
 1148|      0|    if(!result)
  ------------------
  |  Branch (1148:8): [True: 0, False: 0]
  ------------------
 1149|      0|      data->state.rtsp_next_server_CSeq = (uint32_t)arg;
 1150|      0|    break;
 1151|      0|#endif
 1152|       |#ifdef USE_SSH
 1153|       |  case CURLOPT_SSH_AUTH_TYPES:
 1154|       |    s->ssh_auth_types = (uint32_t)arg;
 1155|       |    break;
 1156|       |  case CURLOPT_NEW_DIRECTORY_PERMS:
 1157|       |    if((arg < 0) || (arg > 0777))
 1158|       |      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1159|       |    else
 1160|       |      s->new_directory_perms = (unsigned int)arg;
 1161|       |    break;
 1162|       |#endif
 1163|      0|  case CURLOPT_PROTOCOLS:
  ------------------
  |  Branch (1163:3): [True: 0, False: 2.03k]
  ------------------
 1164|      0|    s->allowed_protocols = (curl_prot_t)arg;
 1165|      0|    break;
 1166|      0|  case CURLOPT_REDIR_PROTOCOLS:
  ------------------
  |  Branch (1166:3): [True: 0, False: 2.03k]
  ------------------
 1167|      0|    s->redir_protocols = (curl_prot_t)arg;
 1168|      0|    break;
 1169|      0|#ifndef CURL_DISABLE_WEBSOCKETS
 1170|      0|  case CURLOPT_WS_OPTIONS:
  ------------------
  |  Branch (1170:3): [True: 0, False: 2.03k]
  ------------------
 1171|      0|    s->ws_raw_mode = !!(arg & CURLWS_RAW_MODE);
  ------------------
  |  |   89|      0|#define CURLWS_RAW_MODE   (1L << 0)
  ------------------
 1172|      0|    s->ws_no_auto_pong = !!(arg & CURLWS_NOAUTOPONG);
  ------------------
  |  |   90|      0|#define CURLWS_NOAUTOPONG (1L << 1)
  ------------------
 1173|      0|    break;
 1174|      0|#endif
 1175|  2.03k|  default:
  ------------------
  |  Branch (1175:3): [True: 2.03k, False: 0]
  ------------------
 1176|  2.03k|    return CURLE_UNKNOWN_OPTION;
 1177|  2.03k|  }
 1178|      0|  return result;
 1179|  2.03k|}
setopt.c:setopt_long_misc:
 1183|  2.03k|{
 1184|  2.03k|  struct UserDefined *s = &data->set;
 1185|       |
 1186|  2.03k|  switch(option) {
 1187|    457|  case CURLOPT_TIMECONDITION:
  ------------------
  |  Branch (1187:3): [True: 457, False: 1.58k]
  ------------------
 1188|    457|    if((arg < CURL_TIMECOND_NONE) || (arg >= CURL_TIMECOND_LAST))
  ------------------
  |  | 2436|    457|#define CURL_TIMECOND_NONE         0L
  ------------------
  |  Branch (1188:8): [True: 120, False: 337]
  |  Branch (1188:38): [True: 190, False: 147]
  ------------------
 1189|    310|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1190|    147|    s->timecondition = (unsigned char)arg;
 1191|    147|    break;
 1192|      0|  case CURLOPT_TIMEVALUE:
  ------------------
  |  Branch (1192:3): [True: 0, False: 2.03k]
  ------------------
 1193|      0|    s->timevalue = (time_t)arg;
 1194|      0|    break;
 1195|      0|  case CURLOPT_POSTFIELDSIZE:
  ------------------
  |  Branch (1195:3): [True: 0, False: 2.03k]
  ------------------
 1196|      0|    if(arg < -1)
  ------------------
  |  Branch (1196:8): [True: 0, False: 0]
  ------------------
 1197|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1198|      0|    if(s->postfieldsize < arg && s->a.str_copypostfields) {
  ------------------
  |  Branch (1198:8): [True: 0, False: 0]
  |  Branch (1198:34): [True: 0, False: 0]
  ------------------
 1199|      0|      curlx_safefree(s->a.str_copypostfields);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1200|      0|      s->postfields = NULL;
 1201|      0|    }
 1202|      0|    s->postfieldsize = arg;
 1203|      0|    break;
 1204|      0|  case CURLOPT_INFILESIZE:
  ------------------
  |  Branch (1204:3): [True: 0, False: 2.03k]
  ------------------
 1205|      0|    if(arg < -1)
  ------------------
  |  Branch (1205:8): [True: 0, False: 0]
  ------------------
 1206|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1207|      0|    s->filesize = arg;
 1208|      0|    break;
 1209|      0|  case CURLOPT_RESUME_FROM:
  ------------------
  |  Branch (1209:3): [True: 0, False: 2.03k]
  ------------------
 1210|      0|    if(arg < -1)
  ------------------
  |  Branch (1210:8): [True: 0, False: 0]
  ------------------
 1211|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1212|      0|    s->set_resume_from = arg;
 1213|      0|    break;
 1214|      0|  case CURLOPT_UPLOAD_FLAGS:
  ------------------
  |  Branch (1214:3): [True: 0, False: 2.03k]
  ------------------
 1215|      0|    s->upload_flags = (unsigned char)arg;
 1216|      0|    break;
 1217|      0|#ifndef CURL_DISABLE_MIME
 1218|    233|  case CURLOPT_MIME_OPTIONS:
  ------------------
  |  Branch (1218:3): [True: 233, False: 1.80k]
  ------------------
 1219|    233|    s->mime_formescape = !!(arg & CURLMIMEOPT_FORMESCAPE);
  ------------------
  |  | 2461|    233|#define CURLMIMEOPT_FORMESCAPE (1L << 0) /* Use backslash-escaping for forms */
  ------------------
 1220|    233|    break;
 1221|      0|#endif
 1222|      0|#ifndef CURL_DISABLE_HSTS
 1223|    525|  case CURLOPT_HSTS_CTRL:
  ------------------
  |  Branch (1223:3): [True: 525, False: 1.51k]
  ------------------
 1224|    525|    if(arg & CURLHSTS_ENABLE) {
  ------------------
  |  | 1083|    525|#define CURLHSTS_ENABLE       (1L << 0)
  ------------------
  |  Branch (1224:8): [True: 185, False: 340]
  ------------------
 1225|    185|      if(!data->hsts) {
  ------------------
  |  Branch (1225:10): [True: 114, False: 71]
  ------------------
 1226|    114|        data->hsts = Curl_hsts_init();
 1227|    114|        if(!data->hsts)
  ------------------
  |  Branch (1227:12): [True: 4, False: 110]
  ------------------
 1228|      4|          return CURLE_OUT_OF_MEMORY;
 1229|    114|      }
 1230|    181|      data->hsts->flags = (unsigned int)arg;
 1231|    181|    }
 1232|    340|    else if(!data->share || !data->share->hsts) {
  ------------------
  |  Branch (1232:13): [True: 340, False: 0]
  |  Branch (1232:29): [True: 0, False: 0]
  ------------------
 1233|       |      /* throw away the HSTS cache unless shared */
 1234|    340|      Curl_hsts_cleanup(&data->hsts);
 1235|       |      /* flush all the entries */
 1236|    340|      Curl_frzn_strs_safefree(&data->set.a.hsts_files);
 1237|    340|    }
 1238|      0|    else
 1239|       |      /* detach from shared HSTS cache without freeing it */
 1240|      0|      data->hsts = NULL;
 1241|    521|    break;
 1242|    521|#endif
 1243|    521|#ifndef CURL_DISABLE_ALTSVC
 1244|    822|  case CURLOPT_ALTSVC_CTRL:
  ------------------
  |  Branch (1244:3): [True: 822, False: 1.21k]
  ------------------
 1245|    822|    return Curl_altsvc_ctrl(data, arg);
 1246|      0|#endif
 1247|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
 1248|       |  case CURLOPT_GSSAPI_DELEGATION:
 1249|       |    s->gssapi_delegation = (unsigned char)arg &
 1250|       |      (CURLGSSAPI_DELEGATION_POLICY_FLAG | CURLGSSAPI_DELEGATION_FLAG);
 1251|       |    break;
 1252|       |#endif
 1253|      0|  default:
  ------------------
  |  Branch (1253:3): [True: 0, False: 2.03k]
  ------------------
 1254|      0|    return CURLE_UNKNOWN_OPTION;
 1255|  2.03k|  }
 1256|    901|  return CURLE_OK;
 1257|  2.03k|}
setopt.c:setopt_slist:
 1285|  18.3k|{
 1286|  18.3k|  CURLcode result = CURLE_OK;
 1287|  18.3k|  struct UserDefined *s = &data->set;
 1288|  18.3k|  switch(option) {
 1289|      0|#ifndef CURL_DISABLE_PROXY
 1290|      0|  case CURLOPT_PROXYHEADER:
  ------------------
  |  Branch (1290:3): [True: 0, False: 18.3k]
  ------------------
 1291|       |    /*
 1292|       |     * Set a list with proxy headers to use (or replace internals with)
 1293|       |     *
 1294|       |     * Since CURLOPT_HTTPHEADER was the only way to set HTTP headers for a
 1295|       |     * long time we remain doing it this way until CURLOPT_PROXYHEADER is
 1296|       |     * used. As soon as this option has been used, if set to anything but
 1297|       |     * NULL, custom headers for proxies are only picked from this list.
 1298|       |     *
 1299|       |     * Set this option to NULL to restore the previous behavior.
 1300|       |     */
 1301|      0|    s->proxyheaders = slist;
 1302|      0|    break;
 1303|      0|#endif
 1304|      0|#ifndef CURL_DISABLE_HTTP
 1305|      0|  case CURLOPT_HTTP200ALIASES:
  ------------------
  |  Branch (1305:3): [True: 0, False: 18.3k]
  ------------------
 1306|       |    /*
 1307|       |     * Set a list of aliases for HTTP 200 in response header
 1308|       |     */
 1309|      0|    Curl_frzn_strs_safefree(&s->a.http200aliases);
 1310|      0|    s->a.http200aliases = Curl_frzn_strs_from_slist(slist);
 1311|      0|    if(slist && !s->a.http200aliases)
  ------------------
  |  Branch (1311:8): [True: 0, False: 0]
  |  Branch (1311:17): [True: 0, False: 0]
  ------------------
 1312|      0|      result = CURLE_OUT_OF_MEMORY;
 1313|      0|    break;
 1314|      0|#endif
 1315|      0|#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH)
 1316|      0|  case CURLOPT_POSTQUOTE:
  ------------------
  |  Branch (1316:3): [True: 0, False: 18.3k]
  ------------------
 1317|       |    /* List of RAW FTP commands to use after a transfer */
 1318|      0|    Curl_frzn_strs_safefree(&s->a.postquote);
 1319|      0|    s->a.postquote = Curl_frzn_strs_from_slist(slist);
 1320|      0|    if(slist && !s->a.postquote)
  ------------------
  |  Branch (1320:8): [True: 0, False: 0]
  |  Branch (1320:17): [True: 0, False: 0]
  ------------------
 1321|      0|      result = CURLE_OUT_OF_MEMORY;
 1322|      0|    break;
 1323|      0|  case CURLOPT_PREQUOTE:
  ------------------
  |  Branch (1323:3): [True: 0, False: 18.3k]
  ------------------
 1324|       |    /* List of RAW FTP commands to use prior to RETR (Wesley Laxton) */
 1325|      0|    Curl_frzn_strs_safefree(&s->a.prequote);
 1326|      0|    s->a.prequote = Curl_frzn_strs_from_slist(slist);
 1327|      0|    if(slist && !s->a.prequote)
  ------------------
  |  Branch (1327:8): [True: 0, False: 0]
  |  Branch (1327:17): [True: 0, False: 0]
  ------------------
 1328|      0|      result = CURLE_OUT_OF_MEMORY;
 1329|      0|    break;
 1330|      0|  case CURLOPT_QUOTE:
  ------------------
  |  Branch (1330:3): [True: 0, False: 18.3k]
  ------------------
 1331|       |    /* List of RAW FTP commands to use before a transfer */
 1332|      0|    Curl_frzn_strs_safefree(&s->a.quote);
 1333|      0|    s->a.quote = Curl_frzn_strs_from_slist(slist);
 1334|      0|    if(slist && !s->a.quote)
  ------------------
  |  Branch (1334:8): [True: 0, False: 0]
  |  Branch (1334:17): [True: 0, False: 0]
  ------------------
 1335|      0|      result = CURLE_OUT_OF_MEMORY;
 1336|      0|    break;
 1337|      0|#endif
 1338|      0|  case CURLOPT_RESOLVE:
  ------------------
  |  Branch (1338:3): [True: 0, False: 18.3k]
  ------------------
 1339|       |    /*
 1340|       |     * List of HOST:PORT:[addresses] strings to populate the DNS cache with
 1341|       |     * Entries added this way will remain in the cache until explicitly
 1342|       |     * removed or the handle is cleaned up.
 1343|       |     *
 1344|       |     * Prefix the HOST with plus sign (+) to have the entry expire like
 1345|       |     * automatically added entries.
 1346|       |     *
 1347|       |     * Prefix the HOST with dash (-) to _remove_ the entry from the cache.
 1348|       |     *
 1349|       |     * This API can remove any entry from the DNS cache, but only entries
 1350|       |     * that are not actually in use right now will be pruned immediately.
 1351|       |     */
 1352|      0|    Curl_frzn_strs_safefree(&s->a.resolve);
 1353|      0|    s->a.resolve = Curl_frzn_strs_from_slist(slist);
 1354|      0|    data->state.resolve_loaded = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1355|      0|    if(slist && !s->a.resolve)
  ------------------
  |  Branch (1355:8): [True: 0, False: 0]
  |  Branch (1355:17): [True: 0, False: 0]
  ------------------
 1356|      0|      result = CURLE_OUT_OF_MEMORY;
 1357|      0|    break;
 1358|      0|#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MIME)
 1359|    772|  case CURLOPT_HTTPHEADER:
  ------------------
  |  Branch (1359:3): [True: 772, False: 17.5k]
  ------------------
 1360|       |    /*
 1361|       |     * Set a list with HTTP headers to use (or replace internals with)
 1362|       |     */
 1363|    772|    s->headers = slist;
 1364|    772|#ifndef CURL_DISABLE_MIME
 1365|    772|    if(data->set.a.mimepostp)
  ------------------
  |  Branch (1365:8): [True: 137, False: 635]
  ------------------
 1366|    137|      curl_mime_headers(data->set.a.mimepostp, NULL, 0);
 1367|    772|#endif
 1368|    772|    break;
 1369|      0|#endif
 1370|      0|#ifndef CURL_DISABLE_TELNET
 1371|      0|  case CURLOPT_TELNETOPTIONS:
  ------------------
  |  Branch (1371:3): [True: 0, False: 18.3k]
  ------------------
 1372|       |    /* Set a linked list of telnet options */
 1373|      0|    Curl_frzn_strs_safefree(&s->a.telnet_options);
 1374|      0|    s->a.telnet_options = Curl_frzn_strs_from_slist(slist);
 1375|      0|    if(slist && !s->a.telnet_options)
  ------------------
  |  Branch (1375:8): [True: 0, False: 0]
  |  Branch (1375:17): [True: 0, False: 0]
  ------------------
 1376|      0|      result = CURLE_OUT_OF_MEMORY;
 1377|      0|    break;
 1378|      0|#endif
 1379|      0|#ifndef CURL_DISABLE_SMTP
 1380|      0|  case CURLOPT_MAIL_RCPT:
  ------------------
  |  Branch (1380:3): [True: 0, False: 18.3k]
  ------------------
 1381|       |    /* Set the list of mail recipients */
 1382|      0|    Curl_frzn_strs_safefree(&s->a.mail_rcpt);
 1383|      0|    s->a.mail_rcpt = Curl_frzn_strs_from_slist(slist);
 1384|      0|    if(slist && !s->a.mail_rcpt)
  ------------------
  |  Branch (1384:8): [True: 0, False: 0]
  |  Branch (1384:17): [True: 0, False: 0]
  ------------------
 1385|      0|      result = CURLE_OUT_OF_MEMORY;
 1386|      0|    break;
 1387|      0|#endif
 1388|  17.5k|  case CURLOPT_CONNECT_TO:
  ------------------
  |  Branch (1388:3): [True: 17.5k, False: 772]
  ------------------
 1389|  17.5k|    Curl_frzn_strs_safefree(&s->a.connect_to);
 1390|  17.5k|    s->a.connect_to = Curl_frzn_strs_from_slist(slist);
 1391|  17.5k|    if(slist && !s->a.connect_to)
  ------------------
  |  Branch (1391:8): [True: 9.71k, False: 7.85k]
  |  Branch (1391:17): [True: 18, False: 9.70k]
  ------------------
 1392|     18|      result = CURLE_OUT_OF_MEMORY;
 1393|  17.5k|    break;
 1394|      0|  default:
  ------------------
  |  Branch (1394:3): [True: 0, False: 18.3k]
  ------------------
 1395|      0|    return CURLE_UNKNOWN_OPTION;
 1396|  18.3k|  }
 1397|  18.3k|  return result;
 1398|  18.3k|}
setopt.c:setopt_pointers:
 1455|  2.02k|{
 1456|  2.02k|  CURLcode result = CURLE_OK;
 1457|  2.02k|  struct UserDefined *s = &data->set;
 1458|  2.02k|  switch(option) {
 1459|      0|  case CURLOPT_CURLU:
  ------------------
  |  Branch (1459:3): [True: 0, False: 2.02k]
  ------------------
 1460|       |    /*
 1461|       |     * pass CURLU to set URL
 1462|       |     */
 1463|      0|    Curl_bufref_free(&data->state.url);
 1464|      0|    CURL_EASY_STR_CLEAR(data, STRING_SET_URL);
  ------------------
  |  | 1212|      0|  Curl_u8_strset_unset(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1465|      0|    s->uh = va_arg(param, CURLU *);
 1466|      0|    break;
 1467|      0|#ifndef CURL_DISABLE_HTTP
 1468|      0|#ifndef CURL_DISABLE_FORM_API
 1469|      0|  case CURLOPT_HTTPPOST:
  ------------------
  |  Branch (1469:3): [True: 0, False: 2.02k]
  ------------------
 1470|       |    /*
 1471|       |     * Set to make us do HTTP POST. Legacy API-style.
 1472|       |     */
 1473|      0|    s->httppost = va_arg(param, struct curl_httppost *);
 1474|      0|    s->method = HTTPREQ_POST_FORM;
 1475|      0|    s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1476|      0|    Curl_mime_cleanpart(data->state.formp);
 1477|      0|    curlx_safefree(data->state.formp);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1478|      0|    data->state.mimepost = NULL;
 1479|      0|    break;
 1480|      0|#endif /* !CURL_DISABLE_FORM_API */
 1481|      0|#endif /* !CURL_DISABLE_HTTP */
 1482|      0|#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) ||       \
 1483|      0|  !defined(CURL_DISABLE_IMAP)
 1484|      0|#ifndef CURL_DISABLE_MIME
 1485|  2.02k|  case CURLOPT_MIMEPOST:
  ------------------
  |  Branch (1485:3): [True: 2.02k, False: 0]
  ------------------
 1486|  2.02k|    result = setopt_mimepost(data, va_arg(param, curl_mime *));
 1487|  2.02k|    break;
 1488|      0|#endif /* !CURL_DISABLE_MIME */
 1489|      0|#endif /* !CURL_DISABLE_HTTP || !CURL_DISABLE_SMTP || !CURL_DISABLE_IMAP */
 1490|      0|  case CURLOPT_STDERR:
  ------------------
  |  Branch (1490:3): [True: 0, False: 2.02k]
  ------------------
 1491|       |    /*
 1492|       |     * Set to a FILE * that should receive all error writes. This
 1493|       |     * defaults to stderr for normal operations.
 1494|       |     */
 1495|      0|    s->err = va_arg(param, FILE *);
 1496|      0|    if(!s->err)
  ------------------
  |  Branch (1496:8): [True: 0, False: 0]
  ------------------
 1497|      0|      s->err = stderr;
 1498|      0|    break;
 1499|      0|  case CURLOPT_SHARE:
  ------------------
  |  Branch (1499:3): [True: 0, False: 2.02k]
  ------------------
 1500|      0|    return setopt_share(data, va_arg(param, struct Curl_share *));
 1501|       |
 1502|      0|  default:
  ------------------
  |  Branch (1502:3): [True: 0, False: 2.02k]
  ------------------
 1503|      0|    return CURLE_UNKNOWN_OPTION;
 1504|  2.02k|  }
 1505|  2.02k|  return result;
 1506|  2.02k|}
setopt.c:setopt_mimepost:
 1404|  2.02k|{
 1405|       |  /*
 1406|       |   * Set to make us do MIME POST
 1407|       |   */
 1408|  2.02k|  CURLcode result;
 1409|  2.02k|  struct UserDefined *s = &data->set;
 1410|  2.02k|  if(!s->a.mimepostp) {
  ------------------
  |  Branch (1410:6): [True: 1.02k, False: 1.00k]
  ------------------
 1411|  1.02k|    s->a.mimepostp = curlx_malloc(sizeof(*s->a.mimepostp));
  ------------------
  |  | 1498|  1.02k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 1412|  1.02k|    if(!s->a.mimepostp)
  ------------------
  |  Branch (1412:8): [True: 8, False: 1.01k]
  ------------------
 1413|      8|      return CURLE_OUT_OF_MEMORY;
 1414|  1.01k|    Curl_mime_initpart(s->a.mimepostp);
 1415|  1.01k|  }
 1416|       |
 1417|  2.01k|  result = Curl_mime_set_subparts(s->a.mimepostp, mimep, FALSE);
  ------------------
  |  |  989|  2.01k|#define FALSE false
  ------------------
 1418|  2.01k|  if(!result) {
  ------------------
  |  Branch (1418:6): [True: 2.01k, False: 0]
  ------------------
 1419|  2.01k|    s->method = HTTPREQ_POST_MIME;
 1420|  2.01k|    s->opt_no_body = FALSE; /* this is implied */
  ------------------
  |  |  989|  2.01k|#define FALSE false
  ------------------
 1421|  2.01k|#ifndef CURL_DISABLE_FORM_API
 1422|  2.01k|    Curl_mime_cleanpart(data->state.formp);
 1423|  2.01k|    curlx_safefree(data->state.formp);
  ------------------
  |  | 1359|  2.01k|  do {                      \
  |  | 1360|  2.01k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  2.01k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  2.01k|    (ptr) = NULL;           \
  |  | 1362|  2.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 2.01k]
  |  |  ------------------
  ------------------
 1424|       |    data->state.mimepost = NULL;
 1425|  2.01k|#endif
 1426|  2.01k|  }
 1427|  2.01k|  return result;
 1428|  2.02k|}
setopt.c:setopt_cptr:
 2513|   145k|{
 2514|   145k|  typedef CURLcode (*ptrfunc)(struct Curl_easy *data, CURLoption option,
 2515|   145k|                              char *ptr);
 2516|       |  /* Order by likeliness */
 2517|   145k|  static const ptrfunc setopt_call[] = {
 2518|   145k|    setopt_cptr_misc,
 2519|   145k|#if defined(USE_SSL) || defined(USE_SSH)
 2520|   145k|    setopt_cptr_ssl,
 2521|   145k|#endif
 2522|   145k|#ifndef CURL_DISABLE_PROXY
 2523|   145k|    setopt_cptr_proxy,
 2524|   145k|#endif
 2525|   145k|    setopt_cptr_net,
 2526|   145k|#ifndef CURL_DISABLE_FTP
 2527|   145k|    setopt_cptr_ftp,
 2528|   145k|#endif
 2529|       |#ifdef USE_SSH
 2530|       |    setopt_cptr_ssh,
 2531|       |#endif
 2532|   145k|#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_MQTT)
 2533|   145k|    setopt_cptr_http_mqtt,
 2534|   145k|#endif
 2535|   145k|  };
 2536|   145k|  size_t i;
 2537|       |
 2538|   367k|  for(i = 0; i < CURL_ARRAYSIZE(setopt_call); i++) {
  ------------------
  |  | 1326|   367k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
  |  Branch (2538:14): [True: 367k, False: 0]
  ------------------
 2539|   367k|    CURLcode result = setopt_call[i](data, option, ptr);
 2540|   367k|    if(result != CURLE_UNKNOWN_OPTION)
  ------------------
  |  Branch (2540:8): [True: 145k, False: 222k]
  ------------------
 2541|   145k|      return result;
 2542|   367k|  }
 2543|      0|  return CURLE_UNKNOWN_OPTION;
 2544|   145k|}
setopt.c:setopt_cptr_misc:
 2297|   145k|{
 2298|   145k|  CURLcode result = CURLE_OK;
 2299|   145k|  struct UserDefined *s = &data->set;
 2300|       |
 2301|   145k|  switch(option) {
 2302|    183|  case CURLOPT_REQUEST_TARGET:
  ------------------
  |  Branch (2302:3): [True: 183, False: 144k]
  ------------------
 2303|    183|    return Curl_setstropt(data, STRING_TARGET, ptr);
 2304|      0|#ifndef CURL_DISABLE_NETRC
 2305|  9.91k|  case CURLOPT_NETRC_FILE:
  ------------------
  |  Branch (2305:3): [True: 9.91k, False: 135k]
  ------------------
 2306|  9.91k|    return Curl_setstropt(data, STRING_NETRC_FILE, ptr);
 2307|      0|#endif
 2308|    144|  case CURLOPT_CUSTOMREQUEST:
  ------------------
  |  Branch (2308:3): [True: 144, False: 145k]
  ------------------
 2309|    144|    return Curl_setstropt(data, STRING_CUSTOMREQUEST, ptr);
 2310|       |
 2311|       |    /* we do not set s->method = HTTPREQ_CUSTOM; here, we continue as if we
 2312|       |       were using the already set type and this changes the actual request
 2313|       |       keyword */
 2314|      0|  case CURLOPT_SERVICE_NAME:
  ------------------
  |  Branch (2314:3): [True: 0, False: 145k]
  ------------------
 2315|      0|    return Curl_setstropt(data, STRING_SERVICE_NAME, ptr);
 2316|       |
 2317|      0|  case CURLOPT_HEADERDATA:
  ------------------
  |  Branch (2317:3): [True: 0, False: 145k]
  ------------------
 2318|      0|    s->writeheader = ptr;
 2319|      0|    break;
 2320|  1.15k|  case CURLOPT_READDATA:
  ------------------
  |  Branch (2320:3): [True: 1.15k, False: 144k]
  ------------------
 2321|  1.15k|    s->in_set = ptr;
 2322|  1.15k|    break;
 2323|      0|  case CURLOPT_WRITEDATA:
  ------------------
  |  Branch (2323:3): [True: 0, False: 145k]
  ------------------
 2324|      0|    s->out = ptr;
 2325|      0|    break;
 2326|    985|  case CURLOPT_DEBUGDATA:
  ------------------
  |  Branch (2326:3): [True: 985, False: 144k]
  ------------------
 2327|    985|    s->debugdata = ptr;
 2328|    985|    break;
 2329|      0|  case CURLOPT_PROGRESSDATA:
  ------------------
  |  | 1353|      0|#define CURLOPT_PROGRESSDATA CURLOPT_XFERINFODATA
  ------------------
  |  Branch (2329:3): [True: 0, False: 145k]
  ------------------
 2330|      0|    s->progress_client = ptr;
 2331|      0|    break;
 2332|  1.15k|  case CURLOPT_SEEKDATA:
  ------------------
  |  Branch (2332:3): [True: 1.15k, False: 144k]
  ------------------
 2333|  1.15k|    s->seek_client = ptr;
 2334|  1.15k|    break;
 2335|      0|  case CURLOPT_IOCTLDATA:
  ------------------
  |  Branch (2335:3): [True: 0, False: 145k]
  ------------------
 2336|      0|    s->ioctl_client = ptr;
 2337|      0|    break;
 2338|  9.91k|  case CURLOPT_SOCKOPTDATA:
  ------------------
  |  Branch (2338:3): [True: 9.91k, False: 135k]
  ------------------
 2339|  9.91k|    s->sockopt_client = ptr;
 2340|  9.91k|    break;
 2341|  9.91k|  case CURLOPT_OPENSOCKETDATA:
  ------------------
  |  Branch (2341:3): [True: 9.91k, False: 135k]
  ------------------
 2342|  9.91k|    s->opensocket_client = ptr;
 2343|  9.91k|    break;
 2344|      0|  case CURLOPT_RESOLVER_START_DATA:
  ------------------
  |  Branch (2344:3): [True: 0, False: 145k]
  ------------------
 2345|      0|    s->resolver_start_client = ptr;
 2346|      0|    break;
 2347|      0|  case CURLOPT_CLOSESOCKETDATA:
  ------------------
  |  Branch (2347:3): [True: 0, False: 145k]
  ------------------
 2348|      0|    s->closesocket_client = ptr;
 2349|      0|    break;
 2350|      0|  case CURLOPT_PREREQDATA:
  ------------------
  |  Branch (2350:3): [True: 0, False: 145k]
  ------------------
 2351|      0|    s->prereq_userp = ptr;
 2352|      0|    break;
 2353|      0|  case CURLOPT_ERRORBUFFER:
  ------------------
  |  Branch (2353:3): [True: 0, False: 145k]
  ------------------
 2354|      0|    s->errorbuffer = ptr;
 2355|      0|    break;
 2356|  9.91k|  case CURLOPT_URL:
  ------------------
  |  Branch (2356:3): [True: 9.91k, False: 135k]
  ------------------
 2357|  9.91k|    result = Curl_setstropt(data, STRING_SET_URL, ptr);
 2358|  9.91k|    Curl_bufref_set(&data->state.url,
 2359|  9.91k|                    CURL_EASY_STR(data, STRING_SET_URL), 0, NULL);
  ------------------
  |  | 1206|  9.91k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2360|  9.91k|    break;
 2361|       |
 2362|    412|  case CURLOPT_USERPWD: {
  ------------------
  |  Branch (2362:3): [True: 412, False: 144k]
  ------------------
 2363|    412|    char *u = NULL, *p = NULL;
 2364|    412|    result = setstropt_userpwd(ptr, &u, &p);
 2365|    412|    if(!result) {
  ------------------
  |  Branch (2365:8): [True: 403, False: 9]
  ------------------
 2366|    403|      result = CURL_EASY_STR_SETN(data, STRING_USERNAME, u);
  ------------------
  |  | 1210|    403|  Curl_u8_strset_setn(&(d)->set.strings, (uint8_t)(id), s)
  ------------------
 2367|    403|      u = NULL;
 2368|    403|    }
 2369|    412|    if(!result) {
  ------------------
  |  Branch (2369:8): [True: 403, False: 9]
  ------------------
 2370|    403|      result = CURL_EASY_STR_SETN(data, STRING_PASSWORD, p);
  ------------------
  |  | 1210|    403|  Curl_u8_strset_setn(&(d)->set.strings, (uint8_t)(id), s)
  ------------------
 2371|    403|      p = NULL;
 2372|    403|    }
 2373|    412|    curlx_free(u);
  ------------------
  |  | 1503|    412|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2374|    412|    curlx_free(p);
  ------------------
  |  | 1503|    412|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2375|    412|    return result;
 2376|      0|  }
 2377|       |
 2378|    214|  case CURLOPT_USERNAME:
  ------------------
  |  Branch (2378:3): [True: 214, False: 144k]
  ------------------
 2379|    214|    return Curl_setstropt(data, STRING_USERNAME, ptr);
 2380|       |
 2381|    237|  case CURLOPT_PASSWORD:
  ------------------
  |  Branch (2381:3): [True: 237, False: 144k]
  ------------------
 2382|    237|    return Curl_setstropt(data, STRING_PASSWORD, ptr);
 2383|       |
 2384|      0|  case CURLOPT_LOGIN_OPTIONS:
  ------------------
  |  Branch (2384:3): [True: 0, False: 145k]
  ------------------
 2385|      0|    return Curl_setstropt(data, STRING_OPTIONS, ptr);
 2386|       |
 2387|    210|  case CURLOPT_XOAUTH2_BEARER:
  ------------------
  |  Branch (2387:3): [True: 210, False: 144k]
  ------------------
 2388|    210|    return Curl_setstropt(data, STRING_BEARER, ptr);
 2389|    214|  case CURLOPT_RANGE:
  ------------------
  |  Branch (2389:3): [True: 214, False: 144k]
  ------------------
 2390|    214|    return Curl_setstropt(data, STRING_SET_RANGE, ptr);
 2391|      0|  case CURLOPT_PRIVATE:
  ------------------
  |  Branch (2391:3): [True: 0, False: 145k]
  ------------------
 2392|      0|    s->private_data = ptr;
 2393|      0|    break;
 2394|  9.91k|  case CURLOPT_PROTOCOLS_STR:
  ------------------
  |  Branch (2394:3): [True: 9.91k, False: 135k]
  ------------------
 2395|  9.91k|    if(ptr) {
  ------------------
  |  Branch (2395:8): [True: 9.91k, False: 0]
  ------------------
 2396|  9.91k|      curl_prot_t protos;
 2397|  9.91k|      result = protocol2num(ptr, &protos);
 2398|  9.91k|      if(!result)
  ------------------
  |  Branch (2398:10): [True: 9.91k, False: 0]
  ------------------
 2399|  9.91k|        s->allowed_protocols = protos;
 2400|  9.91k|    }
 2401|      0|    else
 2402|       |      /* make a NULL argument reset to default */
 2403|      0|      s->allowed_protocols = (curl_prot_t)CURLPROTO_64ALL;
  ------------------
  |  |   67|      0|#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
  ------------------
 2404|  9.91k|    break;
 2405|  9.91k|  case CURLOPT_REDIR_PROTOCOLS_STR:
  ------------------
  |  Branch (2405:3): [True: 9.91k, False: 135k]
  ------------------
 2406|  9.91k|    if(ptr) {
  ------------------
  |  Branch (2406:8): [True: 9.91k, False: 0]
  ------------------
 2407|  9.91k|      curl_prot_t protos;
 2408|  9.91k|      result = protocol2num(ptr, &protos);
 2409|  9.91k|      if(!result)
  ------------------
  |  Branch (2409:10): [True: 9.91k, False: 0]
  ------------------
 2410|  9.91k|        s->redir_protocols = protos;
 2411|  9.91k|    }
 2412|      0|    else
 2413|       |      /* make a NULL argument reset to default */
 2414|      0|      s->redir_protocols = (curl_prot_t)CURLPROTO_REDIR;
  ------------------
  |  |   70|      0|#define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1088|      0|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1089|      0|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1090|      0|#define CURLPROTO_FTP     (1L << 2)
  |  |  ------------------
  |  |   71|      0|                         CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1091|      0|#define CURLPROTO_FTPS    (1L << 3)
  |  |  ------------------
  ------------------
 2415|  9.91k|    break;
 2416|      0|  case CURLOPT_DEFAULT_PROTOCOL:
  ------------------
  |  Branch (2416:3): [True: 0, False: 145k]
  ------------------
 2417|       |    /* Set the protocol to use when the URL does not include any protocol */
 2418|      0|    return Curl_setstropt(data, STRING_DEFAULT_PROTOCOL, ptr);
 2419|      0|#ifndef CURL_DISABLE_SMTP
 2420|      0|  case CURLOPT_MAIL_FROM:
  ------------------
  |  Branch (2420:3): [True: 0, False: 145k]
  ------------------
 2421|       |    /* Set the SMTP mail originator */
 2422|      0|    return Curl_setstropt(data, STRING_MAIL_FROM, ptr);
 2423|      0|  case CURLOPT_MAIL_AUTH:
  ------------------
  |  Branch (2423:3): [True: 0, False: 145k]
  ------------------
 2424|       |    /* Set the SMTP auth originator */
 2425|      0|    return Curl_setstropt(data, STRING_MAIL_AUTH, ptr);
 2426|      0|#endif
 2427|      0|  case CURLOPT_SASL_AUTHZID:
  ------------------
  |  Branch (2427:3): [True: 0, False: 145k]
  ------------------
 2428|       |    /* Authorization identity (identity to act as) */
 2429|      0|    return Curl_setstropt(data, STRING_SASL_AUTHZID, ptr);
 2430|      0|#ifndef CURL_DISABLE_RTSP
 2431|      0|  case CURLOPT_RTSP_SESSION_ID:
  ------------------
  |  Branch (2431:3): [True: 0, False: 145k]
  ------------------
 2432|      0|    result = Curl_setstropt(data, STRING_RTSP_SESSION_ID, ptr);
 2433|      0|    if(!result) {
  ------------------
  |  Branch (2433:8): [True: 0, False: 0]
  ------------------
 2434|      0|      curlx_safefree(data->state.session_id);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2435|      0|      Curl_peer_unlink(&data->state.rtsp_session_origin);
 2436|      0|    }
 2437|      0|    return result;
 2438|      0|  case CURLOPT_RTSP_STREAM_URI:
  ------------------
  |  Branch (2438:3): [True: 0, False: 145k]
  ------------------
 2439|      0|    return Curl_setstropt(data, STRING_RTSP_STREAM_URI, ptr);
 2440|      0|  case CURLOPT_RTSP_TRANSPORT:
  ------------------
  |  Branch (2440:3): [True: 0, False: 145k]
  ------------------
 2441|      0|    return Curl_setstropt(data, STRING_RTSP_TRANSPORT, ptr);
 2442|      0|  case CURLOPT_INTERLEAVEDATA:
  ------------------
  |  Branch (2442:3): [True: 0, False: 145k]
  ------------------
 2443|      0|    s->rtp_out = ptr;
 2444|      0|    break;
 2445|      0|#endif /* !CURL_DISABLE_RTSP */
 2446|      0|  case CURLOPT_TLSAUTH_USERNAME:
  ------------------
  |  Branch (2446:3): [True: 0, False: 145k]
  ------------------
 2447|      0|  case CURLOPT_TLSAUTH_PASSWORD:
  ------------------
  |  Branch (2447:3): [True: 0, False: 145k]
  ------------------
 2448|      0|  case CURLOPT_TLSAUTH_TYPE:
  ------------------
  |  Branch (2448:3): [True: 0, False: 145k]
  ------------------
 2449|      0|  case CURLOPT_PROXY_TLSAUTH_USERNAME:
  ------------------
  |  Branch (2449:3): [True: 0, False: 145k]
  ------------------
 2450|      0|  case CURLOPT_PROXY_TLSAUTH_PASSWORD:
  ------------------
  |  Branch (2450:3): [True: 0, False: 145k]
  ------------------
 2451|      0|  case CURLOPT_PROXY_TLSAUTH_TYPE:
  ------------------
  |  Branch (2451:3): [True: 0, False: 145k]
  ------------------
 2452|      0|    return CURLE_NOT_BUILT_IN;
 2453|      0|#ifndef CURL_DISABLE_HSTS
 2454|      0|  case CURLOPT_HSTSREADDATA:
  ------------------
  |  Branch (2454:3): [True: 0, False: 145k]
  ------------------
 2455|      0|    s->hsts_read_userp = ptr;
 2456|      0|    break;
 2457|      0|  case CURLOPT_HSTSWRITEDATA:
  ------------------
  |  Branch (2457:3): [True: 0, False: 145k]
  ------------------
 2458|      0|    s->hsts_write_userp = ptr;
 2459|      0|    break;
 2460|  9.91k|  case CURLOPT_HSTS:
  ------------------
  |  Branch (2460:3): [True: 9.91k, False: 135k]
  ------------------
 2461|  9.91k|    if(!data->hsts) {
  ------------------
  |  Branch (2461:8): [True: 9.91k, False: 0]
  ------------------
 2462|  9.91k|      data->hsts = Curl_hsts_init();
 2463|  9.91k|      if(!data->hsts)
  ------------------
  |  Branch (2463:10): [True: 17, False: 9.89k]
  ------------------
 2464|     17|        return CURLE_OUT_OF_MEMORY;
 2465|  9.91k|    }
 2466|  9.89k|    if(ptr) {
  ------------------
  |  Branch (2466:8): [True: 9.89k, False: 0]
  ------------------
 2467|  9.89k|      struct Curl_frzn_strs *nfiles;
 2468|  9.89k|      result = Curl_setstropt(data, STRING_HSTS, ptr);
 2469|  9.89k|      if(result)
  ------------------
  |  Branch (2469:10): [True: 11, False: 9.88k]
  ------------------
 2470|     11|        return result;
 2471|       |      /* this needs to build a list of filenames to read from, so that it can
 2472|       |         read them later, as we might get a shared HSTS handle to load them
 2473|       |         into */
 2474|  9.88k|      nfiles = Curl_frzn_strs_add(data->set.a.hsts_files, ptr);
 2475|  9.88k|      Curl_frzn_strs_safefree(&data->set.a.hsts_files);
 2476|  9.88k|      if(!nfiles)
  ------------------
  |  Branch (2476:10): [True: 38, False: 9.84k]
  ------------------
 2477|     38|        return CURLE_OUT_OF_MEMORY;
 2478|  9.84k|      data->set.a.hsts_files = nfiles;
 2479|  9.84k|    }
 2480|      0|    else {
 2481|       |      /* clear the list of HSTS files */
 2482|      0|      Curl_frzn_strs_safefree(&data->set.a.hsts_files);
 2483|      0|      if(!data->share || !data->share->hsts)
  ------------------
  |  Branch (2483:10): [True: 0, False: 0]
  |  Branch (2483:26): [True: 0, False: 0]
  ------------------
 2484|       |        /* throw away the HSTS cache unless shared */
 2485|      0|        Curl_hsts_cleanup(&data->hsts);
 2486|      0|    }
 2487|  9.84k|    break;
 2488|  9.84k|#endif /* !CURL_DISABLE_HSTS */
 2489|  9.84k|#ifndef CURL_DISABLE_ALTSVC
 2490|  9.91k|  case CURLOPT_ALTSVC:
  ------------------
  |  Branch (2490:3): [True: 9.91k, False: 135k]
  ------------------
 2491|  9.91k|    if(!data->asi) {
  ------------------
  |  Branch (2491:8): [True: 9.91k, False: 0]
  ------------------
 2492|  9.91k|      data->asi = Curl_altsvc_init();
 2493|  9.91k|      if(!data->asi)
  ------------------
  |  Branch (2493:10): [True: 40, False: 9.87k]
  ------------------
 2494|     40|        return CURLE_OUT_OF_MEMORY;
 2495|  9.91k|    }
 2496|  9.87k|    result = Curl_setstropt(data, STRING_ALTSVC, ptr);
 2497|  9.87k|    if(result)
  ------------------
  |  Branch (2497:8): [True: 13, False: 9.86k]
  ------------------
 2498|     13|      break;
 2499|  9.86k|    if(ptr)
  ------------------
  |  Branch (2499:8): [True: 9.86k, False: 0]
  ------------------
 2500|  9.86k|      return Curl_altsvc_load(data->asi, ptr);
 2501|      0|    break;
 2502|      0|#endif /* !CURL_DISABLE_ALTSVC */
 2503|      0|  case CURLOPT_ECH:
  ------------------
  |  Branch (2503:3): [True: 0, False: 145k]
  ------------------
 2504|      0|    return setopt_ech(data, ptr);
 2505|  60.9k|  default:
  ------------------
  |  Branch (2505:3): [True: 60.9k, False: 84.2k]
  ------------------
 2506|  60.9k|    return CURLE_UNKNOWN_OPTION;
 2507|   145k|  }
 2508|  62.7k|  return result;
 2509|   145k|}
setopt.c:setstropt_userpwd:
  123|  2.76k|{
  124|  2.76k|  char *user = NULL;
  125|  2.76k|  char *passwd = NULL;
  126|       |
  127|  2.76k|  DEBUGASSERT(userp);
  ------------------
  |  | 1016|  2.76k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (127:3): [True: 0, False: 2.76k]
  |  Branch (127:3): [True: 2.76k, False: 0]
  ------------------
  128|  2.76k|  DEBUGASSERT(passwdp);
  ------------------
  |  | 1016|  2.76k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (128:3): [True: 0, False: 2.76k]
  |  Branch (128:3): [True: 2.76k, False: 0]
  ------------------
  129|       |
  130|       |  /* Parse the login details if specified. If not, then we treat NULL as a
  131|       |     hint to clear the existing data */
  132|  2.76k|  if(option) {
  ------------------
  |  Branch (132:6): [True: 2.76k, False: 0]
  ------------------
  133|  2.76k|    size_t len = strlen(option);
  134|  2.76k|    CURLcode result;
  135|  2.76k|    if(len > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  2.76k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (135:8): [True: 0, False: 2.76k]
  ------------------
  136|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
  137|       |
  138|  2.76k|    result = Curl_parse_login_details(option, len, &user, &passwd, NULL);
  139|  2.76k|    if(result)
  ------------------
  |  Branch (139:8): [True: 28, False: 2.73k]
  ------------------
  140|     28|      return result;
  141|  2.76k|  }
  142|       |
  143|  2.73k|  curlx_free(*userp);
  ------------------
  |  | 1503|  2.73k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  144|  2.73k|  *userp = user;
  145|       |
  146|  2.73k|  curlx_strzero(*passwdp);
  147|  2.73k|  curlx_free(*passwdp);
  ------------------
  |  | 1503|  2.73k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  148|  2.73k|  *passwdp = passwd;
  149|       |
  150|  2.73k|  return CURLE_OK;
  151|  2.76k|}
setopt.c:protocol2num:
  175|  19.8k|{
  176|       |  /*
  177|       |   * We are asked to cherry-pick protocols, so play it safe and disallow all
  178|       |   * protocols to start with, and re-add the wanted ones back in.
  179|       |   */
  180|  19.8k|  *val = 0;
  181|       |
  182|  19.8k|  if(!str)
  ------------------
  |  Branch (182:6): [True: 0, False: 19.8k]
  ------------------
  183|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  184|       |
  185|  19.8k|  if(curl_strequal(str, "all")) {
  ------------------
  |  Branch (185:6): [True: 0, False: 19.8k]
  ------------------
  186|      0|    *val = ~(curl_prot_t)0;
  187|      0|    return CURLE_OK;
  188|      0|  }
  189|       |
  190|  79.3k|  do {
  191|  79.3k|    const char *token = str;
  192|  79.3k|    size_t tlen;
  193|       |
  194|  79.3k|    str = strchr(str, ',');
  195|  79.3k|    tlen = str ? (size_t)(str - token) : strlen(token);
  ------------------
  |  Branch (195:12): [True: 59.4k, False: 19.8k]
  ------------------
  196|  79.3k|    if(tlen) {
  ------------------
  |  Branch (196:8): [True: 79.3k, False: 0]
  ------------------
  197|  79.3k|      const struct Curl_scheme *h = Curl_getn_scheme(token, tlen);
  198|       |
  199|  79.3k|      if(!h || !h->run)
  ------------------
  |  Branch (199:10): [True: 0, False: 79.3k]
  |  Branch (199:16): [True: 0, False: 79.3k]
  ------------------
  200|      0|        return CURLE_UNSUPPORTED_PROTOCOL;
  201|       |
  202|  79.3k|      *val |= h->protocol;
  203|  79.3k|    }
  204|  79.3k|  } while(str && str++);
  ------------------
  |  Branch (204:11): [True: 59.4k, False: 19.8k]
  |  Branch (204:18): [True: 59.4k, False: 0]
  ------------------
  205|       |
  206|  19.8k|  if(!*val)
  ------------------
  |  Branch (206:6): [True: 0, False: 19.8k]
  ------------------
  207|       |    /* no protocol listed */
  208|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  209|  19.8k|  return CURLE_OK;
  210|  19.8k|}
setopt.c:setopt_cptr_ssl:
 1892|  60.9k|{
 1893|  60.9k|  CURLcode result = CURLE_OK;
 1894|       |
 1895|  60.9k|  switch(option) {
 1896|      0|  case CURLOPT_KEYPASSWD:
  ------------------
  |  Branch (1896:3): [True: 0, False: 60.9k]
  ------------------
 1897|       |    /*
 1898|       |     * String that holds the SSL or SSH private key password.
 1899|       |     */
 1900|      0|    result = Curl_setstropt(data, STRING_KEY_PASSWD, ptr);
 1901|      0|    break;
 1902|      0|#ifdef USE_SSL
 1903|      0|  case CURLOPT_CAINFO:
  ------------------
  |  Branch (1903:3): [True: 0, False: 60.9k]
  ------------------
 1904|       |    /*
 1905|       |     * Set CA info for SSL connection. Specify filename of the CA certificate
 1906|       |     */
 1907|      0|    result = Curl_setstropt(data, STRING_SSL_CAFILE, ptr);
 1908|      0|    if(!result)
  ------------------
  |  Branch (1908:8): [True: 0, False: 0]
  ------------------
 1909|      0|      data->set.ssl.custom_cafile = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1910|      0|    return result;
 1911|      0|  case CURLOPT_CAPATH:
  ------------------
  |  Branch (1911:3): [True: 0, False: 60.9k]
  ------------------
 1912|       |    /*
 1913|       |     * Set CA path info for SSL connection. Specify directory name of the CA
 1914|       |     * certificates which have been prepared using openssl c_rehash utility.
 1915|       |     */
 1916|      0|    if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) {
  ------------------
  |  |   36|      0|#define SSLSUPP_CA_PATH      (1 << 0) /* supports CAPATH */
  ------------------
  |  Branch (1916:8): [True: 0, False: 0]
  ------------------
 1917|       |      /* This does not work on Windows. */
 1918|      0|      result = Curl_setstropt(data, STRING_SSL_CAPATH, ptr);
 1919|      0|      if(!result)
  ------------------
  |  Branch (1919:10): [True: 0, False: 0]
  ------------------
 1920|      0|        data->set.ssl.custom_capath = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1921|      0|      return result;
 1922|      0|    }
 1923|      0|    return CURLE_NOT_BUILT_IN;
 1924|      0|  case CURLOPT_CRLFILE:
  ------------------
  |  Branch (1924:3): [True: 0, False: 60.9k]
  ------------------
 1925|       |    /*
 1926|       |     * Set CRL file info for SSL connection. Specify filename of the CRL
 1927|       |     * to check certificates revocation
 1928|       |     */
 1929|      0|    if(Curl_ssl_supports(data, SSLSUPP_CRLFILE))
  ------------------
  |  |   49|      0|#define SSLSUPP_CRLFILE      (1 << 13) /* supports CURLOPT_CRLFILE */
  ------------------
  |  Branch (1929:8): [True: 0, False: 0]
  ------------------
 1930|      0|      return Curl_setstropt(data, STRING_SSL_CRLFILE, ptr);
 1931|      0|    return CURLE_NOT_BUILT_IN;
 1932|      0|  case CURLOPT_SSL_CIPHER_LIST:
  ------------------
  |  Branch (1932:3): [True: 0, False: 60.9k]
  ------------------
 1933|      0|    if(Curl_ssl_supports(data, SSLSUPP_CIPHER_LIST))
  ------------------
  |  |   45|      0|#define SSLSUPP_CIPHER_LIST  (1 << 9) /* supports TLS 1.0-1.2 ciphersuites */
  ------------------
  |  Branch (1933:8): [True: 0, False: 0]
  ------------------
 1934|       |      /* set a list of cipher we want to use in the SSL connection */
 1935|      0|      return Curl_setstropt(data, STRING_SSL_CIPHER_LIST, ptr);
 1936|      0|    else
 1937|      0|      return CURLE_NOT_BUILT_IN;
 1938|      0|  case CURLOPT_TLS13_CIPHERS:
  ------------------
  |  Branch (1938:3): [True: 0, False: 60.9k]
  ------------------
 1939|      0|    if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES))
  ------------------
  |  |   41|      0|#define SSLSUPP_TLS13_CIPHERSUITES (1 << 5) /* supports TLS 1.3 ciphersuites */
  ------------------
  |  Branch (1939:8): [True: 0, False: 0]
  ------------------
 1940|       |      /* set preferred list of TLS 1.3 cipher suites */
 1941|      0|      return Curl_setstropt(data, STRING_SSL_CIPHER13_LIST, ptr);
 1942|      0|    else
 1943|      0|      return CURLE_NOT_BUILT_IN;
 1944|      0|  case CURLOPT_RANDOM_FILE:
  ------------------
  |  Branch (1944:3): [True: 0, False: 60.9k]
  ------------------
 1945|      0|    break;
 1946|      0|  case CURLOPT_EGDSOCKET:
  ------------------
  |  Branch (1946:3): [True: 0, False: 60.9k]
  ------------------
 1947|      0|    break;
 1948|      0|  case CURLOPT_SSL_CTX_DATA:
  ------------------
  |  Branch (1948:3): [True: 0, False: 60.9k]
  ------------------
 1949|       |    /*
 1950|       |     * Set an SSL_CTX callback parameter pointer
 1951|       |     */
 1952|      0|    if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) {
  ------------------
  |  |   39|      0|#define SSLSUPP_SSL_CTX      (1 << 3) /* supports CURLOPT_SSL_CTX */
  ------------------
  |  Branch (1952:8): [True: 0, False: 0]
  ------------------
 1953|      0|      data->set.ssl_fsslctxp = ptr;
 1954|      0|      break;
 1955|      0|    }
 1956|      0|    else
 1957|      0|      return CURLE_NOT_BUILT_IN;
 1958|      0|  case CURLOPT_SSLCERT:
  ------------------
  |  Branch (1958:3): [True: 0, False: 60.9k]
  ------------------
 1959|       |    /*
 1960|       |     * String that holds filename of the SSL certificate to use
 1961|       |     */
 1962|      0|    return Curl_setstropt(data, STRING_CERT, ptr);
 1963|      0|  case CURLOPT_SSLCERTTYPE:
  ------------------
  |  Branch (1963:3): [True: 0, False: 60.9k]
  ------------------
 1964|       |    /*
 1965|       |     * String that holds file type of the SSL certificate to use
 1966|       |     */
 1967|      0|    return Curl_setstropt(data, STRING_CERT_TYPE, ptr);
 1968|      0|  case CURLOPT_SSLKEY:
  ------------------
  |  Branch (1968:3): [True: 0, False: 60.9k]
  ------------------
 1969|       |    /*
 1970|       |     * String that holds filename of the SSL key to use
 1971|       |     */
 1972|      0|    return Curl_setstropt(data, STRING_KEY, ptr);
 1973|      0|  case CURLOPT_SSLKEYTYPE:
  ------------------
  |  Branch (1973:3): [True: 0, False: 60.9k]
  ------------------
 1974|       |    /*
 1975|       |     * String that holds file type of the SSL key to use
 1976|       |     */
 1977|      0|    return Curl_setstropt(data, STRING_KEY_TYPE, ptr);
 1978|      0|  case CURLOPT_SSLENGINE:
  ------------------
  |  Branch (1978:3): [True: 0, False: 60.9k]
  ------------------
 1979|       |    /*
 1980|       |     * String that holds the SSL crypto engine.
 1981|       |     */
 1982|      0|    if(Curl_ssl_backend() != CURLSSLBACKEND_OPENSSL)
  ------------------
  |  Branch (1982:8): [True: 0, False: 0]
  ------------------
 1983|      0|      return CURLE_NOT_BUILT_IN;
 1984|      0|    result = Curl_setstropt(data, STRING_SSL_ENGINE, ptr);
 1985|      0|    break;
 1986|      0|  case CURLOPT_ISSUERCERT:
  ------------------
  |  Branch (1986:3): [True: 0, False: 60.9k]
  ------------------
 1987|       |    /*
 1988|       |     * Set Issuer certificate file
 1989|       |     * to check certificates issuer
 1990|       |     */
 1991|      0|    if(Curl_ssl_supports(data, SSLSUPP_ISSUERCERT))
  ------------------
  |  |   47|      0|#define SSLSUPP_ISSUERCERT   (1 << 11) /* supports CURLOPT_ISSUERCERT */
  ------------------
  |  Branch (1991:8): [True: 0, False: 0]
  ------------------
 1992|      0|      return Curl_setstropt(data, STRING_SSL_ISSUERCERT, ptr);
 1993|      0|    return CURLE_NOT_BUILT_IN;
 1994|      0|  case CURLOPT_SSL_EC_CURVES:
  ------------------
  |  Branch (1994:3): [True: 0, False: 60.9k]
  ------------------
 1995|       |    /*
 1996|       |     * Set accepted curves in SSL connection setup.
 1997|       |     * Specify colon-delimited list of curve algorithm names.
 1998|       |     */
 1999|      0|    if(Curl_ssl_supports(data, SSLSUPP_SSL_EC_CURVES))
  ------------------
  |  |   48|      0|#define SSLSUPP_SSL_EC_CURVES (1 << 12) /* supports CURLOPT_SSL_EC_CURVES */
  ------------------
  |  Branch (1999:8): [True: 0, False: 0]
  ------------------
 2000|      0|      return Curl_setstropt(data, STRING_SSL_EC_CURVES, ptr);
 2001|      0|    return CURLE_NOT_BUILT_IN;
 2002|      0|  case CURLOPT_SSL_SIGNATURE_ALGORITHMS:
  ------------------
  |  Branch (2002:3): [True: 0, False: 60.9k]
  ------------------
 2003|       |    /*
 2004|       |     * Set accepted signature algorithms.
 2005|       |     * Specify colon-delimited list of signature scheme names.
 2006|       |     */
 2007|      0|    if(Curl_ssl_supports(data, SSLSUPP_SIGNATURE_ALGORITHMS))
  ------------------
  |  |   46|      0|#define SSLSUPP_SIGNATURE_ALGORITHMS (1 << 10) /* supports TLS sigalgs */
  ------------------
  |  Branch (2007:8): [True: 0, False: 0]
  ------------------
 2008|      0|      return Curl_setstropt(data, STRING_SSL_SIGNATURE_ALGORITHMS, ptr);
 2009|      0|    return CURLE_NOT_BUILT_IN;
 2010|      0|  case CURLOPT_PINNEDPUBLICKEY:
  ------------------
  |  Branch (2010:3): [True: 0, False: 60.9k]
  ------------------
 2011|       |    /*
 2012|       |     * Set pinned public key for SSL connection.
 2013|       |     * Specify filename of the public key in DER format.
 2014|       |     */
 2015|      0|    if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY))
  ------------------
  |  |   38|      0|#define SSLSUPP_PINNEDPUBKEY (1 << 2) /* supports CURLOPT_PINNEDPUBLICKEY */
  ------------------
  |  Branch (2015:8): [True: 0, False: 0]
  ------------------
 2016|      0|      return Curl_setstropt(data, STRING_SSL_PINNEDPUBLICKEY, ptr);
 2017|      0|    return CURLE_NOT_BUILT_IN;
 2018|      0|  case CURLOPT_ECH:
  ------------------
  |  Branch (2018:3): [True: 0, False: 60.9k]
  ------------------
 2019|      0|    return setopt_ech(data, ptr);
 2020|      0|#endif
 2021|  60.9k|  default:
  ------------------
  |  Branch (2021:3): [True: 60.9k, False: 0]
  ------------------
 2022|  60.9k|    return CURLE_UNKNOWN_OPTION;
 2023|  60.9k|  }
 2024|      0|  return result;
 2025|  60.9k|}
setopt.c:setopt_cptr_proxy:
 1623|  60.9k|{
 1624|  60.9k|  CURLcode result = CURLE_OK;
 1625|  60.9k|  struct UserDefined *s = &data->set;
 1626|  60.9k|  switch(option) {
 1627|  2.34k|  case CURLOPT_PROXYUSERPWD: {
  ------------------
  |  Branch (1627:3): [True: 2.34k, False: 58.6k]
  ------------------
 1628|       |    /*
 1629|       |     * user:password needed to use the proxy
 1630|       |     */
 1631|  2.34k|    char *u = NULL;
 1632|  2.34k|    char *p = NULL;
 1633|  2.34k|    result = setstropt_userpwd(ptr, &u, &p);
 1634|       |
 1635|       |    /* URL decode the components */
 1636|  2.34k|    if(!result) {
  ------------------
  |  Branch (1636:8): [True: 2.32k, False: 19]
  ------------------
 1637|  2.32k|      char *str = NULL;
 1638|  2.32k|      CURL_EASY_STR_CLEAR(data, STRING_PROXYUSERNAME);
  ------------------
  |  | 1212|  2.32k|  Curl_u8_strset_unset(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1639|  2.32k|      CURL_EASY_STR_CLEAR(data, STRING_PROXYPASSWORD);
  ------------------
  |  | 1212|  2.32k|  Curl_u8_strset_unset(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1640|  2.32k|      if(u) {
  ------------------
  |  Branch (1640:10): [True: 2.32k, False: 0]
  ------------------
 1641|  2.32k|        result = Curl_urldecode(u, 0, &str, NULL, REJECT_ZERO);
 1642|  2.32k|        if(!result)
  ------------------
  |  Branch (1642:12): [True: 2.24k, False: 88]
  ------------------
 1643|  2.24k|          result = Curl_u8_strset_setn(&s->strings, STRING_PROXYUSERNAME, str);
 1644|  2.32k|      }
 1645|  2.32k|      if(!result && p) {
  ------------------
  |  Branch (1645:10): [True: 2.24k, False: 88]
  |  Branch (1645:21): [True: 1.22k, False: 1.01k]
  ------------------
 1646|  1.22k|        str = NULL;
 1647|  1.22k|        result = Curl_urldecode(p, 0, &str, NULL, REJECT_ZERO);
 1648|  1.22k|        if(!result)
  ------------------
  |  Branch (1648:12): [True: 1.16k, False: 65]
  ------------------
 1649|  1.16k|          result = Curl_u8_strset_setn(&s->strings, STRING_PROXYPASSWORD, str);
 1650|  1.22k|      }
 1651|  2.32k|    }
 1652|  2.34k|    curlx_free(u);
  ------------------
  |  | 1503|  2.34k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1653|  2.34k|    curlx_strzero(p);
 1654|  2.34k|    curlx_free(p);
  ------------------
  |  | 1503|  2.34k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1655|  2.34k|    break;
 1656|      0|  }
 1657|      0|  case CURLOPT_PROXYUSERNAME:
  ------------------
  |  Branch (1657:3): [True: 0, False: 60.9k]
  ------------------
 1658|       |    /*
 1659|       |     * authentication username to use in the operation
 1660|       |     */
 1661|      0|    return Curl_setstropt(data, STRING_PROXYUSERNAME, ptr);
 1662|       |
 1663|      0|  case CURLOPT_PROXYPASSWORD:
  ------------------
  |  Branch (1663:3): [True: 0, False: 60.9k]
  ------------------
 1664|       |    /*
 1665|       |     * authentication password to use in the operation
 1666|       |     */
 1667|      0|    return Curl_setstropt(data, STRING_PROXYPASSWORD, ptr);
 1668|       |
 1669|  7.65k|  case CURLOPT_NOPROXY:
  ------------------
  |  Branch (1669:3): [True: 7.65k, False: 53.2k]
  ------------------
 1670|       |    /*
 1671|       |     * proxy exception list
 1672|       |     */
 1673|  7.65k|    return Curl_setstropt(data, STRING_NOPROXY, ptr);
 1674|      0|  case CURLOPT_PROXY_SSLCERT:
  ------------------
  |  Branch (1674:3): [True: 0, False: 60.9k]
  ------------------
 1675|       |    /*
 1676|       |     * String that holds filename of the SSL certificate to use for proxy
 1677|       |     */
 1678|      0|    return Curl_setstropt(data, STRING_CERT_PROXY, ptr);
 1679|      0|  case CURLOPT_PROXY_SSLCERTTYPE:
  ------------------
  |  Branch (1679:3): [True: 0, False: 60.9k]
  ------------------
 1680|       |    /*
 1681|       |     * String that holds file type of the SSL certificate to use for proxy
 1682|       |     */
 1683|      0|    return Curl_setstropt(data, STRING_CERT_TYPE_PROXY, ptr);
 1684|      0|  case CURLOPT_PROXY_SSLKEY:
  ------------------
  |  Branch (1684:3): [True: 0, False: 60.9k]
  ------------------
 1685|       |    /*
 1686|       |     * String that holds filename of the SSL key to use for proxy
 1687|       |     */
 1688|      0|    return Curl_setstropt(data, STRING_KEY_PROXY, ptr);
 1689|      0|  case CURLOPT_PROXY_KEYPASSWD:
  ------------------
  |  Branch (1689:3): [True: 0, False: 60.9k]
  ------------------
 1690|       |    /*
 1691|       |     * String that holds the SSL private key password for proxy.
 1692|       |     */
 1693|      0|    return Curl_setstropt(data, STRING_KEY_PASSWD_PROXY, ptr);
 1694|      0|  case CURLOPT_PROXY_SSLKEYTYPE:
  ------------------
  |  Branch (1694:3): [True: 0, False: 60.9k]
  ------------------
 1695|       |    /*
 1696|       |     * String that holds file type of the SSL key to use for proxy
 1697|       |     */
 1698|      0|    return Curl_setstropt(data, STRING_KEY_TYPE_PROXY, ptr);
 1699|      0|  case CURLOPT_PROXY_SSL_CIPHER_LIST:
  ------------------
  |  Branch (1699:3): [True: 0, False: 60.9k]
  ------------------
 1700|      0|    if(Curl_ssl_supports(data, SSLSUPP_CIPHER_LIST)) {
  ------------------
  |  |   45|      0|#define SSLSUPP_CIPHER_LIST  (1 << 9) /* supports TLS 1.0-1.2 ciphersuites */
  ------------------
  |  Branch (1700:8): [True: 0, False: 0]
  ------------------
 1701|       |      /* set a list of cipher we want to use in the SSL connection for proxy */
 1702|      0|      return Curl_setstropt(data, STRING_SSL_CIPHER_LIST_PROXY, ptr);
 1703|      0|    }
 1704|      0|    else
 1705|      0|      return CURLE_NOT_BUILT_IN;
 1706|      0|  case CURLOPT_PROXY_TLS13_CIPHERS:
  ------------------
  |  Branch (1706:3): [True: 0, False: 60.9k]
  ------------------
 1707|      0|    if(Curl_ssl_supports(data, SSLSUPP_TLS13_CIPHERSUITES))
  ------------------
  |  |   41|      0|#define SSLSUPP_TLS13_CIPHERSUITES (1 << 5) /* supports TLS 1.3 ciphersuites */
  ------------------
  |  Branch (1707:8): [True: 0, False: 0]
  ------------------
 1708|       |      /* set preferred list of TLS 1.3 cipher suites for proxy */
 1709|      0|      return Curl_setstropt(data, STRING_SSL_CIPHER13_LIST_PROXY, ptr);
 1710|      0|    else
 1711|      0|      return CURLE_NOT_BUILT_IN;
 1712|  17.5k|  case CURLOPT_PROXY:
  ------------------
  |  Branch (1712:3): [True: 17.5k, False: 43.3k]
  ------------------
 1713|       |    /*
 1714|       |     * Set proxy server:port to use as proxy.
 1715|       |     *
 1716|       |     * If the proxy is set to "" (and CURLOPT_PRE_PROXY is set to "" or NULL)
 1717|       |     * we explicitly say that we do not want to use a proxy (even though there
 1718|       |     * might be environment variables saying so).
 1719|       |     *
 1720|       |     * Setting it to NULL, means no proxy but allows the environment variables
 1721|       |     * to decide for us (if CURLOPT_PRE_PROXY setting it to NULL).
 1722|       |     */
 1723|  17.5k|    return setproxy(data, ptr);
 1724|      0|  case CURLOPT_PRE_PROXY:
  ------------------
  |  Branch (1724:3): [True: 0, False: 60.9k]
  ------------------
 1725|       |    /*
 1726|       |     * Set proxy server:port to use as SOCKS proxy.
 1727|       |     *
 1728|       |     * If the proxy is set to "" or NULL we explicitly say that we do not want
 1729|       |     * to use the socks proxy.
 1730|       |     */
 1731|      0|    return Curl_setstropt(data, STRING_PRE_PROXY, ptr);
 1732|      0|  case CURLOPT_SOCKS5_GSSAPI_SERVICE:
  ------------------
  |  Branch (1732:3): [True: 0, False: 60.9k]
  ------------------
 1733|      0|  case CURLOPT_PROXY_SERVICE_NAME:
  ------------------
  |  Branch (1733:3): [True: 0, False: 60.9k]
  ------------------
 1734|       |    /*
 1735|       |     * Set proxy authentication service name for Kerberos 5 and SPNEGO
 1736|       |     */
 1737|      0|    return Curl_setstropt(data, STRING_PROXY_SERVICE_NAME, ptr);
 1738|      0|  case CURLOPT_PROXY_PINNEDPUBLICKEY:
  ------------------
  |  Branch (1738:3): [True: 0, False: 60.9k]
  ------------------
 1739|       |    /*
 1740|       |     * Set pinned public key for SSL connection.
 1741|       |     * Specify filename of the public key in DER format.
 1742|       |     */
 1743|      0|#ifdef USE_SSL
 1744|      0|    if(Curl_ssl_supports(data, SSLSUPP_PINNEDPUBKEY))
  ------------------
  |  |   38|      0|#define SSLSUPP_PINNEDPUBKEY (1 << 2) /* supports CURLOPT_PINNEDPUBLICKEY */
  ------------------
  |  Branch (1744:8): [True: 0, False: 0]
  ------------------
 1745|      0|      return Curl_setstropt(data, STRING_SSL_PINNEDPUBLICKEY_PROXY, ptr);
 1746|      0|#endif
 1747|      0|    return CURLE_NOT_BUILT_IN;
 1748|       |
 1749|      0|  case CURLOPT_HAPROXY_CLIENT_IP:
  ------------------
  |  Branch (1749:3): [True: 0, False: 60.9k]
  ------------------
 1750|       |    /*
 1751|       |     * Set the client IP to send through HAProxy PROXY protocol
 1752|       |     */
 1753|      0|    result = Curl_setstropt(data, STRING_HAPROXY_CLIENT_IP, ptr);
 1754|       |
 1755|       |    /* enable the HAProxy protocol if an IP is provided */
 1756|      0|    s->haproxyprotocol = !!CURL_EASY_STR(data, STRING_HAPROXY_CLIENT_IP);
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1757|      0|    break;
 1758|      0|  case CURLOPT_PROXY_CAINFO:
  ------------------
  |  Branch (1758:3): [True: 0, False: 60.9k]
  ------------------
 1759|       |    /*
 1760|       |     * Set CA info SSL connection for proxy. Specify filename of the
 1761|       |     * CA certificate
 1762|       |     */
 1763|      0|    result = Curl_setstropt(data, STRING_SSL_CAFILE_PROXY, ptr);
 1764|      0|    if(!result)
  ------------------
  |  Branch (1764:8): [True: 0, False: 0]
  ------------------
 1765|      0|      s->proxy_ssl.custom_cafile = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1766|      0|    return result;
 1767|      0|  case CURLOPT_PROXY_CRLFILE:
  ------------------
  |  Branch (1767:3): [True: 0, False: 60.9k]
  ------------------
 1768|       |    /*
 1769|       |     * Set CRL file info for SSL connection for proxy. Specify filename of the
 1770|       |     * CRL to check certificates revocation
 1771|       |     */
 1772|      0|    if(Curl_ssl_supports(data, SSLSUPP_CRLFILE))
  ------------------
  |  |   49|      0|#define SSLSUPP_CRLFILE      (1 << 13) /* supports CURLOPT_CRLFILE */
  ------------------
  |  Branch (1772:8): [True: 0, False: 0]
  ------------------
 1773|      0|      return Curl_setstropt(data, STRING_SSL_CRLFILE_PROXY, ptr);
 1774|      0|    return CURLE_NOT_BUILT_IN;
 1775|      0|  case CURLOPT_PROXY_ISSUERCERT:
  ------------------
  |  Branch (1775:3): [True: 0, False: 60.9k]
  ------------------
 1776|       |    /*
 1777|       |     * Set Issuer certificate file to check certificates issuer
 1778|       |     */
 1779|      0|    if(Curl_ssl_supports(data, SSLSUPP_ISSUERCERT))
  ------------------
  |  |   47|      0|#define SSLSUPP_ISSUERCERT   (1 << 11) /* supports CURLOPT_ISSUERCERT */
  ------------------
  |  Branch (1779:8): [True: 0, False: 0]
  ------------------
 1780|      0|      return Curl_setstropt(data, STRING_SSL_ISSUERCERT_PROXY, ptr);
 1781|      0|    return CURLE_NOT_BUILT_IN;
 1782|      0|  case CURLOPT_PROXY_CAPATH:
  ------------------
  |  Branch (1782:3): [True: 0, False: 60.9k]
  ------------------
 1783|       |    /*
 1784|       |     * Set CA path info for SSL connection proxy. Specify directory name of the
 1785|       |     * CA certificates which have been prepared using openssl c_rehash utility.
 1786|       |     */
 1787|      0|#ifdef USE_SSL
 1788|      0|    if(Curl_ssl_supports(data, SSLSUPP_CA_PATH)) {
  ------------------
  |  |   36|      0|#define SSLSUPP_CA_PATH      (1 << 0) /* supports CAPATH */
  ------------------
  |  Branch (1788:8): [True: 0, False: 0]
  ------------------
 1789|       |      /* This does not work on Windows. */
 1790|      0|      result = Curl_setstropt(data, STRING_SSL_CAPATH_PROXY, ptr);
 1791|      0|      if(!result)
  ------------------
  |  Branch (1791:10): [True: 0, False: 0]
  ------------------
 1792|      0|        s->proxy_ssl.custom_capath = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1793|      0|      return result;
 1794|      0|    }
 1795|      0|#endif
 1796|      0|    return CURLE_NOT_BUILT_IN;
 1797|  33.3k|  default:
  ------------------
  |  Branch (1797:3): [True: 33.3k, False: 27.5k]
  ------------------
 1798|  33.3k|    return CURLE_UNKNOWN_OPTION;
 1799|  60.9k|  }
 1800|  2.34k|  return result;
 1801|  60.9k|}
setopt.c:setproxy:
 1610|  17.5k|{
 1611|  17.5k|  const char *str = CURL_EASY_STR(data, STRING_PROXY);
  ------------------
  |  | 1206|  17.5k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1612|  17.5k|  if(str && proxy &&
  ------------------
  |  Branch (1612:6): [True: 7.64k, False: 9.92k]
  |  Branch (1612:13): [True: 7.64k, False: 0]
  ------------------
 1613|       |     /* there was one set, is this a new one? */
 1614|  7.64k|     !strcmp(str, proxy))
  ------------------
  |  Branch (1614:6): [True: 0, False: 7.64k]
  ------------------
 1615|      0|    return CURLE_OK; /* same one as before */
 1616|       |
 1617|  17.5k|  changeproxy(data);
 1618|  17.5k|  return Curl_setstropt(data, STRING_PROXY, proxy);
 1619|  17.5k|}
setopt.c:setopt_cptr_net:
 2251|  33.3k|{
 2252|  33.3k|  switch(option) {
 2253|      0|  case CURLOPT_INTERFACE:
  ------------------
  |  Branch (2253:3): [True: 0, False: 33.3k]
  ------------------
 2254|       |    /*
 2255|       |     * Set what interface or address/hostname to bind the socket to when
 2256|       |     * performing an operation and thus what from-IP your connection will use.
 2257|       |     */
 2258|      0|    return setstropt_interface(data, ptr);
 2259|       |
 2260|       |#ifdef USE_RESOLV_ARES
 2261|       |  case CURLOPT_DNS_SERVERS:
 2262|       |    return Curl_setstropt(data, STRING_DNS_SERVERS, ptr);
 2263|       |
 2264|       |  case CURLOPT_DNS_INTERFACE:
 2265|       |    return Curl_setstropt(data, STRING_DNS_INTERFACE, ptr);
 2266|       |
 2267|       |  case CURLOPT_DNS_LOCAL_IP4:
 2268|       |    return Curl_setstropt(data, STRING_DNS_LOCAL_IP4, ptr);
 2269|       |
 2270|       |  case CURLOPT_DNS_LOCAL_IP6:
 2271|       |    return Curl_setstropt(data, STRING_DNS_LOCAL_IP6, ptr);
 2272|       |#endif
 2273|      0|#ifdef USE_UNIX_SOCKETS
 2274|      0|  case CURLOPT_UNIX_SOCKET_PATH:
  ------------------
  |  Branch (2274:3): [True: 0, False: 33.3k]
  ------------------
 2275|      0|    data->set.abstract_unix_socket = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2276|      0|    return Curl_setstropt(data, STRING_UNIX_SOCKET_PATH, ptr);
 2277|       |
 2278|      0|  case CURLOPT_ABSTRACT_UNIX_SOCKET:
  ------------------
  |  Branch (2278:3): [True: 0, False: 33.3k]
  ------------------
 2279|      0|    data->set.abstract_unix_socket = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2280|      0|    return Curl_setstropt(data, STRING_UNIX_SOCKET_PATH, ptr);
 2281|      0|#endif
 2282|      0|#ifndef CURL_DISABLE_DOH
 2283|      0|  case CURLOPT_DOH_URL:
  ------------------
  |  Branch (2283:3): [True: 0, False: 33.3k]
  ------------------
 2284|      0|    {
 2285|      0|      CURLcode result = Curl_setstropt(data, STRING_DOH, ptr);
 2286|      0|      data->set.doh = !!CURL_EASY_STR(data, STRING_DOH);
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2287|      0|      return result;
 2288|      0|    }
 2289|      0|#endif
 2290|  33.3k|  default:
  ------------------
  |  Branch (2290:3): [True: 33.3k, False: 0]
  ------------------
 2291|  33.3k|    return CURLE_UNKNOWN_OPTION;
 2292|  33.3k|  }
 2293|  33.3k|}
setopt.c:setopt_cptr_ftp:
 2216|  33.3k|{
 2217|  33.3k|  CURLcode result = CURLE_OK;
 2218|  33.3k|  struct UserDefined *s = &data->set;
 2219|  33.3k|  switch(option) {
 2220|      0|  case CURLOPT_FTPPORT:
  ------------------
  |  Branch (2220:3): [True: 0, False: 33.3k]
  ------------------
 2221|       |    /*
 2222|       |     * Use FTP PORT, this also specifies which IP address to use
 2223|       |     */
 2224|      0|    result = Curl_setstropt(data, STRING_FTPPORT, ptr);
 2225|      0|    s->ftp_use_port = !!CURL_EASY_STR(data, STRING_FTPPORT);
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2226|      0|    break;
 2227|       |
 2228|      0|  case CURLOPT_FTP_ACCOUNT:
  ------------------
  |  Branch (2228:3): [True: 0, False: 33.3k]
  ------------------
 2229|      0|    return Curl_setstropt(data, STRING_FTP_ACCOUNT, ptr);
 2230|       |
 2231|      0|  case CURLOPT_FTP_ALTERNATIVE_TO_USER:
  ------------------
  |  Branch (2231:3): [True: 0, False: 33.3k]
  ------------------
 2232|      0|    return Curl_setstropt(data, STRING_FTP_ALTERNATIVE_TO_USER, ptr);
 2233|       |
 2234|      0|  case CURLOPT_KRBLEVEL:
  ------------------
  |  Branch (2234:3): [True: 0, False: 33.3k]
  ------------------
 2235|      0|    return CURLE_NOT_BUILT_IN; /* removed in 8.17.0 */
 2236|      0|  case CURLOPT_CHUNK_DATA:
  ------------------
  |  Branch (2236:3): [True: 0, False: 33.3k]
  ------------------
 2237|      0|    s->wildcardptr = ptr;
 2238|      0|    break;
 2239|      0|  case CURLOPT_FNMATCH_DATA:
  ------------------
  |  Branch (2239:3): [True: 0, False: 33.3k]
  ------------------
 2240|      0|    s->fnmatch_data = ptr;
 2241|      0|    break;
 2242|  33.3k|  default:
  ------------------
  |  Branch (2242:3): [True: 33.3k, False: 0]
  ------------------
 2243|  33.3k|    return CURLE_UNKNOWN_OPTION;
 2244|  33.3k|  }
 2245|      0|  return result;
 2246|  33.3k|}
setopt.c:setopt_cptr_http_mqtt:
 2031|  33.3k|{
 2032|  33.3k|  CURLcode result = CURLE_OK;
 2033|  33.3k|  struct UserDefined *s = &data->set;
 2034|       |
 2035|  33.3k|  switch(option) {
 2036|      0|  case CURLOPT_COPYPOSTFIELDS:
  ------------------
  |  Branch (2036:3): [True: 0, False: 33.3k]
  ------------------
 2037|      0|    return setopt_copypostfields(ptr, s);
 2038|       |
 2039|    866|  case CURLOPT_POSTFIELDS:
  ------------------
  |  Branch (2039:3): [True: 866, False: 32.5k]
  ------------------
 2040|       |    /*
 2041|       |     * Like above, but use static data instead of copying it.
 2042|       |     */
 2043|    866|    s->postfields = ptr;
 2044|       |    /* Release old copied data. */
 2045|    866|    curlx_safefree(s->a.str_copypostfields);
  ------------------
  |  | 1359|    866|  do {                      \
  |  | 1360|    866|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    866|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    866|    (ptr) = NULL;           \
  |  | 1362|    866|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 866]
  |  |  ------------------
  ------------------
 2046|    866|    s->method = HTTPREQ_POST;
 2047|    866|    break;
 2048|       |
 2049|      0|#ifndef CURL_DISABLE_HTTP
 2050|      0|  case CURLOPT_TRAILERDATA:
  ------------------
  |  Branch (2050:3): [True: 0, False: 33.3k]
  ------------------
 2051|      0|    s->trailer_data = ptr;
 2052|      0|    break;
 2053|    887|  case CURLOPT_ACCEPT_ENCODING:
  ------------------
  |  Branch (2053:3): [True: 887, False: 32.4k]
  ------------------
 2054|       |    /*
 2055|       |     * String to use at the value of Accept-Encoding header.
 2056|       |     *
 2057|       |     * If the encoding is set to "" we use an Accept-Encoding header that
 2058|       |     * encompasses all the encodings we support.
 2059|       |     * If the encoding is set to NULL we do not send an Accept-Encoding header
 2060|       |     * and ignore any received Content-Encoding header.
 2061|       |     *
 2062|       |     */
 2063|    887|    if(ptr && !*ptr) {
  ------------------
  |  Branch (2063:8): [True: 887, False: 0]
  |  Branch (2063:15): [True: 757, False: 130]
  ------------------
 2064|    757|      ptr = Curl_get_content_encodings();
 2065|    757|      if(ptr)
  ------------------
  |  Branch (2065:10): [True: 750, False: 7]
  ------------------
 2066|    750|        result = CURL_EASY_STR_SETN(data, STRING_ENCODING, ptr);
  ------------------
  |  | 1210|    750|  Curl_u8_strset_setn(&(d)->set.strings, (uint8_t)(id), s)
  ------------------
 2067|      7|      else
 2068|      7|        result = CURLE_OUT_OF_MEMORY;
 2069|    757|      return result;
 2070|    757|    }
 2071|    130|    return Curl_setstropt(data, STRING_ENCODING, ptr);
 2072|       |
 2073|      0|#ifndef CURL_DISABLE_AWS
 2074|    568|  case CURLOPT_AWS_SIGV4:
  ------------------
  |  Branch (2074:3): [True: 568, False: 32.8k]
  ------------------
 2075|       |    /*
 2076|       |     * String that is merged to some authentication
 2077|       |     * parameters are used by the algorithm.
 2078|       |     */
 2079|    568|    result = Curl_setstropt(data, STRING_AWS_SIGV4, ptr);
 2080|       |    /*
 2081|       |     * Basic has been set by default; it needs to be unset here.
 2082|       |     */
 2083|    568|    if(CURL_EASY_STR(data, STRING_AWS_SIGV4))
  ------------------
  |  | 1206|    568|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 560, False: 8]
  |  |  ------------------
  ------------------
 2084|    560|      s->httpauth = CURLAUTH_AWS_SIGV4;
  ------------------
  |  |  847|    560|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
 2085|      8|    else
 2086|      8|      s->httpauth &= ~(uint32_t)CURLAUTH_AWS_SIGV4;
  ------------------
  |  |  847|      8|#define CURLAUTH_AWS_SIGV4    (((unsigned long)1) << 7)
  ------------------
 2087|    568|    break;
 2088|      0|#endif
 2089|      0|#ifndef CURL_DISABLE_HTTPSIG
 2090|      0|  case CURLOPT_HTTPSIG_KEY:
  ------------------
  |  Branch (2090:3): [True: 0, False: 33.3k]
  ------------------
 2091|      0|    result = Curl_setstropt(data, STRING_HTTPSIG_KEY, ptr);
 2092|      0|    break;
 2093|      0|  case CURLOPT_HTTPSIG_KEYID:
  ------------------
  |  Branch (2093:3): [True: 0, False: 33.3k]
  ------------------
 2094|      0|    result = Curl_setstropt(data, STRING_HTTPSIG_KEYID, ptr);
 2095|      0|    break;
 2096|      0|  case CURLOPT_HTTPSIG_HEADERS:
  ------------------
  |  Branch (2096:3): [True: 0, False: 33.3k]
  ------------------
 2097|      0|    result = Curl_setstropt(data, STRING_HTTPSIG_HEADERS, ptr);
 2098|      0|    break;
 2099|      0|#endif
 2100|    353|  case CURLOPT_REFERER: {
  ------------------
  |  Branch (2100:3): [True: 353, False: 33.0k]
  ------------------
 2101|       |    /*
 2102|       |     * String to set in the HTTP Referer: field.
 2103|       |     */
 2104|    353|    struct bufref *oldref = &data->state.referer;
 2105|       |    /* free the old after the storing the new in case the input is actually
 2106|       |       pointing back to this */
 2107|    353|    result = Curl_setstropt(data, STRING_SET_REFERER, ptr);
 2108|    353|    Curl_bufref_free(oldref);
 2109|    353|    break;
 2110|    887|  }
 2111|       |
 2112|    248|  case CURLOPT_USERAGENT:
  ------------------
  |  Branch (2112:3): [True: 248, False: 33.1k]
  ------------------
 2113|       |    /*
 2114|       |     * String to use in the HTTP User-Agent field
 2115|       |     */
 2116|    248|    return Curl_setstropt(data, STRING_USERAGENT, ptr);
 2117|       |
 2118|      0|#ifndef CURL_DISABLE_COOKIES
 2119|    208|  case CURLOPT_COOKIE:
  ------------------
  |  Branch (2119:3): [True: 208, False: 33.1k]
  ------------------
 2120|       |    /*
 2121|       |     * Cookie string to send to the remote server in the request.
 2122|       |     */
 2123|    208|    return Curl_setstropt(data, STRING_COOKIE, ptr);
 2124|       |
 2125|  9.91k|  case CURLOPT_COOKIEFILE:
  ------------------
  |  Branch (2125:3): [True: 9.91k, False: 23.4k]
  ------------------
 2126|  9.91k|    return cookiefile(data, ptr);
 2127|       |
 2128|  9.91k|  case CURLOPT_COOKIEJAR:
  ------------------
  |  Branch (2128:3): [True: 9.91k, False: 23.4k]
  ------------------
 2129|       |    /*
 2130|       |     * Set cookie filename to dump all cookies to when we are done.
 2131|       |     */
 2132|  9.91k|    result = Curl_setstropt(data, STRING_COOKIEJAR, ptr);
 2133|  9.91k|    if(!result) {
  ------------------
  |  Branch (2133:8): [True: 9.88k, False: 34]
  ------------------
 2134|       |      /*
 2135|       |       * Activate the cookie parser. This may or may not already
 2136|       |       * have been made.
 2137|       |       */
 2138|  9.88k|      if(!data->cookies)
  ------------------
  |  Branch (2138:10): [True: 9.88k, False: 0]
  ------------------
 2139|  9.88k|        data->cookies = Curl_cookie_init();
 2140|  9.88k|      if(!data->cookies)
  ------------------
  |  Branch (2140:10): [True: 16, False: 9.86k]
  ------------------
 2141|     16|        result = CURLE_OUT_OF_MEMORY;
 2142|  9.86k|      else
 2143|  9.86k|        data->state.cookie_engine = TRUE;
  ------------------
  |  |  986|  9.86k|#define TRUE true
  ------------------
 2144|  9.88k|    }
 2145|  9.91k|    break;
 2146|       |
 2147|  10.4k|  case CURLOPT_COOKIELIST:
  ------------------
  |  Branch (2147:3): [True: 10.4k, False: 22.9k]
  ------------------
 2148|  10.4k|    return cookielist(data, ptr);
 2149|      0|#endif /* !CURL_DISABLE_COOKIES */
 2150|       |
 2151|      0|#endif /* !CURL_DISABLE_HTTP */
 2152|      0|  default:
  ------------------
  |  Branch (2152:3): [True: 0, False: 33.3k]
  ------------------
 2153|      0|    return CURLE_UNKNOWN_OPTION;
 2154|  33.3k|  }
 2155|  11.7k|  return result;
 2156|  33.3k|}
setopt.c:cookiefile:
 1571|  9.91k|{
 1572|       |  /*
 1573|       |   * Set cookie file to read and parse. Can be used multiple times.
 1574|       |   */
 1575|  9.91k|  if(ptr) {
  ------------------
  |  Branch (1575:6): [True: 9.91k, False: 0]
  ------------------
 1576|  9.91k|    struct curl_slist *cl;
 1577|       |    /* general protection against mistakes and abuse */
 1578|  9.91k|    if(strlen(ptr) > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  9.91k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (1578:8): [True: 0, False: 9.91k]
  ------------------
 1579|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1580|       |    /* append the cookie filename to the list of filenames, and deal with
 1581|       |       them later */
 1582|  9.91k|    cl = curl_slist_append(data->state.cookielist, ptr);
 1583|  9.91k|    if(!cl) {
  ------------------
  |  Branch (1583:8): [True: 32, False: 9.88k]
  ------------------
 1584|     32|      curl_slist_free_all(data->state.cookielist);
 1585|     32|      data->state.cookielist = NULL;
 1586|     32|      return CURLE_OUT_OF_MEMORY;
 1587|     32|    }
 1588|  9.88k|    data->state.cookielist = cl; /* store the list for later use */
 1589|  9.88k|  }
 1590|      0|  else {
 1591|       |    /* clear the list of cookie files */
 1592|      0|    curl_slist_free_all(data->state.cookielist);
 1593|      0|    data->state.cookielist = NULL;
 1594|       |
 1595|      0|    if(!data->share || !data->share->cookies) {
  ------------------
  |  Branch (1595:8): [True: 0, False: 0]
  |  Branch (1595:24): [True: 0, False: 0]
  ------------------
 1596|       |      /* throw away all existing cookies if this is not a shared cookie
 1597|       |         container */
 1598|      0|      Curl_cookie_clearall(data->cookies);
 1599|      0|      Curl_cookie_cleanup(data->cookies);
 1600|      0|    }
 1601|       |    /* disable the cookie engine */
 1602|      0|    data->cookies = NULL;
 1603|      0|  }
 1604|  9.88k|  return CURLE_OK;
 1605|  9.91k|}
setopt.c:cookielist:
 1510|  10.4k|{
 1511|  10.4k|  CURLcode result = CURLE_OK;
 1512|  10.4k|  if(!ptr)
  ------------------
  |  Branch (1512:6): [True: 0, False: 10.4k]
  ------------------
 1513|      0|    return CURLE_OK;
 1514|       |
 1515|  10.4k|  if(curl_strequal(ptr, "ALL")) {
  ------------------
  |  Branch (1515:6): [True: 607, False: 9.80k]
  ------------------
 1516|       |    /* clear all cookies */
 1517|    607|    Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1518|    607|    Curl_cookie_clearall(data->cookies);
 1519|    607|    Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1520|    607|  }
 1521|  9.80k|  else if(curl_strequal(ptr, "SESS")) {
  ------------------
  |  Branch (1521:11): [True: 0, False: 9.80k]
  ------------------
 1522|       |    /* clear session cookies */
 1523|      0|    Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1524|      0|    Curl_cookie_clearsess(data->cookies);
 1525|      0|    Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1526|      0|  }
 1527|  9.80k|  else if(curl_strequal(ptr, "FLUSH")) {
  ------------------
  |  Branch (1527:11): [True: 0, False: 9.80k]
  ------------------
 1528|       |    /* flush cookies to file, takes care of the locking */
 1529|      0|    Curl_flush_cookies(data, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1530|      0|  }
 1531|  9.80k|  else if(curl_strequal(ptr, "RELOAD")) {
  ------------------
  |  Branch (1531:11): [True: 0, False: 9.80k]
  ------------------
 1532|       |    /* reload cookies from file */
 1533|      0|    return Curl_cookie_loadfiles(data, COOKIE_NOPSL |
  ------------------
  |  |  119|      0|#define COOKIE_NOPSL      (1<<3) /* skip PSL check */
  ------------------
 1534|      0|                                 (data->set.cookiesession ?
  ------------------
  |  Branch (1534:35): [True: 0, False: 0]
  ------------------
 1535|      0|                                  COOKIE_NOSESSION : 0));
  ------------------
  |  |  120|      0|#define COOKIE_NOSESSION  (1<<6) /* drop session cookies */
  ------------------
 1536|      0|  }
 1537|  9.80k|  else {
 1538|  9.80k|    if(!data->cookies) {
  ------------------
  |  Branch (1538:8): [True: 7, False: 9.79k]
  ------------------
 1539|       |      /* if cookie engine was not running, activate it */
 1540|      7|      data->cookies = Curl_cookie_init();
 1541|      7|      if(!data->cookies)
  ------------------
  |  Branch (1541:10): [True: 0, False: 7]
  ------------------
 1542|      0|        return CURLE_OUT_OF_MEMORY;
 1543|      7|      data->state.cookie_engine = TRUE;
  ------------------
  |  |  986|      7|#define TRUE true
  ------------------
 1544|      7|    }
 1545|       |
 1546|       |    /* general protection against mistakes and abuse */
 1547|  9.80k|    if(strlen(ptr) > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  9.80k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (1547:8): [True: 0, False: 9.80k]
  ------------------
 1548|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 1549|       |
 1550|       |    /* Adding these cookies without the PSL check, because the PSL is not
 1551|       |       initialized until *perform() time, and this might be called before
 1552|       |       that */
 1553|  9.80k|    Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
 1554|  9.80k|    if(checkprefix("Set-Cookie:", ptr))
  ------------------
  |  |   49|  9.80k|#define checkprefix(a, b) curl_strnequal(b, STRCONST(a))
  |  |  ------------------
  |  |  |  | 1324|  9.80k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1319|  9.80k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (49:27): [True: 0, False: 9.80k]
  |  |  ------------------
  ------------------
 1555|       |      /* HTTP Header format line */
 1556|      0|      result = Curl_cookie_add(data, data->cookies, ptr + 11,
 1557|      0|                               NULL, NULL,
 1558|      0|                               COOKIE_HTTPHEADER | COOKIE_SECURE |
  ------------------
  |  |  116|      0|#define COOKIE_HTTPHEADER (1<<0) /* if HTTP header-style line */
  ------------------
                                             COOKIE_HTTPHEADER | COOKIE_SECURE |
  ------------------
  |  |  118|      0|#define COOKIE_SECURE     (1<<2) /* connection is over secure origin */
  ------------------
 1559|      0|                               COOKIE_NOPSL | COOKIE_LIVE);
  ------------------
  |  |  119|      0|#define COOKIE_NOPSL      (1<<3) /* skip PSL check */
  ------------------
                                             COOKIE_NOPSL | COOKIE_LIVE);
  ------------------
  |  |  117|      0|#define COOKIE_LIVE       (1<<1) /* from a server or API */
  ------------------
 1560|  9.80k|    else
 1561|       |      /* Netscape format line */
 1562|  9.80k|      result = Curl_cookie_add(data, data->cookies, ptr, NULL,
 1563|  9.80k|                               NULL, COOKIE_SECURE | COOKIE_NOPSL |
  ------------------
  |  |  118|  9.80k|#define COOKIE_SECURE     (1<<2) /* connection is over secure origin */
  ------------------
                                             NULL, COOKIE_SECURE | COOKIE_NOPSL |
  ------------------
  |  |  119|  9.80k|#define COOKIE_NOPSL      (1<<3) /* skip PSL check */
  ------------------
 1564|  9.80k|                               COOKIE_LIVE);
  ------------------
  |  |  117|  9.80k|#define COOKIE_LIVE       (1<<1) /* from a server or API */
  ------------------
 1565|  9.80k|    Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
 1566|  9.80k|  }
 1567|  10.4k|  return result;
 1568|  10.4k|}
setopt.c:setopt_func:
 2548|  42.9k|{
 2549|  42.9k|  struct UserDefined *s = &data->set;
 2550|  42.9k|  switch(option) {
 2551|      0|  case CURLOPT_PROGRESSFUNCTION:
  ------------------
  |  Branch (2551:3): [True: 0, False: 42.9k]
  ------------------
 2552|       |    /*
 2553|       |     * Progress callback function
 2554|       |     */
 2555|      0|    s->fprogress = va_arg(param, curl_progress_callback);
 2556|      0|    if(s->fprogress)
  ------------------
  |  Branch (2556:8): [True: 0, False: 0]
  ------------------
 2557|      0|      data->progress.callback = TRUE; /* no longer internal */
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2558|      0|    else
 2559|      0|      data->progress.callback = FALSE; /* NULL enforces internal */
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2560|      0|    break;
 2561|       |
 2562|      0|  case CURLOPT_XFERINFOFUNCTION:
  ------------------
  |  Branch (2562:3): [True: 0, False: 42.9k]
  ------------------
 2563|       |    /*
 2564|       |     * Transfer info callback function
 2565|       |     */
 2566|      0|    s->fxferinfo = va_arg(param, curl_xferinfo_callback);
 2567|      0|    if(s->fxferinfo)
  ------------------
  |  Branch (2567:8): [True: 0, False: 0]
  ------------------
 2568|      0|      data->progress.callback = TRUE; /* no longer internal */
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2569|      0|    else
 2570|      0|      data->progress.callback = FALSE; /* NULL enforces internal */
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2571|       |
 2572|      0|    break;
 2573|    985|  case CURLOPT_DEBUGFUNCTION:
  ------------------
  |  Branch (2573:3): [True: 985, False: 41.9k]
  ------------------
 2574|       |    /*
 2575|       |     * stderr write callback.
 2576|       |     */
 2577|    985|    s->fdebug = va_arg(param, curl_debug_callback);
 2578|       |    /*
 2579|       |     * if the callback provided is NULL, it will use the default callback
 2580|       |     */
 2581|    985|    break;
 2582|  9.91k|  case CURLOPT_HEADERFUNCTION:
  ------------------
  |  Branch (2582:3): [True: 9.91k, False: 33.0k]
  ------------------
 2583|       |    /*
 2584|       |     * Set header write callback
 2585|       |     */
 2586|  9.91k|    s->fwrite_header = va_arg(param, curl_write_callback);
 2587|  9.91k|    break;
 2588|  9.91k|  case CURLOPT_WRITEFUNCTION:
  ------------------
  |  Branch (2588:3): [True: 9.91k, False: 33.0k]
  ------------------
 2589|       |    /*
 2590|       |     * Set data write callback
 2591|       |     */
 2592|  9.91k|    s->fwrite_func = va_arg(param, curl_write_callback);
 2593|  9.91k|    if(!s->fwrite_func)
  ------------------
  |  Branch (2593:8): [True: 0, False: 9.91k]
  ------------------
 2594|      0|#if defined(__clang__) && __clang_major__ >= 16
 2595|      0|#pragma clang diagnostic push
 2596|      0|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
 2597|      0|#endif
 2598|       |      /* When set to NULL, reset to our internal default function */
 2599|      0|      s->fwrite_func = (curl_write_callback)fwrite;
 2600|  9.91k|#if defined(__clang__) && __clang_major__ >= 16
 2601|  9.91k|#pragma clang diagnostic pop
 2602|  9.91k|#endif
 2603|  9.91k|    break;
 2604|  1.15k|  case CURLOPT_READFUNCTION:
  ------------------
  |  Branch (2604:3): [True: 1.15k, False: 41.7k]
  ------------------
 2605|       |    /*
 2606|       |     * Read data callback
 2607|       |     */
 2608|  1.15k|    s->fread_func_set = va_arg(param, curl_read_callback);
 2609|  1.15k|    if(!s->fread_func_set) {
  ------------------
  |  Branch (2609:8): [True: 576, False: 576]
  ------------------
 2610|    576|      s->is_fread_set = 0;
 2611|    576|#if defined(__clang__) && __clang_major__ >= 16
 2612|    576|#pragma clang diagnostic push
 2613|    576|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
 2614|    576|#endif
 2615|       |      /* When set to NULL, reset to our internal default function */
 2616|    576|      s->fread_func_set = (curl_read_callback)fread;
 2617|    576|#if defined(__clang__) && __clang_major__ >= 16
 2618|    576|#pragma clang diagnostic pop
 2619|    576|#endif
 2620|    576|    }
 2621|    576|    else
 2622|    576|      s->is_fread_set = 1;
 2623|  1.15k|    break;
 2624|  1.15k|  case CURLOPT_SEEKFUNCTION:
  ------------------
  |  Branch (2624:3): [True: 1.15k, False: 41.7k]
  ------------------
 2625|       |    /*
 2626|       |     * Seek callback. Might be NULL.
 2627|       |     */
 2628|  1.15k|    s->seek_func = va_arg(param, curl_seek_callback);
 2629|  1.15k|    break;
 2630|      0|  case CURLOPT_IOCTLFUNCTION:
  ------------------
  |  Branch (2630:3): [True: 0, False: 42.9k]
  ------------------
 2631|       |    /*
 2632|       |     * I/O control callback. Might be NULL.
 2633|       |     */
 2634|      0|    s->ioctl_func = va_arg(param, curl_ioctl_callback);
 2635|      0|    break;
 2636|      0|  case CURLOPT_SSL_CTX_FUNCTION:
  ------------------
  |  Branch (2636:3): [True: 0, False: 42.9k]
  ------------------
 2637|       |    /*
 2638|       |     * Set an SSL_CTX callback
 2639|       |     */
 2640|      0|#ifdef USE_SSL
 2641|      0|    if(Curl_ssl_supports(data, SSLSUPP_SSL_CTX)) {
  ------------------
  |  |   39|      0|#define SSLSUPP_SSL_CTX      (1 << 3) /* supports CURLOPT_SSL_CTX */
  ------------------
  |  Branch (2641:8): [True: 0, False: 0]
  ------------------
 2642|      0|      s->ssl_fsslctx = va_arg(param, curl_ssl_ctx_callback);
 2643|      0|      break;
 2644|      0|    }
 2645|      0|    else
 2646|      0|#endif
 2647|      0|      return CURLE_NOT_BUILT_IN;
 2648|       |
 2649|  9.91k|  case CURLOPT_SOCKOPTFUNCTION:
  ------------------
  |  Branch (2649:3): [True: 9.91k, False: 33.0k]
  ------------------
 2650|       |    /*
 2651|       |     * socket callback function: called after socket() but before connect()
 2652|       |     */
 2653|  9.91k|    s->fsockopt = va_arg(param, curl_sockopt_callback);
 2654|  9.91k|    break;
 2655|       |
 2656|  9.91k|  case CURLOPT_OPENSOCKETFUNCTION:
  ------------------
  |  Branch (2656:3): [True: 9.91k, False: 33.0k]
  ------------------
 2657|       |    /*
 2658|       |     * open/create socket callback function: called instead of socket(),
 2659|       |     * before connect()
 2660|       |     */
 2661|  9.91k|    s->fopensocket = va_arg(param, curl_opensocket_callback);
 2662|  9.91k|    break;
 2663|       |
 2664|      0|  case CURLOPT_CLOSESOCKETFUNCTION:
  ------------------
  |  Branch (2664:3): [True: 0, False: 42.9k]
  ------------------
 2665|       |    /*
 2666|       |     * close socket callback function: called instead of close()
 2667|       |     * when shutting down a connection
 2668|       |     */
 2669|      0|    s->fclosesocket = va_arg(param, curl_closesocket_callback);
 2670|      0|    break;
 2671|       |
 2672|      0|  case CURLOPT_RESOLVER_START_FUNCTION:
  ------------------
  |  Branch (2672:3): [True: 0, False: 42.9k]
  ------------------
 2673|       |    /*
 2674|       |     * resolver start callback function: called before a new resolver request
 2675|       |     * is started
 2676|       |     */
 2677|      0|    s->resolver_start = va_arg(param, curl_resolver_start_callback);
 2678|      0|    break;
 2679|       |
 2680|       |#ifdef USE_SSH
 2681|       |#ifdef USE_LIBSSH2
 2682|       |  case CURLOPT_SSH_HOSTKEYFUNCTION:
 2683|       |    /* the callback to check the hostkey without the knownhost file */
 2684|       |    s->ssh_hostkeyfunc = va_arg(param, curl_sshhostkeycallback);
 2685|       |    break;
 2686|       |#endif
 2687|       |
 2688|       |  case CURLOPT_SSH_KEYFUNCTION:
 2689|       |    /* setting to NULL is fine since the ssh.c functions themselves will
 2690|       |       then revert to use the internal default */
 2691|       |    s->ssh_keyfunc = va_arg(param, curl_sshkeycallback);
 2692|       |    break;
 2693|       |
 2694|       |#endif /* USE_SSH */
 2695|       |
 2696|      0|#ifndef CURL_DISABLE_RTSP
 2697|      0|  case CURLOPT_INTERLEAVEFUNCTION:
  ------------------
  |  Branch (2697:3): [True: 0, False: 42.9k]
  ------------------
 2698|       |    /* Set the user defined RTP write function */
 2699|      0|    s->fwrite_rtp = va_arg(param, curl_write_callback);
 2700|      0|    break;
 2701|      0|#endif
 2702|      0|#ifndef CURL_DISABLE_FTP
 2703|      0|  case CURLOPT_CHUNK_BGN_FUNCTION:
  ------------------
  |  Branch (2703:3): [True: 0, False: 42.9k]
  ------------------
 2704|      0|    s->chunk_bgn = va_arg(param, curl_chunk_bgn_callback);
 2705|      0|    break;
 2706|      0|  case CURLOPT_CHUNK_END_FUNCTION:
  ------------------
  |  Branch (2706:3): [True: 0, False: 42.9k]
  ------------------
 2707|      0|    s->chunk_end = va_arg(param, curl_chunk_end_callback);
 2708|      0|    break;
 2709|      0|  case CURLOPT_FNMATCH_FUNCTION:
  ------------------
  |  Branch (2709:3): [True: 0, False: 42.9k]
  ------------------
 2710|      0|    s->fnmatch = va_arg(param, curl_fnmatch_callback);
 2711|      0|    break;
 2712|      0|#endif
 2713|      0|#ifndef CURL_DISABLE_HTTP
 2714|      0|  case CURLOPT_TRAILERFUNCTION:
  ------------------
  |  Branch (2714:3): [True: 0, False: 42.9k]
  ------------------
 2715|      0|    s->trailer_callback = va_arg(param, curl_trailer_callback);
 2716|      0|    break;
 2717|      0|#endif
 2718|      0|#ifndef CURL_DISABLE_HSTS
 2719|      0|  case CURLOPT_HSTSREADFUNCTION:
  ------------------
  |  Branch (2719:3): [True: 0, False: 42.9k]
  ------------------
 2720|      0|    s->hsts_read = va_arg(param, curl_hstsread_callback);
 2721|      0|    break;
 2722|      0|  case CURLOPT_HSTSWRITEFUNCTION:
  ------------------
  |  Branch (2722:3): [True: 0, False: 42.9k]
  ------------------
 2723|      0|    s->hsts_write = va_arg(param, curl_hstswrite_callback);
 2724|      0|    break;
 2725|      0|#endif
 2726|      0|  case CURLOPT_PREREQFUNCTION:
  ------------------
  |  Branch (2726:3): [True: 0, False: 42.9k]
  ------------------
 2727|      0|    s->fprereq = va_arg(param, curl_prereq_callback);
 2728|      0|    break;
 2729|      0|  default:
  ------------------
  |  Branch (2729:3): [True: 0, False: 42.9k]
  ------------------
 2730|      0|    return CURLE_UNKNOWN_OPTION;
 2731|  42.9k|  }
 2732|  42.9k|  return CURLE_OK;
 2733|  42.9k|}
setopt.c:setopt_offt:
 2737|  2.66k|{
 2738|  2.66k|  struct UserDefined *s = &data->set;
 2739|  2.66k|  switch(option) {
 2740|    172|  case CURLOPT_TIMEVALUE_LARGE:
  ------------------
  |  Branch (2740:3): [True: 172, False: 2.48k]
  ------------------
 2741|       |    /*
 2742|       |     * This is the value to compare with the remote document with the
 2743|       |     * method set with CURLOPT_TIMECONDITION
 2744|       |     */
 2745|    172|    s->timevalue = (time_t)offt;
 2746|    172|    break;
 2747|       |
 2748|       |    /* MQTT "borrows" some of the HTTP options */
 2749|    866|  case CURLOPT_POSTFIELDSIZE_LARGE:
  ------------------
  |  Branch (2749:3): [True: 866, False: 1.79k]
  ------------------
 2750|       |    /*
 2751|       |     * The size of the POSTFIELD data to prevent libcurl to do strlen() to
 2752|       |     * figure it out. Enables binary posts.
 2753|       |     */
 2754|    866|    if(offt < -1)
  ------------------
  |  Branch (2754:8): [True: 0, False: 866]
  ------------------
 2755|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2756|       |
 2757|    866|    if(s->postfieldsize < offt && s->a.str_copypostfields) {
  ------------------
  |  Branch (2757:8): [True: 188, False: 678]
  |  Branch (2757:35): [True: 0, False: 188]
  ------------------
 2758|       |      /* Previous CURLOPT_COPYPOSTFIELDS is no longer valid. */
 2759|      0|      curlx_safefree(s->a.str_copypostfields);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2760|      0|      s->postfields = NULL;
 2761|      0|    }
 2762|    866|    s->postfieldsize = offt;
 2763|    866|    break;
 2764|    480|  case CURLOPT_INFILESIZE_LARGE:
  ------------------
  |  Branch (2764:3): [True: 480, False: 2.18k]
  ------------------
 2765|       |    /*
 2766|       |     * If known, this should inform curl about the file size of the
 2767|       |     * to-be-uploaded file.
 2768|       |     */
 2769|    480|    if(offt < -1)
  ------------------
  |  Branch (2769:8): [True: 204, False: 276]
  ------------------
 2770|    204|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2771|    276|    s->filesize = offt;
 2772|    276|    break;
 2773|      0|  case CURLOPT_MAX_SEND_SPEED_LARGE:
  ------------------
  |  Branch (2773:3): [True: 0, False: 2.66k]
  ------------------
 2774|       |    /*
 2775|       |     * When transfer uploads are faster than CURLOPT_MAX_SEND_SPEED_LARGE
 2776|       |     * bytes per second the transfer is throttled..
 2777|       |     */
 2778|      0|    if(offt < 0)
  ------------------
  |  Branch (2778:8): [True: 0, False: 0]
  ------------------
 2779|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2780|      0|    s->max_send_speed = offt;
 2781|       |    /* use minimal burst rate of 32k. some protocol batch IO */
 2782|      0|    Curl_rlimit_change(&data->progress.ul.rlimit, offt,
 2783|      0|                       CURLMAX(offt, (32 * 1024)));
  ------------------
  |  | 1314|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1314:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2784|      0|    break;
 2785|    262|  case CURLOPT_MAX_RECV_SPEED_LARGE:
  ------------------
  |  Branch (2785:3): [True: 262, False: 2.39k]
  ------------------
 2786|       |    /*
 2787|       |     * When receiving data faster than CURLOPT_MAX_RECV_SPEED_LARGE bytes per
 2788|       |     * second the transfer is throttled..
 2789|       |     */
 2790|    262|    if(offt < 0)
  ------------------
  |  Branch (2790:8): [True: 0, False: 262]
  ------------------
 2791|      0|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2792|    262|    s->max_recv_speed = offt;
 2793|       |    /* use minimal burst rate of 32k. some protocol batch IO */
 2794|    262|    Curl_rlimit_change(&data->progress.dl.rlimit, offt,
 2795|    262|                       CURLMAX(offt, (32 * 1024)));
  ------------------
  |  | 1314|    262|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1314:24): [True: 205, False: 57]
  |  |  ------------------
  ------------------
 2796|    262|    break;
 2797|    474|  case CURLOPT_RESUME_FROM_LARGE:
  ------------------
  |  Branch (2797:3): [True: 474, False: 2.18k]
  ------------------
 2798|       |    /*
 2799|       |     * Resume transfer at the given file position
 2800|       |     */
 2801|    474|    if(offt < -1)
  ------------------
  |  Branch (2801:8): [True: 123, False: 351]
  ------------------
 2802|    123|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2803|    351|    s->set_resume_from = offt;
 2804|    351|    break;
 2805|    406|  case CURLOPT_MAXFILESIZE_LARGE:
  ------------------
  |  Branch (2805:3): [True: 406, False: 2.25k]
  ------------------
 2806|       |    /*
 2807|       |     * Set the maximum size of a file to download.
 2808|       |     */
 2809|    406|    if(offt < 0)
  ------------------
  |  Branch (2809:8): [True: 171, False: 235]
  ------------------
 2810|    171|      return CURLE_BAD_FUNCTION_ARGUMENT;
 2811|    235|    s->max_filesize = offt;
 2812|    235|    break;
 2813|       |
 2814|      0|  default:
  ------------------
  |  Branch (2814:3): [True: 0, False: 2.66k]
  ------------------
 2815|      0|    return CURLE_UNKNOWN_OPTION;
 2816|  2.66k|  }
 2817|  2.16k|  return CURLE_OK;
 2818|  2.66k|}
setopt.c:setopt_blob:
 2822|  9.91k|{
 2823|  9.91k|  struct UserDefined *s = &data->set;
 2824|  9.91k|  switch(option) {
 2825|      0|  case CURLOPT_SSLCERT_BLOB:
  ------------------
  |  Branch (2825:3): [True: 0, False: 9.91k]
  ------------------
 2826|       |    /*
 2827|       |     * Blob that holds file content of the SSL certificate to use
 2828|       |     */
 2829|      0|    return Curl_setblobopt(&s->a.blobs[BLOB_CERT], blob);
 2830|      0|#ifndef CURL_DISABLE_PROXY
 2831|      0|  case CURLOPT_PROXY_SSLCERT_BLOB:
  ------------------
  |  Branch (2831:3): [True: 0, False: 9.91k]
  ------------------
 2832|       |    /*
 2833|       |     * Blob that holds file content of the SSL certificate to use for proxy
 2834|       |     */
 2835|      0|    return Curl_setblobopt(&s->a.blobs[BLOB_CERT_PROXY], blob);
 2836|      0|  case CURLOPT_PROXY_SSLKEY_BLOB:
  ------------------
  |  Branch (2836:3): [True: 0, False: 9.91k]
  ------------------
 2837|       |    /*
 2838|       |     * Blob that holds file content of the SSL key to use for proxy
 2839|       |     */
 2840|      0|    return Curl_setblobopt(&s->a.blobs[BLOB_KEY_PROXY], blob);
 2841|      0|  case CURLOPT_PROXY_CAINFO_BLOB:
  ------------------
  |  Branch (2841:3): [True: 0, False: 9.91k]
  ------------------
 2842|       |    /*
 2843|       |     * Blob that holds CA info for SSL connection proxy.
 2844|       |     * Specify entire PEM of the CA certificate
 2845|       |     */
 2846|      0|#ifdef USE_SSL
 2847|      0|    if(Curl_ssl_supports(data, SSLSUPP_CAINFO_BLOB)) {
  ------------------
  |  |   42|      0|#define SSLSUPP_CAINFO_BLOB  (1 << 6)
  ------------------
  |  Branch (2847:8): [True: 0, False: 0]
  ------------------
 2848|      0|      CURLcode result = Curl_setblobopt(&s->a.blobs[BLOB_CAINFO_PROXY], blob);
 2849|      0|      if(!result)
  ------------------
  |  Branch (2849:10): [True: 0, False: 0]
  ------------------
 2850|      0|        s->proxy_ssl.custom_cablob = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2851|      0|      return result;
 2852|      0|    }
 2853|      0|#endif
 2854|      0|    return CURLE_NOT_BUILT_IN;
 2855|      0|  case CURLOPT_PROXY_ISSUERCERT_BLOB:
  ------------------
  |  Branch (2855:3): [True: 0, False: 9.91k]
  ------------------
 2856|       |    /*
 2857|       |     * Blob that holds Issuer certificate to check certificates issuer
 2858|       |     */
 2859|      0|    if(Curl_ssl_supports(data, SSLSUPP_ISSUERCERT_BLOB))
  ------------------
  |  |   50|      0|#define SSLSUPP_ISSUERCERT_BLOB (1 << 14) /* CURLOPT_ISSUERCERT_BLOB */
  ------------------
  |  Branch (2859:8): [True: 0, False: 0]
  ------------------
 2860|      0|      return Curl_setblobopt(&s->a.blobs[BLOB_SSL_ISSUERCERT_PROXY], blob);
 2861|      0|    return CURLE_NOT_BUILT_IN;
 2862|      0|#endif
 2863|      0|  case CURLOPT_SSLKEY_BLOB:
  ------------------
  |  Branch (2863:3): [True: 0, False: 9.91k]
  ------------------
 2864|       |    /*
 2865|       |     * Blob that holds file content of the SSL key to use
 2866|       |     */
 2867|      0|    return Curl_setblobopt(&s->a.blobs[BLOB_KEY], blob);
 2868|  9.91k|  case CURLOPT_CAINFO_BLOB:
  ------------------
  |  Branch (2868:3): [True: 9.91k, False: 0]
  ------------------
 2869|       |    /*
 2870|       |     * Blob that holds CA info for SSL connection.
 2871|       |     * Specify entire PEM of the CA certificate
 2872|       |     */
 2873|  9.91k|#ifdef USE_SSL
 2874|  9.91k|    if(Curl_ssl_supports(data, SSLSUPP_CAINFO_BLOB)) {
  ------------------
  |  |   42|  9.91k|#define SSLSUPP_CAINFO_BLOB  (1 << 6)
  ------------------
  |  Branch (2874:8): [True: 9.91k, False: 0]
  ------------------
 2875|  9.91k|      CURLcode result = Curl_setblobopt(&s->a.blobs[BLOB_CAINFO], blob);
 2876|  9.91k|      if(!result)
  ------------------
  |  Branch (2876:10): [True: 9.88k, False: 31]
  ------------------
 2877|  9.88k|        s->ssl.custom_cablob = TRUE;
  ------------------
  |  |  986|  9.88k|#define TRUE true
  ------------------
 2878|  9.91k|      return result;
 2879|  9.91k|    }
 2880|      0|#endif
 2881|      0|    return CURLE_NOT_BUILT_IN;
 2882|      0|  case CURLOPT_ISSUERCERT_BLOB:
  ------------------
  |  Branch (2882:3): [True: 0, False: 9.91k]
  ------------------
 2883|       |    /*
 2884|       |     * Blob that holds Issuer certificate to check certificates issuer
 2885|       |     */
 2886|      0|    if(Curl_ssl_supports(data, SSLSUPP_ISSUERCERT_BLOB))
  ------------------
  |  |   50|      0|#define SSLSUPP_ISSUERCERT_BLOB (1 << 14) /* CURLOPT_ISSUERCERT_BLOB */
  ------------------
  |  Branch (2886:8): [True: 0, False: 0]
  ------------------
 2887|      0|      return Curl_setblobopt(&s->a.blobs[BLOB_SSL_ISSUERCERT], blob);
 2888|      0|    return CURLE_NOT_BUILT_IN;
 2889|       |
 2890|      0|  default:
  ------------------
  |  Branch (2890:3): [True: 0, False: 9.91k]
  ------------------
 2891|      0|    return CURLE_UNKNOWN_OPTION;
 2892|  9.91k|  }
 2893|       |  /* unreachable */
 2894|  9.91k|}

Curl_sha256it:
  279|  3.34k|{
  280|  3.34k|  my_sha256_ctx ctx;
  281|  3.34k|  CURLcode result = my_sha256_init(&ctx);
  282|  3.34k|  if(result)
  ------------------
  |  Branch (282:6): [True: 0, False: 3.34k]
  ------------------
  283|      0|    return result;
  284|       |
  285|  3.34k|  result = my_sha256_update(&ctx, input, input_len);
  286|  3.34k|  if(result) {
  ------------------
  |  Branch (286:6): [True: 0, False: 3.34k]
  ------------------
  287|      0|    (void)my_sha256_final(digest, &ctx);
  288|      0|    return result;
  289|      0|  }
  290|       |
  291|  3.34k|  return my_sha256_final(digest, &ctx);
  292|  3.34k|}
sha256.c:my_sha256_init:
   39|  3.34k|{
   40|  3.34k|  EVP_MD_CTX ** const ctx = pctx;
   41|       |
   42|  3.34k|  *ctx = EVP_MD_CTX_new();
   43|  3.34k|  if(!*ctx)
  ------------------
  |  Branch (43:6): [True: 0, False: 3.34k]
  ------------------
   44|      0|    return CURLE_OUT_OF_MEMORY;
   45|       |
   46|  3.34k|  if(!EVP_DigestInit_ex(*ctx, EVP_sha256(), NULL)) {
  ------------------
  |  Branch (46:6): [True: 0, False: 3.34k]
  ------------------
   47|      0|    EVP_MD_CTX_free(*ctx);
   48|      0|    *ctx = NULL;
   49|      0|    return CURLE_FAILED_INIT;
   50|      0|  }
   51|  3.34k|  return CURLE_OK;
   52|  3.34k|}
sha256.c:my_sha256_update:
   56|  3.34k|{
   57|  3.34k|  EVP_MD_CTX ** const ctx = pctx;
   58|  3.34k|  return EVP_DigestUpdate(*ctx, input, input_len) ?
  ------------------
  |  Branch (58:10): [True: 3.34k, False: 0]
  ------------------
   59|  3.34k|    CURLE_OK : CURLE_BAD_FUNCTION_ARGUMENT;
   60|  3.34k|}
sha256.c:my_sha256_final:
   63|  3.34k|{
   64|  3.34k|  EVP_MD_CTX ** const ctx = pctx;
   65|  3.34k|  CURLcode result = EVP_DigestFinal_ex(*ctx, digest, NULL) ?
  ------------------
  |  Branch (65:21): [True: 3.34k, False: 0]
  ------------------
   66|  3.34k|    CURLE_OK : CURLE_BAD_FUNCTION_ARGUMENT;
   67|  3.34k|  EVP_MD_CTX_free(*ctx);
   68|       |  *ctx = NULL;
   69|  3.34k|  return result;
   70|  3.34k|}

easy.c:sigpipe_ignore:
   49|  9.91k|{
   50|       |  /* get a local copy of no_signal because the Curl_easy might not be
   51|       |     around when we restore */
   52|  9.91k|  ig->no_signal = data->set.no_signal;
   53|  9.91k|  if(!data->set.no_signal) {
  ------------------
  |  Branch (53:6): [True: 9.91k, False: 0]
  ------------------
   54|  9.91k|    struct sigaction action;
   55|       |    /* first, extract the existing situation */
   56|  9.91k|    sigaction(SIGPIPE, NULL, &ig->old_pipe_act);
   57|  9.91k|    action = ig->old_pipe_act;
   58|       |    /* ignore this signal */
   59|  9.91k|    action.sa_handler = SIG_IGN;
   60|  9.91k|#ifdef SA_SIGINFO
   61|       |    /* clear SA_SIGINFO flag since we are using sa_handler */
   62|  9.91k|    action.sa_flags &= ~SA_SIGINFO;
   63|  9.91k|#endif
   64|  9.91k|    sigaction(SIGPIPE, &action, NULL);
   65|  9.91k|  }
   66|  9.91k|}
easy.c:sigpipe_restore:
   74|  9.91k|{
   75|  9.91k|  if(!ig->no_signal)
  ------------------
  |  Branch (75:6): [True: 9.91k, False: 0]
  ------------------
   76|       |    /* restore the outside state */
   77|  9.91k|    sigaction(SIGPIPE, &ig->old_pipe_act, NULL);
   78|  9.91k|}
multi.c:sigpipe_init:
   37|   135k|{
   38|   135k|  memset(ig, 0, sizeof(*ig));
   39|       |  ig->no_signal = TRUE;
  ------------------
  |  |  986|   135k|#define TRUE true
  ------------------
   40|   135k|}
multi.c:sigpipe_apply:
   82|   136k|{
   83|   136k|  if(data && (data->set.no_signal != ig->no_signal)) {
  ------------------
  |  Branch (83:6): [True: 136k, False: 0]
  |  Branch (83:14): [True: 135k, False: 632]
  ------------------
   84|   135k|    sigpipe_restore(ig);
   85|   135k|    sigpipe_ignore(data, ig);
   86|   135k|  }
   87|   136k|}
multi.c:sigpipe_ignore:
   49|   135k|{
   50|       |  /* get a local copy of no_signal because the Curl_easy might not be
   51|       |     around when we restore */
   52|   135k|  ig->no_signal = data->set.no_signal;
   53|   135k|  if(!data->set.no_signal) {
  ------------------
  |  Branch (53:6): [True: 135k, False: 0]
  ------------------
   54|   135k|    struct sigaction action;
   55|       |    /* first, extract the existing situation */
   56|   135k|    sigaction(SIGPIPE, NULL, &ig->old_pipe_act);
   57|   135k|    action = ig->old_pipe_act;
   58|       |    /* ignore this signal */
   59|   135k|    action.sa_handler = SIG_IGN;
   60|   135k|#ifdef SA_SIGINFO
   61|       |    /* clear SA_SIGINFO flag since we are using sa_handler */
   62|   135k|    action.sa_flags &= ~SA_SIGINFO;
   63|   135k|#endif
   64|   135k|    sigaction(SIGPIPE, &action, NULL);
   65|   135k|  }
   66|   135k|}
multi.c:sigpipe_restore:
   74|   271k|{
   75|   271k|  if(!ig->no_signal)
  ------------------
  |  Branch (75:6): [True: 135k, False: 135k]
  ------------------
   76|       |    /* restore the outside state */
   77|   135k|    sigaction(SIGPIPE, &ig->old_pipe_act, NULL);
   78|   271k|}
conncache.c:sigpipe_init:
   37|  1.57k|{
   38|  1.57k|  memset(ig, 0, sizeof(*ig));
   39|       |  ig->no_signal = TRUE;
  ------------------
  |  |  986|  1.57k|#define TRUE true
  ------------------
   40|  1.57k|}
conncache.c:sigpipe_apply:
   82|  1.57k|{
   83|  1.57k|  if(data && (data->set.no_signal != ig->no_signal)) {
  ------------------
  |  Branch (83:6): [True: 1.57k, False: 0]
  |  Branch (83:14): [True: 1.57k, False: 0]
  ------------------
   84|  1.57k|    sigpipe_restore(ig);
   85|  1.57k|    sigpipe_ignore(data, ig);
   86|  1.57k|  }
   87|  1.57k|}
conncache.c:sigpipe_ignore:
   49|  1.57k|{
   50|       |  /* get a local copy of no_signal because the Curl_easy might not be
   51|       |     around when we restore */
   52|  1.57k|  ig->no_signal = data->set.no_signal;
   53|  1.57k|  if(!data->set.no_signal) {
  ------------------
  |  Branch (53:6): [True: 1.57k, False: 0]
  ------------------
   54|  1.57k|    struct sigaction action;
   55|       |    /* first, extract the existing situation */
   56|  1.57k|    sigaction(SIGPIPE, NULL, &ig->old_pipe_act);
   57|  1.57k|    action = ig->old_pipe_act;
   58|       |    /* ignore this signal */
   59|  1.57k|    action.sa_handler = SIG_IGN;
   60|  1.57k|#ifdef SA_SIGINFO
   61|       |    /* clear SA_SIGINFO flag since we are using sa_handler */
   62|  1.57k|    action.sa_flags &= ~SA_SIGINFO;
   63|  1.57k|#endif
   64|  1.57k|    sigaction(SIGPIPE, &action, NULL);
   65|  1.57k|  }
   66|  1.57k|}
conncache.c:sigpipe_restore:
   74|  3.14k|{
   75|  3.14k|  if(!ig->no_signal)
  ------------------
  |  Branch (75:6): [True: 1.57k, False: 1.57k]
  ------------------
   76|       |    /* restore the outside state */
   77|  1.57k|    sigaction(SIGPIPE, &ig->old_pipe_act, NULL);
   78|  3.14k|}

Curl_slist_append_nodup:
   56|  32.1k|{
   57|  32.1k|  struct curl_slist *last;
   58|  32.1k|  struct curl_slist *new_item;
   59|       |
   60|  32.1k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  32.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (60:3): [True: 0, False: 32.1k]
  |  Branch (60:3): [True: 32.1k, False: 0]
  ------------------
   61|       |
   62|  32.1k|  new_item = curlx_malloc(sizeof(struct curl_slist));
  ------------------
  |  | 1498|  32.1k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   63|  32.1k|  if(!new_item)
  ------------------
  |  Branch (63:6): [True: 92, False: 32.0k]
  ------------------
   64|     92|    return NULL;
   65|       |
   66|  32.0k|  new_item->next = NULL;
   67|  32.0k|  new_item->data = CURL_UNCONST(data);
  ------------------
  |  |  793|  32.0k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
   68|       |
   69|       |  /* if this is the first item, then new_item *is* the list */
   70|  32.0k|  if(!list)
  ------------------
  |  Branch (70:6): [True: 24.6k, False: 7.36k]
  ------------------
   71|  24.6k|    return new_item;
   72|       |
   73|  7.36k|  last = slist_get_last(list);
   74|  7.36k|  last->next = new_item;
   75|  7.36k|  return list;
   76|  32.0k|}
curl_slist_append:
   86|  28.0k|{
   87|  28.0k|  char *dupdata = curlx_strdup(data);
  ------------------
  |  | 1497|  28.0k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
   88|       |
   89|  28.0k|  if(!dupdata)
  ------------------
  |  Branch (89:6): [True: 154, False: 27.8k]
  ------------------
   90|    154|    return NULL;
   91|       |
   92|  27.8k|  list = Curl_slist_append_nodup(list, dupdata);
   93|  27.8k|  if(!list)
  ------------------
  |  Branch (93:6): [True: 92, False: 27.7k]
  ------------------
   94|     92|    curlx_free(dupdata);
  ------------------
  |  | 1503|     92|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   95|       |
   96|  27.8k|  return list;
   97|  28.0k|}
curl_slist_free_all:
  126|  43.2k|{
  127|  43.2k|  struct curl_slist *next;
  128|  43.2k|  struct curl_slist *item;
  129|       |
  130|  43.2k|  if(!list)
  ------------------
  |  Branch (130:6): [True: 18.5k, False: 24.6k]
  ------------------
  131|  18.5k|    return;
  132|       |
  133|  24.6k|  item = list;
  134|  32.0k|  do {
  135|  32.0k|    next = item->next;
  136|  32.0k|    curlx_safefree(item->data);
  ------------------
  |  | 1359|  32.0k|  do {                      \
  |  | 1360|  32.0k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  32.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  32.0k|    (ptr) = NULL;           \
  |  | 1362|  32.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 32.0k]
  |  |  ------------------
  ------------------
  137|  32.0k|    curlx_free(item);
  ------------------
  |  | 1503|  32.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  138|  32.0k|    item = next;
  139|  32.0k|  } while(next);
  ------------------
  |  Branch (139:11): [True: 7.36k, False: 24.6k]
  ------------------
  140|  24.6k|}
slist.c:slist_get_last:
   30|  7.36k|{
   31|  7.36k|  struct curl_slist *item;
   32|       |
   33|       |  /* if caller passed us a NULL, return now */
   34|  7.36k|  if(!list)
  ------------------
  |  Branch (34:6): [True: 0, False: 7.36k]
  ------------------
   35|      0|    return NULL;
   36|       |
   37|       |  /* loop through to find the last item */
   38|  7.36k|  item = list;
   39|  26.4k|  while(item->next) {
  ------------------
  |  Branch (39:9): [True: 19.1k, False: 7.36k]
  ------------------
   40|  19.1k|    item = item->next;
   41|  19.1k|  }
   42|  7.36k|  return item;
   43|  7.36k|}

Curl_wakeup_init:
  278|  19.5k|{
  279|  19.5k|#ifdef USE_EVENTFD
  280|  19.5k|  return wakeup_eventfd(socks, nonblocking);
  281|       |#elif defined(HAVE_PIPE)
  282|       |  return wakeup_pipe(socks, nonblocking);
  283|       |#elif defined(HAVE_SOCKETPAIR)
  284|       |  return wakeup_socketpair(socks, nonblocking);
  285|       |#else
  286|       |  return wakeup_inet(socks, nonblocking);
  287|       |#endif
  288|  19.5k|}
Curl_wakeup_signal:
  305|    150|{
  306|    150|  int sockerr = 0;
  307|    150|#ifdef USE_EVENTFD
  308|    150|  const uint64_t buf[1] = { 1 };
  309|       |#else
  310|       |  const char buf[1] = { 1 };
  311|       |#endif
  312|       |
  313|    150|  while(1) {
  ------------------
  |  Branch (313:9): [True: 150, Folded]
  ------------------
  314|    150|    sockerr = 0;
  315|    150|    if(wakeup_write(socks[1], buf, sizeof(buf)) < 0) {
  ------------------
  |  |  292|    150|#define wakeup_write        write
  ------------------
  |  Branch (315:8): [True: 0, False: 150]
  ------------------
  316|      0|      sockerr = SOCKERRNO;
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
  317|      0|#ifndef USE_WINSOCK
  318|      0|      if(sockerr == SOCKEINTR)
  ------------------
  |  | 1139|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (318:10): [True: 0, False: 0]
  ------------------
  319|      0|        continue;
  320|      0|#endif
  321|      0|      if(SOCK_EAGAIN(sockerr))
  ------------------
  |  | 1156|      0|#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
  |  |  ------------------
  |  |  |  | 1147|      0|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  |  |  ------------------
  |  |  |  Branch (1156:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  322|      0|        sockerr = 0; /* wakeup is already ongoing */
  323|      0|    }
  324|    150|    break;
  325|    150|  }
  326|    150|  return sockerr;
  327|    150|}
Curl_wakeup_consume:
  330|   122k|{
  331|   122k|  char buf[64];
  332|   122k|  ssize_t rc;
  333|   122k|  CURLcode result = CURLE_OK;
  334|       |
  335|   122k|  do {
  336|   122k|    rc = wakeup_read(socks[0], buf, sizeof(buf));
  ------------------
  |  |  293|   122k|#define wakeup_read         read
  ------------------
  337|   122k|    if(!rc)
  ------------------
  |  Branch (337:8): [True: 0, False: 122k]
  ------------------
  338|      0|      break;
  339|   122k|    else if(rc < 0) {
  ------------------
  |  Branch (339:13): [True: 122k, False: 141]
  ------------------
  340|   122k|      int sockerr = SOCKERRNO;
  ------------------
  |  | 1105|   122k|#define SOCKERRNO         errno
  ------------------
  341|   122k|#ifndef USE_WINSOCK
  342|   122k|      if(sockerr == SOCKEINTR)
  ------------------
  |  | 1139|   122k|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (342:10): [True: 0, False: 122k]
  ------------------
  343|      0|        continue;
  344|   122k|#endif
  345|   122k|      if(SOCK_EAGAIN(sockerr))
  ------------------
  |  | 1156|   122k|#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
  |  |  ------------------
  |  |  |  | 1147|   122k|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  |  |  ------------------
  |  |  |  Branch (1156:24): [True: 122k, False: 0]
  |  |  ------------------
  ------------------
  346|   122k|        break;
  347|      0|      result = CURLE_READ_ERROR;
  348|      0|      break;
  349|   122k|    }
  350|   122k|  } while(all);
  ------------------
  |  Branch (350:11): [True: 141, False: 0]
  ------------------
  351|   122k|  return result;
  352|   122k|}
Curl_wakeup_destroy:
  355|  19.6k|{
  356|       |#ifndef USE_EVENTFD
  357|       |  if(socks[1] != CURL_SOCKET_BAD)
  358|       |    wakeup_close(socks[1]);
  359|       |#endif
  360|  19.6k|  if(socks[0] != CURL_SOCKET_BAD)
  ------------------
  |  |  147|  19.6k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (360:6): [True: 19.5k, False: 104]
  ------------------
  361|  19.5k|    wakeup_close(socks[0]);
  ------------------
  |  |  294|  19.5k|#define wakeup_close        close
  ------------------
  362|  19.6k|  socks[0] = socks[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  19.6k|#define CURL_SOCKET_BAD (-1)
  ------------------
  363|  19.6k|}
socketpair.c:wakeup_eventfd:
   39|  19.5k|{
   40|  19.5k|  int efd = eventfd(0, nonblocking ? EFD_CLOEXEC | EFD_NONBLOCK : EFD_CLOEXEC);
  ------------------
  |  Branch (40:24): [True: 19.5k, False: 0]
  ------------------
   41|  19.5k|  if(efd == -1) {
  ------------------
  |  Branch (41:6): [True: 0, False: 19.5k]
  ------------------
   42|      0|    socks[0] = socks[1] = CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
   43|      0|    return -1;
   44|      0|  }
   45|  19.5k|  socks[0] = socks[1] = efd;
   46|  19.5k|  return 0;
   47|  19.5k|}

Curl_timeouts_init:
   43|  9.82k|{
   44|  9.82k|  struct curltime time_base = ptime_base ? *ptime_base : curlx_now();
  ------------------
  |  Branch (44:31): [True: 9.82k, False: 0]
  ------------------
   45|       |  timeouts->tree = NULL;
   46|  9.82k|  timeouts->time_base_sec = time_base.tv_sec;
   47|  9.82k|}
Curl_timeouts_has:
   50|   101k|{
   51|   101k|  struct Curl_tree *node = data ? &data->state.timeouts.splaynode : NULL;
  ------------------
  |  Branch (51:28): [True: 101k, False: 0]
  ------------------
   52|   101k|  return node && node->registered;
  ------------------
  |  Branch (52:10): [True: 101k, False: 0]
  |  Branch (52:18): [True: 78.1k, False: 23.4k]
  ------------------
   53|   101k|}
Curl_timeouts_offset_us:
   57|   361k|{
   58|   361k|  struct curltime time_base;
   59|   361k|  time_base.tv_sec = timeouts->time_base_sec;
   60|   361k|  time_base.tv_usec = 0;
   61|   361k|  return curlx_ptimediff_us(pts, &time_base);
   62|   361k|}
Curl_timeouts_next_ms:
   68|  60.3k|{
   69|  60.3k|  if(timeouts->tree) { /* splay the lowest key to the root */
  ------------------
  |  Branch (69:6): [True: 56.7k, False: 3.59k]
  ------------------
   70|  56.7k|    timeouts->tree = splay(TIMEDIFF_T_MIN, timeouts->tree);
  ------------------
  |  |   34|  56.7k|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  541|  56.7k|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|  56.7k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   71|  56.7k|  }
   72|       |
   73|  60.3k|  if(timeouts->tree) {
  ------------------
  |  Branch (73:6): [True: 56.7k, False: 3.59k]
  ------------------
   74|  56.7k|    timediff_t elapsed_us = Curl_timeouts_offset_us(timeouts, pnow);
   75|  56.7k|    timediff_t delta_us = timeouts->tree->key - elapsed_us;
   76|  56.7k|    if(pmid)
  ------------------
  |  Branch (76:8): [True: 56.7k, False: 0]
  ------------------
   77|  56.7k|      *pmid = timeouts->tree->id;
   78|  56.7k|    if(pexpire_offset_us)
  ------------------
  |  Branch (78:8): [True: 11.9k, False: 44.8k]
  ------------------
   79|  11.9k|      *pexpire_offset_us = timeouts->tree->key;
   80|  56.7k|    if(delta_us > 0) { /* expires in the future */
  ------------------
  |  Branch (80:8): [True: 55.6k, False: 1.15k]
  ------------------
   81|  55.6k|      timediff_t ms = curlx_us_to_ceil_ms(delta_us);
   82|  55.6k|      return (ms > INT_MAX) ? INT_MAX : (int)ms;
  ------------------
  |  Branch (82:14): [True: 0, False: 55.6k]
  ------------------
   83|  55.6k|    }
   84|  1.15k|    else /* has expired */
   85|  1.15k|      return 0;
   86|  56.7k|  }
   87|  3.59k|  if(pmid)
  ------------------
  |  Branch (87:6): [True: 3.59k, False: 0]
  ------------------
   88|  3.59k|    *pmid = UINT32_MAX;
   89|  3.59k|  if(pexpire_offset_us)
  ------------------
  |  Branch (89:6): [True: 3.59k, False: 0]
  ------------------
   90|  3.59k|    *pexpire_offset_us = 0;
   91|  3.59k|  return -1;
   92|  60.3k|}
splayinsert:
  183|  24.9k|{
  184|  24.9k|  DEBUGASSERT(node);
  ------------------
  |  | 1016|  24.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (184:3): [True: 0, False: 24.9k]
  |  Branch (184:3): [True: 24.9k, False: 0]
  ------------------
  185|       |
  186|  24.9k|  node->key = key;
  187|  24.9k|  node->id = id;
  188|  24.9k|  node->same = NULL;
  189|  24.9k|  node->registered = TRUE;
  ------------------
  |  |  986|  24.9k|#define TRUE true
  ------------------
  190|  24.9k|  if(root) {
  ------------------
  |  Branch (190:6): [True: 0, False: 24.9k]
  ------------------
  191|      0|    root = splay(key, root);
  192|      0|    DEBUGASSERT(root);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (192:5): [True: 0, False: 0]
  |  Branch (192:5): [True: 0, False: 0]
  ------------------
  193|      0|    if(key == root->key) {
  ------------------
  |  Branch (193:8): [True: 0, False: 0]
  ------------------
  194|       |      /* There already exists a node in the tree with the same key.
  195|       |         Append the new node to the `same` list. */
  196|      0|      struct Curl_tree **panchor = &root->same;
  197|      0|      while(*panchor)
  ------------------
  |  Branch (197:13): [True: 0, False: 0]
  ------------------
  198|      0|        panchor = &(*panchor)->same;
  199|      0|      *panchor = node;
  200|      0|      return root; /* the root node always stays the same */
  201|      0|    }
  202|      0|  }
  203|       |
  204|       |  /* node becomes the new root. Insert old root as sub-branch. */
  205|  24.9k|  if(!root) {
  ------------------
  |  Branch (205:6): [True: 24.9k, False: 0]
  ------------------
  206|  24.9k|    node->smaller = node->larger = NULL;
  207|  24.9k|  }
  208|      0|  else if(key < root->key) {
  ------------------
  |  Branch (208:11): [True: 0, False: 0]
  ------------------
  209|      0|    node->smaller = root->smaller;
  210|      0|    node->larger = root;
  211|      0|    root->smaller = NULL;
  212|      0|  }
  213|      0|  else {
  214|      0|    node->larger = root->larger;
  215|      0|    node->smaller = root;
  216|      0|    root->larger = NULL;
  217|      0|  }
  218|       |
  219|  24.9k|  return node;
  220|  24.9k|}
Curl_timeouts_add:
  225|  24.9k|{
  226|  24.9k|  struct Curl_tree *node = &data->state.timeouts.splaynode;
  227|  24.9k|  DEBUGASSERT(!node->registered);
  ------------------
  |  | 1016|  24.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (227:3): [True: 0, False: 24.9k]
  |  Branch (227:3): [True: 24.9k, False: 0]
  ------------------
  228|  24.9k|  timeouts->tree = splayinsert(offset_us, timeouts->tree,
  229|  24.9k|                               node, data->mid);
  230|  24.9k|}
splaygetbest:
  244|   141k|{
  245|   141k|  struct Curl_tree *x;
  246|       |
  247|   141k|  if(!root) {
  ------------------
  |  Branch (247:6): [True: 0, False: 141k]
  ------------------
  248|      0|    *removed = NULL; /* none removed since there was no root */
  249|      0|    return NULL;
  250|      0|  }
  251|       |
  252|       |  /* find smallest */
  253|   141k|  root = splay(TIMEDIFF_T_MIN, root);
  ------------------
  |  |   34|   141k|#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
  |  |  ------------------
  |  |  |  |  541|   141k|#define CURL_OFF_T_MIN (-CURL_OFF_T_MAX - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  539|   141k|#  define CURL_OFF_T_MAX 0x7FFFFFFFFFFFFFFF
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|   141k|  DEBUGASSERT(root);
  ------------------
  |  | 1016|   141k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (254:3): [True: 0, False: 141k]
  |  Branch (254:3): [True: 141k, False: 0]
  ------------------
  255|   141k|  if(key < root->key) {
  ------------------
  |  Branch (255:6): [True: 138k, False: 2.20k]
  ------------------
  256|       |    /* even the smallest is too big */
  257|   138k|    *removed = NULL;
  258|   138k|    return root;
  259|   138k|  }
  260|       |
  261|       |  /* FIRST! Check if there is a list with identical keys */
  262|  2.20k|  if(root->same) {
  ------------------
  |  Branch (262:6): [True: 0, False: 2.20k]
  ------------------
  263|      0|    x = root->same;
  264|      0|    DEBUGASSERT(x->key == root->key);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (264:5): [True: 0, False: 0]
  |  Branch (264:5): [True: 0, False: 0]
  ------------------
  265|       |    /* 'x' becomes the new root node */
  266|      0|    x->larger = root->larger;
  267|      0|    x->smaller = root->smaller;
  268|      0|    root->same = NULL;
  269|      0|    root->registered = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  270|      0|    *removed = root;
  271|      0|    return x; /* new root */
  272|      0|  }
  273|       |
  274|       |  /* we splayed the tree to the smallest element, there is no smaller */
  275|  2.20k|  x = root->larger;
  276|  2.20k|  root->registered = FALSE;
  ------------------
  |  |  989|  2.20k|#define FALSE false
  ------------------
  277|  2.20k|  *removed = root;
  278|       |
  279|  2.20k|  return x;
  280|  2.20k|}
Curl_timeouts_remove_expired:
  285|   151k|{
  286|   151k|  if(timeouts->tree) {
  ------------------
  |  Branch (286:6): [True: 141k, False: 10.2k]
  ------------------
  287|   141k|    struct Curl_tree *t = NULL;
  288|   141k|    timediff_t elapsed_us = Curl_timeouts_offset_us(timeouts, ts);
  289|   141k|    timeouts->tree = splaygetbest(elapsed_us, timeouts->tree, &t);
  290|   141k|    if(t) {
  ------------------
  |  Branch (290:8): [True: 2.20k, False: 138k]
  ------------------
  291|  2.20k|      *pmid = t->id;
  292|  2.20k|      return TRUE;
  ------------------
  |  |  986|  2.20k|#define TRUE true
  ------------------
  293|  2.20k|    }
  294|   141k|  }
  295|   149k|  *pmid = UINT32_MAX;
  296|       |  return FALSE;
  ------------------
  |  |  989|   149k|#define FALSE false
  ------------------
  297|   151k|}
splayremove:
  316|  22.7k|{
  317|  22.7k|  struct Curl_tree *x;
  318|       |
  319|  22.7k|  if(!root)
  ------------------
  |  Branch (319:6): [True: 0, False: 22.7k]
  ------------------
  320|      0|    return 1;
  321|       |
  322|  22.7k|  DEBUGASSERT(removenode);
  ------------------
  |  | 1016|  22.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (322:3): [True: 0, False: 22.7k]
  |  Branch (322:3): [True: 22.7k, False: 0]
  ------------------
  323|  22.7k|  if(!removenode->registered)
  ------------------
  |  Branch (323:6): [True: 0, False: 22.7k]
  ------------------
  324|      0|    return 2;
  325|       |
  326|  22.7k|  root = splay(removenode->key, root);
  327|  22.7k|  DEBUGASSERT(root);
  ------------------
  |  | 1016|  22.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (327:3): [True: 0, False: 22.7k]
  |  Branch (327:3): [True: 22.7k, False: 0]
  ------------------
  328|       |
  329|       |  /* First make sure that we got the same root key as the one we want
  330|       |     to remove, as otherwise we might be trying to remove a node that
  331|       |     is not actually in the tree. */
  332|  22.7k|  if(root->key != removenode->key) {
  ------------------
  |  Branch (332:6): [True: 0, False: 22.7k]
  ------------------
  333|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (333:5): [Folded, False: 0]
  |  Branch (333:5): [Folded, False: 0]
  ------------------
  334|      0|    return 2;
  335|      0|  }
  336|       |
  337|  22.7k|  if(root != removenode) {
  ------------------
  |  Branch (337:6): [True: 0, False: 22.7k]
  ------------------
  338|       |    /* Should be in the root->same list then */
  339|      0|    struct Curl_tree **panchor;
  340|      0|    for(panchor = &root->same; *panchor; panchor = &(*panchor)->same) {
  ------------------
  |  Branch (340:32): [True: 0, False: 0]
  ------------------
  341|      0|      if(*panchor == removenode) {
  ------------------
  |  Branch (341:10): [True: 0, False: 0]
  ------------------
  342|      0|        *panchor = removenode->same;
  343|      0|        removenode->same = NULL;
  344|      0|        removenode->registered = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  345|      0|        *newroot = root;
  346|      0|        return 0;
  347|      0|      }
  348|      0|    }
  349|       |    /* not found in same list, error */
  350|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (350:5): [Folded, False: 0]
  |  Branch (350:5): [Folded, False: 0]
  ------------------
  351|      0|    return 2;
  352|      0|  }
  353|       |  /* removing the root node */
  354|  22.7k|  if(root->same) {
  ------------------
  |  Branch (354:6): [True: 0, False: 22.7k]
  ------------------
  355|       |    /* 'x' is the new root node, we make it use the root node's
  356|       |       smaller/larger links */
  357|      0|    x = root->same;
  358|      0|    x->larger = root->larger;
  359|      0|    x->smaller = root->smaller;
  360|      0|    root->same = NULL;
  361|      0|  }
  362|  22.7k|  else {
  363|       |    /* Remove the root node */
  364|  22.7k|    if(!root->smaller)
  ------------------
  |  Branch (364:8): [True: 22.7k, False: 0]
  ------------------
  365|  22.7k|      x = root->larger;
  366|      0|    else {
  367|      0|      x = splay(removenode->key, root->smaller);
  368|      0|      DEBUGASSERT(x);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (368:7): [True: 0, False: 0]
  |  Branch (368:7): [True: 0, False: 0]
  ------------------
  369|      0|      x->larger = root->larger;
  370|      0|    }
  371|  22.7k|  }
  372|  22.7k|  removenode->registered = FALSE;
  ------------------
  |  |  989|  22.7k|#define FALSE false
  ------------------
  373|  22.7k|  *newroot = x; /* return new root */
  374|  22.7k|  return 0;
  375|  22.7k|}
Curl_timeouts_remove:
  379|  30.8k|{
  380|  30.8k|  struct Curl_tree *node = &data->state.timeouts.splaynode;
  381|  30.8k|  if(node->registered) {
  ------------------
  |  Branch (381:6): [True: 22.7k, False: 8.14k]
  ------------------
  382|  22.7k|    int rc = splayremove(timeouts->tree, node, &timeouts->tree);
  383|  22.7k|#ifdef DEBUGBUILD
  384|  22.7k|    if(rc)
  ------------------
  |  Branch (384:8): [True: 0, False: 22.7k]
  ------------------
  385|      0|      curl_mfprintf(stderr, "Internal error removing splay node = %d\n", rc);
  386|       |#else
  387|       |    (void)rc;
  388|       |#endif
  389|  22.7k|    return TRUE;
  ------------------
  |  |  986|  22.7k|#define TRUE true
  ------------------
  390|  22.7k|  }
  391|  8.14k|  return FALSE;
  ------------------
  |  |  989|  8.14k|#define FALSE false
  ------------------
  392|  30.8k|}
splay.c:splay:
  104|   220k|{
  105|   220k|  struct Curl_tree N, *l, *r, *y;
  106|       |
  107|   220k|  if(!root)
  ------------------
  |  Branch (107:6): [True: 0, False: 220k]
  ------------------
  108|      0|    return NULL;
  109|   220k|  N.smaller = N.larger = NULL;
  110|   220k|  l = r = &N;
  111|       |
  112|   220k|  for(;;) {
  113|   220k|    if(key < root->key) {
  ------------------
  |  Branch (113:8): [True: 197k, False: 22.7k]
  ------------------
  114|       |      /* key is somewhere in root->smaller branch */
  115|   197k|      if(!root->smaller)  /* which is empty, done */
  ------------------
  |  Branch (115:10): [True: 197k, False: 0]
  ------------------
  116|   197k|        break;
  117|      0|      if(key < root->smaller->key) {
  ------------------
  |  Branch (117:10): [True: 0, False: 0]
  ------------------
  118|       |        /* key is somewhere in root->smaller->smaller, make a "Zig step" */
  119|      0|        y = root->smaller;
  120|      0|        root->smaller = y->larger;
  121|      0|        y->larger = root;
  122|      0|        root = y;
  123|      0|        if(!root->smaller)
  ------------------
  |  Branch (123:12): [True: 0, False: 0]
  ------------------
  124|      0|          break;
  125|      0|      }
  126|       |      /* Making root->smaller the new root, the old root is no longer
  127|       |       * referenced. Remember it in the N tree's `r`ight/larger side.
  128|       |       * Everything in old root is smaller than what the right side
  129|       |       * of N already has, so it gets added to r->smaller. */
  130|      0|      r->smaller = root;
  131|      0|      r = root;
  132|      0|      root = root->smaller;
  133|      0|    }
  134|  22.7k|    else if(key > root->key) {
  ------------------
  |  Branch (134:13): [True: 0, False: 22.7k]
  ------------------
  135|       |      /* key is somewhere in root->larger branch */
  136|      0|      if(!root->larger)  /* which is empty, done */
  ------------------
  |  Branch (136:10): [True: 0, False: 0]
  ------------------
  137|      0|        break;
  138|      0|      if(key > root->larger->key) {
  ------------------
  |  Branch (138:10): [True: 0, False: 0]
  ------------------
  139|       |        /* key is somewhere in root->larger->larger, make a "Zig step" */
  140|      0|        y = root->larger;
  141|      0|        root->larger = y->smaller;
  142|      0|        y->smaller = root;
  143|      0|        root = y;
  144|      0|        if(!root->larger)
  ------------------
  |  Branch (144:12): [True: 0, False: 0]
  ------------------
  145|      0|          break;
  146|      0|      }
  147|       |      /* Making root->larger the new root, the old root is no longer
  148|       |       * referenced. Remember it in the N tree's `l`eft/smaller side.
  149|       |       * Everything in old root is larger than what the left side
  150|       |       * of N already has, so it gets added to l->larger. */
  151|      0|      l->larger = root;
  152|      0|      l = root;
  153|      0|      root = root->larger;
  154|      0|    }
  155|  22.7k|    else  /* exact match, root is key, done */
  156|  22.7k|      break;
  157|   220k|  }
  158|       |
  159|       |  /* Put it all together again.
  160|       |   * root->smaller has everything larger than current `l`.
  161|       |   * root->larger has everything smaller than current `r`. */
  162|   220k|  l->larger = root->smaller;
  163|   220k|  r->smaller = root->larger;
  164|   220k|  root->smaller = N.larger;
  165|   220k|  root->larger = N.smaller;
  166|       |
  167|   220k|  return root;
  168|   220k|}

Curl_strntolower:
   93|  44.7k|{
   94|  44.7k|  if(n < 1)
  ------------------
  |  Branch (94:6): [True: 0, False: 44.7k]
  ------------------
   95|      0|    return;
   96|       |
   97|   404k|  do {
   98|   404k|    *dest++ = Curl_raw_tolower(*src);
   99|   404k|  } while(*src++ && --n);
  ------------------
  |  Branch (99:11): [True: 404k, False: 0]
  |  Branch (99:21): [True: 360k, False: 44.7k]
  ------------------
  100|  44.7k|}
Curl_safecmp:
  106|  7.28k|{
  107|  7.28k|  if(a && b)
  ------------------
  |  Branch (107:6): [True: 0, False: 7.28k]
  |  Branch (107:11): [True: 0, False: 0]
  ------------------
  108|      0|    return !strcmp(a, b);
  109|  7.28k|  return !a && !b;
  ------------------
  |  Branch (109:10): [True: 7.28k, False: 0]
  |  Branch (109:16): [True: 0, False: 7.28k]
  ------------------
  110|  7.28k|}

headers.c:Curl_raw_toupper:
   38|  1.36M|{
   39|  1.36M|  return (char)Curl_touppermap[(unsigned char)in];
   40|  1.36M|}
strcase.c:Curl_raw_tolower:
   43|   404k|{
   44|   404k|  return (char)Curl_tolowermap[(unsigned char)in];
   45|   404k|}
strequal.c:Curl_raw_toupper:
   38|  2.10M|{
   39|  2.10M|  return (char)Curl_touppermap[(unsigned char)in];
   40|  2.10M|}
cookie.c:Curl_raw_toupper:
   38|  42.7k|{
   39|  42.7k|  return (char)Curl_touppermap[(unsigned char)in];
   40|  42.7k|}

curl_strequal:
   77|   287k|{
   78|   287k|  if(s1 && s2)
  ------------------
  |  Branch (78:6): [True: 287k, False: 0]
  |  Branch (78:12): [True: 277k, False: 9.65k]
  ------------------
   79|       |    /* both pointers point to something then compare them */
   80|   277k|    return casecompare(s1, s2);
   81|       |
   82|       |  /* if both pointers are NULL then treat them as equal */
   83|  9.65k|  return NULL == s1 && NULL == s2;
  ------------------
  |  Branch (83:10): [True: 0, False: 9.65k]
  |  Branch (83:24): [True: 0, False: 0]
  ------------------
   84|   287k|}
curl_strnequal:
   88|   285k|{
   89|   285k|  if(s1 && s2)
  ------------------
  |  Branch (89:6): [True: 285k, False: 0]
  |  Branch (89:12): [True: 285k, False: 0]
  ------------------
   90|       |    /* both pointers point to something then compare them */
   91|   285k|    return ncasecompare(s1, s2, n);
   92|       |
   93|       |  /* if both pointers are NULL then treat them as equal if max is non-zero */
   94|      0|  return NULL == s1 && NULL == s2 && n;
  ------------------
  |  Branch (94:10): [True: 0, False: 0]
  |  Branch (94:24): [True: 0, False: 0]
  |  Branch (94:38): [True: 0, False: 0]
  ------------------
   95|   285k|}
strequal.c:casecompare:
   36|   277k|{
   37|   603k|  while(*first) {
  ------------------
  |  Branch (37:9): [True: 535k, False: 67.8k]
  ------------------
   38|   535k|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (38:8): [True: 209k, False: 325k]
  ------------------
   39|       |      /* get out of the loop as soon as they do not match */
   40|   209k|      return 0;
   41|   325k|    first++;
   42|   325k|    second++;
   43|   325k|  }
   44|       |  /* If we are here either the strings are the same or the length is different.
   45|       |     We can test if the "current" character is non-zero for one and zero
   46|       |     for the other. Note that the characters may not be exactly the same even
   47|       |     if they match, we only want to compare zero-ness. */
   48|  67.8k|  return !*first == !*second;
   49|   277k|}
strequal.c:ncasecompare:
   52|   285k|{
   53|   573k|  while(*first && max) {
  ------------------
  |  Branch (53:9): [True: 521k, False: 51.9k]
  |  Branch (53:19): [True: 498k, False: 22.8k]
  ------------------
   54|   498k|    if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second))
  ------------------
  |  Branch (54:8): [True: 211k, False: 287k]
  ------------------
   55|   211k|      return 0;
   56|   287k|    max--;
   57|   287k|    first++;
   58|   287k|    second++;
   59|   287k|  }
   60|  74.7k|  if(max == 0)
  ------------------
  |  Branch (60:6): [True: 54.5k, False: 20.2k]
  ------------------
   61|  54.5k|    return 1; /* they are equal this far */
   62|       |
   63|  20.2k|  return Curl_raw_toupper(*first) == Curl_raw_toupper(*second);
   64|  74.7k|}

curl_easy_strerror:
   35|     38|{
   36|     38|#ifdef CURLVERBOSE
   37|     38|  switch(error) {
   38|      0|  case CURLE_OK:
  ------------------
  |  Branch (38:3): [True: 0, False: 38]
  ------------------
   39|      0|    return "No error";
   40|       |
   41|      0|  case CURLE_UNSUPPORTED_PROTOCOL:
  ------------------
  |  Branch (41:3): [True: 0, False: 38]
  ------------------
   42|      0|    return "Unsupported protocol";
   43|       |
   44|      0|  case CURLE_FAILED_INIT:
  ------------------
  |  Branch (44:3): [True: 0, False: 38]
  ------------------
   45|      0|    return "Failed initialization";
   46|       |
   47|      0|  case CURLE_URL_MALFORMAT:
  ------------------
  |  Branch (47:3): [True: 0, False: 38]
  ------------------
   48|      0|    return "URL using bad/illegal format or missing URL";
   49|       |
   50|      0|  case CURLE_NOT_BUILT_IN:
  ------------------
  |  Branch (50:3): [True: 0, False: 38]
  ------------------
   51|      0|    return "A requested feature, protocol or option was not found built-in in"
   52|      0|           " this libcurl due to a build-time decision.";
   53|       |
   54|      0|  case CURLE_COULDNT_RESOLVE_PROXY:
  ------------------
  |  Branch (54:3): [True: 0, False: 38]
  ------------------
   55|      0|    return "Could not resolve proxy name";
   56|       |
   57|      0|  case CURLE_COULDNT_RESOLVE_HOST:
  ------------------
  |  Branch (57:3): [True: 0, False: 38]
  ------------------
   58|      0|    return "Could not resolve hostname";
   59|       |
   60|      6|  case CURLE_COULDNT_CONNECT:
  ------------------
  |  Branch (60:3): [True: 6, False: 32]
  ------------------
   61|      6|    return "Could not connect to server";
   62|       |
   63|      0|  case CURLE_WEIRD_SERVER_REPLY:
  ------------------
  |  Branch (63:3): [True: 0, False: 38]
  ------------------
   64|      0|    return "Weird server reply";
   65|       |
   66|      0|  case CURLE_REMOTE_ACCESS_DENIED:
  ------------------
  |  Branch (66:3): [True: 0, False: 38]
  ------------------
   67|      0|    return "Access denied to remote resource";
   68|       |
   69|      0|  case CURLE_FTP_ACCEPT_FAILED:
  ------------------
  |  Branch (69:3): [True: 0, False: 38]
  ------------------
   70|      0|    return "FTP: The server failed to connect to data port";
   71|       |
   72|      0|  case CURLE_FTP_ACCEPT_TIMEOUT:
  ------------------
  |  Branch (72:3): [True: 0, False: 38]
  ------------------
   73|      0|    return "FTP: Accepting server connect has timed out";
   74|       |
   75|      0|  case CURLE_FTP_PRET_FAILED:
  ------------------
  |  Branch (75:3): [True: 0, False: 38]
  ------------------
   76|      0|    return "FTP: The server did not accept the PRET command.";
   77|       |
   78|      0|  case CURLE_FTP_WEIRD_PASS_REPLY:
  ------------------
  |  Branch (78:3): [True: 0, False: 38]
  ------------------
   79|      0|    return "FTP: unknown PASS reply";
   80|       |
   81|      0|  case CURLE_FTP_WEIRD_PASV_REPLY:
  ------------------
  |  Branch (81:3): [True: 0, False: 38]
  ------------------
   82|      0|    return "FTP: unknown PASV reply";
   83|       |
   84|      0|  case CURLE_FTP_WEIRD_227_FORMAT:
  ------------------
  |  Branch (84:3): [True: 0, False: 38]
  ------------------
   85|      0|    return "FTP: unknown 227 response format";
   86|       |
   87|      0|  case CURLE_FTP_CANT_GET_HOST:
  ------------------
  |  Branch (87:3): [True: 0, False: 38]
  ------------------
   88|      0|    return "FTP: cannot figure out the host in the PASV response";
   89|       |
   90|      0|  case CURLE_HTTP2:
  ------------------
  |  Branch (90:3): [True: 0, False: 38]
  ------------------
   91|      0|    return "Error in the HTTP2 framing layer";
   92|       |
   93|      0|  case CURLE_FTP_COULDNT_SET_TYPE:
  ------------------
  |  Branch (93:3): [True: 0, False: 38]
  ------------------
   94|      0|    return "FTP: could not set file type";
   95|       |
   96|      0|  case CURLE_PARTIAL_FILE:
  ------------------
  |  Branch (96:3): [True: 0, False: 38]
  ------------------
   97|      0|    return "Transferred a partial file";
   98|       |
   99|      0|  case CURLE_FTP_COULDNT_RETR_FILE:
  ------------------
  |  Branch (99:3): [True: 0, False: 38]
  ------------------
  100|      0|    return "FTP: could not retrieve (RETR failed) the specified file";
  101|       |
  102|      0|  case CURLE_QUOTE_ERROR:
  ------------------
  |  Branch (102:3): [True: 0, False: 38]
  ------------------
  103|      0|    return "Quote command returned error";
  104|       |
  105|      0|  case CURLE_HTTP_RETURNED_ERROR:
  ------------------
  |  Branch (105:3): [True: 0, False: 38]
  ------------------
  106|      0|    return "HTTP response code said error";
  107|       |
  108|      0|  case CURLE_WRITE_ERROR:
  ------------------
  |  Branch (108:3): [True: 0, False: 38]
  ------------------
  109|      0|    return "Failed writing received data to disk/application";
  110|       |
  111|      0|  case CURLE_UPLOAD_FAILED:
  ------------------
  |  Branch (111:3): [True: 0, False: 38]
  ------------------
  112|      0|    return "Upload failed (at start/before it took off)";
  113|       |
  114|      0|  case CURLE_READ_ERROR:
  ------------------
  |  Branch (114:3): [True: 0, False: 38]
  ------------------
  115|      0|    return "Failed to open/read local data from file/application";
  116|       |
  117|     18|  case CURLE_OUT_OF_MEMORY:
  ------------------
  |  Branch (117:3): [True: 18, False: 20]
  ------------------
  118|     18|    return "Out of memory";
  119|       |
  120|      0|  case CURLE_OPERATION_TIMEDOUT:
  ------------------
  |  Branch (120:3): [True: 0, False: 38]
  ------------------
  121|      0|    return "Timeout was reached";
  122|       |
  123|      0|  case CURLE_FTP_PORT_FAILED:
  ------------------
  |  Branch (123:3): [True: 0, False: 38]
  ------------------
  124|      0|    return "FTP: command PORT failed";
  125|       |
  126|      0|  case CURLE_FTP_COULDNT_USE_REST:
  ------------------
  |  Branch (126:3): [True: 0, False: 38]
  ------------------
  127|      0|    return "FTP: command REST failed";
  128|       |
  129|      0|  case CURLE_RANGE_ERROR:
  ------------------
  |  Branch (129:3): [True: 0, False: 38]
  ------------------
  130|      0|    return "Requested range was not delivered by the server";
  131|       |
  132|      0|  case CURLE_SSL_CONNECT_ERROR:
  ------------------
  |  Branch (132:3): [True: 0, False: 38]
  ------------------
  133|      0|    return "SSL connect error";
  134|       |
  135|      0|  case CURLE_BAD_DOWNLOAD_RESUME:
  ------------------
  |  Branch (135:3): [True: 0, False: 38]
  ------------------
  136|      0|    return "Could not resume download";
  137|       |
  138|      0|  case CURLE_FILE_COULDNT_READ_FILE:
  ------------------
  |  Branch (138:3): [True: 0, False: 38]
  ------------------
  139|      0|    return "Could not read a file:// file";
  140|       |
  141|      0|  case CURLE_LDAP_CANNOT_BIND:
  ------------------
  |  Branch (141:3): [True: 0, False: 38]
  ------------------
  142|      0|    return "LDAP: cannot bind";
  143|       |
  144|      0|  case CURLE_LDAP_SEARCH_FAILED:
  ------------------
  |  Branch (144:3): [True: 0, False: 38]
  ------------------
  145|      0|    return "LDAP: search failed";
  146|       |
  147|      0|  case CURLE_ABORTED_BY_CALLBACK:
  ------------------
  |  Branch (147:3): [True: 0, False: 38]
  ------------------
  148|      0|    return "Operation was aborted by an application callback";
  149|       |
  150|      0|  case CURLE_BAD_FUNCTION_ARGUMENT:
  ------------------
  |  Branch (150:3): [True: 0, False: 38]
  ------------------
  151|      0|    return "A libcurl function was given a bad argument";
  152|       |
  153|      0|  case CURLE_INTERFACE_FAILED:
  ------------------
  |  Branch (153:3): [True: 0, False: 38]
  ------------------
  154|      0|    return "Failed binding local connection end";
  155|       |
  156|      0|  case CURLE_TOO_MANY_REDIRECTS:
  ------------------
  |  Branch (156:3): [True: 0, False: 38]
  ------------------
  157|      0|    return "Number of redirects hit maximum amount";
  158|       |
  159|      0|  case CURLE_UNKNOWN_OPTION:
  ------------------
  |  Branch (159:3): [True: 0, False: 38]
  ------------------
  160|      0|    return "An unknown option was passed in to libcurl";
  161|       |
  162|      0|  case CURLE_SETOPT_OPTION_SYNTAX:
  ------------------
  |  Branch (162:3): [True: 0, False: 38]
  ------------------
  163|      0|    return "Malformed option provided in a setopt";
  164|       |
  165|      0|  case CURLE_GOT_NOTHING:
  ------------------
  |  Branch (165:3): [True: 0, False: 38]
  ------------------
  166|      0|    return "Server returned nothing (no headers, no data)";
  167|       |
  168|      0|  case CURLE_SSL_ENGINE_NOTFOUND:
  ------------------
  |  Branch (168:3): [True: 0, False: 38]
  ------------------
  169|      0|    return "SSL crypto engine not found";
  170|       |
  171|      0|  case CURLE_SSL_ENGINE_SETFAILED:
  ------------------
  |  Branch (171:3): [True: 0, False: 38]
  ------------------
  172|      0|    return "Can not set SSL crypto engine as default";
  173|       |
  174|      0|  case CURLE_SSL_ENGINE_INITFAILED:
  ------------------
  |  Branch (174:3): [True: 0, False: 38]
  ------------------
  175|      0|    return "Failed to initialize SSL crypto engine";
  176|       |
  177|      1|  case CURLE_SEND_ERROR:
  ------------------
  |  Branch (177:3): [True: 1, False: 37]
  ------------------
  178|      1|    return "Failed sending data to the peer";
  179|       |
  180|      2|  case CURLE_RECV_ERROR:
  ------------------
  |  Branch (180:3): [True: 2, False: 36]
  ------------------
  181|      2|    return "Failure when receiving data from the peer";
  182|       |
  183|      0|  case CURLE_SSL_CERTPROBLEM:
  ------------------
  |  Branch (183:3): [True: 0, False: 38]
  ------------------
  184|      0|    return "Problem with the local SSL certificate";
  185|       |
  186|      0|  case CURLE_SSL_CIPHER:
  ------------------
  |  Branch (186:3): [True: 0, False: 38]
  ------------------
  187|      0|    return "Could not use specified SSL cipher";
  188|       |
  189|      7|  case CURLE_PEER_FAILED_VERIFICATION:
  ------------------
  |  Branch (189:3): [True: 7, False: 31]
  ------------------
  190|      7|    return "SSL peer certificate or SSH remote key was not OK";
  191|       |
  192|      0|  case CURLE_SSL_CACERT_BADFILE:
  ------------------
  |  Branch (192:3): [True: 0, False: 38]
  ------------------
  193|      0|    return "Problem with the SSL CA cert (path? access rights?)";
  194|       |
  195|      0|  case CURLE_BAD_CONTENT_ENCODING:
  ------------------
  |  Branch (195:3): [True: 0, False: 38]
  ------------------
  196|      0|    return "Unrecognized or bad HTTP Content or Transfer-Encoding";
  197|       |
  198|      0|  case CURLE_FILESIZE_EXCEEDED:
  ------------------
  |  Branch (198:3): [True: 0, False: 38]
  ------------------
  199|      0|    return "Maximum file size exceeded";
  200|       |
  201|      0|  case CURLE_USE_SSL_FAILED:
  ------------------
  |  Branch (201:3): [True: 0, False: 38]
  ------------------
  202|      0|    return "Requested SSL level failed";
  203|       |
  204|      0|  case CURLE_SSL_SHUTDOWN_FAILED:
  ------------------
  |  Branch (204:3): [True: 0, False: 38]
  ------------------
  205|      0|    return "Failed to shut down the SSL connection";
  206|       |
  207|      0|  case CURLE_SSL_CRL_BADFILE:
  ------------------
  |  Branch (207:3): [True: 0, False: 38]
  ------------------
  208|      0|    return "Failed to load CRL file (path? access rights?, format?)";
  209|       |
  210|      0|  case CURLE_SSL_ISSUER_ERROR:
  ------------------
  |  Branch (210:3): [True: 0, False: 38]
  ------------------
  211|      0|    return "Issuer check against peer certificate failed";
  212|       |
  213|      0|  case CURLE_SEND_FAIL_REWIND:
  ------------------
  |  Branch (213:3): [True: 0, False: 38]
  ------------------
  214|      0|    return "Send failed since rewinding of the data stream failed";
  215|       |
  216|      0|  case CURLE_LOGIN_DENIED:
  ------------------
  |  Branch (216:3): [True: 0, False: 38]
  ------------------
  217|      0|    return "Login denied";
  218|       |
  219|      0|  case CURLE_TFTP_NOTFOUND:
  ------------------
  |  Branch (219:3): [True: 0, False: 38]
  ------------------
  220|      0|    return "TFTP: File Not Found";
  221|       |
  222|      0|  case CURLE_TFTP_PERM:
  ------------------
  |  Branch (222:3): [True: 0, False: 38]
  ------------------
  223|      0|    return "TFTP: Access Violation";
  224|       |
  225|      0|  case CURLE_REMOTE_DISK_FULL:
  ------------------
  |  Branch (225:3): [True: 0, False: 38]
  ------------------
  226|      0|    return "Disk full or allocation exceeded";
  227|       |
  228|      0|  case CURLE_TFTP_ILLEGAL:
  ------------------
  |  Branch (228:3): [True: 0, False: 38]
  ------------------
  229|      0|    return "TFTP: Illegal operation";
  230|       |
  231|      0|  case CURLE_TFTP_UNKNOWNID:
  ------------------
  |  Branch (231:3): [True: 0, False: 38]
  ------------------
  232|      0|    return "TFTP: Unknown transfer ID";
  233|       |
  234|      0|  case CURLE_REMOTE_FILE_EXISTS:
  ------------------
  |  Branch (234:3): [True: 0, False: 38]
  ------------------
  235|      0|    return "Remote file already exists";
  236|       |
  237|      0|  case CURLE_TFTP_NOSUCHUSER:
  ------------------
  |  Branch (237:3): [True: 0, False: 38]
  ------------------
  238|      0|    return "TFTP: No such user";
  239|       |
  240|      0|  case CURLE_REMOTE_FILE_NOT_FOUND:
  ------------------
  |  Branch (240:3): [True: 0, False: 38]
  ------------------
  241|      0|    return "Remote file not found";
  242|       |
  243|      0|  case CURLE_SSH:
  ------------------
  |  Branch (243:3): [True: 0, False: 38]
  ------------------
  244|      0|    return "Error in the SSH layer";
  245|       |
  246|      0|  case CURLE_AGAIN:
  ------------------
  |  Branch (246:3): [True: 0, False: 38]
  ------------------
  247|      0|    return "Socket not ready for send/recv";
  248|       |
  249|      0|  case CURLE_RTSP_CSEQ_ERROR:
  ------------------
  |  Branch (249:3): [True: 0, False: 38]
  ------------------
  250|      0|    return "RTSP CSeq mismatch or invalid CSeq";
  251|       |
  252|      0|  case CURLE_RTSP_SESSION_ERROR:
  ------------------
  |  Branch (252:3): [True: 0, False: 38]
  ------------------
  253|      0|    return "RTSP session error";
  254|       |
  255|      0|  case CURLE_FTP_BAD_FILE_LIST:
  ------------------
  |  Branch (255:3): [True: 0, False: 38]
  ------------------
  256|      0|    return "Unable to parse FTP file list";
  257|       |
  258|      0|  case CURLE_CHUNK_FAILED:
  ------------------
  |  Branch (258:3): [True: 0, False: 38]
  ------------------
  259|      0|    return "Chunk callback failed";
  260|       |
  261|      0|  case CURLE_NO_CONNECTION_AVAILABLE:
  ------------------
  |  Branch (261:3): [True: 0, False: 38]
  ------------------
  262|      0|    return "The max connection limit is reached";
  263|       |
  264|      0|  case CURLE_SSL_PINNEDPUBKEYNOTMATCH:
  ------------------
  |  Branch (264:3): [True: 0, False: 38]
  ------------------
  265|      0|    return "SSL public key does not match pinned public key";
  266|       |
  267|      0|  case CURLE_SSL_INVALIDCERTSTATUS:
  ------------------
  |  Branch (267:3): [True: 0, False: 38]
  ------------------
  268|      0|    return "SSL server certificate status verification FAILED";
  269|       |
  270|      0|  case CURLE_HTTP2_STREAM:
  ------------------
  |  Branch (270:3): [True: 0, False: 38]
  ------------------
  271|      0|    return "Stream error in the HTTP/2 framing layer";
  272|       |
  273|      0|  case CURLE_RECURSIVE_API_CALL:
  ------------------
  |  Branch (273:3): [True: 0, False: 38]
  ------------------
  274|      0|    return "API function called from within callback";
  275|       |
  276|      0|  case CURLE_AUTH_ERROR:
  ------------------
  |  Branch (276:3): [True: 0, False: 38]
  ------------------
  277|      0|    return "An authentication function returned an error";
  278|       |
  279|      0|  case CURLE_HTTP3:
  ------------------
  |  Branch (279:3): [True: 0, False: 38]
  ------------------
  280|      0|    return "HTTP/3 error";
  281|       |
  282|      4|  case CURLE_QUIC_CONNECT_ERROR:
  ------------------
  |  Branch (282:3): [True: 4, False: 34]
  ------------------
  283|      4|    return "QUIC connection error";
  284|       |
  285|      0|  case CURLE_PROXY:
  ------------------
  |  Branch (285:3): [True: 0, False: 38]
  ------------------
  286|      0|    return "proxy handshake error";
  287|       |
  288|      0|  case CURLE_SSL_CLIENTCERT:
  ------------------
  |  Branch (288:3): [True: 0, False: 38]
  ------------------
  289|      0|    return "SSL Client Certificate required";
  290|       |
  291|      0|  case CURLE_UNRECOVERABLE_POLL:
  ------------------
  |  Branch (291:3): [True: 0, False: 38]
  ------------------
  292|      0|    return "Unrecoverable error in select/poll";
  293|       |
  294|      0|  case CURLE_TOO_LARGE:
  ------------------
  |  Branch (294:3): [True: 0, False: 38]
  ------------------
  295|      0|    return "A value or data field grew larger than allowed";
  296|       |
  297|      0|  case CURLE_ECH_REQUIRED:
  ------------------
  |  Branch (297:3): [True: 0, False: 38]
  ------------------
  298|      0|    return "ECH attempted but failed";
  299|       |
  300|       |    /* error codes not used by current libcurl */
  301|      0|  default:
  ------------------
  |  Branch (301:3): [True: 0, False: 38]
  ------------------
  302|      0|    break;
  303|     38|  }
  304|       |  /*
  305|       |   * By using a switch, gcc -Wall will complain about enum values
  306|       |   * which do not appear, helping keep this function up-to-date.
  307|       |   * By using gcc -Wall -Werror, you cannot forget.
  308|       |   *
  309|       |   * A table would not have the same benefit. Most compilers will generate
  310|       |   * code similar to a table in any case, so there is little performance gain
  311|       |   * from a table. Something is broken for the user's application, anyways, so
  312|       |   * does it matter how fast it _does not_ work?
  313|       |   *
  314|       |   * The line number for the error will be near this comment, which is why it
  315|       |   * is here, and not at the start of the switch.
  316|       |   */
  317|      0|  return "Unknown error";
  318|       |#else
  319|       |  if(!error)
  320|       |    return "No error";
  321|       |  else
  322|       |    return "Error";
  323|       |#endif
  324|     38|}
curl_url_strerror:
  421|    188|{
  422|    188|#ifdef CURLVERBOSE
  423|    188|  switch(error) {
  ------------------
  |  Branch (423:10): [True: 188, False: 0]
  ------------------
  424|      0|  case CURLUE_OK:
  ------------------
  |  Branch (424:3): [True: 0, False: 188]
  ------------------
  425|      0|    return "No error";
  426|       |
  427|      0|  case CURLUE_BAD_HANDLE:
  ------------------
  |  Branch (427:3): [True: 0, False: 188]
  ------------------
  428|      0|    return "An invalid CURLU pointer was passed as argument";
  429|       |
  430|      0|  case CURLUE_BAD_PARTPOINTER:
  ------------------
  |  Branch (430:3): [True: 0, False: 188]
  ------------------
  431|      0|    return "An invalid 'part' argument was passed as argument";
  432|       |
  433|      0|  case CURLUE_MALFORMED_INPUT:
  ------------------
  |  Branch (433:3): [True: 0, False: 188]
  ------------------
  434|      0|    return "Malformed input to a URL function";
  435|       |
  436|      0|  case CURLUE_BAD_PORT_NUMBER:
  ------------------
  |  Branch (436:3): [True: 0, False: 188]
  ------------------
  437|      0|    return "Port number was not a decimal number between 0 and 65535";
  438|       |
  439|      0|  case CURLUE_UNSUPPORTED_SCHEME:
  ------------------
  |  Branch (439:3): [True: 0, False: 188]
  ------------------
  440|      0|    return "Unsupported URL scheme";
  441|       |
  442|      0|  case CURLUE_URLDECODE:
  ------------------
  |  Branch (442:3): [True: 0, False: 188]
  ------------------
  443|      0|    return "URL decode error, most likely because of rubbish in the input";
  444|       |
  445|     25|  case CURLUE_OUT_OF_MEMORY:
  ------------------
  |  Branch (445:3): [True: 25, False: 163]
  ------------------
  446|     25|    return "A memory function failed";
  447|       |
  448|      0|  case CURLUE_USER_NOT_ALLOWED:
  ------------------
  |  Branch (448:3): [True: 0, False: 188]
  ------------------
  449|      0|    return "Credentials was passed in the URL when prohibited";
  450|       |
  451|      0|  case CURLUE_UNKNOWN_PART:
  ------------------
  |  Branch (451:3): [True: 0, False: 188]
  ------------------
  452|      0|    return "An unknown part ID was passed to a URL API function";
  453|       |
  454|      0|  case CURLUE_NO_SCHEME:
  ------------------
  |  Branch (454:3): [True: 0, False: 188]
  ------------------
  455|      0|    return "No scheme present";
  456|       |
  457|      0|  case CURLUE_NO_USER:
  ------------------
  |  Branch (457:3): [True: 0, False: 188]
  ------------------
  458|      0|    return "No user present";
  459|       |
  460|      0|  case CURLUE_NO_PASSWORD:
  ------------------
  |  Branch (460:3): [True: 0, False: 188]
  ------------------
  461|      0|    return "No password present";
  462|       |
  463|      0|  case CURLUE_NO_OPTIONS:
  ------------------
  |  Branch (463:3): [True: 0, False: 188]
  ------------------
  464|      0|    return "No options present";
  465|       |
  466|      0|  case CURLUE_NO_HOST:
  ------------------
  |  Branch (466:3): [True: 0, False: 188]
  ------------------
  467|      0|    return "No host present";
  468|       |
  469|      0|  case CURLUE_NO_PORT:
  ------------------
  |  Branch (469:3): [True: 0, False: 188]
  ------------------
  470|      0|    return "No port number present";
  471|       |
  472|      0|  case CURLUE_NO_QUERY:
  ------------------
  |  Branch (472:3): [True: 0, False: 188]
  ------------------
  473|      0|    return "No query present";
  474|       |
  475|      0|  case CURLUE_NO_FRAGMENT:
  ------------------
  |  Branch (475:3): [True: 0, False: 188]
  ------------------
  476|      0|    return "No fragment present";
  477|       |
  478|      0|  case CURLUE_NO_ZONEID:
  ------------------
  |  Branch (478:3): [True: 0, False: 188]
  ------------------
  479|      0|    return "No zoneid present";
  480|       |
  481|      0|  case CURLUE_BAD_LOGIN:
  ------------------
  |  Branch (481:3): [True: 0, False: 188]
  ------------------
  482|      0|    return "Bad login";
  483|       |
  484|      0|  case CURLUE_BAD_IPV6:
  ------------------
  |  Branch (484:3): [True: 0, False: 188]
  ------------------
  485|      0|    return "Bad IPv6 address";
  486|       |
  487|      0|  case CURLUE_BAD_HOSTNAME:
  ------------------
  |  Branch (487:3): [True: 0, False: 188]
  ------------------
  488|      0|    return "Bad hostname";
  489|       |
  490|      0|  case CURLUE_BAD_FILE_URL:
  ------------------
  |  Branch (490:3): [True: 0, False: 188]
  ------------------
  491|      0|    return "Bad file:// URL";
  492|       |
  493|      0|  case CURLUE_BAD_SLASHES:
  ------------------
  |  Branch (493:3): [True: 0, False: 188]
  ------------------
  494|      0|    return "Unsupported number of slashes following scheme";
  495|       |
  496|      0|  case CURLUE_BAD_SCHEME:
  ------------------
  |  Branch (496:3): [True: 0, False: 188]
  ------------------
  497|      0|    return "Bad scheme";
  498|       |
  499|     93|  case CURLUE_BAD_PATH:
  ------------------
  |  Branch (499:3): [True: 93, False: 95]
  ------------------
  500|     93|    return "Bad path";
  501|       |
  502|     30|  case CURLUE_BAD_FRAGMENT:
  ------------------
  |  Branch (502:3): [True: 30, False: 158]
  ------------------
  503|     30|    return "Bad fragment";
  504|       |
  505|     40|  case CURLUE_BAD_QUERY:
  ------------------
  |  Branch (505:3): [True: 40, False: 148]
  ------------------
  506|     40|    return "Bad query";
  507|       |
  508|      0|  case CURLUE_BAD_PASSWORD:
  ------------------
  |  Branch (508:3): [True: 0, False: 188]
  ------------------
  509|      0|    return "Bad password";
  510|       |
  511|      0|  case CURLUE_BAD_USER:
  ------------------
  |  Branch (511:3): [True: 0, False: 188]
  ------------------
  512|      0|    return "Bad user";
  513|       |
  514|      0|  case CURLUE_LACKS_IDN:
  ------------------
  |  Branch (514:3): [True: 0, False: 188]
  ------------------
  515|      0|    return "libcurl lacks IDN support";
  516|       |
  517|      0|  case CURLUE_TOO_LARGE:
  ------------------
  |  Branch (517:3): [True: 0, False: 188]
  ------------------
  518|      0|    return "A value or data field is larger than allowed";
  519|       |
  520|      0|  case CURLUE_BACKSLASH:
  ------------------
  |  Branch (520:3): [True: 0, False: 188]
  ------------------
  521|      0|    return "Found a backslash where a forward slash was expected";
  522|       |
  523|      0|  case CURLUE_LAST:
  ------------------
  |  Branch (523:3): [True: 0, False: 188]
  ------------------
  524|      0|    break;
  525|    188|  }
  526|       |
  527|      0|  return "CURLUcode unknown";
  528|       |#else
  529|       |  if(error == CURLUE_OK)
  530|       |    return "No error";
  531|       |  else
  532|       |    return "Error";
  533|       |#endif
  534|    188|}

Curl_thrdpool_set_props:
  282|  9.76k|{
  283|  9.76k|  CURLcode result = CURLE_OK;
  284|  9.76k|  size_t running;
  285|       |
  286|  9.76k|  if(!max_threads || (min_threads > max_threads))
  ------------------
  |  Branch (286:6): [True: 0, False: 9.76k]
  |  Branch (286:22): [True: 0, False: 9.76k]
  ------------------
  287|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  288|       |
  289|  9.76k|  Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   51|  9.76k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  290|  9.76k|  tpool->min_threads = min_threads;
  291|  9.76k|  tpool->max_threads = max_threads;
  292|  9.76k|  tpool->idle_time_ms = idle_time_ms;
  293|  9.76k|  running = Curl_llist_count(&tpool->slots);
  294|  9.76k|  if(tpool->min_threads > running) {
  ------------------
  |  Branch (294:6): [True: 0, False: 9.76k]
  ------------------
  295|      0|    result = thrdpool_signal(tpool, tpool->min_threads - (uint32_t)running);
  296|      0|  }
  297|  9.76k|  Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|  9.76k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  298|       |
  299|  9.76k|  return result;
  300|  9.76k|}
Curl_thrdpool_create:
  311|  9.77k|{
  312|  9.77k|  struct curl_thrdpool *tpool;
  313|  9.77k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  314|  9.77k|  DEBUGASSERT(name);
  ------------------
  |  | 1016|  9.77k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (314:3): [True: 0, False: 9.77k]
  |  Branch (314:3): [True: 9.77k, False: 0]
  ------------------
  315|       |
  316|  9.77k|  tpool = curlx_calloc(1, sizeof(*tpool));
  ------------------
  |  | 1500|  9.77k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  317|  9.77k|  if(!tpool)
  ------------------
  |  Branch (317:6): [True: 15, False: 9.76k]
  ------------------
  318|     15|    goto out;
  319|  9.76k|  tpool->refcount = 1;
  320|       |
  321|  9.76k|  Curl_mutex_init(&tpool->lock);
  ------------------
  |  |   50|  9.76k|#  define Curl_mutex_init(m)     pthread_mutex_init(m, NULL)
  ------------------
  322|  9.76k|  Curl_cond_init(&tpool->await);
  ------------------
  |  |   55|  9.76k|#  define Curl_cond_init(c)      pthread_cond_init(c, NULL)
  ------------------
  323|  9.76k|  Curl_llist_init(&tpool->slots, NULL);
  324|  9.76k|  Curl_llist_init(&tpool->zombies, NULL);
  325|  9.76k|  tpool->fn_take = fn_take;
  326|  9.76k|  tpool->fn_process = fn_process;
  327|  9.76k|  tpool->fn_return = fn_return;
  328|  9.76k|  tpool->fn_user_data = user_data;
  329|       |
  330|       |  /* a const string that remains */
  331|  9.76k|  tpool->name = name;
  332|       |
  333|  9.76k|#ifdef DEBUGBUILD
  334|  9.76k|  {
  335|  9.76k|    const char *p = getenv("CURL_DBG_THRDPOOL_FAIL_STARTS");
  336|  9.76k|    if(p) {
  ------------------
  |  Branch (336:8): [True: 0, False: 9.76k]
  ------------------
  337|      0|      curl_off_t l;
  338|      0|      if(!curlx_str_number(&p, &l, INT_MAX))
  ------------------
  |  Branch (338:10): [True: 0, False: 0]
  ------------------
  339|      0|        tpool->dbg_fail_starts = (int)l;
  340|      0|    }
  341|  9.76k|  }
  342|  9.76k|#endif
  343|       |
  344|  9.76k|  result = Curl_thrdpool_set_props(tpool, min_threads, max_threads,
  345|  9.76k|                                   idle_time_ms);
  346|       |
  347|  9.77k|out:
  348|  9.77k|  if(result && tpool) {
  ------------------
  |  Branch (348:6): [True: 15, False: 9.76k]
  |  Branch (348:16): [True: 0, False: 15]
  ------------------
  349|      0|    Curl_thrdpool_destroy(tpool, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  350|       |    tpool = NULL;
  351|      0|  }
  352|  9.77k|  *ptpool = tpool;
  353|  9.77k|  return result;
  354|  9.76k|}
Curl_thrdpool_destroy:
  357|  9.76k|{
  358|  9.76k|  Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   51|  9.76k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  359|       |
  360|  9.76k|  tpool->aborted = TRUE;
  ------------------
  |  |  986|  9.76k|#define TRUE true
  ------------------
  361|       |
  362|  9.91k|  while(join && Curl_llist_count(&tpool->slots)) {
  ------------------
  |  Branch (362:9): [True: 9.91k, False: 0]
  |  Branch (362:17): [True: 153, False: 9.76k]
  ------------------
  363|    153|    thrdpool_wake_all(tpool);
  364|    153|    Curl_cond_wait(&tpool->await, &tpool->lock);
  365|    153|  }
  366|       |
  367|  9.76k|  thrdpool_join_zombies(tpool);
  368|       |
  369|       |  /* detach all still running threads */
  370|  9.76k|  if(Curl_llist_count(&tpool->slots)) {
  ------------------
  |  Branch (370:6): [True: 0, False: 9.76k]
  ------------------
  371|      0|    struct Curl_llist_node *e;
  372|      0|    for(e = Curl_llist_head(&tpool->slots); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (372:45): [True: 0, False: 0]
  ------------------
  373|      0|      struct thrdslot *tslot = Curl_node_elem(e);
  374|      0|      if(tslot->thread != curl_thread_t_null)
  ------------------
  |  |   49|      0|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  |  Branch (374:10): [True: 0, False: 0]
  ------------------
  375|      0|        Curl_thread_destroy(&tslot->thread);
  376|      0|    }
  377|      0|    tpool->detached = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  378|      0|  }
  379|       |
  380|  9.76k|  if(!thrdpool_unlink(tpool, TRUE)) {
  ------------------
  |  |  986|  9.76k|#define TRUE true
  ------------------
  |  Branch (380:6): [True: 0, False: 9.76k]
  ------------------
  381|       |    /* tpool not destroyed */
  382|      0|    Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|      0|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  383|      0|  }
  384|  9.76k|}
Curl_thrdpool_signal:
  387|    465|{
  388|    465|  CURLcode result;
  389|       |
  390|    465|  Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   51|    465|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  391|    465|  result = thrdpool_signal(tpool, nthreads);
  392|    465|  Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|    465|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  393|    465|  return result;
  394|    465|}
Curl_thrdpool_trace:
  459|    134|{
  460|    134|  struct curl_trc_feat *feat = &Curl_trc_feat_threads;
  461|    134|  if(Curl_trc_ft_is_verbose(data, feat)) {
  ------------------
  |  |  329|    134|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  322|    268|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 134, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 134, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    268|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 134, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    134|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  330|    134|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|    134|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (330:4): [True: 134, False: 0]
  |  |  ------------------
  ------------------
  462|    134|    struct Curl_llist_node *e;
  463|    134|    struct curltime now = curlx_now();
  464|       |
  465|    134|    Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   51|    134|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  466|    134|    if(!Curl_llist_count(&tpool->slots)) {
  ------------------
  |  Branch (466:8): [True: 120, False: 14]
  ------------------
  467|    120|      Curl_trc_feat_infof(data, feat, "[TPOOL-%s] no threads running",
  468|    120|                          tpool->name);
  469|    120|    }
  470|    161|    for(e = Curl_llist_head(&tpool->slots); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (470:45): [True: 27, False: 134]
  ------------------
  471|     27|      struct thrdslot *tslot = Curl_node_elem(e);
  472|     27|      timediff_t elapsed_ms = curlx_ptimediff_ms(&now, &tslot->starttime);
  473|     27|      if(!tslot->running) {
  ------------------
  |  Branch (473:10): [True: 0, False: 27]
  ------------------
  474|      0|        Curl_trc_feat_infof(data, feat, "[TPOOL-%s] [%u]: not running",
  475|      0|                            tpool->name, tslot->id);
  476|      0|      }
  477|     27|      else if(!tslot->starttime.tv_sec && !tslot->starttime.tv_usec) {
  ------------------
  |  Branch (477:15): [True: 19, False: 8]
  |  Branch (477:43): [True: 19, False: 0]
  ------------------
  478|     19|        Curl_trc_feat_infof(data, feat, "[TPOOL-%s] [%u]: starting...",
  479|     19|                            tpool->name, tslot->id);
  480|     19|      }
  481|      8|      else if(tslot->idle) {
  ------------------
  |  Branch (481:15): [True: 8, False: 0]
  ------------------
  482|      8|        Curl_trc_feat_infof(data, feat, "[TPOOL-%s] [%u]: idle for %"
  483|      8|                            FMT_TIMEDIFF_T "ms",
  484|      8|                            tpool->name, tslot->id, elapsed_ms);
  485|      8|      }
  486|      0|      else {
  487|      0|        timediff_t remain_ms = tslot->work_timeout_ms ?
  ------------------
  |  Branch (487:32): [True: 0, False: 0]
  ------------------
  488|      0|          (tslot->work_timeout_ms - elapsed_ms) : 0;
  489|      0|        Curl_trc_feat_infof(data, feat, "[TPOOL-%s] [%u]: busy %"
  490|      0|                            FMT_TIMEDIFF_T "ms, timeout in %" FMT_TIMEDIFF_T
  491|      0|                            "ms: %s",
  492|      0|                            tpool->name, tslot->id, elapsed_ms, remain_ms,
  493|      0|                            tslot->work_description);
  494|      0|      }
  495|     27|    }
  496|    134|    Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|    134|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  497|    134|  }
  498|    134|}
thrdpool.c:thrdpool_signal:
  247|    465|{
  248|    465|  struct Curl_llist_node *e, *n;
  249|    465|  CURLcode result = CURLE_OK;
  250|       |
  251|    465|  DEBUGASSERT(!tpool->aborted);
  ------------------
  |  | 1016|    465|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (251:3): [True: 0, False: 465]
  |  Branch (251:3): [True: 465, False: 0]
  ------------------
  252|    465|  thrdpool_join_zombies(tpool);
  253|       |
  254|  1.03k|  for(e = Curl_llist_head(&tpool->slots); e && nthreads; e = n) {
  ------------------
  |  Branch (254:43): [True: 573, False: 461]
  |  Branch (254:48): [True: 569, False: 4]
  ------------------
  255|    569|    struct thrdslot *tslot = Curl_node_elem(e);
  256|    569|    n = Curl_node_next(e);
  257|    569|    if(tslot->idle) {
  ------------------
  |  Branch (257:8): [True: 0, False: 569]
  ------------------
  258|      0|      Curl_cond_signal(&tslot->await);
  259|      0|      --nthreads;
  260|      0|    }
  261|    569|    else if(!tslot->starttime.tv_sec && !tslot->starttime.tv_usec) {
  ------------------
  |  Branch (261:13): [True: 532, False: 37]
  |  Branch (261:41): [True: 532, False: 0]
  ------------------
  262|       |      /* starting thread, queries for work soon. */
  263|    532|      --nthreads;
  264|    532|    }
  265|    569|  }
  266|       |
  267|    675|  while(nthreads && !result &&
  ------------------
  |  Branch (267:9): [True: 247, False: 428]
  |  Branch (267:21): [True: 247, False: 0]
  ------------------
  268|    247|        Curl_llist_count(&tpool->slots) < tpool->max_threads) {
  ------------------
  |  Branch (268:9): [True: 247, False: 0]
  ------------------
  269|    247|    result = thrdslot_start(tpool);
  270|    247|    if(result)
  ------------------
  |  Branch (270:8): [True: 37, False: 210]
  ------------------
  271|     37|      break;
  272|    210|    --nthreads;
  273|    210|  }
  274|       |
  275|    465|  return result;
  276|    465|}
thrdpool.c:thrdslot_start:
  159|    247|{
  160|    247|  struct thrdslot *tslot;
  161|    247|  CURLcode result = CURLE_OUT_OF_MEMORY;
  162|       |
  163|    247|  tslot = curlx_calloc(1, sizeof(*tslot));
  ------------------
  |  | 1500|    247|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  164|    247|  if(!tslot)
  ------------------
  |  Branch (164:6): [True: 16, False: 231]
  ------------------
  165|     16|    goto out;
  166|    231|  tslot->id = tpool->next_id++;
  167|    231|  tslot->tpool = tpool;
  168|    231|  tslot->thread = curl_thread_t_null;
  ------------------
  |  |   49|    231|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  169|    231|  Curl_cond_init(&tslot->await);
  ------------------
  |  |   55|    231|#  define Curl_cond_init(c)      pthread_cond_init(c, NULL)
  ------------------
  170|       |
  171|    231|  tpool->refcount++;
  172|    231|  tslot->running = TRUE;
  ------------------
  |  |  986|    231|#define TRUE true
  ------------------
  173|    231|#ifdef DEBUGBUILD
  174|    231|  if(tpool->dbg_fail_starts > 0) {
  ------------------
  |  Branch (174:6): [True: 0, False: 231]
  ------------------
  175|      0|    --tpool->dbg_fail_starts;
  176|      0|    tslot->thread = curl_thread_t_null;
  ------------------
  |  |   49|      0|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  177|      0|  }
  178|    231|  else
  179|    231|#endif
  180|    231|    tslot->thread = Curl_thread_create(thrdslot_run, tslot);
  181|    231|  if(tslot->thread == curl_thread_t_null) { /* never started */
  ------------------
  |  |   49|    231|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  |  Branch (181:6): [True: 21, False: 210]
  ------------------
  182|     21|    tslot->running = FALSE;
  ------------------
  |  |  989|     21|#define FALSE false
  ------------------
  183|     21|    thrdpool_unlink(tpool, TRUE);
  ------------------
  |  |  986|     21|#define TRUE true
  ------------------
  184|     21|    result = CURLE_FAILED_INIT;
  185|     21|    goto out;
  186|     21|  }
  187|       |
  188|    210|  Curl_llist_append(&tpool->slots, tslot, &tslot->node);
  189|    210|  tslot = NULL;
  190|    210|  result = CURLE_OK;
  191|       |
  192|    247|out:
  193|    247|  if(tslot)
  ------------------
  |  Branch (193:6): [True: 21, False: 226]
  ------------------
  194|     21|    thrdslot_destroy(tslot);
  195|    247|  return result;
  196|    210|}
thrdpool.c:thrdslot_run:
   98|    210|{
   99|    210|  struct thrdslot *tslot = arg;
  100|    210|  struct curl_thrdpool *tpool = tslot->tpool;
  101|    210|  void *item;
  102|       |
  103|    210|  Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   51|    210|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  104|    210|  DEBUGASSERT(Curl_node_llist(&tslot->node) == &tpool->slots);
  ------------------
  |  | 1016|    210|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (104:3): [True: 0, False: 210]
  |  Branch (104:3): [True: 210, False: 0]
  ------------------
  105|    362|  for(;;) {
  106|    541|    while(!tpool->aborted) {
  ------------------
  |  Branch (106:11): [True: 331, False: 210]
  ------------------
  107|    331|      tslot->work_description = NULL;
  108|    331|      tslot->work_timeout_ms = 0;
  109|    331|      item = tpool->fn_take(tpool->fn_user_data, &tslot->work_description,
  110|    331|                            &tslot->work_timeout_ms);
  111|    331|      if(!item)
  ------------------
  |  Branch (111:10): [True: 152, False: 179]
  ------------------
  112|    152|        break;
  113|    179|      tslot->starttime = curlx_now();
  114|    179|      tslot->idle = FALSE;
  ------------------
  |  |  989|    179|#define FALSE false
  ------------------
  115|    179|      Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|    179|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  116|       |
  117|    179|      tpool->fn_process(item);
  118|       |
  119|    179|      Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   51|    179|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  120|    179|      tslot->work_description = NULL;
  121|    179|      tpool->fn_return(item, tpool->aborted ? NULL : tpool->fn_user_data);
  ------------------
  |  Branch (121:30): [True: 29, False: 150]
  ------------------
  122|    179|    }
  123|       |
  124|    362|    if(tpool->aborted ||
  ------------------
  |  Branch (124:8): [True: 210, False: 152]
  ------------------
  125|    152|       (Curl_llist_count(&tpool->slots) > tpool->max_threads))
  ------------------
  |  Branch (125:8): [True: 0, False: 152]
  ------------------
  126|    210|      goto out;
  127|       |
  128|    152|    tslot->idle = TRUE;
  ------------------
  |  |  986|    152|#define TRUE true
  ------------------
  129|    152|    tslot->starttime = curlx_now();
  130|    152|    thrdpool_join_zombies(tpool);
  131|    152|    Curl_cond_signal(&tpool->await);
  132|       |    /* Only wait with idle timeout when we are above the minimum
  133|       |     * number of threads. Otherwise short idle timeouts will keep
  134|       |     * on activating threads that have no means to shut down. */
  135|    152|    if((tpool->idle_time_ms > 0) &&
  ------------------
  |  Branch (135:8): [True: 152, False: 0]
  ------------------
  136|    152|       (Curl_llist_count(&tpool->slots) > tpool->min_threads)) {
  ------------------
  |  Branch (136:8): [True: 152, False: 0]
  ------------------
  137|    152|      CURLcode result = Curl_cond_timedwait(&tslot->await, &tpool->lock,
  138|    152|                                            tpool->idle_time_ms);
  139|    152|      if((result == CURLE_OPERATION_TIMEDOUT) &&
  ------------------
  |  Branch (139:10): [True: 0, False: 152]
  ------------------
  140|      0|         (Curl_llist_count(&tpool->slots) > tpool->min_threads)) {
  ------------------
  |  Branch (140:10): [True: 0, False: 0]
  ------------------
  141|      0|        goto out;
  142|      0|      }
  143|    152|    }
  144|      0|    else {
  145|      0|      Curl_cond_wait(&tslot->await, &tpool->lock);
  146|      0|    }
  147|    152|  }
  148|       |
  149|    210|out:
  150|    210|  thrdslot_done(tslot);
  151|    210|  if(!thrdpool_unlink(tslot->tpool, TRUE)) {
  ------------------
  |  |  986|    210|#define TRUE true
  ------------------
  |  Branch (151:6): [True: 210, False: 0]
  ------------------
  152|       |    /* tpool not destroyed */
  153|    210|    Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|    210|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  154|    210|  }
  155|    210|  return 0;
  156|    210|}
thrdpool.c:thrdslot_done:
   87|    210|{
   88|    210|  struct curl_thrdpool *tpool = tslot->tpool;
   89|       |
   90|    210|  DEBUGASSERT(Curl_node_llist(&tslot->node) == &tpool->slots);
  ------------------
  |  | 1016|    210|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (90:3): [True: 0, False: 210]
  |  Branch (90:3): [True: 210, False: 0]
  ------------------
   91|    210|  Curl_node_remove(&tslot->node);
   92|       |  tslot->running = FALSE;
  ------------------
  |  |  989|    210|#define FALSE false
  ------------------
   93|    210|  Curl_llist_append(&tpool->zombies, tslot, &tslot->node);
   94|    210|  Curl_cond_signal(&tpool->await);
   95|    210|}
thrdpool.c:thrdslot_destroy:
   79|    231|{
   80|    231|  DEBUGASSERT(tslot->thread == curl_thread_t_null);
  ------------------
  |  | 1016|    231|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (80:3): [True: 0, False: 231]
  |  Branch (80:3): [True: 231, False: 0]
  ------------------
   81|    231|  DEBUGASSERT(!tslot->running);
  ------------------
  |  | 1016|    231|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (81:3): [True: 0, False: 231]
  |  Branch (81:3): [True: 231, False: 0]
  ------------------
   82|    231|  Curl_cond_destroy(&tslot->await);
  ------------------
  |  |   56|    231|#  define Curl_cond_destroy(c)   pthread_cond_destroy(c)
  ------------------
   83|    231|  curlx_free(tslot);
  ------------------
  |  | 1503|    231|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   84|    231|}
thrdpool.c:thrdpool_wake_all:
  199|    153|{
  200|    153|  struct Curl_llist_node *e;
  201|    410|  for(e = Curl_llist_head(&tpool->slots); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (201:43): [True: 257, False: 153]
  ------------------
  202|    257|    struct thrdslot *tslot = Curl_node_elem(e);
  203|    257|    Curl_cond_signal(&tslot->await);
  204|    257|  }
  205|    153|}
thrdpool.c:thrdpool_join_zombies:
  208|  20.1k|{
  209|  20.1k|  struct Curl_llist_node *e;
  210|       |
  211|  20.3k|  for(e = Curl_llist_head(&tpool->zombies); e;
  ------------------
  |  Branch (211:45): [True: 210, False: 20.1k]
  ------------------
  212|  20.1k|      e = Curl_llist_head(&tpool->zombies)) {
  213|    210|    struct thrdslot *tslot = Curl_node_elem(e);
  214|       |
  215|    210|    Curl_node_remove(&tslot->node);
  216|    210|    if(tslot->thread != curl_thread_t_null) {
  ------------------
  |  |   49|    210|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  |  Branch (216:8): [True: 210, False: 0]
  ------------------
  217|    210|      Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|    210|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  218|    210|      Curl_thread_join(&tslot->thread);
  219|    210|      Curl_mutex_acquire(&tpool->lock);
  ------------------
  |  |   51|    210|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  220|    210|      tslot->thread = curl_thread_t_null;
  ------------------
  |  |   49|    210|#  define curl_thread_t_null     (pthread_t *)0
  ------------------
  221|    210|    }
  222|    210|    thrdslot_destroy(tslot);
  223|    210|  }
  224|  20.1k|}
thrdpool.c:thrdpool_unlink:
  227|  9.99k|{
  228|  9.99k|  DEBUGASSERT(tpool->refcount);
  ------------------
  |  | 1016|  9.99k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (228:3): [True: 0, False: 9.99k]
  |  Branch (228:3): [True: 9.99k, False: 0]
  ------------------
  229|  9.99k|  if(tpool->refcount)
  ------------------
  |  Branch (229:6): [True: 9.99k, False: 0]
  ------------------
  230|  9.99k|    tpool->refcount--;
  231|  9.99k|  if(tpool->refcount)
  ------------------
  |  Branch (231:6): [True: 231, False: 9.76k]
  ------------------
  232|    231|    return FALSE;
  ------------------
  |  |  989|    231|#define FALSE false
  ------------------
  233|       |
  234|       |  /* no more references, free */
  235|  9.76k|  DEBUGASSERT(tpool->aborted);
  ------------------
  |  | 1016|  9.76k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (235:3): [True: 0, False: 9.76k]
  |  Branch (235:3): [True: 9.76k, False: 0]
  ------------------
  236|  9.76k|  thrdpool_join_zombies(tpool);
  237|  9.76k|  if(locked)
  ------------------
  |  Branch (237:6): [True: 9.76k, False: 0]
  ------------------
  238|  9.76k|    Curl_mutex_release(&tpool->lock);
  ------------------
  |  |   52|  9.76k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  239|  9.76k|  Curl_cond_destroy(&tpool->await);
  ------------------
  |  |   56|  9.76k|#  define Curl_cond_destroy(c)   pthread_cond_destroy(c)
  ------------------
  240|  9.76k|  Curl_mutex_destroy(&tpool->lock);
  ------------------
  |  |   53|  9.76k|#  define Curl_mutex_destroy(m)  pthread_mutex_destroy(m)
  ------------------
  241|  9.76k|  curlx_free(tpool);
  ------------------
  |  | 1503|  9.76k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  242|       |  return TRUE;
  ------------------
  |  |  986|  9.76k|#define TRUE true
  ------------------
  243|  9.76k|}

Curl_thrdq_create:
  206|  9.77k|{
  207|  9.77k|  struct curl_thrdq *tqueue;
  208|  9.77k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  209|  9.77k|  DEBUGASSERT(name);
  ------------------
  |  | 1016|  9.77k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:3): [True: 0, False: 9.77k]
  |  Branch (209:3): [True: 9.77k, False: 0]
  ------------------
  210|       |
  211|  9.77k|  tqueue = curlx_calloc(1, sizeof(*tqueue));
  ------------------
  |  | 1500|  9.77k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  212|  9.77k|  if(!tqueue)
  ------------------
  |  Branch (212:6): [True: 1, False: 9.77k]
  ------------------
  213|      1|    goto out;
  214|       |
  215|  9.77k|  Curl_mutex_init(&tqueue->lock);
  ------------------
  |  |   50|  9.77k|#  define Curl_mutex_init(m)     pthread_mutex_init(m, NULL)
  ------------------
  216|  9.77k|  Curl_cond_init(&tqueue->await);
  ------------------
  |  |   55|  9.77k|#  define Curl_cond_init(c)      pthread_cond_init(c, NULL)
  ------------------
  217|  9.77k|  Curl_llist_init(&tqueue->sendq, thrdq_item_list_dtor);
  218|  9.77k|  Curl_llist_init(&tqueue->recvq, thrdq_item_list_dtor);
  219|  9.77k|  tqueue->fn_free = fn_free;
  220|  9.77k|  tqueue->fn_process = fn_process;
  221|  9.77k|  tqueue->fn_event = fn_event;
  222|  9.77k|  tqueue->fn_user_data = user_data;
  223|       |
  224|       |  /* a const string that remains */
  225|  9.77k|  tqueue->name = name;
  226|       |
  227|  9.77k|  result = Curl_thrdpool_create(&tqueue->tpool, name,
  228|  9.77k|                                min_threads, max_threads, idle_time_ms,
  229|  9.77k|                                thrdq_tpool_take,
  230|  9.77k|                                thrdq_tpool_process,
  231|  9.77k|                                thrdq_tpool_return,
  232|  9.77k|                                tqueue);
  233|       |
  234|  9.77k|out:
  235|  9.77k|  if(result && tqueue) {
  ------------------
  |  Branch (235:6): [True: 16, False: 9.76k]
  |  Branch (235:16): [True: 15, False: 1]
  ------------------
  236|     15|    tqueue->aborted = TRUE;
  ------------------
  |  |  986|     15|#define TRUE true
  ------------------
  237|     15|    thrdq_unlink(tqueue, FALSE, TRUE);
  ------------------
  |  |  989|     15|#define FALSE false
  ------------------
                  thrdq_unlink(tqueue, FALSE, TRUE);
  ------------------
  |  |  986|     15|#define TRUE true
  ------------------
  238|       |    tqueue = NULL;
  239|     15|  }
  240|  9.77k|  *ptqueue = tqueue;
  241|  9.77k|  return result;
  242|  9.77k|}
Curl_thrdq_destroy:
  245|  9.76k|{
  246|  9.76k|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|  9.76k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  247|  9.76k|  DEBUGASSERT(!tqueue->aborted);
  ------------------
  |  | 1016|  9.76k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (247:3): [True: 0, False: 9.76k]
  |  Branch (247:3): [True: 9.76k, False: 0]
  ------------------
  248|  9.76k|  tqueue->aborted = TRUE;
  ------------------
  |  |  986|  9.76k|#define TRUE true
  ------------------
  249|       |  thrdq_unlink(tqueue, TRUE, join);
  ------------------
  |  |  986|  9.76k|#define TRUE true
  ------------------
  250|  9.76k|}
Curl_thrdq_send:
  260|    215|{
  261|    215|  struct thrdq_item *qitem;
  262|    215|  CURLcode result = CURLE_OK;
  263|    215|  uint32_t signals = 0;
  264|       |
  265|    215|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|    215|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  266|    215|  if(tqueue->aborted) {
  ------------------
  |  Branch (266:6): [True: 0, False: 215]
  ------------------
  267|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (267:5): [Folded, False: 0]
  |  Branch (267:5): [Folded, False: 0]
  ------------------
  268|      0|    result = CURLE_SEND_ERROR;
  269|      0|    goto out;
  270|      0|  }
  271|    215|  if(timeout_ms < 0) {
  ------------------
  |  Branch (271:6): [True: 0, False: 215]
  ------------------
  272|      0|    result = CURLE_OPERATION_TIMEDOUT;
  273|      0|    goto out;
  274|      0|  }
  275|       |
  276|    215|  qitem = thrdq_item_create(tqueue, item, description, timeout_ms);
  277|    215|  if(!qitem) {
  ------------------
  |  Branch (277:6): [True: 7, False: 208]
  ------------------
  278|      7|    result = CURLE_OUT_OF_MEMORY;
  279|      7|    goto out;
  280|      7|  }
  281|    208|  Curl_llist_append(&tqueue->sendq, qitem, &qitem->node);
  282|    208|  signals = thrdq_get_signals(tqueue);
  283|       |
  284|    215|out:
  285|    215|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|    215|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  286|       |  /* Signal thread pool unlocked to avoid deadlocks. Since we added
  287|       |   * item to the queue already, it might have been taken for processing
  288|       |   * already. Any error in signalling the pool cannot be reported to
  289|       |   * the caller since it needs to give up ownership of item. */
  290|    215|  if(!result && signals)
  ------------------
  |  Branch (290:6): [True: 208, False: 7]
  |  Branch (290:17): [True: 208, False: 0]
  ------------------
  291|    208|    (void)Curl_thrdpool_signal(tqueue->tpool, (uint32_t)signals);
  292|    215|  return result;
  293|    208|}
Curl_thrdq_check_started:
  296|    392|{
  297|    392|  size_t unprocessed;
  298|       |
  299|    392|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|    392|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  300|    392|  unprocessed = tqueue->aborted ? 0 : Curl_llist_count(&tqueue->sendq);
  ------------------
  |  Branch (300:17): [True: 0, False: 392]
  ------------------
  301|    392|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|    392|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  302|    392|  return !unprocessed ||
  ------------------
  |  Branch (302:10): [True: 224, False: 168]
  ------------------
  303|    168|         !Curl_thrdpool_signal(tqueue->tpool, (uint32_t)unprocessed);
  ------------------
  |  Branch (303:10): [True: 154, False: 14]
  ------------------
  304|    392|}
Curl_thrdq_recv:
  307|   122k|{
  308|   122k|  CURLcode result = CURLE_AGAIN;
  309|   122k|  struct Curl_llist_node *e;
  310|   122k|  uint32_t signals = 0;
  311|       |
  312|   122k|  *pitem = NULL;
  313|   122k|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|   122k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  314|   122k|  if(tqueue->aborted) {
  ------------------
  |  Branch (314:6): [True: 0, False: 122k]
  ------------------
  315|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (315:5): [Folded, False: 0]
  |  Branch (315:5): [Folded, False: 0]
  ------------------
  316|      0|    result = CURLE_RECV_ERROR;
  317|      0|    goto out;
  318|      0|  }
  319|       |
  320|   122k|  e = Curl_llist_head(&tqueue->recvq);
  321|   122k|  if(e) {
  ------------------
  |  Branch (321:6): [True: 150, False: 122k]
  ------------------
  322|    150|    struct thrdq_item *qitem = Curl_node_take_elem(e);
  323|    150|    *pitem = qitem->item;
  324|    150|    qitem->item = NULL;
  325|    150|    thrdq_item_destroy(qitem);
  326|    150|    result = CURLE_OK;
  327|    150|  }
  328|   122k|  else
  329|   122k|    signals = thrdq_get_signals(tqueue);
  330|       |
  331|   122k|out:
  332|   122k|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|   122k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  333|       |  /* Signal thread pool unlocked to avoid deadlocks. If items await
  334|       |   * processing while nothing was ready, make sure the pool has a
  335|       |   * thread to work on them. An earlier thread start may have failed,
  336|       |   * which `Curl_thrdq_send()` cannot report to its caller. Without
  337|       |   * this, such items would sit unprocessed until the next send. */
  338|   122k|  if(signals)
  ------------------
  |  Branch (338:6): [True: 89, False: 122k]
  ------------------
  339|     89|    (void)Curl_thrdpool_signal(tqueue->tpool, (uint32_t)signals);
  340|   122k|  return result;
  341|   122k|}
Curl_thrdq_clear:
  361|     43|{
  362|     43|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|     43|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  363|     43|  if(tqueue->aborted) {
  ------------------
  |  Branch (363:6): [True: 0, False: 43]
  ------------------
  364|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (364:5): [Folded, False: 0]
  |  Branch (364:5): [Folded, False: 0]
  ------------------
  365|      0|    goto out;
  366|      0|  }
  367|     43|  thrdq_llist_clean_matches(&tqueue->sendq, fn_match, match_data);
  368|     43|  thrdq_llist_clean_matches(&tqueue->recvq, fn_match, match_data);
  369|     43|out:
  370|     43|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|     43|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  371|     43|}
Curl_thrdq_trace:
  406|    134|{
  407|    134|  struct curl_trc_feat *feat = &Curl_trc_feat_threads;
  408|    134|  if(Curl_trc_ft_is_verbose(data, feat)) {
  ------------------
  |  |  329|    134|  (Curl_trc_is_verbose(data) &&          \
  |  |  ------------------
  |  |  |  |  322|    268|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 134, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 134, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    268|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 134, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    134|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  330|    134|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  ------------------
  |  |  |  |   70|    134|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (330:4): [True: 134, False: 0]
  |  |  ------------------
  ------------------
  409|    134|    struct Curl_llist_node *e;
  410|    134|    struct thrdq_item *qitem;
  411|       |
  412|    134|    Curl_thrdpool_trace(tqueue->tpool, data);
  413|    134|    Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|    134|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  414|    134|    if(!Curl_llist_count(&tqueue->sendq) &&
  ------------------
  |  Branch (414:8): [True: 124, False: 10]
  ------------------
  415|    124|       !Curl_llist_count(&tqueue->recvq)) {
  ------------------
  |  Branch (415:8): [True: 124, False: 0]
  ------------------
  416|    124|      Curl_trc_feat_infof(data, feat, "[TQUEUE-%s] empty", tqueue->name);
  417|    124|    }
  418|    154|    for(e = Curl_llist_head(&tqueue->sendq); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (418:46): [True: 20, False: 134]
  ------------------
  419|     20|      qitem = Curl_node_elem(e);
  420|     20|      Curl_trc_feat_infof(data, feat, "[TQUEUE-%s] in: %s",
  421|     20|                          tqueue->name, qitem->description);
  422|     20|    }
  423|    134|    for(e = Curl_llist_head(&tqueue->recvq); e; e = Curl_node_next(e)) {
  ------------------
  |  Branch (423:46): [True: 0, False: 134]
  ------------------
  424|      0|      qitem = Curl_node_elem(e);
  425|      0|      Curl_trc_feat_infof(data, feat, "[TQUEUE-%s] out: %s",
  426|      0|                          tqueue->name, qitem->description);
  427|      0|    }
  428|    134|    Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|    134|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  429|    134|  }
  430|    134|}
thrdqueue.c:thrdq_item_list_dtor:
   92|     29|{
   93|     29|  (void)user_data;
   94|     29|  thrdq_item_destroy(elem);
   95|     29|}
thrdqueue.c:thrdq_tpool_take:
   99|    331|{
  100|    331|  struct curl_thrdq *tqueue = user_data;
  101|    331|  struct thrdq_item *qitem = NULL;
  102|    331|  struct Curl_llist_node *e;
  103|    331|  Curl_thrdq_ev_cb *fn_event = NULL;
  104|    331|  void *fn_user_data = NULL;
  105|       |
  106|    331|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|    331|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  107|    331|  *pdescription = NULL;
  108|    331|  *ptimeout_ms = 0;
  109|    331|  if(!tqueue->aborted) {
  ------------------
  |  Branch (109:6): [True: 329, False: 2]
  ------------------
  110|    329|    e = Curl_llist_head(&tqueue->sendq);
  111|    329|    if(e) {
  ------------------
  |  Branch (111:8): [True: 179, False: 150]
  ------------------
  112|    179|      struct curltime now = curlx_now();
  113|    179|      timediff_t timeout_ms;
  114|    179|      while(e) {
  ------------------
  |  Branch (114:13): [True: 179, False: 0]
  ------------------
  115|    179|        qitem = Curl_node_take_elem(e);
  116|    179|        timeout_ms = (!qitem->timeout_ms) ? 0 :
  ------------------
  |  Branch (116:22): [True: 0, False: 179]
  ------------------
  117|    179|          (qitem->timeout_ms - curlx_ptimediff_ms(&now, &qitem->start));
  118|    179|        if(timeout_ms < 0) {
  ------------------
  |  Branch (118:12): [True: 0, False: 179]
  ------------------
  119|       |          /* timed out while queued, place on receive queue */
  120|      0|          Curl_llist_append(&tqueue->recvq, qitem, &qitem->node);
  121|      0|          fn_event = tqueue->fn_event;
  122|      0|          fn_user_data = tqueue->fn_user_data;
  123|      0|          qitem = NULL;
  124|      0|          e = Curl_llist_head(&tqueue->sendq);
  125|      0|          continue;
  126|      0|        }
  127|    179|        else {
  128|    179|          *pdescription = qitem->description;
  129|    179|          *ptimeout_ms = timeout_ms;
  130|    179|          break;
  131|    179|        }
  132|    179|      }
  133|    179|    }
  134|    329|  }
  135|    331|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|    331|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  136|       |  /* avoiding deadlocks */
  137|    331|  if(fn_event)
  ------------------
  |  Branch (137:6): [True: 0, False: 331]
  ------------------
  138|      0|    fn_event(tqueue, CURL_THRDQ_EV_ITEM_DONE, fn_user_data);
  139|    331|  return qitem;
  140|    331|}
thrdqueue.c:thrdq_tpool_process:
  171|    179|{
  172|    179|  struct thrdq_item *qitem = item;
  173|    179|  qitem->fn_process(qitem->item);
  174|    179|}
thrdqueue.c:thrdq_tpool_return:
  143|    179|{
  144|    179|  struct curl_thrdq *tqueue = user_data;
  145|    179|  struct thrdq_item *qitem = item;
  146|    179|  Curl_thrdq_ev_cb *fn_event = NULL;
  147|    179|  void *fn_user_data = NULL;
  148|       |
  149|    179|  if(!tqueue) {
  ------------------
  |  Branch (149:6): [True: 29, False: 150]
  ------------------
  150|     29|    thrdq_item_destroy(item);
  151|     29|    return;
  152|     29|  }
  153|       |
  154|    150|  Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|    150|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  155|    150|  if(tqueue->aborted) {
  ------------------
  |  Branch (155:6): [True: 0, False: 150]
  ------------------
  156|      0|    thrdq_item_destroy(qitem);
  157|      0|  }
  158|    150|  else {
  159|    150|    DEBUGASSERT(!Curl_node_llist(&qitem->node));
  ------------------
  |  | 1016|    150|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (159:5): [True: 0, False: 150]
  |  Branch (159:5): [True: 150, False: 0]
  ------------------
  160|    150|    Curl_llist_append(&tqueue->recvq, qitem, &qitem->node);
  161|    150|    fn_event = tqueue->fn_event;
  162|    150|    fn_user_data = tqueue->fn_user_data;
  163|    150|  }
  164|    150|  Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|    150|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  165|       |  /* avoiding deadlocks */
  166|    150|  if(fn_event)
  ------------------
  |  Branch (166:6): [True: 150, False: 0]
  ------------------
  167|    150|    fn_event(tqueue, CURL_THRDQ_EV_ITEM_DONE, fn_user_data);
  168|    150|}
thrdqueue.c:thrdq_unlink:
  177|  9.77k|{
  178|  9.77k|  DEBUGASSERT(tqueue->aborted);
  ------------------
  |  | 1016|  9.77k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (178:3): [True: 0, False: 9.77k]
  |  Branch (178:3): [True: 9.77k, False: 0]
  ------------------
  179|  9.77k|  if(tqueue->tpool) {
  ------------------
  |  Branch (179:6): [True: 9.76k, False: 15]
  ------------------
  180|  9.76k|    if(locked)
  ------------------
  |  Branch (180:8): [True: 9.76k, False: 0]
  ------------------
  181|  9.76k|      Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|  9.76k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  182|  9.76k|    Curl_thrdpool_destroy(tqueue->tpool, join);
  183|  9.76k|    tqueue->tpool = NULL;
  184|  9.76k|    if(locked)
  ------------------
  |  Branch (184:8): [True: 9.76k, False: 0]
  ------------------
  185|  9.76k|      Curl_mutex_acquire(&tqueue->lock);
  ------------------
  |  |   51|  9.76k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  186|  9.76k|  }
  187|       |
  188|  9.77k|  Curl_llist_destroy(&tqueue->sendq, NULL);
  189|  9.77k|  Curl_llist_destroy(&tqueue->recvq, NULL);
  190|  9.77k|  Curl_cond_destroy(&tqueue->await);
  ------------------
  |  |   56|  9.77k|#  define Curl_cond_destroy(c)   pthread_cond_destroy(c)
  ------------------
  191|  9.77k|  if(locked)
  ------------------
  |  Branch (191:6): [True: 9.76k, False: 15]
  ------------------
  192|  9.76k|    Curl_mutex_release(&tqueue->lock);
  ------------------
  |  |   52|  9.76k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  193|  9.77k|  Curl_mutex_destroy(&tqueue->lock);
  ------------------
  |  |   53|  9.77k|#  define Curl_mutex_destroy(m)  pthread_mutex_destroy(m)
  ------------------
  194|  9.77k|  curlx_free(tqueue);
  ------------------
  |  | 1503|  9.77k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  195|  9.77k|}
thrdqueue.c:thrdq_item_create:
   67|    215|{
   68|    215|  struct thrdq_item *qitem;
   69|       |
   70|    215|  qitem = curlx_calloc(1, sizeof(*qitem));
  ------------------
  |  | 1500|    215|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   71|    215|  if(!qitem)
  ------------------
  |  Branch (71:6): [True: 7, False: 208]
  ------------------
   72|      7|    return NULL;
   73|    208|  qitem->item = item;
   74|    208|  qitem->description = description;
   75|    208|  qitem->fn_free = tqueue->fn_free;
   76|    208|  qitem->fn_process = tqueue->fn_process;
   77|    208|  if(timeout_ms) {
  ------------------
  |  Branch (77:6): [True: 208, False: 0]
  ------------------
   78|    208|    qitem->start = curlx_now();
   79|    208|    qitem->timeout_ms = timeout_ms;
   80|    208|  }
   81|    208|  return qitem;
   82|    215|}
thrdqueue.c:thrdq_get_signals:
  253|   122k|{
  254|   122k|  size_t qlen = Curl_llist_count(&tqueue->sendq);
  255|   122k|  return (qlen <= UINT32_MAX) ? (uint32_t)qlen : UINT32_MAX;
  ------------------
  |  Branch (255:10): [True: 122k, False: 0]
  ------------------
  256|   122k|}
thrdqueue.c:thrdq_item_destroy:
   85|    208|{
   86|    208|  if(qitem->item)
  ------------------
  |  Branch (86:6): [True: 58, False: 150]
  ------------------
   87|     58|    qitem->fn_free(qitem->item);
   88|    208|  curlx_free(qitem);
  ------------------
  |  | 1503|    208|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   89|    208|}
thrdqueue.c:thrdq_llist_clean_matches:
  346|     86|{
  347|     86|  struct Curl_llist_node *e, *n;
  348|     86|  struct thrdq_item *qitem;
  349|       |
  350|    115|  for(e = Curl_llist_head(llist); e; e = n) {
  ------------------
  |  Branch (350:35): [True: 29, False: 86]
  ------------------
  351|     29|    n = Curl_node_next(e);
  352|     29|    qitem = Curl_node_elem(e);
  353|     29|    if(fn_match(qitem->item, match_data))
  ------------------
  |  Branch (353:8): [True: 29, False: 0]
  ------------------
  354|     29|      Curl_node_remove(e);
  355|     29|  }
  356|     86|}

Curl_checkheaders:
   87|  11.0k|{
   88|  11.0k|  struct curl_slist *head;
   89|  11.0k|  DEBUGASSERT(thislen);
  ------------------
  |  | 1016|  11.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (89:3): [True: 0, False: 11.0k]
  |  Branch (89:3): [True: 11.0k, False: 0]
  ------------------
   90|  11.0k|  DEBUGASSERT(thisheader[thislen - 1] != ':');
  ------------------
  |  | 1016|  11.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (90:3): [True: 0, False: 11.0k]
  |  Branch (90:3): [True: 11.0k, False: 0]
  ------------------
   91|       |
   92|  16.0k|  for(head = data->set.headers; head; head = head->next) {
  ------------------
  |  Branch (92:33): [True: 5.00k, False: 11.0k]
  ------------------
   93|  5.00k|    if(curl_strnequal(head->data, thisheader, thislen) &&
  ------------------
  |  Branch (93:8): [True: 8, False: 4.99k]
  ------------------
   94|      8|       Curl_headersep(head->data[thislen]))
  ------------------
  |  |   26|      8|#define Curl_headersep(x) ((((x) == ':') || ((x) == ';')))
  |  |  ------------------
  |  |  |  Branch (26:29): [True: 7, False: 1]
  |  |  |  Branch (26:45): [True: 0, False: 1]
  |  |  ------------------
  ------------------
   95|      7|      return head->data;
   96|  5.00k|  }
   97|       |
   98|  11.0k|  return NULL;
   99|  11.0k|}
Curl_sendrecv:
  332|  9.62k|{
  333|  9.62k|  struct SingleRequest *k = &data->req;
  334|  9.62k|  const struct curltime *pnow = NULL;
  335|  9.62k|  CURLcode result = CURLE_OK;
  336|       |
  337|  9.62k|  if(Curl_xfer_is_blocked(data)) {
  ------------------
  |  Branch (337:6): [True: 0, False: 9.62k]
  ------------------
  338|      0|    result = Curl_conn_do_maintenance(data);
  339|      0|    goto out;
  340|      0|  }
  341|       |
  342|       |  /* We go ahead and do a read if we have a readable socket or if the stream
  343|       |     was rewound (in which case we have data in a buffer) */
  344|  9.62k|  if(CURL_REQ_WANT_RECV(data)) {
  ------------------
  |  |   40|  9.62k|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  9.62k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 9.62k, False: 0]
  |  |  ------------------
  ------------------
  345|  9.62k|    result = sendrecv_dl(data, k);
  346|  9.62k|    if(result || data->req.done)
  ------------------
  |  Branch (346:8): [True: 567, False: 9.06k]
  |  Branch (346:18): [True: 0, False: 9.06k]
  ------------------
  347|    567|      goto out;
  348|  9.62k|  }
  349|       |
  350|       |  /* If we still have writing to do, we check if we have a writable socket. */
  351|  9.06k|  if(Curl_req_want_send(data)) {
  ------------------
  |  Branch (351:6): [True: 822, False: 8.24k]
  ------------------
  352|    822|    result = sendrecv_ul(data);
  353|    822|    if(result)
  ------------------
  |  Branch (353:8): [True: 22, False: 800]
  ------------------
  354|     22|      goto out;
  355|    822|  }
  356|       |
  357|  9.04k|  pnow = Curl_pgrs_now(data);
  358|  9.04k|  if(CURL_REQ_WANT_IO(data)) {
  ------------------
  |  |   42|  9.04k|  ((d)->req.io_flags & (REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   35|  9.04k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |                 ((d)->req.io_flags & (REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   36|  9.04k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (42:3): [True: 8.50k, False: 533]
  |  |  ------------------
  ------------------
  359|  8.50k|    if(Curl_timeleft_now_ms(data, pnow) < 0) {
  ------------------
  |  Branch (359:8): [True: 0, False: 8.50k]
  ------------------
  360|      0|      if(k->size != -1) {
  ------------------
  |  Branch (360:10): [True: 0, False: 0]
  ------------------
  361|      0|        failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  362|      0|              " milliseconds with %" FMT_OFF_T " out of %"
  363|      0|              FMT_OFF_T " bytes received",
  364|      0|              Curl_pgrs_since_ms(data, NULL, TIMER_STARTSINGLE),
  365|      0|              k->bytecount, k->size);
  366|      0|      }
  367|      0|      else {
  368|      0|        failf(data, "Operation timed out after %" FMT_TIMEDIFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  369|      0|              " milliseconds with %" FMT_OFF_T " bytes received",
  370|      0|              Curl_pgrs_since_ms(data, NULL, TIMER_STARTSINGLE),
  371|      0|              k->bytecount);
  372|      0|      }
  373|      0|      result = CURLE_OPERATION_TIMEDOUT;
  374|      0|      goto out;
  375|      0|    }
  376|  8.50k|  }
  377|    533|  else {
  378|       |    /*
  379|       |     * The transfer has been performed. Make some general checks before
  380|       |     * returning.
  381|       |     */
  382|    533|    if(!data->req.no_body && (k->size != -1) &&
  ------------------
  |  Branch (382:8): [True: 526, False: 7]
  |  Branch (382:30): [True: 0, False: 526]
  ------------------
  383|      0|       (k->bytecount != k->size) && !k->newurl) {
  ------------------
  |  Branch (383:8): [True: 0, False: 0]
  |  Branch (383:37): [True: 0, False: 0]
  ------------------
  384|      0|      failf(data, "transfer closed with %" FMT_OFF_T
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  385|      0|            " bytes remaining to read", k->size - k->bytecount);
  386|      0|      result = CURLE_PARTIAL_FILE;
  387|      0|      goto out;
  388|      0|    }
  389|    533|  }
  390|       |
  391|       |  /* If there is nothing more to send/recv, the request is done */
  392|  9.04k|  if(!CURL_REQ_WANT_IO(data))
  ------------------
  |  |   42|  9.04k|  ((d)->req.io_flags & (REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   35|  9.04k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |                 ((d)->req.io_flags & (REQ_IO_RECV | REQ_IO_SEND))
  |  |  ------------------
  |  |  |  |   36|  9.04k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  |  Branch (392:6): [True: 533, False: 8.50k]
  ------------------
  393|    533|    data->req.done = TRUE;
  ------------------
  |  |  986|    533|#define TRUE true
  ------------------
  394|       |
  395|  9.04k|  result = Curl_pgrsCheckX(data, pnow);
  396|       |
  397|  9.62k|out:
  398|  9.62k|  if(result)
  ------------------
  |  Branch (398:6): [True: 589, False: 9.04k]
  ------------------
  399|    589|    DEBUGF(infof(data, "Curl_sendrecv() -> %d", (int)result));
  ------------------
  |  | 1002|  13.9k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 589, False: 0]
  |  |  |  Branch (1002:19): [True: 50, False: 539]
  |  |  |  Branch (1002:19): [True: 50, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 589]
  |  |  ------------------
  ------------------
  400|  9.62k|  return result;
  401|  9.04k|}
Curl_init_CONNECT:
  406|  9.66k|{
  407|  9.66k|  data->state.fread_func = data->set.fread_func_set;
  408|  9.66k|  data->state.in = data->set.in_set;
  409|  9.66k|  data->state.upload = (data->state.httpreq == HTTPREQ_PUT);
  410|  9.66k|}
Curl_pretransfer:
  418|  9.74k|{
  419|  9.74k|  CURLcode result = CURLE_OK;
  420|       |
  421|       |  /* Reset the retry count at the start of each request.
  422|       |   * If the retry count is not reset, when the connection drops,
  423|       |   * it will not enter the retry mechanism on CONN_MAX_RETRIES + 1 attempts
  424|       |   * and will immediately throw
  425|       |   * "Connection died, tried CONN_MAX_RETRIES times before giving up".
  426|       |   * By resetting it here, we ensure each new request starts fresh. */
  427|  9.74k|  data->state.retrycount = 0;
  428|       |
  429|  9.74k|  if(!CURL_EASY_STR(data, STRING_SET_URL) && !data->set.uh) {
  ------------------
  |  | 1206|  19.4k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  |  Branch (429:6): [True: 15, False: 9.72k]
  |  Branch (429:46): [True: 15, False: 0]
  ------------------
  430|       |    /* we cannot do anything without URL */
  431|     15|    failf(data, "No URL set");
  ------------------
  |  |   62|     15|#define failf Curl_failf
  ------------------
  432|     15|    return CURLE_URL_MALFORMAT;
  433|     15|  }
  434|       |
  435|       |  /* CURLOPT_CURLU overrides CURLOPT_URL and the contents of the CURLU handle
  436|       |     is allowed to be changed by the user between transfers */
  437|  9.72k|  if(data->set.uh) {
  ------------------
  |  Branch (437:6): [True: 0, False: 9.72k]
  ------------------
  438|      0|    char *url = NULL;
  439|      0|    CURLUcode uc;
  440|      0|    uc = curl_url_get(data->set.uh, CURLUPART_URL, &url, 0);
  441|      0|    if(uc) {
  ------------------
  |  Branch (441:8): [True: 0, False: 0]
  ------------------
  442|       |      /* clear the pointer to not point to freed memory anymore */
  443|      0|      Curl_bufref_set(&data->state.url, NULL, 0, NULL);
  444|      0|      failf(data, "No URL set");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  445|      0|      return CURLE_URL_MALFORMAT;
  446|      0|    }
  447|      0|    result = CURL_EASY_STR_SETN(data, STRING_SET_URL, url);
  ------------------
  |  | 1210|      0|  Curl_u8_strset_setn(&(d)->set.strings, (uint8_t)(id), s)
  ------------------
  448|      0|    if(result)
  ------------------
  |  Branch (448:8): [True: 0, False: 0]
  ------------------
  449|      0|      return result;
  450|      0|  }
  451|       |
  452|  9.72k|  Curl_bufref_set(&data->state.url, CURL_EASY_STR(data, STRING_SET_URL),
  ------------------
  |  | 1206|  9.72k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  453|  9.72k|                  0, NULL);
  454|       |
  455|  9.72k|  if(data->set.postfields && data->set.set_resume_from) {
  ------------------
  |  Branch (455:6): [True: 131, False: 9.59k]
  |  Branch (455:30): [True: 50, False: 81]
  ------------------
  456|       |    /* we cannot */
  457|     50|    failf(data, "cannot mix POSTFIELDS with RESUME_FROM");
  ------------------
  |  |   62|     50|#define failf Curl_failf
  ------------------
  458|     50|    return CURLE_BAD_FUNCTION_ARGUMENT;
  459|     50|  }
  460|       |
  461|  9.67k|  data->state.prefer_ascii = data->set.prefer_ascii;
  462|  9.67k|#ifdef CURL_LIST_ONLY_PROTOCOL
  463|  9.67k|  data->state.list_only = data->set.list_only;
  464|  9.67k|#endif
  465|  9.67k|  data->state.httpreq = data->set.method;
  466|       |
  467|       |  /* initial transfer request coming up, forget the initial origin
  468|       |   * from a previous perform() on this handle. */
  469|  9.67k|  Curl_peer_unlink(&data->state.initial_origin);
  470|  9.67k|  Curl_peer_unlink(&data->state.origin);
  471|  9.67k|  data->state.requests = 0;
  472|  9.67k|  data->state.still_connecting = FALSE;
  ------------------
  |  |  989|  9.67k|#define FALSE false
  ------------------
  473|  9.67k|  data->state.followlocation = 0; /* reset the location-follow counter */
  474|  9.67k|  data->state.this_is_a_follow = FALSE; /* reset this */
  ------------------
  |  |  989|  9.67k|#define FALSE false
  ------------------
  475|  9.67k|  data->state.http_ignorecustom = FALSE; /* use custom HTTP method */
  ------------------
  |  |  989|  9.67k|#define FALSE false
  ------------------
  476|  9.67k|  data->state.errorbuf = FALSE; /* no error has occurred */
  ------------------
  |  |  989|  9.67k|#define FALSE false
  ------------------
  477|  9.67k|#ifndef CURL_DISABLE_HTTP
  478|  9.67k|  Curl_http_neg_init(data, &data->state.http_neg);
  479|  9.67k|#endif
  480|  9.67k|  data->state.authproblem = FALSE;
  ------------------
  |  |  989|  9.67k|#define FALSE false
  ------------------
  481|  9.67k|  data->state.authhost.want = data->set.httpauth;
  482|  9.67k|  data->state.authproxy.want = data->set.proxyauth;
  483|  9.67k|  curlx_safefree(data->info.wouldredirect);
  ------------------
  |  | 1359|  9.67k|  do {                      \
  |  | 1360|  9.67k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.67k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.67k|    (ptr) = NULL;           \
  |  | 1362|  9.67k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.67k]
  |  |  ------------------
  ------------------
  484|  9.67k|  curlx_safefree(data->info.effective_url);
  ------------------
  |  | 1359|  9.67k|  do {                      \
  |  | 1360|  9.67k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.67k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.67k|    (ptr) = NULL;           \
  |  | 1362|  9.67k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.67k]
  |  |  ------------------
  ------------------
  485|  9.67k|  Curl_data_priority_clear_state(data);
  486|  9.67k|  if(data->set.http_auto_referer)
  ------------------
  |  Branch (486:6): [True: 93, False: 9.58k]
  ------------------
  487|     93|    Curl_bufref_free(&data->state.referer);
  488|  9.67k|  if(CURL_EASY_STR(data, STRING_SET_REFERER))
  ------------------
  |  | 1206|  9.67k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 48, False: 9.63k]
  |  |  ------------------
  ------------------
  489|     48|    Curl_bufref_set(&data->state.referer,
  490|     48|                    CURL_EASY_STR(data, STRING_SET_REFERER), 0, NULL);
  ------------------
  |  | 1206|     48|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  491|  9.63k|  else
  492|  9.63k|    Curl_bufref_free(&data->state.referer);
  493|       |
  494|  9.67k|  if(data->state.httpreq == HTTPREQ_PUT)
  ------------------
  |  Branch (494:6): [True: 204, False: 9.47k]
  ------------------
  495|    204|    data->state.infilesize = data->set.filesize;
  496|  9.47k|  else if((data->state.httpreq != HTTPREQ_GET) &&
  ------------------
  |  Branch (496:11): [True: 1.09k, False: 8.37k]
  ------------------
  497|  1.09k|          (data->state.httpreq != HTTPREQ_HEAD)) {
  ------------------
  |  Branch (497:11): [True: 1.06k, False: 30]
  ------------------
  498|  1.06k|    data->state.infilesize = data->set.postfieldsize;
  499|  1.06k|    if(data->set.postfields && (data->state.infilesize == -1))
  ------------------
  |  Branch (499:8): [True: 76, False: 993]
  |  Branch (499:32): [True: 0, False: 76]
  ------------------
  500|      0|      data->state.infilesize = (curl_off_t)strlen(data->set.postfields);
  501|  1.06k|  }
  502|  8.40k|  else
  503|  8.40k|    data->state.infilesize = 0;
  504|       |
  505|       |  /* If there is a list of cookie files to read, do it now! */
  506|  9.67k|  result = Curl_cookie_loadfiles(data,
  507|  9.67k|                                 data->set.cookiesession ?
  ------------------
  |  Branch (507:34): [True: 125, False: 9.55k]
  ------------------
  508|  9.55k|                                 COOKIE_NOSESSION : 0);
  ------------------
  |  |  120|    125|#define COOKIE_NOSESSION  (1<<6) /* drop session cookies */
  ------------------
  509|  9.67k|  if(!result)
  ------------------
  |  Branch (509:6): [True: 9.67k, False: 5]
  ------------------
  510|  9.67k|    Curl_cookie_run(data); /* activate */
  511|       |
  512|       |  /* If there is a list of host pairs to deal with */
  513|  9.67k|  if(!result && data->set.a.resolve && !data->state.resolve_loaded)
  ------------------
  |  Branch (513:6): [True: 9.67k, False: 5]
  |  Branch (513:17): [True: 0, False: 9.67k]
  |  Branch (513:40): [True: 0, False: 0]
  ------------------
  514|      0|    result = Curl_loadhostpairs(data);
  515|       |
  516|  9.67k|#ifndef CURL_DISABLE_HSTS
  517|  9.67k|  if(!result)
  ------------------
  |  Branch (517:6): [True: 9.67k, False: 5]
  ------------------
  518|       |    /* If there is a list of hsts files to read */
  519|  9.67k|    result = Curl_hsts_loadfiles(data, data->set.a.hsts_files);
  520|  9.67k|#endif
  521|       |
  522|  9.67k|  if(!result) {
  ------------------
  |  Branch (522:6): [True: 9.66k, False: 15]
  ------------------
  523|       |    /* Allow data->set.use_port to set which port to use. This needs to be
  524|       |     * disabled for example when we follow Location: headers to URLs using
  525|       |     * different ports! */
  526|  9.66k|    data->state.allow_port = TRUE;
  ------------------
  |  |  986|  9.66k|#define TRUE true
  ------------------
  527|       |
  528|       |#if defined(HAVE_SIGNAL) && defined(SIGPIPE) && !defined(MSG_NOSIGNAL)
  529|       |    /*************************************************************
  530|       |     * Tell signal handler to ignore SIGPIPE
  531|       |     *************************************************************/
  532|       |    if(!data->set.no_signal)
  533|       |      data->state.prev_signal = signal(SIGPIPE, SIG_IGN);
  534|       |#endif
  535|       |
  536|  9.66k|    Curl_initinfo(data); /* reset session-specific information "variables" */
  537|  9.66k|    Curl_pgrsResetTransferSizes(data);
  538|  9.66k|    Curl_pgrsStart(data, NULL);
  539|       |    /* Start rate limiting afresh: a handle reused for another transfer
  540|       |       must not carry over the time step and tokens of an earlier one */
  541|  9.66k|    Curl_rlimit_start(&data->progress.dl.rlimit, Curl_pgrs_now(data), -1);
  542|  9.66k|    Curl_rlimit_start(&data->progress.ul.rlimit, Curl_pgrs_now(data), -1);
  543|       |
  544|       |    /* In case the handle is reused and an authentication method was picked
  545|       |       in the session we need to make sure we only use the one(s) we now
  546|       |       consider to be fine */
  547|  9.66k|    data->state.authhost.picked &= data->state.authhost.want;
  548|  9.66k|    data->state.authproxy.picked &= data->state.authproxy.want;
  549|       |
  550|  9.66k|#ifndef CURL_DISABLE_FTP
  551|  9.66k|    data->state.wildcardmatch = data->set.wildcard_enabled;
  552|  9.66k|#ifdef DEBUGBUILD
  553|  9.66k|  if(getenv("CURL_DBG_FTP_WILDCARD"))
  ------------------
  |  Branch (553:6): [True: 0, False: 9.66k]
  ------------------
  554|      0|    data->state.wildcardmatch = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  555|  9.66k|#endif
  556|  9.66k|    if(data->state.wildcardmatch) {
  ------------------
  |  Branch (556:8): [True: 0, False: 9.66k]
  ------------------
  557|      0|      struct WildcardData *wc;
  558|      0|      if(!data->wildcard) {
  ------------------
  |  Branch (558:10): [True: 0, False: 0]
  ------------------
  559|      0|        data->wildcard = curlx_calloc(1, sizeof(struct WildcardData));
  ------------------
  |  | 1500|      0|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  560|      0|        if(!data->wildcard)
  ------------------
  |  Branch (560:12): [True: 0, False: 0]
  ------------------
  561|      0|          return CURLE_OUT_OF_MEMORY;
  562|      0|      }
  563|      0|      wc = data->wildcard;
  564|      0|      if(wc->state < CURLWC_INIT) {
  ------------------
  |  Branch (564:10): [True: 0, False: 0]
  ------------------
  565|      0|        if(wc->ftpwc)
  ------------------
  |  Branch (565:12): [True: 0, False: 0]
  ------------------
  566|      0|          wc->dtor(wc->ftpwc);
  567|      0|        curlx_safefree(wc->pattern);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  568|      0|        curlx_safefree(wc->path);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  569|      0|        Curl_wildcard_init(wc); /* init wildcard structures */
  570|      0|      }
  571|      0|    }
  572|  9.66k|#endif
  573|  9.66k|    result = Curl_hsts_loadcb(data, data->hsts);
  574|  9.66k|  }
  575|       |
  576|  9.67k|  data->req.headerbytecount = 0;
  577|       |  /* a previous transfer on this handle may have ended with a rewind request
  578|       |   * still pending (a follow or auth retry that failed). This is a new
  579|       |   * transfer, so drop those readers now instead of letting a later upload
  580|       |   * read from them. */
  581|       |  data->req.rewind_read = FALSE;
  ------------------
  |  |  989|  9.67k|#define FALSE false
  ------------------
  582|  9.67k|  Curl_client_reset(data);
  583|  9.67k|  Curl_headers_cleanup(data);
  584|  9.67k|  return result;
  585|  9.67k|}
Curl_retry_request:
  591|    911|{
  592|    911|  struct connectdata *conn = data->conn;
  593|    911|  bool retry = FALSE;
  ------------------
  |  |  989|    911|#define FALSE false
  ------------------
  594|    911|  *url = NULL;
  595|       |
  596|       |  /* if we are talking upload, we cannot do the checks below, unless the
  597|       |     protocol is HTTP as when uploading over HTTP we will still get a
  598|       |     response */
  599|    911|  if(data->state.upload &&
  ------------------
  |  Branch (599:6): [True: 6, False: 905]
  ------------------
  600|      6|     !(conn->scheme->protocol & (PROTO_FAMILY_HTTP | CURLPROTO_RTSP)))
  ------------------
  |  |   83|      6|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|      6|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|      6|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   62|      6|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   84|      6|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   63|      6|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
                   !(conn->scheme->protocol & (PROTO_FAMILY_HTTP | CURLPROTO_RTSP)))
  ------------------
  |  | 1106|      6|#define CURLPROTO_RTSP    (1L << 18)
  ------------------
  |  Branch (600:6): [True: 0, False: 6]
  ------------------
  601|      0|    return CURLE_OK;
  602|       |
  603|    911|  if(data->set.never_retry)
  ------------------
  |  Branch (603:6): [True: 0, False: 911]
  ------------------
  604|      0|    return CURLE_OK;
  605|       |
  606|    911|  if(conn->bits.reuse &&
  ------------------
  |  Branch (606:6): [True: 0, False: 911]
  ------------------
  607|      0|     (data->req.bytecount + data->req.headerbytecount == 0) &&
  ------------------
  |  Branch (607:6): [True: 0, False: 0]
  ------------------
  608|      0|     ((!data->req.no_body && !data->req.done) ||
  ------------------
  |  Branch (608:8): [True: 0, False: 0]
  |  Branch (608:30): [True: 0, False: 0]
  ------------------
  609|      0|      (conn->scheme->protocol & PROTO_FAMILY_HTTP))
  ------------------
  |  |   83|      0|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|      0|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|      0|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   62|      0|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   84|      0|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   63|      0|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (609:7): [True: 0, False: 0]
  ------------------
  610|      0|#ifndef CURL_DISABLE_RTSP
  611|      0|     && (data->set.rtspreq != RTSPREQ_RECEIVE)
  ------------------
  |  |   44|      0|#define RTSPREQ_RECEIVE CURL_RTSPREQ_RECEIVE
  |  |  ------------------
  |  |  |  | 2377|      0|#define CURL_RTSPREQ_RECEIVE       11L
  |  |  ------------------
  ------------------
  |  Branch (611:9): [True: 0, False: 0]
  ------------------
  612|    911|#endif
  613|    911|    )
  614|       |    /* We got no data, we attempted to reuse a connection. For HTTP this
  615|       |       can be a retry so we try again regardless if we expected a body.
  616|       |       For other protocols we only try again only if we expected a body.
  617|       |
  618|       |       This might happen if the connection was left alive when we were
  619|       |       done using it before, but that was closed when we wanted to read from
  620|       |       it again. Bad luck. Retry the same request on a fresh connect! */
  621|      0|    retry = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  622|    911|  else if(data->req.refused_stream &&
  ------------------
  |  Branch (622:11): [True: 0, False: 911]
  ------------------
  623|      0|          (data->req.bytecount + data->req.headerbytecount == 0)) {
  ------------------
  |  Branch (623:11): [True: 0, False: 0]
  ------------------
  624|       |    /* This was sent on a refused stream, safe to rerun. A refused stream
  625|       |       error can only happen on multiplexed protoccols (HTTP/2+3).
  626|       |       While this *should* imply that the server never processed any
  627|       |       of the request data, we only act on this when we have
  628|       |       not received any response headers or content bytes. */
  629|      0|    infof(data, "REFUSED_STREAM, retrying a fresh connect");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  630|      0|    retry = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  631|      0|  }
  632|    911|  if(retry) {
  ------------------
  |  Branch (632:6): [True: 0, False: 911]
  ------------------
  633|      0|#define CONN_MAX_RETRIES 5
  634|      0|    if(data->state.retrycount++ >= CONN_MAX_RETRIES) {
  ------------------
  |  |  633|      0|#define CONN_MAX_RETRIES 5
  ------------------
  |  Branch (634:8): [True: 0, False: 0]
  ------------------
  635|      0|      failf(data, "Connection died, tried %d times before giving up",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  636|      0|            CONN_MAX_RETRIES);
  ------------------
  |  |  633|      0|#define CONN_MAX_RETRIES 5
  ------------------
  637|      0|      data->state.retrycount = 0;
  638|      0|      return CURLE_SEND_ERROR;
  639|      0|    }
  640|      0|    infof(data, "Connection died, retrying a fresh connect (retry count: %d)",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  641|      0|          data->state.retrycount);
  642|      0|    *url = Curl_bufref_dup(&data->state.url);
  ------------------
  |  |   49|      0|#define Curl_bufref_dup(x) curlx_strdup(Curl_bufref_ptr(x))
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  ------------------
  643|      0|    if(!*url)
  ------------------
  |  Branch (643:8): [True: 0, False: 0]
  ------------------
  644|      0|      return CURLE_OUT_OF_MEMORY;
  645|       |
  646|      0|    connclose(conn); /* close this connection */
  ------------------
  |  |   72|      0|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   66|      0|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
  647|      0|    conn->bits.retry = TRUE; /* mark this as a connection we are about to
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  648|       |                                retry. Marking it this way should prevent i.e
  649|       |                                HTTP transfers to return error because nothing
  650|       |                                has been transferred! */
  651|      0|    Curl_creader_set_rewind(data, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  652|      0|  }
  653|    911|  return CURLE_OK;
  654|    911|}
Curl_xfer_setup_sendrecv:
  702|  1.94k|{
  703|  1.94k|  xfer_setup(data, TRUE, TRUE, recv_size);
  ------------------
  |  |  986|  1.94k|#define TRUE true
  ------------------
                xfer_setup(data, TRUE, TRUE, recv_size);
  ------------------
  |  |  986|  1.94k|#define TRUE true
  ------------------
  704|  1.94k|}
Curl_xfer_write_resp:
  720|    650|{
  721|    650|  CURLcode result = CURLE_OK;
  722|       |
  723|    650|  if(data->conn->scheme->run->write_resp) {
  ------------------
  |  Branch (723:6): [True: 650, False: 0]
  ------------------
  724|       |    /* protocol handlers offering this function take full responsibility
  725|       |     * for writing all received download data to the client. */
  726|    650|    result = data->conn->scheme->run->write_resp(data, buf, blen, is_eos);
  727|    650|  }
  728|      0|  else {
  729|       |    /* No special handling by protocol handler, write all received data
  730|       |     * as BODY to the client. */
  731|      0|    if(blen || is_eos) {
  ------------------
  |  Branch (731:8): [True: 0, False: 0]
  |  Branch (731:16): [True: 0, False: 0]
  ------------------
  732|      0|      int cwtype = CLIENTWRITE_BODY;
  ------------------
  |  |   43|      0|#define CLIENTWRITE_BODY    (1 << 0) /* non-meta information, BODY */
  ------------------
  733|      0|      if(is_eos)
  ------------------
  |  Branch (733:10): [True: 0, False: 0]
  ------------------
  734|      0|        cwtype |= CLIENTWRITE_EOS;
  ------------------
  |  |   50|      0|#define CLIENTWRITE_EOS     (1 << 7) /* End Of transfer download Stream */
  ------------------
  735|      0|      result = Curl_client_write(data, cwtype, buf, blen);
  736|      0|    }
  737|      0|  }
  738|       |
  739|    650|  if(!result && is_eos) {
  ------------------
  |  Branch (739:6): [True: 650, False: 0]
  |  Branch (739:17): [True: 533, False: 117]
  ------------------
  740|       |    /* If we wrote the EOS, we are definitely done */
  741|    533|    data->req.eos_written = TRUE;
  ------------------
  |  |  986|    533|#define TRUE true
  ------------------
  742|    533|    data->req.download_done = TRUE;
  ------------------
  |  |  986|    533|#define TRUE true
  ------------------
  743|    533|  }
  744|    650|  CURL_TRC_WRITE(data, "xfer_write_resp(len=%zu, eos=%d) -> %d",
  ------------------
  |  |  158|    650|  do {                                                     \
  |  |  159|    650|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \
  |  |  ------------------
  |  |  |  |  329|    650|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.30k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 650, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 44, False: 606]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.30k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 44, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     44|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|    650|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     44|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 3, False: 41]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  160|    650|      Curl_trc_write(data, __VA_ARGS__);                   \
  |  |  161|    650|  } while(0)
  |  |  ------------------
  |  |  |  Branch (161:11): [Folded, False: 650]
  |  |  ------------------
  ------------------
  745|    650|                 blen, is_eos, (int)result);
  746|    650|  return result;
  747|    650|}
Curl_xfer_write_resp_hd:
  756|  3.28k|{
  757|  3.28k|  if(data->conn->scheme->run->write_resp_hd) {
  ------------------
  |  Branch (757:6): [True: 3.28k, False: 0]
  ------------------
  758|  3.28k|    DEBUGASSERT(!hd0[hdlen]); /* null-terminated */
  ------------------
  |  | 1016|  3.28k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (758:5): [True: 0, False: 3.28k]
  |  Branch (758:5): [True: 3.28k, False: 0]
  ------------------
  759|       |    /* protocol handlers offering this function take full responsibility
  760|       |     * for writing all received download data to the client. */
  761|  3.28k|    return data->conn->scheme->run->write_resp_hd(data, hd0, hdlen, is_eos);
  762|  3.28k|  }
  763|       |  /* No special handling by protocol handler, write as response bytes */
  764|      0|  return Curl_xfer_write_resp(data, hd0, hdlen, is_eos);
  765|  3.28k|}
Curl_xfer_write_done:
  768|  9.37k|{
  769|  9.37k|  (void)premature;
  770|  9.37k|  return Curl_cw_out_done(data);
  771|  9.37k|}
Curl_xfer_needs_flush:
  774|  17.1k|{
  775|  17.1k|  return Curl_cfchain_needs_flush(data, &data->conn->chain);
  776|  17.1k|}
Curl_xfer_try_send:
  786|  2.23k|{
  787|  2.23k|  CURLcode result;
  788|       |
  789|  2.23k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (789:3): [True: 0, False: 2.23k]
  |  Branch (789:3): [True: 2.23k, False: 0]
  ------------------
  790|  2.23k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (790:3): [True: 0, False: 2.23k]
  |  Branch (790:3): [True: 2.23k, False: 0]
  ------------------
  791|       |
  792|  2.23k|  result = Curl_conn_send(data, buf, blen, eos, pnwritten);
  793|  2.23k|  if(!result && *pnwritten)
  ------------------
  |  Branch (793:6): [True: 2.16k, False: 74]
  |  Branch (793:17): [True: 2.11k, False: 50]
  ------------------
  794|  2.11k|    data->info.request_size += *pnwritten;
  795|       |
  796|  2.23k|  DEBUGF(infof(data, "Curl_xfer_send(len=%zu, eos=%d) -> %d, %zu",
  ------------------
  |  | 1002|  16.2k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 2.23k, False: 0]
  |  |  |  Branch (1002:19): [True: 192, False: 2.04k]
  |  |  |  Branch (1002:19): [True: 192, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 2.23k]
  |  |  ------------------
  ------------------
  797|  2.23k|               blen, eos, (int)result, *pnwritten));
  798|  2.23k|  return result;
  799|  2.23k|}
Curl_xfer_recv:
  821|  9.62k|{
  822|  9.62k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (822:3): [True: 0, False: 9.62k]
  |  Branch (822:3): [True: 9.62k, False: 0]
  ------------------
  823|  9.62k|  DEBUGASSERT(data->conn);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (823:3): [True: 0, False: 9.62k]
  |  Branch (823:3): [True: 9.62k, False: 0]
  ------------------
  824|  9.62k|  DEBUGASSERT(data->set.buffer_size > 0);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (824:3): [True: 0, False: 9.62k]
  |  Branch (824:3): [True: 9.62k, False: 0]
  ------------------
  825|       |
  826|  9.62k|  if(curlx_uitouz(data->set.buffer_size) < blen)
  ------------------
  |  Branch (826:6): [True: 0, False: 9.62k]
  ------------------
  827|      0|    blen = curlx_uitouz(data->set.buffer_size);
  828|  9.62k|  return Curl_conn_recv(data, buf, blen, pnrcvd);
  829|  9.62k|}
Curl_xfer_is_blocked:
  832|  9.62k|{
  833|  9.62k|  bool want_send = CURL_REQ_WANT_SEND(data);
  ------------------
  |  |   39|  9.62k|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  9.62k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  834|  9.62k|  bool want_recv = CURL_REQ_WANT_RECV(data);
  ------------------
  |  |   40|  9.62k|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  9.62k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
  835|  9.62k|  if(!want_send)
  ------------------
  |  Branch (835:6): [True: 8.79k, False: 833]
  ------------------
  836|  8.79k|    return want_recv && Curl_xfer_recv_is_paused(data);
  ------------------
  |  Branch (836:12): [True: 8.79k, False: 0]
  |  Branch (836:25): [True: 0, False: 8.79k]
  ------------------
  837|    833|  else if(!want_recv)
  ------------------
  |  Branch (837:11): [True: 0, False: 833]
  ------------------
  838|      0|    return want_send && Curl_xfer_send_is_paused(data);
  ------------------
  |  Branch (838:12): [True: 0, False: 0]
  |  Branch (838:25): [True: 0, False: 0]
  ------------------
  839|    833|  else
  840|    833|    return Curl_xfer_recv_is_paused(data) && Curl_xfer_send_is_paused(data);
  ------------------
  |  Branch (840:12): [True: 0, False: 833]
  |  Branch (840:46): [True: 0, False: 0]
  ------------------
  841|  9.62k|}
Curl_xfer_send_is_paused:
  844|  1.26k|{
  845|  1.26k|  return Curl_rlimit_is_blocked(&data->progress.ul.rlimit);
  846|  1.26k|}
Curl_xfer_recv_is_paused:
  849|   197k|{
  850|   197k|  return Curl_rlimit_is_blocked(&data->progress.dl.rlimit);
  851|   197k|}
Curl_xfer_is_secure:
  877|  2.00k|{
  878|  2.00k|#ifndef CURL_DISABLE_PROXY
  879|  2.00k|  if(data->conn && data->conn->bits.origin_is_proxy) {
  ------------------
  |  Branch (879:6): [True: 2.00k, False: 0]
  |  Branch (879:20): [True: 0, False: 2.00k]
  ------------------
  880|       |    /* talking to a forward proxy, not secure. we do not use
  881|       |     * a forward proxy for https: and other 's' URLs. Let's just check that
  882|       |     * this did not fail somewhere. */
  883|      0|    DEBUGASSERT(!(data->state.origin->scheme->flags & PROTOPT_SSL));
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (883:5): [True: 0, False: 0]
  |  Branch (883:5): [True: 0, False: 0]
  ------------------
  884|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  885|      0|  }
  886|  2.00k|#endif
  887|  2.00k|  return (data->state.origin->scheme->flags & PROTOPT_SSL);
  ------------------
  |  |  214|  2.00k|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  888|  2.00k|}
transfer.c:sendrecv_dl:
  195|  9.62k|{
  196|  9.62k|  struct connectdata *conn = data->conn;
  197|  9.62k|  CURLcode result = CURLE_OK;
  198|  9.62k|  char *buf, *xfer_buf;
  199|  9.62k|  size_t blen, xfer_blen;
  200|  9.62k|  int maxloops = 10;
  201|  9.62k|  bool safe_eos = FALSE;
  ------------------
  |  |  989|  9.62k|#define FALSE false
  ------------------
  202|  9.62k|  bool rcvd_eagain = FALSE;
  ------------------
  |  |  989|  9.62k|#define FALSE false
  ------------------
  203|  9.62k|  bool is_eos = FALSE, rate_limited = FALSE;
  ------------------
  |  |  989|  9.62k|#define FALSE false
  ------------------
                bool is_eos = FALSE, rate_limited = FALSE;
  ------------------
  |  |  989|  9.62k|#define FALSE false
  ------------------
  204|       |
  205|  9.62k|  result = Curl_multi_xfer_buf_borrow(data, &xfer_buf, &xfer_blen);
  206|  9.62k|  if(result)
  ------------------
  |  Branch (206:6): [True: 0, False: 9.62k]
  ------------------
  207|      0|    goto out;
  208|       |
  209|       |  /* This is where we loop until we have read everything there is to
  210|       |     read or we get a CURLE_AGAIN */
  211|  9.62k|  do {
  212|  9.62k|    size_t bytestoread;
  213|       |
  214|  9.62k|    if(!safe_eos) {
  ------------------
  |  Branch (214:8): [True: 9.62k, False: 0]
  ------------------
  215|       |      /* When the connection handles End-Of-Stream (EOS) safely
  216|       |       * AND we either do not do a range request OR we are HTTP
  217|       |       * (in HTTP, ranged downloads retrieve the right amount),
  218|       |       * we do not have to watch the amount we try to receive.
  219|       |       * This changes only in one direction. */
  220|  9.62k|      safe_eos = Curl_conn_has_safe_eos(conn) &&
  ------------------
  |  Branch (220:18): [True: 9.62k, False: 0]
  ------------------
  221|  9.62k|                 (!data->state.use_range ||
  ------------------
  |  Branch (221:19): [True: 9.58k, False: 49]
  ------------------
  222|     49|                  (conn->scheme->protocol & PROTO_FAMILY_HTTP));
  ------------------
  |  |   83|     49|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|     49|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|     49|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   62|     49|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   84|     49|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   63|     49|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (222:19): [True: 49, False: 0]
  ------------------
  223|  9.62k|    }
  224|       |
  225|  9.62k|    buf = xfer_buf;
  226|  9.62k|    bytestoread = xfer_blen;
  227|       |
  228|  9.62k|    if(bytestoread && Curl_rlimit_active(&data->progress.dl.rlimit)) {
  ------------------
  |  Branch (228:8): [True: 9.62k, False: 0]
  |  Branch (228:23): [True: 49, False: 9.58k]
  ------------------
  229|     49|      curl_off_t dl_avail = Curl_rlimit_avail(&data->progress.dl.rlimit, NULL);
  230|       |#if 0
  231|       |      DEBUGF(infof(data, "dl_rlimit, available=%" FMT_OFF_T, dl_avail));
  232|       |#endif
  233|       |      /* In case of rate limited downloads: if this loop already got data and
  234|       |       * less than 16k is left in the limit, break out. We want to stutter a
  235|       |       * bit to keep in the limit, but too small receives will cost cpu
  236|       |       * unnecessarily. */
  237|     49|      if(dl_avail <= 0) {
  ------------------
  |  Branch (237:10): [True: 0, False: 49]
  ------------------
  238|      0|        rate_limited = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  239|      0|        break;
  240|      0|      }
  241|     49|      if(dl_avail < (curl_off_t)bytestoread)
  ------------------
  |  Branch (241:10): [True: 3, False: 46]
  ------------------
  242|      3|        bytestoread = (size_t)dl_avail;
  243|     49|    }
  244|       |
  245|  9.62k|    rcvd_eagain = FALSE;
  ------------------
  |  |  989|  9.62k|#define FALSE false
  ------------------
  246|  9.62k|    result = xfer_recv_resp(data, buf, bytestoread, safe_eos, &blen);
  247|  9.62k|    if(result) {
  ------------------
  |  Branch (247:8): [True: 9.09k, False: 532]
  ------------------
  248|  9.09k|      if(result != CURLE_AGAIN)
  ------------------
  |  Branch (248:10): [True: 567, False: 8.53k]
  ------------------
  249|    567|        goto out; /* real error */
  250|  8.53k|      rcvd_eagain = TRUE;
  ------------------
  |  |  986|  8.53k|#define TRUE true
  ------------------
  251|  8.53k|      result = CURLE_OK;
  252|  8.53k|      if(data->req.download_done && data->req.no_body &&
  ------------------
  |  Branch (252:10): [True: 1, False: 8.52k]
  |  Branch (252:37): [True: 1, False: 0]
  ------------------
  253|      1|         !data->req.resp_trailer) {
  ------------------
  |  Branch (253:10): [True: 1, False: 0]
  ------------------
  254|      1|        DEBUGF(infof(data, "EAGAIN, download done, no trailer announced, "
  ------------------
  |  | 1002|      7|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 1, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 1]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 1]
  |  |  ------------------
  ------------------
  255|      1|                     "not waiting for EOS"));
  256|      1|        blen = 0;
  257|       |        /* continue as if we received the EOS */
  258|      1|      }
  259|  8.52k|      else
  260|  8.52k|        break; /* get out of loop */
  261|  8.53k|    }
  262|       |
  263|       |    /* We only get a 0-length receive at the end of the response */
  264|    533|    is_eos = (blen == 0);
  265|       |
  266|    533|    if(!blen) {
  ------------------
  |  Branch (266:8): [True: 533, False: 0]
  ------------------
  267|    533|      result = Curl_req_stop_send_recv(data);
  268|    533|      if(result)
  ------------------
  |  Branch (268:10): [True: 0, False: 533]
  ------------------
  269|      0|        goto out;
  270|    533|      if(k->eos_written) /* already did write this to client, leave */
  ------------------
  |  Branch (270:10): [True: 0, False: 533]
  ------------------
  271|      0|        break;
  272|    533|    }
  273|       |
  274|    533|    result = Curl_xfer_write_resp(data, buf, blen, is_eos);
  275|    533|    if(result || data->req.done)
  ------------------
  |  Branch (275:8): [True: 0, False: 533]
  |  Branch (275:18): [True: 0, False: 533]
  ------------------
  276|      0|      goto out;
  277|       |
  278|       |    /* if we are done, we stop receiving. On multiplexed connections,
  279|       |     * we should read the EOS. Which may arrive as meta data after
  280|       |     * the bytes. Not taking it in might lead to RST of streams. */
  281|    533|    if((!safe_eos && data->req.download_done) || is_eos) {
  ------------------
  |  Branch (281:9): [True: 0, False: 533]
  |  Branch (281:22): [True: 0, False: 0]
  |  Branch (281:50): [True: 533, False: 0]
  ------------------
  282|    533|      CURL_REQ_CLEAR_RECV(data);
  ------------------
  |  |   49|    533|  ((d)->req.io_flags &= (uint8_t)~REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|    533|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
  283|    533|    }
  284|       |    /* if we stopped receiving, leave the loop */
  285|    533|    if(!CURL_REQ_WANT_RECV(data))
  ------------------
  |  |   40|    533|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|    533|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
  |  Branch (285:8): [True: 533, False: 0]
  ------------------
  286|    533|      break;
  287|       |
  288|    533|  } while(maxloops--);
  ------------------
  |  Branch (288:11): [True: 0, False: 0]
  ------------------
  289|       |
  290|  9.06k|  if(!is_eos && !rate_limited && CURL_REQ_WANT_RECV(data) &&
  ------------------
  |  |   40|  17.5k|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  8.52k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  |  |  |  Branch (40:32): [True: 8.52k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (290:6): [True: 8.52k, False: 533]
  |  Branch (290:17): [True: 8.52k, False: 0]
  ------------------
  291|  8.52k|     (!rcvd_eagain || data_pending(data, rcvd_eagain))) {
  ------------------
  |  Branch (291:7): [True: 0, False: 8.52k]
  |  Branch (291:23): [True: 0, False: 8.52k]
  ------------------
  292|       |    /* Did not read until EAGAIN/EOS or there is still data pending
  293|       |     * in buffers. Mark as read-again via simulated SELECT results. */
  294|      0|    Curl_multi_mark_dirty(data);
  295|      0|    CURL_TRC_M(data, "sendrecv_dl() no EAGAIN/pending data, mark as dirty");
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  296|      0|  }
  297|       |
  298|  9.06k|  if(!CURL_REQ_WANT_RECV(data) && CURL_REQ_WANT_SEND(data) &&
  ------------------
  |  |   40|  18.1k|#define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  9.06k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
                if(!CURL_REQ_WANT_RECV(data) && CURL_REQ_WANT_SEND(data) &&
  ------------------
  |  |   39|  9.59k|#define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|    533|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  |  |  |  Branch (39:32): [True: 0, False: 533]
  |  |  ------------------
  ------------------
  |  Branch (298:6): [True: 533, False: 8.52k]
  ------------------
  299|      0|     (conn->bits.close || safe_eos)) {
  ------------------
  |  Branch (299:7): [True: 0, False: 0]
  |  Branch (299:27): [True: 0, False: 0]
  ------------------
  300|       |    /* When we have read the entire thing and the close bit is set, the server
  301|       |       may now close the connection. If there is now any kind of sending going
  302|       |       on from our side, we need to stop that immediately. */
  303|      0|    infof(data, "we are done reading and this is set to close, stop send");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  304|      0|    Curl_req_abort_sending(data);
  305|      0|  }
  306|       |
  307|  9.62k|out:
  308|  9.62k|  Curl_multi_xfer_buf_release(data, xfer_buf);
  309|  9.62k|  if(result)
  ------------------
  |  Branch (309:6): [True: 567, False: 9.06k]
  ------------------
  310|    567|    DEBUGF(infof(data, "sendrecv_dl() -> %d", (int)result));
  ------------------
  |  | 1002|  13.7k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 567, False: 0]
  |  |  |  Branch (1002:19): [True: 46, False: 521]
  |  |  |  Branch (1002:19): [True: 46, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 567]
  |  |  ------------------
  ------------------
  311|  9.62k|  return result;
  312|  9.06k|}
transfer.c:xfer_recv_resp:
  162|  9.62k|{
  163|  9.62k|  CURLcode result;
  164|       |
  165|  9.62k|  DEBUGASSERT(blen > 0);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (165:3): [True: 0, False: 9.62k]
  |  Branch (165:3): [True: 9.62k, False: 0]
  ------------------
  166|  9.62k|  *pnread = 0;
  167|       |  /* If we are reading BODY data and the connection does NOT handle EOF
  168|       |   * and we know the size of the BODY data, limit the read amount */
  169|  9.62k|  if(!eos_reliable && !data->req.header && data->req.size != -1) {
  ------------------
  |  Branch (169:6): [True: 0, False: 9.62k]
  |  Branch (169:23): [True: 0, False: 0]
  |  Branch (169:44): [True: 0, False: 0]
  ------------------
  170|      0|    blen = curlx_sotouz_range(data->req.size - data->req.bytecount, 0, blen);
  171|      0|  }
  172|  9.62k|  else if(xfer_recv_shutdown_started(data)) {
  ------------------
  |  Branch (172:11): [True: 0, False: 9.62k]
  ------------------
  173|       |    /* we already received everything. Do not try more. */
  174|      0|    blen = 0;
  175|      0|  }
  176|       |
  177|  9.62k|  if(blen) {
  ------------------
  |  Branch (177:6): [True: 9.62k, False: 0]
  ------------------
  178|  9.62k|    result = Curl_xfer_recv(data, buf, blen, pnread);
  179|  9.62k|    if(result)
  ------------------
  |  Branch (179:8): [True: 9.09k, False: 532]
  ------------------
  180|  9.09k|      return result;
  181|  9.62k|  }
  182|       |
  183|    532|  if(*pnread == 0)
  ------------------
  |  Branch (183:6): [True: 532, False: 0]
  ------------------
  184|    532|    DEBUGF(infof(data, "sendrecv_dl: we are done"));
  ------------------
  |  | 1002|  4.37k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 532, False: 0]
  |  |  |  Branch (1002:19): [True: 41, False: 491]
  |  |  |  Branch (1002:19): [True: 41, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 532]
  |  |  ------------------
  ------------------
  185|    532|  return CURLE_OK;
  186|  9.62k|}
transfer.c:xfer_recv_shutdown_started:
  144|  9.62k|{
  145|  9.62k|  if(!data || !data->conn)
  ------------------
  |  Branch (145:6): [True: 0, False: 9.62k]
  |  Branch (145:15): [True: 0, False: 9.62k]
  ------------------
  146|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  147|  9.62k|  return CURL_CFCHAIN_IN_SHUTDOWN(&data->conn->chain);
  ------------------
  |  |   60|  9.62k|#define CURL_CFCHAIN_IN_SHUTDOWN(c)  ((c)->shutdown_start_ms >= 0)
  ------------------
  148|  9.62k|}
transfer.c:data_pending:
  103|  8.52k|{
  104|  8.52k|  struct connectdata *conn = data->conn;
  105|       |
  106|       |  /* in the case of libssh2, we can never be really sure that we have emptied
  107|       |     its internal buffers so we MUST always try until we get EAGAIN back */
  108|  8.52k|  return (!rcvd_eagain &&
  ------------------
  |  Branch (108:11): [True: 0, False: 8.52k]
  ------------------
  109|      0|          conn->scheme->protocol & (CURLPROTO_SCP | CURLPROTO_SFTP)) ||
  ------------------
  |  | 1092|      0|#define CURLPROTO_SCP     (1L << 4)
  ------------------
                        conn->scheme->protocol & (CURLPROTO_SCP | CURLPROTO_SFTP)) ||
  ------------------
  |  | 1093|      0|#define CURLPROTO_SFTP    (1L << 5)
  ------------------
  |  Branch (109:11): [True: 0, False: 0]
  ------------------
  110|  8.52k|         Curl_conn_data_pending(data);
  ------------------
  |  Branch (110:10): [True: 0, False: 8.52k]
  ------------------
  111|  8.52k|}
transfer.c:sendrecv_ul:
  318|    822|{
  319|       |  /* We should not get here when the sending is already done. */
  320|    822|  DEBUGASSERT(!Curl_req_done_sending(data));
  ------------------
  |  | 1016|    822|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (320:3): [True: 0, False: 822]
  |  Branch (320:3): [True: 822, False: 0]
  ------------------
  321|       |
  322|    822|  if(!Curl_req_done_sending(data))
  ------------------
  |  Branch (322:6): [True: 822, False: 0]
  ------------------
  323|    822|    return Curl_req_send_more(data);
  324|      0|  return CURLE_OK;
  325|    822|}
transfer.c:xfer_setup:
  662|  1.94k|{
  663|  1.94k|  struct SingleRequest *k = &data->req;
  664|  1.94k|  struct connectdata *conn = data->conn;
  665|       |
  666|  1.94k|  DEBUGASSERT(conn);
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (666:3): [True: 0, False: 1.94k]
  |  Branch (666:3): [True: 1.94k, False: 0]
  ------------------
  667|       |  /* if request wants to send, switching off the send direction is wrong */
  668|  1.94k|  DEBUGASSERT(want_send || !Curl_req_want_send(data));
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (668:3): [True: 1.94k, False: 0]
  |  Branch (668:3): [True: 0, False: 0]
  |  Branch (668:3): [True: 1.94k, False: 0]
  |  Branch (668:3): [True: 0, False: 0]
  ------------------
  669|       |
  670|  1.94k|  conn->bits.want_send = want_send;
  671|  1.94k|  conn->bits.want_recv = want_recv;
  672|       |
  673|       |  /* without receiving, there should be not recv_size */
  674|  1.94k|  DEBUGASSERT(want_recv || (recv_size == -1));
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (674:3): [True: 1.94k, False: 0]
  |  Branch (674:3): [True: 0, False: 0]
  |  Branch (674:3): [True: 1.94k, False: 0]
  |  Branch (674:3): [True: 0, False: 0]
  ------------------
  675|  1.94k|  k->size = recv_size;
  676|  1.94k|  k->header = !!conn->scheme->run->write_resp_hd;
  677|       |
  678|       |  /* The code sequence below is placed in this function because all necessary
  679|       |     input is not always known in do_complete() as this function may be called
  680|       |     after that */
  681|  1.94k|  if(!k->header && (recv_size > 0))
  ------------------
  |  Branch (681:6): [True: 0, False: 1.94k]
  |  Branch (681:20): [True: 0, False: 0]
  ------------------
  682|      0|    Curl_pgrsSetDownloadSize(data, recv_size);
  683|       |
  684|       |  /* we want header and/or body, if neither then do not do this! */
  685|  1.94k|  if(conn->scheme->run->write_resp_hd || !data->req.no_body) {
  ------------------
  |  Branch (685:6): [True: 1.94k, False: 0]
  |  Branch (685:42): [True: 0, False: 0]
  ------------------
  686|  1.94k|    if(want_recv)
  ------------------
  |  Branch (686:8): [True: 1.94k, False: 0]
  ------------------
  687|  1.94k|      CURL_REQ_SET_RECV(data);
  ------------------
  |  |   45|  1.94k|#define CURL_REQ_SET_RECV(d)   ((d)->req.io_flags |= REQ_IO_RECV)
  |  |  ------------------
  |  |  |  |   35|  1.94k|#define REQ_IO_RECV       (1 << 0) /* there is or may be data to read */
  |  |  ------------------
  ------------------
  688|  1.94k|    if(want_send)
  ------------------
  |  Branch (688:8): [True: 1.94k, False: 0]
  ------------------
  689|  1.94k|      CURL_REQ_SET_SEND(data);
  ------------------
  |  |   44|  1.94k|#define CURL_REQ_SET_SEND(d)   ((d)->req.io_flags |= REQ_IO_SEND)
  |  |  ------------------
  |  |  |  |   36|  1.94k|#define REQ_IO_SEND       (1 << 1) /* there is or may be data to write */
  |  |  ------------------
  ------------------
  690|  1.94k|  }
  691|  1.94k|  CURL_TRC_M(data, "xfer_setup: want_recv=%d, want_send=%d",
  ------------------
  |  |  148|  1.94k|  do {                                   \
  |  |  149|  1.94k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  1.94k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  1.94k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  3.89k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 1.94k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 145, False: 1.80k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  3.89k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 145, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    145|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  1.94k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    145|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 4, False: 141]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  1.94k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  1.94k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 1.94k]
  |  |  ------------------
  ------------------
  692|  1.94k|             conn->bits.want_recv, conn->bits.want_send);
  693|  1.94k|}

Curl_u32_ptrset_init:
   65|  6.73k|{
   66|  6.73k|  memset(set, 0, sizeof(*set));
   67|  6.73k|  set->dtor = dtor;
   68|  6.73k|#ifdef DEBUGBUILD
   69|  6.73k|  set->init = CURL_U32_PTRSET_MAGIC;
  ------------------
  |  |   30|  6.73k|#define CURL_U32_PTRSET_MAGIC 0x75703272
  ------------------
   70|  6.73k|#endif
   71|  6.73k|}
Curl_u32_ptrset_clear:
   74|  3.36k|{
   75|  3.36k|  uint32_t i;
   76|  3.36k|  DEBUGASSERT(set->init == CURL_U32_PTRSET_MAGIC);
  ------------------
  |  | 1016|  3.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (76:3): [True: 0, False: 3.36k]
  |  Branch (76:3): [True: 3.36k, False: 0]
  ------------------
   77|  3.36k|  if(set->dtor)
  ------------------
  |  Branch (77:6): [True: 3.36k, False: 0]
  ------------------
   78|  65.6k|    for(i = 0; i < CURL_U32_PTRSET_SLOT_CNT(set); ++i)
  ------------------
  |  |   40|  65.6k|#define CURL_U32_PTRSET_SLOT_CNT(s)    CURL_U32_SLOT_CNT((s)->slotbits)
  |  |  ------------------
  |  |  |  |   39|  65.6k|#define CURL_U32_SLOT_CNT(bits)        ((bits) ? (1U << (bits)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:41): [True: 64.2k, False: 1.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (78:16): [True: 62.2k, False: 3.36k]
  ------------------
   79|  62.2k|      if(set->data[i])
  ------------------
  |  Branch (79:10): [True: 0, False: 62.2k]
  ------------------
   80|      0|        set->dtor(set->ids[i], set->data[i]);
   81|       |
   82|       |  curlx_safefree(set->data);
  ------------------
  |  | 1359|  3.36k|  do {                      \
  |  | 1360|  3.36k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  3.36k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  3.36k|    (ptr) = NULL;           \
  |  | 1362|  3.36k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 3.36k]
  |  |  ------------------
  ------------------
   83|  3.36k|  Curl_u32_ptrset_init(set, set->dtor);
   84|  3.36k|}
Curl_u32_ptrset_count:
  191|  7.40k|{
  192|  7.40k|  return set->count;
  193|  7.40k|}
Curl_u32_ptrset_get:
  196|  27.0k|{
  197|  27.0k|  uint32_t i;
  198|  27.0k|  DEBUGASSERT(set->init == CURL_U32_PTRSET_MAGIC);
  ------------------
  |  | 1016|  27.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (198:3): [True: 0, False: 27.0k]
  |  Branch (198:3): [True: 27.0k, False: 0]
  ------------------
  199|  27.0k|  if(u32_ptrset_get_index(set, id, &i))
  ------------------
  |  Branch (199:6): [True: 22.3k, False: 4.76k]
  ------------------
  200|  22.3k|    return set->data[i];
  201|  4.76k|  return NULL;
  202|  27.0k|}
Curl_u32_ptrset_set:
  206|  1.94k|{
  207|  1.94k|  uint32_t i;
  208|       |
  209|  1.94k|  DEBUGASSERT(set->init == CURL_U32_PTRSET_MAGIC);
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:3): [True: 0, False: 1.94k]
  |  Branch (209:3): [True: 1.94k, False: 0]
  ------------------
  210|  1.94k|  if(!ptr) {
  ------------------
  |  Branch (210:6): [True: 0, False: 1.94k]
  ------------------
  211|      0|    Curl_u32_ptrset_unset(set, id);
  212|      0|    return CURLE_OK;
  213|      0|  }
  214|       |
  215|  1.94k|  if(u32_ptrset_get_index(set, id, &i)) {
  ------------------
  |  Branch (215:6): [True: 0, False: 1.94k]
  ------------------
  216|       |    /* `id` is in set, replace value */
  217|      0|    if(set->dtor && (set->data[i] != ptr))
  ------------------
  |  Branch (217:8): [True: 0, False: 0]
  |  Branch (217:21): [True: 0, False: 0]
  ------------------
  218|      0|      set->dtor(set->ids[i], set->data[i]);
  219|       |#if CURL_U32_PTRSET_DEBUG
  220|       |    curl_mfprintf(stderr, "u32_ptrset_set replace %u=%p at idx=%u\n",
  221|       |                  id, ptr, i);
  222|       |#endif
  223|      0|    set->data[i] = ptr;
  224|      0|    return CURLE_OK;
  225|      0|  }
  226|       |  /* `id` not in set yet, grow if full */
  227|  1.94k|  if((set->count >= CURL_U32_PTRSET_SLOT_CNT(set)) &&
  ------------------
  |  |   40|  1.94k|#define CURL_U32_PTRSET_SLOT_CNT(s)    CURL_U32_SLOT_CNT((s)->slotbits)
  |  |  ------------------
  |  |  |  |   39|  1.94k|#define CURL_U32_SLOT_CNT(bits)        ((bits) ? (1U << (bits)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:41): [True: 0, False: 1.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (227:6): [True: 1.94k, False: 0]
  ------------------
  228|  1.94k|     !u32_ptrset_grow(set)) {
  ------------------
  |  Branch (228:6): [True: 0, False: 1.94k]
  ------------------
  229|      0|    return CURLE_OUT_OF_MEMORY;
  230|      0|  }
  231|       |
  232|  1.94k|  u32_ptrset_add(set, id, ptr);
  233|  1.94k|  return CURLE_OK;
  234|  1.94k|}
Curl_u32_ptrset_unset:
  266|  1.94k|{
  267|  1.94k|  u32_ptrset_unset(set, id);
  268|  1.94k|}
u32_ptrset.c:u32_ptrset_get_index:
  166|  30.9k|{
  167|  30.9k|  uint32_t i = CURL_U32_PTRSET_SLOT_IDX(set, id);
  ------------------
  |  |   41|  30.9k|#define CURL_U32_PTRSET_SLOT_IDX(s, i) (uint32_t)((i) & (s)->slotmask)
  ------------------
  168|  30.9k|  uint32_t psl = 0;
  169|  30.9k|  if(!set->data)
  ------------------
  |  Branch (169:6): [True: 6.70k, False: 24.2k]
  ------------------
  170|  6.70k|    return FALSE;
  ------------------
  |  |  989|  6.70k|#define FALSE false
  ------------------
  171|  24.2k|  while(set->data[i] && (psl <= set->psl[i])) {
  ------------------
  |  Branch (171:9): [True: 24.2k, False: 0]
  |  Branch (171:25): [True: 24.2k, False: 0]
  ------------------
  172|  24.2k|    if(set->ids[i] == id) {
  ------------------
  |  Branch (172:8): [True: 24.2k, False: 0]
  ------------------
  173|  24.2k|      *pindex = i;
  174|       |#if CURL_U32_PTRSET_DEBUG
  175|       |      curl_mfprintf(stderr, "u32_ptrset_index %u=%p at idx=%u\n",
  176|       |                    id, set->data[i], i);
  177|       |#endif
  178|  24.2k|      return TRUE;
  ------------------
  |  |  986|  24.2k|#define TRUE true
  ------------------
  179|  24.2k|    }
  180|      0|    i = CURL_U32_PTRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   41|      0|#define CURL_U32_PTRSET_SLOT_IDX(s, i) (uint32_t)((i) & (s)->slotmask)
  ------------------
  181|      0|    ++psl;
  182|      0|  }
  183|       |#if CURL_U32_PTRSET_DEBUG
  184|       |  curl_mfprintf(stderr, "u32_ptrset_index %u not found\n", id);
  185|       |#endif
  186|      0|  *pindex = 0;
  187|       |  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  188|  24.2k|}
u32_ptrset.c:u32_ptrset_grow:
  115|  1.94k|{
  116|  1.94k|  uint32_t i, *prev_ids;
  117|  1.94k|  uint8_t nslotbits, pslotbits;
  118|  1.94k|  void **prev_data;
  119|  1.94k|  size_t nslots;
  120|  1.94k|  const size_t slot_size = (sizeof(void *) + (2 * sizeof(uint32_t)));
  121|  1.94k|  void *d;
  122|       |
  123|  1.94k|  if(set->slotbits >= 31)
  ------------------
  |  Branch (123:6): [True: 0, False: 1.94k]
  ------------------
  124|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  125|  1.94k|  nslotbits = set->slotbits ? (uint8_t)(set->slotbits + 1) : 5;
  ------------------
  |  Branch (125:15): [True: 0, False: 1.94k]
  ------------------
  126|  1.94k|  nslots = CURL_U32_SLOT_CNT(nslotbits);
  ------------------
  |  |   39|  1.94k|#define CURL_U32_SLOT_CNT(bits)        ((bits) ? (1U << (bits)) : 0)
  |  |  ------------------
  |  |  |  Branch (39:41): [True: 1.94k, False: 0]
  |  |  ------------------
  ------------------
  127|  1.94k|  if(nslots > (SIZE_MAX / slot_size)) /* 32-bit arch may trigger here */
  ------------------
  |  Branch (127:6): [True: 0, False: 1.94k]
  ------------------
  128|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  129|       |#if CURL_U32_PTRSET_DEBUG
  130|       |  curl_mfprintf(stderr, "u32_ptrset_grow from bits=%d to %d, slots=%zu\n",
  131|       |                set->slotbits, nslotbits, nslots);
  132|       |#endif
  133|  1.94k|  d = curlx_calloc(1, nslots * slot_size);
  ------------------
  |  | 1500|  1.94k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  134|  1.94k|  if(!d)
  ------------------
  |  Branch (134:6): [True: 0, False: 1.94k]
  ------------------
  135|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  136|       |
  137|  1.94k|  prev_data = set->data;
  138|  1.94k|  prev_ids = set->ids;
  139|  1.94k|  pslotbits = set->slotbits;
  140|       |#if defined(__GNUC__) && __GNUC__ >= 13
  141|       |#pragma GCC diagnostic push
  142|       |#pragma GCC diagnostic ignored "-Wanalyzer-allocation-size"
  143|       |#endif
  144|  1.94k|  set->data = d;
  145|  1.94k|  set->ids = (uint32_t *)(set->data + nslots);
  146|  1.94k|  set->psl = (uint32_t *)(set->ids + nslots);
  147|       |#if defined(__GNUC__) && __GNUC__ >= 13
  148|       |#pragma GCC diagnostic pop
  149|       |#endif
  150|       |
  151|  1.94k|  set->slotbits = nslotbits;
  152|  1.94k|  set->slotmask = (uint32_t)((1U << set->slotbits) - 1);
  153|  1.94k|  set->count = 0;
  154|       |  /* re-add previous entries */
  155|  1.94k|  for(i = 0; i < CURL_U32_SLOT_CNT(pslotbits); ++i) {
  ------------------
  |  |   39|  1.94k|#define CURL_U32_SLOT_CNT(bits)        ((bits) ? (1U << (bits)) : 0)
  |  |  ------------------
  |  |  |  Branch (39:41): [True: 0, False: 1.94k]
  |  |  ------------------
  ------------------
  |  Branch (155:14): [True: 0, False: 1.94k]
  ------------------
  156|      0|    if(prev_data[i])
  ------------------
  |  Branch (156:8): [True: 0, False: 0]
  ------------------
  157|      0|      u32_ptrset_add(set, prev_ids[i], prev_data[i]);
  158|      0|  }
  159|  1.94k|  if(prev_data)
  ------------------
  |  Branch (159:6): [True: 0, False: 1.94k]
  ------------------
  160|      0|    curlx_free(prev_data);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  161|       |  return TRUE;
  ------------------
  |  |  986|  1.94k|#define TRUE true
  ------------------
  162|  1.94k|}
u32_ptrset.c:u32_ptrset_add:
   87|  1.94k|{
   88|  1.94k|  uint32_t i = CURL_U32_PTRSET_SLOT_IDX(set, id);
  ------------------
  |  |   41|  1.94k|#define CURL_U32_PTRSET_SLOT_IDX(s, i) (uint32_t)((i) & (s)->slotmask)
  ------------------
   89|  1.94k|  uint32_t psl = 0;
   90|  1.94k|  while(set->data[i]) {
  ------------------
  |  Branch (90:9): [True: 0, False: 1.94k]
  ------------------
   91|      0|    if(psl > set->psl[i]) { /* SWAP */
  ------------------
  |  Branch (91:8): [True: 0, False: 0]
  ------------------
   92|      0|      void *tmpdata;
   93|       |#if CURL_U32_PTRSET_DEBUG
   94|       |  curl_mfprintf(stderr, "u32_ptrset_add %u=%p to idx=%u\n", id, ptr, i);
   95|       |#endif
   96|      0|      tmpdata = set->data[i];
   97|      0|      set->data[i] = ptr;
   98|      0|      ptr = tmpdata;
   99|      0|      CURL_SWAP(set->psl[i], psl);
  ------------------
  |  |   36|      0|#define CURL_SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b)))
  ------------------
  100|      0|      CURL_SWAP(set->ids[i], id);
  ------------------
  |  |   36|      0|#define CURL_SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b)))
  ------------------
  101|      0|    }
  102|      0|    i = CURL_U32_PTRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   41|      0|#define CURL_U32_PTRSET_SLOT_IDX(s, i) (uint32_t)((i) & (s)->slotmask)
  ------------------
  103|      0|    ++psl;
  104|      0|  }
  105|  1.94k|  set->ids[i] = id;
  106|  1.94k|  set->data[i] = ptr;
  107|  1.94k|  set->psl[i] = psl;
  108|  1.94k|  ++set->count;
  109|       |#if CURL_U32_PTRSET_DEBUG
  110|       |  curl_mfprintf(stderr, "u32_ptrset_add %u=%p to idx=%u\n", id, ptr, i);
  111|       |#endif
  112|  1.94k|}
u32_ptrset.c:u32_ptrset_unset:
  237|  1.94k|{
  238|  1.94k|  uint32_t i, j;
  239|       |
  240|  1.94k|  DEBUGASSERT(set->init == CURL_U32_PTRSET_MAGIC);
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (240:3): [True: 0, False: 1.94k]
  |  Branch (240:3): [True: 1.94k, False: 0]
  ------------------
  241|  1.94k|  if(u32_ptrset_get_index(set, id, &i)) {
  ------------------
  |  Branch (241:6): [True: 1.94k, False: 0]
  ------------------
  242|       |    /* `id` is in set */
  243|       |#if CURL_U32_PTRSET_DEBUG
  244|       |    curl_mfprintf(stderr, "u32_ptrset_unset %u at idx=%u\n", id, i);
  245|       |#endif
  246|  1.94k|    if(set->dtor)
  ------------------
  |  Branch (246:8): [True: 1.94k, False: 0]
  ------------------
  247|  1.94k|      set->dtor(set->ids[i], set->data[i]);
  248|  1.94k|    set->data[i] = NULL;
  249|  1.94k|    set->ids[i] = set->psl[i] = 0;
  250|  1.94k|    --set->count;
  251|  1.94k|    j = CURL_U32_PTRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   41|  1.94k|#define CURL_U32_PTRSET_SLOT_IDX(s, i) (uint32_t)((i) & (s)->slotmask)
  ------------------
  252|       |    /* shift all entries with positive psl "down" */
  253|  1.94k|    while(set->data[j] && set->psl[j]) {
  ------------------
  |  Branch (253:11): [True: 0, False: 1.94k]
  |  Branch (253:27): [True: 0, False: 0]
  ------------------
  254|      0|      set->data[i] = set->data[j];
  255|      0|      set->ids[i] = set->ids[j];
  256|      0|      set->psl[i] = set->psl[j] - 1;
  257|      0|      set->data[j] = NULL;
  258|      0|      set->ids[j] = set->psl[j] = 0;
  259|      0|      i = j;
  260|      0|      j = CURL_U32_PTRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   41|      0|#define CURL_U32_PTRSET_SLOT_IDX(s, i) (uint32_t)((i) & (s)->slotmask)
  ------------------
  261|      0|    }
  262|  1.94k|  }
  263|  1.94k|}

Curl_u8_strset_init:
   64|  59.2k|{
   65|       |#if defined(__GNUC__) && __GNUC__ >= 13
   66|       |#pragma GCC diagnostic push
   67|       |#pragma GCC diagnostic ignored "-Warray-bounds"
   68|       |#endif
   69|  59.2k|  memset(set, 0, sizeof(*set));
   70|       |#if defined(__GNUC__) && __GNUC__ >= 13
   71|       |#pragma GCC diagnostic pop
   72|       |#endif
   73|  59.2k|  set->data = set->sdata;
   74|  59.2k|  set->ids = set->sids;
   75|  59.2k|  set->psl = set->spsl;
   76|  59.2k|  set->slotbits = CURL_U8_STRSET_START_BITS;
  ------------------
  |  |   39|  59.2k|#define CURL_U8_STRSET_START_BITS   3
  ------------------
   77|  59.2k|  set->slotmask = CURL_U8_SLOT_MASK(set->slotbits);
  ------------------
  |  |   40|  59.2k|#define CURL_U8_SLOT_MASK(i)             (uint8_t)((1U << (i)) - 1)
  ------------------
   78|  59.2k|  set->count = 0;
   79|  59.2k|#ifdef DEBUGBUILD
   80|  59.2k|  set->init = CURL_U8_STRSET_MAGIC;
  ------------------
  |  |   31|  59.2k|#define CURL_U8_STRSET_MAGIC 0x7117e783
  ------------------
   81|  59.2k|#endif
   82|  59.2k|}
Curl_u8_strset_clear:
   85|  19.7k|{
   86|  19.7k|  uint16_t i;
   87|  19.7k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|  19.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:3): [True: 0, False: 19.7k]
  |  Branch (87:3): [True: 19.7k, False: 0]
  ------------------
   88|   179k|  for(i = 0; i < CURL_U8_STRSET_SLOT_CNT(set); ++i)
  ------------------
  |  |   41|   179k|#define CURL_U8_STRSET_SLOT_CNT(s)       CURL_U8_SLOT_CNT((s)->slotbits)
  |  |  ------------------
  |  |  |  |   39|   179k|#define CURL_U8_SLOT_CNT(i)              (uint16_t)((i) ? (1U << (i)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:53): [True: 179k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (88:14): [True: 159k, False: 19.7k]
  ------------------
   89|   159k|    curlx_safefree(set->data[i]);
  ------------------
  |  | 1359|   179k|  do {                      \
  |  | 1360|   159k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|   159k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|   159k|    (ptr) = NULL;           \
  |  | 1362|   159k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 159k]
  |  |  ------------------
  ------------------
   90|       |
   91|  19.7k|  if(set->data != set->sdata)
  ------------------
  |  Branch (91:6): [True: 201, False: 19.5k]
  ------------------
   92|       |    curlx_safefree(set->data);
  ------------------
  |  | 1359|    201|  do {                      \
  |  | 1360|    201|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|    201|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|    201|    (ptr) = NULL;           \
  |  | 1362|    201|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 201]
  |  |  ------------------
  ------------------
   93|  19.7k|  Curl_u8_strset_init(set);
   94|  19.7k|}
Curl_u8_strset_get:
  199|   547k|{
  200|   547k|  uint8_t i;
  201|   547k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|   547k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (201:3): [True: 0, False: 547k]
  |  Branch (201:3): [True: 547k, False: 0]
  ------------------
  202|   547k|  if(u8_strset_get_index(set, id, &i))
  ------------------
  |  Branch (202:6): [True: 85.5k, False: 461k]
  ------------------
  203|  85.5k|    return set->data[i];
  204|   461k|  return NULL;
  205|   547k|}
Curl_u8_strset_setn:
  209|  82.2k|{
  210|  82.2k|  uint8_t i;
  211|       |
  212|  82.2k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|  82.2k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (212:3): [True: 0, False: 82.2k]
  |  Branch (212:3): [True: 82.2k, False: 0]
  ------------------
  213|       |#if CURL_U8_STRSET_DEBUG
  214|       |  curl_mfprintf(stderr, "u8_strset_setn %d=%s\n", id, str);
  215|       |#endif
  216|  82.2k|  if(!str) {
  ------------------
  |  Branch (216:6): [True: 347, False: 81.8k]
  ------------------
  217|    347|    Curl_u8_strset_unset(set, id);
  218|    347|    return CURLE_OK;
  219|    347|  }
  220|       |
  221|  81.8k|  if(u8_strset_get_index(set, id, &i)) {
  ------------------
  |  Branch (221:6): [True: 10.6k, False: 71.2k]
  ------------------
  222|       |    /* `id` is in set, replace value */
  223|  10.6k|    curlx_free(set->data[i]);
  ------------------
  |  | 1503|  10.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  224|  10.6k|    set->data[i] = str;
  225|  10.6k|    return CURLE_OK;
  226|  10.6k|  }
  227|       |  /* `id` not in set yet, grow if full */
  228|  71.2k|  if((set->count >= CURL_U8_STRSET_SLOT_CNT(set)) && !u8_strset_grow(set)) {
  ------------------
  |  |   41|  71.2k|#define CURL_U8_STRSET_SLOT_CNT(s)       CURL_U8_SLOT_CNT((s)->slotbits)
  |  |  ------------------
  |  |  |  |   39|  71.2k|#define CURL_U8_SLOT_CNT(i)              (uint16_t)((i) ? (1U << (i)) : 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (39:53): [True: 71.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (228:6): [True: 216, False: 70.9k]
  |  Branch (228:54): [True: 12, False: 204]
  ------------------
  229|     12|    curlx_free(str);
  ------------------
  |  | 1503|     12|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  230|     12|    return CURLE_OUT_OF_MEMORY;
  231|     12|  }
  232|       |
  233|  71.1k|  u8_strset_addn(set, id, str);
  234|  71.1k|  return CURLE_OK;
  235|  71.2k|}
Curl_u8_strset_setx:
  239|  77.4k|{
  240|  77.4k|  char *val;
  241|       |
  242|  77.4k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|  77.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (242:3): [True: 0, False: 77.4k]
  |  Branch (242:3): [True: 77.4k, False: 0]
  ------------------
  243|  77.4k|  if(!str) {
  ------------------
  |  Branch (243:6): [True: 0, False: 77.4k]
  ------------------
  244|      0|    Curl_u8_strset_unset(set, id);
  245|      0|    return CURLE_OK;
  246|      0|  }
  247|       |
  248|  77.4k|  val = curlx_memdup0(str, slen);
  249|  77.4k|  if(!val)
  ------------------
  |  Branch (249:6): [True: 192, False: 77.2k]
  ------------------
  250|    192|    return CURLE_OUT_OF_MEMORY;
  251|  77.2k|  return Curl_u8_strset_setn(set, id, val);
  252|  77.4k|}
Curl_u8_strset_unset:
  290|  5.00k|{
  291|       |  u8_strset_unset(set, id, FALSE);
  ------------------
  |  |  989|  5.00k|#define FALSE false
  ------------------
  292|  5.00k|}
Curl_u8_strset_unset0:
  295|  98.7k|{
  296|       |  u8_strset_unset(set, id, TRUE);
  ------------------
  |  |  986|  98.7k|#define TRUE true
  ------------------
  297|  98.7k|}
u8_strset.c:u8_strset_get_index:
  169|   732k|{
  170|   732k|  uint8_t i = CURL_U8_STRSET_SLOT_IDX(set, id);
  ------------------
  |  |   38|   732k|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  171|   732k|  uint8_t psl = 0;
  172|  1.63M|  while(set->data[i] && (psl <= set->psl[i])) {
  ------------------
  |  Branch (172:9): [True: 1.20M, False: 430k]
  |  Branch (172:25): [True: 1.00M, False: 203k]
  ------------------
  173|  1.00M|    if(set->ids[i] == id) {
  ------------------
  |  Branch (173:8): [True: 99.4k, False: 904k]
  ------------------
  174|  99.4k|      *pindex = i;
  175|       |#if CURL_U8_STRSET_DEBUG
  176|       |      curl_mfprintf(stderr, "u8_strset_index %d=%s\n", id, set->data[i]);
  177|       |#endif
  178|  99.4k|      return TRUE;
  ------------------
  |  |  986|  99.4k|#define TRUE true
  ------------------
  179|  99.4k|    }
  180|   904k|    i = CURL_U8_STRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   38|   904k|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  181|   904k|    ++psl;
  182|   904k|  }
  183|       |#if CURL_U8_STRSET_DEBUG
  184|       |  curl_mfprintf(stderr, "u8_strset_index %d not found\n", id);
  185|       |#endif
  186|   633k|  *pindex = 0;
  187|       |  return FALSE;
  ------------------
  |  |  989|   633k|#define FALSE false
  ------------------
  188|   732k|}
u8_strset.c:u8_strset_grow:
  119|    216|{
  120|    216|  uint8_t *prev_ids, nslotbits;
  121|    216|  uint16_t prev_slots;
  122|    216|  char **prev_data;
  123|    216|  size_t nslots;
  124|    216|  void *d;
  125|       |
  126|    216|  if(set->slotbits >= 8)
  ------------------
  |  Branch (126:6): [True: 0, False: 216]
  ------------------
  127|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  128|    216|  nslotbits = (uint8_t)(set->slotbits + 1);
  129|       |#if CURL_U8_STRSET_DEBUG
  130|       |  curl_mfprintf(stderr, "u8_strset_grow from %d to %d\n",
  131|       |                set->slotbits, nslotbits);
  132|       |#endif
  133|    216|  nslots = CURL_U8_SLOT_CNT(nslotbits);
  ------------------
  |  |   39|    216|#define CURL_U8_SLOT_CNT(i)              (uint16_t)((i) ? (1U << (i)) : 0)
  |  |  ------------------
  |  |  |  Branch (39:53): [True: 216, False: 0]
  |  |  ------------------
  ------------------
  134|    216|  d = curlx_calloc(1, (nslots * sizeof(char *)) + (2 * nslots));
  ------------------
  |  | 1500|    216|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  135|    216|  if(!d)
  ------------------
  |  Branch (135:6): [True: 12, False: 204]
  ------------------
  136|     12|    return FALSE;
  ------------------
  |  |  989|     12|#define FALSE false
  ------------------
  137|       |
  138|    204|  prev_data = set->data;
  139|    204|  prev_ids = set->ids;
  140|    204|  prev_slots = set->slotbits;
  141|       |#if defined(__GNUC__) && __GNUC__ >= 13
  142|       |#pragma GCC diagnostic push
  143|       |#pragma GCC diagnostic ignored "-Wanalyzer-allocation-size"
  144|       |#endif
  145|    204|  set->data = (char **)d;
  146|       |#if defined(__GNUC__) && __GNUC__ >= 13
  147|       |#pragma GCC diagnostic pop
  148|       |#endif
  149|    204|  set->ids = (uint8_t *)d + (nslots * sizeof(char *));
  150|    204|  set->psl = set->ids + nslots;
  151|    204|  set->slotbits = nslotbits;
  152|    204|  set->slotmask = CURL_U8_SLOT_MASK(set->slotbits);
  ------------------
  |  |   40|    204|#define CURL_U8_SLOT_MASK(i)             (uint8_t)((1U << (i)) - 1)
  ------------------
  153|    204|  set->count = 0;
  154|       |  /* re-add previous entries */
  155|    204|  {
  156|    204|    uint16_t i;
  157|  1.86k|    for(i = 0; i < CURL_U8_SLOT_CNT(prev_slots); ++i) {
  ------------------
  |  |   39|  1.86k|#define CURL_U8_SLOT_CNT(i)              (uint16_t)((i) ? (1U << (i)) : 0)
  |  |  ------------------
  |  |  |  Branch (39:53): [True: 1.86k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (157:16): [True: 1.65k, False: 204]
  ------------------
  158|  1.65k|      if(prev_data[i])
  ------------------
  |  Branch (158:10): [True: 1.65k, False: 0]
  ------------------
  159|  1.65k|        u8_strset_addn(set, prev_ids[i], prev_data[i]);
  160|  1.65k|    }
  161|    204|  }
  162|    204|  if(prev_data != set->sdata)
  ------------------
  |  Branch (162:6): [True: 3, False: 201]
  ------------------
  163|      3|    curlx_free(prev_data);
  ------------------
  |  | 1503|      3|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  164|       |  return TRUE;
  ------------------
  |  |  986|    204|#define TRUE true
  ------------------
  165|    216|}
u8_strset.c:u8_strset_addn:
   97|  72.8k|{
   98|  72.8k|  uint8_t i = CURL_U8_STRSET_SLOT_IDX(set, id);
  ------------------
  |  |   38|  72.8k|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
   99|  72.8k|  uint8_t psl = 0;
  100|   135k|  while(set->data[i]) {
  ------------------
  |  Branch (100:9): [True: 62.8k, False: 72.8k]
  ------------------
  101|  62.8k|    if(psl > set->psl[i]) { /* SWAP */
  ------------------
  |  Branch (101:8): [True: 21.3k, False: 41.4k]
  ------------------
  102|  21.3k|      char *tmpdata;
  103|  21.3k|      tmpdata = set->data[i];
  104|  21.3k|      set->data[i] = val;
  105|  21.3k|      val = tmpdata;
  106|  21.3k|      CURL_SWAP(set->psl[i], psl);
  ------------------
  |  |   36|  21.3k|#define CURL_SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b)))
  ------------------
  107|  21.3k|      CURL_SWAP(set->ids[i], id);
  ------------------
  |  |   36|  21.3k|#define CURL_SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b)))
  ------------------
  108|  21.3k|    }
  109|  62.8k|    i = CURL_U8_STRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   38|  62.8k|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  110|  62.8k|    ++psl;
  111|  62.8k|  }
  112|  72.8k|  set->ids[i] = id;
  113|  72.8k|  set->data[i] = val;
  114|  72.8k|  set->psl[i] = psl;
  115|  72.8k|  ++set->count;
  116|  72.8k|}
u8_strset.c:u8_strset_unset:
  264|   103k|{
  265|   103k|  uint8_t i, j;
  266|       |
  267|   103k|  DEBUGASSERT(set->init == CURL_U8_STRSET_MAGIC);
  ------------------
  |  | 1016|   103k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (267:3): [True: 0, False: 103k]
  |  Branch (267:3): [True: 103k, False: 0]
  ------------------
  268|   103k|  if(u8_strset_get_index(set, id, &i)) {
  ------------------
  |  Branch (268:6): [True: 3.16k, False: 100k]
  ------------------
  269|       |    /* `id` is in set */
  270|  3.16k|    if(zero)
  ------------------
  |  Branch (270:8): [True: 259, False: 2.90k]
  ------------------
  271|    259|      curlx_strzero(set->data[i]);
  272|  3.16k|    curlx_safefree(set->data[i]);
  ------------------
  |  | 1359|  3.16k|  do {                      \
  |  | 1360|  3.16k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  3.16k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  3.16k|    (ptr) = NULL;           \
  |  | 1362|  3.16k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 3.16k]
  |  |  ------------------
  ------------------
  273|  3.16k|    set->ids[i] = set->psl[i] = 0;
  274|  3.16k|    --set->count;
  275|  3.16k|    j = CURL_U8_STRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   38|  3.16k|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  276|       |    /* shift all entries with positive psl "down" */
  277|  4.47k|    while(set->data[j] && set->psl[j]) {
  ------------------
  |  Branch (277:11): [True: 4.08k, False: 386]
  |  Branch (277:27): [True: 1.31k, False: 2.77k]
  ------------------
  278|  1.31k|      set->data[i] = set->data[j];
  279|  1.31k|      set->ids[i] = set->ids[j];
  280|  1.31k|      set->psl[i] = (uint8_t)(set->psl[j] - 1);
  281|  1.31k|      set->data[j] = NULL;
  282|  1.31k|      set->ids[j] = set->psl[j] = 0;
  283|  1.31k|      i = j;
  284|  1.31k|      j = CURL_U8_STRSET_SLOT_IDX(set, i + 1);
  ------------------
  |  |   38|  1.31k|#define CURL_U8_STRSET_SLOT_IDX(s, i)    (uint8_t)((i) & (s)->slotmask)
  ------------------
  285|  1.31k|    }
  286|  3.16k|  }
  287|   103k|}

Curl_uint32_bset_init:
   33|  49.0k|{
   34|  49.0k|  memset(bset, 0, sizeof(*bset));
   35|  49.0k|#ifdef DEBUGBUILD
   36|  49.0k|  bset->init = CURL_UINT32_BSET_MAGIC;
  ------------------
  |  |   29|  49.0k|#define CURL_UINT32_BSET_MAGIC  0x62757473
  ------------------
   37|  49.0k|#endif
   38|  49.0k|}
Curl_uint32_bset_resize:
   41|  48.6k|{
   42|  48.6k|  uint32_t nslots = (nmax < (UINT32_MAX - 63)) ?
  ------------------
  |  Branch (42:21): [True: 48.6k, False: 0]
  ------------------
   43|  48.6k|                    ((nmax + 63) / 64) : (UINT32_MAX / 64);
   44|       |
   45|  48.6k|  DEBUGASSERT(bset->init == CURL_UINT32_BSET_MAGIC);
  ------------------
  |  | 1016|  48.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (45:3): [True: 0, False: 48.6k]
  |  Branch (45:3): [True: 48.6k, False: 0]
  ------------------
   46|  48.6k|  if(nslots != bset->nslots) {
  ------------------
  |  Branch (46:6): [True: 48.6k, False: 0]
  ------------------
   47|  48.6k|    uint64_t *slots = curlx_calloc(nslots, sizeof(uint64_t));
  ------------------
  |  | 1500|  48.6k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   48|  48.6k|    if(!slots)
  ------------------
  |  Branch (48:8): [True: 45, False: 48.5k]
  ------------------
   49|     45|      return CURLE_OUT_OF_MEMORY;
   50|       |
   51|  48.5k|    if(bset->slots) {
  ------------------
  |  Branch (51:8): [True: 0, False: 48.5k]
  ------------------
   52|      0|      memcpy(slots, bset->slots,
   53|      0|             (CURLMIN(nslots, bset->nslots) * sizeof(uint64_t)));
  ------------------
  |  | 1315|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   54|      0|      curlx_free(bset->slots);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   55|      0|    }
   56|  48.5k|    bset->slots = slots;
   57|  48.5k|    bset->nslots = nslots;
   58|  48.5k|    bset->first_slot_used = 0;
   59|  48.5k|  }
   60|  48.5k|  return CURLE_OK;
   61|  48.6k|}
Curl_uint32_bset_destroy:
   64|  49.0k|{
   65|  49.0k|  DEBUGASSERT(bset->init == CURL_UINT32_BSET_MAGIC);
  ------------------
  |  | 1016|  49.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (65:3): [True: 0, False: 49.0k]
  |  Branch (65:3): [True: 49.0k, False: 0]
  ------------------
   66|  49.0k|  curlx_free(bset->slots);
  ------------------
  |  | 1503|  49.0k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   67|  49.0k|  memset(bset, 0, sizeof(*bset));
   68|  49.0k|}
Curl_uint32_bset_count:
   80|  8.05k|{
   81|  8.05k|  uint32_t i;
   82|  8.05k|  uint32_t n = 0;
   83|  24.1k|  for(i = bset->first_slot_used; i < bset->nslots; ++i) {
  ------------------
  |  Branch (83:34): [True: 16.1k, False: 8.05k]
  ------------------
   84|  16.1k|    if(bset->slots[i])
  ------------------
  |  Branch (84:8): [True: 0, False: 16.1k]
  ------------------
   85|      0|      n += CURL_POPCOUNT64(bset->slots[i]);
  ------------------
  |  |  347|      0|#      define CURL_POPCOUNT64(x)       __builtin_popcountl(x)
  ------------------
   86|  16.1k|  }
   87|  8.05k|  return n;
   88|  8.05k|}
Curl_uint32_bset_empty:
   91|  16.1k|{
   92|  16.1k|  uint32_t i;
   93|  32.2k|  for(i = bset->first_slot_used; i < bset->nslots; ++i) {
  ------------------
  |  Branch (93:34): [True: 24.1k, False: 8.05k]
  ------------------
   94|  24.1k|    if(bset->slots[i])
  ------------------
  |  Branch (94:8): [True: 8.05k, False: 16.1k]
  ------------------
   95|  8.05k|      return FALSE;
  ------------------
  |  |  989|  8.05k|#define FALSE false
  ------------------
   96|  24.1k|  }
   97|  8.05k|  return TRUE;
  ------------------
  |  |  986|  8.05k|#define TRUE true
  ------------------
   98|  16.1k|}
Curl_uint32_bset_add:
  109|  53.1k|{
  110|  53.1k|  uint32_t islot = i / 64;
  111|  53.1k|  if(islot >= bset->nslots)
  ------------------
  |  Branch (111:6): [True: 0, False: 53.1k]
  ------------------
  112|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  113|  53.1k|  bset->slots[islot] |= ((uint64_t)1 << (i % 64));
  114|  53.1k|  if(islot < bset->first_slot_used)
  ------------------
  |  Branch (114:6): [True: 11.1k, False: 41.9k]
  ------------------
  115|  11.1k|    bset->first_slot_used = islot;
  116|       |  return TRUE;
  ------------------
  |  |  986|  53.1k|#define TRUE true
  ------------------
  117|  53.1k|}
Curl_uint32_bset_remove:
  120|   355k|{
  121|   355k|  size_t islot = i / 64;
  122|   355k|  if(islot < bset->nslots)
  ------------------
  |  Branch (122:6): [True: 355k, False: 0]
  ------------------
  123|   355k|    bset->slots[islot] &= ~((uint64_t)1 << (i % 64));
  124|   355k|}
Curl_uint32_bset_contains:
  127|  24.3k|{
  128|  24.3k|  uint32_t islot = i / 64;
  129|  24.3k|  if(islot >= bset->nslots)
  ------------------
  |  Branch (129:6): [True: 0, False: 24.3k]
  ------------------
  130|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  131|  24.3k|  return (bset->slots[islot] & ((uint64_t)1 << (i % 64))) != 0;
  132|  24.3k|}
Curl_uint32_bset_first:
  135|   333k|{
  136|   333k|  uint32_t i;
  137|   400k|  for(i = bset->first_slot_used; i < bset->nslots; ++i) {
  ------------------
  |  Branch (137:34): [True: 268k, False: 131k]
  ------------------
  138|   268k|    if(bset->slots[i]) {
  ------------------
  |  Branch (138:8): [True: 201k, False: 66.5k]
  ------------------
  139|   201k|      *pfirst = (i * 64) + CURL_CTZ64(bset->slots[i]);
  ------------------
  |  |  348|   201k|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  140|   201k|      bset->first_slot_used = i;
  141|   201k|      return TRUE;
  ------------------
  |  |  986|   201k|#define TRUE true
  ------------------
  142|   201k|    }
  143|   268k|  }
  144|   131k|  bset->first_slot_used = *pfirst = UINT32_MAX;
  145|       |  return FALSE;
  ------------------
  |  |  989|   131k|#define FALSE false
  ------------------
  146|   333k|}
Curl_uint32_bset_next:
  150|   369k|{
  151|   369k|  uint32_t islot;
  152|   369k|  uint64_t x;
  153|       |
  154|   369k|  ++last; /* look for number one higher than last */
  155|   369k|  islot = last / 64; /* the slot this would be in */
  156|   369k|  if(islot < bset->nslots) {
  ------------------
  |  Branch (156:6): [True: 369k, False: 0]
  ------------------
  157|       |    /* shift away the bits we already iterated in this slot */
  158|   369k|    x = (bset->slots[islot] >> (last % 64));
  159|   369k|    if(x) {
  ------------------
  |  Branch (159:8): [True: 177k, False: 191k]
  ------------------
  160|       |      /* more bits set, next is `last` + trailing 0s of the shifted slot */
  161|   177k|      *pnext = last + CURL_CTZ64(x);
  ------------------
  |  |  348|   177k|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  162|   177k|      return TRUE;
  ------------------
  |  |  986|   177k|#define TRUE true
  ------------------
  163|   177k|    }
  164|       |    /* no more bits set in the last slot, scan forward */
  165|   383k|    for(islot = islot + 1; islot < bset->nslots; ++islot) {
  ------------------
  |  Branch (165:28): [True: 191k, False: 191k]
  ------------------
  166|   191k|      if(bset->slots[islot]) {
  ------------------
  |  Branch (166:10): [True: 0, False: 191k]
  ------------------
  167|      0|        *pnext = (islot * 64) + CURL_CTZ64(bset->slots[islot]);
  ------------------
  |  |  348|      0|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  168|      0|        return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  169|      0|      }
  170|   191k|    }
  171|   191k|  }
  172|   191k|  *pnext = UINT32_MAX; /* a value we cannot store */
  173|       |  return FALSE;
  ------------------
  |  |  989|   191k|#define FALSE false
  ------------------
  174|   369k|}

Curl_uint32_spbset_init:
   34|  13.5k|{
   35|  13.5k|  memset(bset, 0, sizeof(*bset));
   36|  13.5k|#ifdef DEBUGBUILD
   37|  13.5k|  bset->init = CURL_UINT32_SPBSET_MAGIC;
  ------------------
  |  |   30|  13.5k|#define CURL_UINT32_SPBSET_MAGIC  0x70737362
  ------------------
   38|  13.5k|#endif
   39|  13.5k|}
uint32_spbset_clear:
   47|  13.5k|{
   48|  13.5k|  struct uint32_spbset_chunk *next, *chunk;
   49|       |
   50|  13.5k|  for(chunk = bset->head.next; chunk; chunk = next) {
  ------------------
  |  Branch (50:32): [True: 0, False: 13.5k]
  ------------------
   51|      0|    next = chunk->next;
   52|      0|    curlx_free(chunk);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   53|      0|  }
   54|  13.5k|  memset(&bset->head, 0, sizeof(bset->head));
   55|  13.5k|}
Curl_uint32_spbset_destroy:
   58|  13.5k|{
   59|  13.5k|  DEBUGASSERT(bset->init == CURL_UINT32_SPBSET_MAGIC);
  ------------------
  |  | 1016|  13.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (59:3): [True: 0, False: 13.5k]
  |  Branch (59:3): [True: 13.5k, False: 0]
  ------------------
   60|  13.5k|  uint32_spbset_clear(bset);
   61|  13.5k|}
Curl_uint32_spbset_count:
   64|  35.1k|{
   65|  35.1k|  struct uint32_spbset_chunk *chunk;
   66|  35.1k|  uint32_t i, n = 0;
   67|       |
   68|  70.2k|  for(chunk = &bset->head; chunk; chunk = chunk->next) {
  ------------------
  |  Branch (68:28): [True: 35.1k, False: 35.1k]
  ------------------
   69|   175k|    for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) {
  ------------------
  |  |   37|   175k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  ------------------
  |  Branch (69:16): [True: 140k, False: 35.1k]
  ------------------
   70|   140k|      if(chunk->slots[i])
  ------------------
  |  Branch (70:10): [True: 17.7k, False: 122k]
  ------------------
   71|  17.7k|        n += CURL_POPCOUNT64(chunk->slots[i]);
  ------------------
  |  |  347|  17.7k|#      define CURL_POPCOUNT64(x)       __builtin_popcountl(x)
  ------------------
   72|   140k|    }
   73|  35.1k|  }
   74|  35.1k|  return n;
   75|  35.1k|}
Curl_uint32_spbset_add:
  182|  13.5k|{
  183|  13.5k|  struct uint32_spbset_chunk *chunk = uint32_spbset_get_chunk(bset, i, TRUE);
  ------------------
  |  |  986|  13.5k|#define TRUE true
  ------------------
  184|  13.5k|  if(!chunk)
  ------------------
  |  Branch (184:6): [True: 0, False: 13.5k]
  ------------------
  185|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  186|       |
  187|  13.5k|  DEBUGASSERT(i >= chunk->offset);
  ------------------
  |  | 1016|  13.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (187:3): [True: 0, False: 13.5k]
  |  Branch (187:3): [True: 13.5k, False: 0]
  ------------------
  188|  13.5k|  i -= chunk->offset;
  189|  13.5k|  DEBUGASSERT(i < (CURL_UINT32_SPBSET_CH_SLOTS * 64));
  ------------------
  |  | 1016|  13.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (189:3): [True: 0, False: 13.5k]
  |  Branch (189:3): [True: 13.5k, False: 0]
  ------------------
  190|  13.5k|  chunk->slots[(i / 64)] |= ((uint64_t)1 << (i % 64));
  191|       |  return TRUE;
  ------------------
  |  |  986|  13.5k|#define TRUE true
  ------------------
  192|  13.5k|}
Curl_uint32_spbset_remove:
  195|  13.1k|{
  196|  13.1k|  struct uint32_spbset_chunk *chunk = uint32_spbset_get_chunk(bset, i, FALSE);
  ------------------
  |  |  989|  13.1k|#define FALSE false
  ------------------
  197|  13.1k|  if(chunk) {
  ------------------
  |  Branch (197:6): [True: 13.1k, False: 0]
  ------------------
  198|  13.1k|    DEBUGASSERT(i >= chunk->offset);
  ------------------
  |  | 1016|  13.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (198:5): [True: 0, False: 13.1k]
  |  Branch (198:5): [True: 13.1k, False: 0]
  ------------------
  199|  13.1k|    i -= chunk->offset;
  200|  13.1k|    DEBUGASSERT(i < (CURL_UINT32_SPBSET_CH_SLOTS * 64));
  ------------------
  |  | 1016|  13.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (200:5): [True: 0, False: 13.1k]
  |  Branch (200:5): [True: 13.1k, False: 0]
  ------------------
  201|  13.1k|    chunk->slots[(i / 64)] &= ~((uint64_t)1 << (i % 64));
  202|  13.1k|  }
  203|  13.1k|}
Curl_uint32_spbset_contains:
  206|  15.4k|{
  207|  15.4k|  struct uint32_spbset_chunk *chunk = uint32_spbset_get_chunk(bset, i, FALSE);
  ------------------
  |  |  989|  15.4k|#define FALSE false
  ------------------
  208|  15.4k|  if(chunk) {
  ------------------
  |  Branch (208:6): [True: 15.4k, False: 0]
  ------------------
  209|  15.4k|    DEBUGASSERT(i >= chunk->offset);
  ------------------
  |  | 1016|  15.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (209:5): [True: 0, False: 15.4k]
  |  Branch (209:5): [True: 15.4k, False: 0]
  ------------------
  210|  15.4k|    i -= chunk->offset;
  211|  15.4k|    DEBUGASSERT(i < (CURL_UINT32_SPBSET_CH_SLOTS * 64));
  ------------------
  |  | 1016|  15.4k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (211:5): [True: 0, False: 15.4k]
  |  Branch (211:5): [True: 15.4k, False: 0]
  ------------------
  212|  15.4k|    return (chunk->slots[i / 64] & ((uint64_t)1 << (i % 64))) != 0;
  213|  15.4k|  }
  214|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  215|  15.4k|}
Curl_uint32_spbset_first:
  218|  14.1k|{
  219|  14.1k|  struct uint32_spbset_chunk *chunk;
  220|  14.1k|  uint32_t i;
  221|       |
  222|  17.9k|  for(chunk = &bset->head; chunk; chunk = chunk->next) {
  ------------------
  |  Branch (222:28): [True: 14.1k, False: 3.77k]
  ------------------
  223|  29.2k|    for(i = 0; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) {
  ------------------
  |  |   37|  29.2k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  ------------------
  |  Branch (223:16): [True: 25.4k, False: 3.77k]
  ------------------
  224|  25.4k|      if(chunk->slots[i]) {
  ------------------
  |  Branch (224:10): [True: 10.3k, False: 15.0k]
  ------------------
  225|  10.3k|        *pfirst = chunk->offset + ((i * 64) + CURL_CTZ64(chunk->slots[i]));
  ------------------
  |  |  348|  10.3k|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  226|  10.3k|        return TRUE;
  ------------------
  |  |  986|  10.3k|#define TRUE true
  ------------------
  227|  10.3k|      }
  228|  25.4k|    }
  229|  14.1k|  }
  230|  3.77k|  *pfirst = 0; /* give it a defined value even if it should not be used */
  231|       |  return FALSE;
  ------------------
  |  |  989|  3.77k|#define FALSE false
  ------------------
  232|  14.1k|}
Curl_uint32_spbset_next:
  277|  10.3k|{
  278|  10.3k|  struct uint32_spbset_chunk *chunk;
  279|  10.3k|  uint32_t last_offset;
  280|       |
  281|  10.3k|  ++last; /* look for the next higher number */
  282|  10.3k|  last_offset = (last & ~CURL_UINT32_SPBSET_CH_MASK);
  ------------------
  |  |   38|  10.3k|#define CURL_UINT32_SPBSET_CH_MASK   ((CURL_UINT32_SPBSET_CH_SLOTS * 64) - 1)
  |  |  ------------------
  |  |  |  |   37|  10.3k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  |  |  ------------------
  ------------------
  283|       |
  284|  10.3k|  for(chunk = &bset->head; chunk; chunk = chunk->next) {
  ------------------
  |  Branch (284:28): [True: 10.3k, False: 0]
  ------------------
  285|  10.3k|    if(chunk->offset >= last_offset) {
  ------------------
  |  Branch (285:8): [True: 10.3k, False: 0]
  ------------------
  286|  10.3k|      break;
  287|  10.3k|    }
  288|  10.3k|  }
  289|       |
  290|  10.3k|  if(chunk && (chunk->offset == last_offset)) {
  ------------------
  |  Branch (290:6): [True: 10.3k, False: 0]
  |  Branch (290:15): [True: 10.3k, False: 0]
  ------------------
  291|       |    /* is there a number higher than last in this chunk? */
  292|  10.3k|    if(uint32_spbset_chunk_next(chunk, last, pnext))
  ------------------
  |  Branch (292:8): [True: 0, False: 10.3k]
  ------------------
  293|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  294|       |    /* not in this chunk */
  295|  10.3k|    chunk = chunk->next;
  296|  10.3k|  }
  297|       |  /* look for the first in the "higher" chunks, if there are any. */
  298|  10.3k|  while(chunk) {
  ------------------
  |  Branch (298:9): [True: 0, False: 10.3k]
  ------------------
  299|      0|    if(uint32_spbset_chunk_first(chunk, pnext))
  ------------------
  |  Branch (299:8): [True: 0, False: 0]
  ------------------
  300|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  301|      0|    chunk = chunk->next;
  302|      0|  }
  303|  10.3k|  *pnext = UINT32_MAX;
  304|       |  return FALSE;
  ------------------
  |  |  989|  10.3k|#define FALSE false
  ------------------
  305|  10.3k|}
uint-spbset.c:uint32_spbset_get_chunk:
  146|  42.2k|{
  147|  42.2k|  struct uint32_spbset_chunk *chunk;
  148|  42.2k|  uint32_t i_offset = (i & ~CURL_UINT32_SPBSET_CH_MASK);
  ------------------
  |  |   38|  42.2k|#define CURL_UINT32_SPBSET_CH_MASK   ((CURL_UINT32_SPBSET_CH_SLOTS * 64) - 1)
  |  |  ------------------
  |  |  |  |   37|  42.2k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  |  |  ------------------
  ------------------
  149|       |
  150|  42.2k|  if(!bset)
  ------------------
  |  Branch (150:6): [True: 0, False: 42.2k]
  ------------------
  151|      0|    return NULL;
  152|       |
  153|  42.2k|  for(chunk = &bset->head; chunk; chunk = chunk->next) {
  ------------------
  |  Branch (153:28): [True: 42.2k, False: 0]
  ------------------
  154|  42.2k|    if(chunk->offset == i_offset)
  ------------------
  |  Branch (154:8): [True: 42.2k, False: 0]
  ------------------
  155|  42.2k|      return chunk;
  156|      0|    else if(chunk->offset > i_offset)
  ------------------
  |  Branch (156:13): [True: 0, False: 0]
  ------------------
  157|      0|      break; /* need new chunk here */
  158|  42.2k|  }
  159|      0|  if(!grow) /* just a check if the chunk exists */
  ------------------
  |  Branch (159:6): [True: 0, False: 0]
  ------------------
  160|      0|    return NULL;
  161|       |
  162|       |  /* Is there an empty chunk to reuse? */
  163|      0|  chunk = uint32_spbset_unlink_empty(bset, i_offset);
  164|      0|  if(chunk) {
  ------------------
  |  Branch (164:6): [True: 0, False: 0]
  ------------------
  165|      0|    chunk->offset = i_offset;
  166|      0|    if(chunk == &bset->head) /* head chunk is empty, stayed linked */
  ------------------
  |  Branch (166:8): [True: 0, False: 0]
  ------------------
  167|      0|      return &bset->head;
  168|       |    /* was really unlinked, need to insert below */
  169|      0|  }
  170|      0|  else {
  171|       |    /* need a new one */
  172|      0|    chunk = curlx_calloc(1, sizeof(*chunk));
  ------------------
  |  | 1500|      0|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  173|      0|    if(!chunk)
  ------------------
  |  Branch (173:8): [True: 0, False: 0]
  ------------------
  174|      0|      return NULL;
  175|      0|    chunk->offset = i_offset;
  176|      0|  }
  177|       |
  178|      0|  return uint32_spbset_insert_chunk(bset, chunk);
  179|      0|}
uint-spbset.c:uint32_spbset_chunk_next:
  251|  10.3k|{
  252|  10.3k|  if(chunk->offset <= last) {
  ------------------
  |  Branch (252:6): [True: 10.3k, False: 0]
  ------------------
  253|  10.3k|    uint64_t x;
  254|  10.3k|    uint32_t i = ((last - chunk->offset) / 64);
  255|  10.3k|    if(i < CURL_UINT32_SPBSET_CH_SLOTS) {
  ------------------
  |  |   37|  10.3k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  ------------------
  |  Branch (255:8): [True: 10.3k, False: 0]
  ------------------
  256|  10.3k|      x = (chunk->slots[i] >> (last % 64));
  257|  10.3k|      if(x) {
  ------------------
  |  Branch (257:10): [True: 0, False: 10.3k]
  ------------------
  258|       |        /* more bits set, next is `last` + trailing 0s of the shifted slot */
  259|      0|        *pnext = last + CURL_CTZ64(x);
  ------------------
  |  |  348|      0|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  260|      0|        return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  261|      0|      }
  262|       |      /* no more bits set in the last slot, scan forward */
  263|  41.4k|      for(i = i + 1; i < CURL_UINT32_SPBSET_CH_SLOTS; ++i) {
  ------------------
  |  |   37|  41.4k|#define CURL_UINT32_SPBSET_CH_SLOTS  4
  ------------------
  |  Branch (263:22): [True: 31.1k, False: 10.3k]
  ------------------
  264|  31.1k|        if(chunk->slots[i]) {
  ------------------
  |  Branch (264:12): [True: 0, False: 31.1k]
  ------------------
  265|      0|          *pnext = chunk->offset + ((i * 64) + CURL_CTZ64(chunk->slots[i]));
  ------------------
  |  |  348|      0|#      define CURL_CTZ64(x)            __builtin_ctzl(x)
  ------------------
  266|      0|          return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  267|      0|        }
  268|  31.1k|      }
  269|  10.3k|    }
  270|  10.3k|  }
  271|  10.3k|  *pnext = UINT32_MAX;
  272|       |  return FALSE;
  ------------------
  |  |  989|  10.3k|#define FALSE false
  ------------------
  273|  10.3k|}

Curl_uint32_tbl_init:
   33|  19.6k|{
   34|  19.6k|  memset(tbl, 0, sizeof(*tbl));
   35|  19.6k|  tbl->last_key_added = UINT32_MAX;
   36|  19.6k|#ifdef DEBUGBUILD
   37|  19.6k|  tbl->init = CURL_UINT32_TBL_MAGIC;
  ------------------
  |  |   29|  19.6k|#define CURL_UINT32_TBL_MAGIC  0x62757473
  ------------------
   38|  19.6k|#endif
   39|  19.6k|}
Curl_uint32_tbl_resize:
   57|  19.1k|{
   58|       |  /* we use `tbl->nrows + 1` during iteration, want that to work */
   59|  19.1k|  DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
  ------------------
  |  | 1016|  19.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (59:3): [True: 0, False: 19.1k]
  |  Branch (59:3): [True: 19.1k, False: 0]
  ------------------
   60|  19.1k|  if(!nrows)
  ------------------
  |  Branch (60:6): [True: 0, False: 19.1k]
  ------------------
   61|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
   62|  19.1k|  if(nrows != tbl->nrows) {
  ------------------
  |  Branch (62:6): [True: 19.1k, False: 0]
  ------------------
   63|  19.1k|    void **rows = curlx_calloc(nrows, sizeof(void *));
  ------------------
  |  | 1500|  19.1k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   64|  19.1k|    if(!rows)
  ------------------
  |  Branch (64:8): [True: 8, False: 19.1k]
  ------------------
   65|      8|      return CURLE_OUT_OF_MEMORY;
   66|  19.1k|    if(tbl->rows) {
  ------------------
  |  Branch (66:8): [True: 0, False: 19.1k]
  ------------------
   67|      0|      memcpy(rows, tbl->rows, (CURLMIN(nrows, tbl->nrows) * sizeof(void *)));
  ------------------
  |  | 1315|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   68|      0|      if(nrows < tbl->nrows)
  ------------------
  |  Branch (68:10): [True: 0, False: 0]
  ------------------
   69|      0|        uint32_tbl_clear_rows(tbl, nrows, tbl->nrows);
   70|      0|      curlx_free(tbl->rows);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   71|      0|    }
   72|  19.1k|    tbl->rows = rows;
   73|  19.1k|    tbl->nrows = nrows;
   74|  19.1k|  }
   75|  19.1k|  return CURLE_OK;
   76|  19.1k|}
uint32_tbl_clear:
   84|  19.6k|{
   85|  19.6k|  DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
  ------------------
  |  | 1016|  19.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (85:3): [True: 0, False: 19.6k]
  |  Branch (85:3): [True: 19.6k, False: 0]
  ------------------
   86|  19.6k|  uint32_tbl_clear_rows(tbl, 0, tbl->nrows);
   87|  19.6k|  DEBUGASSERT(!tbl->nentries);
  ------------------
  |  | 1016|  19.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:3): [True: 0, False: 19.6k]
  |  Branch (87:3): [True: 19.6k, False: 0]
  ------------------
   88|  19.6k|  tbl->last_key_added = UINT32_MAX;
   89|  19.6k|}
Curl_uint32_tbl_destroy:
   92|  19.6k|{
   93|  19.6k|  DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
  ------------------
  |  | 1016|  19.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (93:3): [True: 0, False: 19.6k]
  |  Branch (93:3): [True: 19.6k, False: 0]
  ------------------
   94|  19.6k|  uint32_tbl_clear(tbl);
   95|  19.6k|  curlx_free(tbl->rows);
  ------------------
  |  | 1503|  19.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   96|  19.6k|  memset(tbl, 0, sizeof(*tbl));
   97|  19.6k|}
Curl_uint32_tbl_capacity:
  100|  19.1k|{
  101|  19.1k|  return tbl->nrows;
  102|  19.1k|}
Curl_uint32_tbl_count:
  105|  42.4k|{
  106|  42.4k|  return tbl->nentries;
  107|  42.4k|}
Curl_uint32_tbl_get:
  110|   476k|{
  111|   476k|  return (key < tbl->nrows) ? tbl->rows[key] : NULL;
  ------------------
  |  Branch (111:10): [True: 476k, False: 0]
  ------------------
  112|   476k|}
Curl_uint32_tbl_add:
  115|  28.9k|{
  116|  28.9k|  uint32_t key, start_pos;
  117|       |
  118|  28.9k|  DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
  ------------------
  |  | 1016|  28.9k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (118:3): [True: 0, False: 28.9k]
  |  Branch (118:3): [True: 28.9k, False: 0]
  ------------------
  119|  28.9k|  if(!entry || !pkey)
  ------------------
  |  Branch (119:6): [True: 0, False: 28.9k]
  |  Branch (119:16): [True: 0, False: 28.9k]
  ------------------
  120|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  121|  28.9k|  *pkey = UINT32_MAX;
  122|  28.9k|  if(tbl->nentries == tbl->nrows)  /* full */
  ------------------
  |  Branch (122:6): [True: 0, False: 28.9k]
  ------------------
  123|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  124|       |
  125|  28.9k|  start_pos = CURLMIN(tbl->last_key_added, tbl->nrows) + 1;
  ------------------
  |  | 1315|  28.9k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 9.76k, False: 19.1k]
  |  |  ------------------
  ------------------
  126|  28.9k|  for(key = start_pos; key < tbl->nrows; ++key) {
  ------------------
  |  Branch (126:24): [True: 9.76k, False: 19.1k]
  ------------------
  127|  9.76k|    if(!tbl->rows[key]) {
  ------------------
  |  Branch (127:8): [True: 9.76k, False: 0]
  ------------------
  128|  9.76k|      tbl->rows[key] = entry;
  129|  9.76k|      tbl->nentries++;
  130|  9.76k|      tbl->last_key_added = key;
  131|  9.76k|      *pkey = key;
  132|  9.76k|      return TRUE;
  ------------------
  |  |  986|  9.76k|#define TRUE true
  ------------------
  133|  9.76k|    }
  134|  9.76k|  }
  135|       |  /* no free entry at or above tbl->maybe_next_key, wrap around */
  136|  19.1k|  for(key = 0; key < start_pos; ++key) {
  ------------------
  |  Branch (136:16): [True: 19.1k, False: 0]
  ------------------
  137|  19.1k|    if(!tbl->rows[key]) {
  ------------------
  |  Branch (137:8): [True: 19.1k, False: 0]
  ------------------
  138|  19.1k|      tbl->rows[key] = entry;
  139|  19.1k|      tbl->nentries++;
  140|  19.1k|      tbl->last_key_added = key;
  141|  19.1k|      *pkey = key;
  142|  19.1k|      return TRUE;
  ------------------
  |  |  986|  19.1k|#define TRUE true
  ------------------
  143|  19.1k|    }
  144|  19.1k|  }
  145|       |  /* Did not find any free row? Should not happen */
  146|      0|  DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (146:3): [Folded, False: 0]
  |  Branch (146:3): [Folded, False: 0]
  ------------------
  147|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  148|      0|}
Curl_uint32_tbl_remove:
  151|  28.9k|{
  152|  28.9k|  if(key < tbl->nrows)
  ------------------
  |  Branch (152:6): [True: 28.9k, False: 0]
  ------------------
  153|  28.9k|    uint32_tbl_clear_rows(tbl, key, key + 1);
  154|  28.9k|}
Curl_uint32_tbl_contains:
  157|  9.76k|{
  158|  9.76k|  return (key < tbl->nrows) ? !!tbl->rows[key] : FALSE;
  ------------------
  |  |  989|  9.76k|#define FALSE false
  ------------------
  |  Branch (158:10): [True: 9.76k, False: 0]
  ------------------
  159|  9.76k|}
Curl_uint32_tbl_first:
  178|  38.6k|{
  179|  38.6k|  if(!pkey || !pentry)
  ------------------
  |  Branch (179:6): [True: 0, False: 38.6k]
  |  Branch (179:15): [True: 0, False: 38.6k]
  ------------------
  180|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  181|  38.6k|  if(tbl->nentries && uint32_tbl_next_at(tbl, 0, pkey, pentry))
  ------------------
  |  Branch (181:6): [True: 21.0k, False: 17.5k]
  |  Branch (181:23): [True: 21.0k, False: 0]
  ------------------
  182|  21.0k|    return TRUE;
  ------------------
  |  |  986|  21.0k|#define TRUE true
  ------------------
  183|  17.5k|  DEBUGASSERT(!tbl->nentries);
  ------------------
  |  | 1016|  17.5k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (183:3): [True: 0, False: 17.5k]
  |  Branch (183:3): [True: 17.5k, False: 0]
  ------------------
  184|  17.5k|  *pkey = UINT32_MAX;  /* always invalid */
  185|  17.5k|  *pentry = NULL;
  186|       |  return FALSE;
  ------------------
  |  |  989|  17.5k|#define FALSE false
  ------------------
  187|  17.5k|}
Curl_uint32_tbl_next:
  191|  30.8k|{
  192|  30.8k|  if(!pkey || !pentry)
  ------------------
  |  Branch (192:6): [True: 0, False: 30.8k]
  |  Branch (192:15): [True: 0, False: 30.8k]
  ------------------
  193|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  194|  30.8k|  if(uint32_tbl_next_at(tbl, last_key + 1, pkey, pentry))
  ------------------
  |  Branch (194:6): [True: 9.76k, False: 21.0k]
  ------------------
  195|  9.76k|    return TRUE;
  ------------------
  |  |  986|  9.76k|#define TRUE true
  ------------------
  196|  21.0k|  *pkey = UINT32_MAX;  /* always invalid */
  197|  21.0k|  *pentry = NULL;
  198|       |  return FALSE;
  ------------------
  |  |  989|  21.0k|#define FALSE false
  ------------------
  199|  30.8k|}
uint-table.c:uint32_tbl_clear_rows:
   44|  48.5k|{
   45|  48.5k|  uint32_t i, end;
   46|       |
   47|  48.5k|  end = CURLMIN(upto_excluding, tbl->nrows);
  ------------------
  |  | 1315|  48.5k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 28.9k, False: 19.6k]
  |  |  ------------------
  ------------------
   48|  1.47M|  for(i = from; i < end; ++i) {
  ------------------
  |  Branch (48:17): [True: 1.43M, False: 48.5k]
  ------------------
   49|  1.43M|    if(tbl->rows[i]) {
  ------------------
  |  Branch (49:8): [True: 28.9k, False: 1.40M]
  ------------------
   50|       |      tbl->rows[i] = NULL;
   51|  28.9k|      tbl->nentries--;
   52|  28.9k|    }
   53|  1.43M|  }
   54|  48.5k|}
uint-table.c:uint32_tbl_next_at:
  163|  51.9k|{
  164|  2.54M|  for(; key < tbl->nrows; ++key) {
  ------------------
  |  Branch (164:9): [True: 2.52M, False: 21.0k]
  ------------------
  165|  2.52M|    if(tbl->rows[key]) {
  ------------------
  |  Branch (165:8): [True: 30.8k, False: 2.49M]
  ------------------
  166|  30.8k|      *pkey = key;
  167|  30.8k|      *pentry = tbl->rows[key];
  168|  30.8k|      return TRUE;
  ------------------
  |  |  986|  30.8k|#define TRUE true
  ------------------
  169|  30.8k|    }
  170|  2.52M|  }
  171|  21.0k|  *pkey = UINT32_MAX;  /* always invalid */
  172|  21.0k|  *pentry = NULL;
  173|       |  return FALSE;
  ------------------
  |  |  989|  21.0k|#define FALSE false
  ------------------
  174|  51.9k|}

Curl_freeset:
  148|  19.7k|{
  149|       |  /* Free all dynamic strings stored in the data->set substructure. */
  150|  19.7k|  enum dupblob j;
  151|       |
  152|  19.7k|  CURL_EASY_STR_CLEAR0(data, STRING_PASSWORD);
  ------------------
  |  | 1214|  19.7k|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  153|  19.7k|  CURL_EASY_STR_CLEAR0(data, STRING_KEY_PASSWD);
  ------------------
  |  | 1214|  19.7k|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  154|  19.7k|  CURL_EASY_STR_CLEAR0(data, STRING_BEARER);
  ------------------
  |  | 1214|  19.7k|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  155|  19.7k|#ifndef CURL_DISABLE_PROXY
  156|  19.7k|  CURL_EASY_STR_CLEAR0(data, STRING_PROXYPASSWORD);
  ------------------
  |  | 1214|  19.7k|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  157|  19.7k|  CURL_EASY_STR_CLEAR0(data, STRING_KEY_PASSWD_PROXY);
  ------------------
  |  | 1214|  19.7k|  Curl_u8_strset_unset0(&(d)->set.strings, (uint8_t)(id))
  ------------------
  158|  19.7k|#endif
  159|  19.7k|  Curl_u8_strset_clear(&data->set.strings);
  160|  19.7k|  curlx_safefree(data->set.a.str_copypostfields);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  161|       |
  162|   177k|  for(j = (enum dupblob)0; j < BLOB_LAST; j++) {
  ------------------
  |  Branch (162:28): [True: 157k, False: 19.7k]
  ------------------
  163|   157k|    curlx_safefree(data->set.a.blobs[j]);
  ------------------
  |  | 1359|   157k|  do {                      \
  |  | 1360|   157k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|   157k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|   157k|    (ptr) = NULL;           \
  |  | 1362|   157k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 157k]
  |  |  ------------------
  ------------------
  164|   157k|  }
  165|       |
  166|  19.7k|  Curl_frzn_strs_safefree(&data->set.a.resolve);
  167|  19.7k|  Curl_frzn_strs_safefree(&data->set.a.connect_to);
  168|  19.7k|#ifndef CURL_DISABLE_HSTS
  169|  19.7k|  Curl_frzn_strs_safefree(&data->set.a.hsts_files);
  170|  19.7k|#endif
  171|  19.7k|#ifndef CURL_DISABLE_TELNET
  172|  19.7k|  Curl_frzn_strs_safefree(&data->set.a.telnet_options);
  173|  19.7k|#endif
  174|  19.7k|#ifndef CURL_DISABLE_HTTP
  175|  19.7k|  Curl_frzn_strs_safefree(&data->set.a.http200aliases);
  176|  19.7k|#endif
  177|  19.7k|#if !defined(CURL_DISABLE_FTP) || defined(USE_SSH)
  178|  19.7k|  Curl_frzn_strs_safefree(&data->set.a.quote);
  179|  19.7k|  Curl_frzn_strs_safefree(&data->set.a.postquote);
  180|  19.7k|  Curl_frzn_strs_safefree(&data->set.a.prequote);
  181|  19.7k|#endif
  182|  19.7k|#ifndef CURL_DISABLE_SMTP
  183|  19.7k|  Curl_frzn_strs_safefree(&data->set.a.mail_rcpt);
  184|  19.7k|#endif
  185|       |
  186|  19.7k|  Curl_bufref_free(&data->state.referer);
  187|  19.7k|  Curl_bufref_free(&data->state.url);
  188|       |
  189|  19.7k|#if !defined(CURL_DISABLE_MIME) || !defined(CURL_DISABLE_FORM_API)
  190|  19.7k|  Curl_mime_cleanpart(data->set.a.mimepostp);
  191|  19.7k|  curlx_safefree(data->set.a.mimepostp);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  192|  19.7k|#endif
  193|       |
  194|  19.7k|#ifndef CURL_DISABLE_COOKIES
  195|  19.7k|  curl_slist_free_all(data->state.cookielist);
  196|       |  data->state.cookielist = NULL;
  197|  19.7k|#endif
  198|  19.7k|}
Curl_close:
  218|  19.7k|{
  219|  19.7k|  struct Curl_easy *data;
  220|       |
  221|  19.7k|  if(!datap || !*datap)
  ------------------
  |  Branch (221:6): [True: 0, False: 19.7k]
  |  Branch (221:16): [True: 0, False: 19.7k]
  ------------------
  222|      0|    return CURLE_OK;
  223|       |
  224|  19.7k|  data = *datap;
  225|  19.7k|  *datap = NULL;
  226|       |
  227|  19.7k|  if(!data->state.internal && data->multi) {
  ------------------
  |  Branch (227:6): [True: 9.91k, False: 9.82k]
  |  Branch (227:31): [True: 0, False: 9.91k]
  ------------------
  228|       |    /* This handle is still part of a multi handle, take care of this first
  229|       |       and detach this handle from there.
  230|       |       This detaches the connection. */
  231|      0|    Curl_multi_remove_handle(data->multi, data);
  232|      0|  }
  233|  19.7k|  else {
  234|       |    /* Detach connection if any is left. This should not be normal, but can be
  235|       |       the case for example with CONNECT_ONLY + recv/send (test 556) */
  236|  19.7k|    Curl_detach_connection(data);
  237|  19.7k|    if(!data->state.internal && data->multi_easy) {
  ------------------
  |  Branch (237:8): [True: 9.91k, False: 9.82k]
  |  Branch (237:33): [True: 0, False: 9.91k]
  ------------------
  238|       |      /* when curl_easy_perform() is used, it creates its own multi handle to
  239|       |         use and this is the one */
  240|      0|      curl_multi_cleanup(data->multi_easy);
  241|      0|      data->multi_easy = NULL;
  242|      0|    }
  243|  19.7k|  }
  244|  19.7k|  DEBUGASSERT(!data->conn || data->state.internal);
  ------------------
  |  | 1016|  19.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (244:3): [True: 19.7k, False: 0]
  |  Branch (244:3): [True: 0, False: 0]
  |  Branch (244:3): [True: 19.7k, False: 0]
  |  Branch (244:3): [True: 0, False: 0]
  ------------------
  245|       |
  246|  19.7k|  Curl_expire_clear_all(data); /* shut off any timers left */
  247|       |
  248|  19.7k|  if(data->state.rangestringalloc)
  ------------------
  |  Branch (248:6): [True: 170, False: 19.5k]
  ------------------
  249|    170|    curlx_free(data->state.range);
  ------------------
  |  | 1503|    170|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  250|       |
  251|       |  /* release any resolve information this transfer kept */
  252|  19.7k|  Curl_resolv_destroy_all(data);
  253|       |
  254|  19.7k|  data->set.verbose = FALSE; /* no more calls to DEBUGFUNCTION */
  ------------------
  |  |  989|  19.7k|#define FALSE false
  ------------------
  255|  19.7k|  data->magic = 0; /* force a clear AFTER the possibly enforced removal from
  256|       |                    * the multi handle and async dns shutdown. The multi
  257|       |                    * handle might check the magic and so might any
  258|       |                    * DEBUGFUNCTION invoked for tracing */
  259|       |
  260|       |  /* freed here in case DONE was not called */
  261|  19.7k|  Curl_req_free(&data->req, data);
  262|       |
  263|       |  /* Close down all open SSL info and sessions */
  264|  19.7k|  Curl_ssl_close_all(data);
  265|  19.7k|  Curl_peer_unlink(&data->state.origin);
  266|  19.7k|  Curl_peer_unlink(&data->state.initial_origin);
  267|  19.7k|#ifndef CURL_DISABLE_RTSP
  268|  19.7k|  Curl_peer_unlink(&data->state.rtsp_session_origin);
  269|  19.7k|#endif
  270|  19.7k|  Curl_ssl_free_certinfo(data);
  271|       |
  272|  19.7k|  Curl_bufref_free(&data->state.referer);
  273|       |
  274|  19.7k|  up_free(data);
  275|  19.7k|  curlx_dyn_free(&data->state.headerb);
  276|  19.7k|  Curl_flush_cookies(data, TRUE);
  ------------------
  |  |  986|  19.7k|#define TRUE true
  ------------------
  277|  19.7k|#ifndef CURL_DISABLE_ALTSVC
  278|  19.7k|  Curl_altsvc_save(data, data->asi, CURL_EASY_STR(data, STRING_ALTSVC));
  ------------------
  |  | 1206|  19.7k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  279|  19.7k|  Curl_altsvc_cleanup(&data->asi);
  280|  19.7k|#endif
  281|  19.7k|#ifndef CURL_DISABLE_HSTS
  282|  19.7k|  Curl_hsts_save(data, data->hsts, CURL_EASY_STR(data, STRING_HSTS));
  ------------------
  |  | 1206|  19.7k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  283|  19.7k|  if(!data->share || !data->share->hsts)
  ------------------
  |  Branch (283:6): [True: 19.7k, False: 0]
  |  Branch (283:22): [True: 0, False: 0]
  ------------------
  284|  19.7k|    Curl_hsts_cleanup(&data->hsts);
  285|  19.7k|#endif
  286|  19.7k|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_DIGEST_AUTH)
  287|  19.7k|  Curl_http_auth_cleanup_digest(data);
  288|  19.7k|#endif
  289|  19.7k|  curlx_safefree(data->state.most_recent_ftp_entrypath);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  290|  19.7k|  curlx_safefree(data->info.contenttype);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  291|  19.7k|  curlx_safefree(data->info.wouldredirect);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  292|  19.7k|  curlx_safefree(data->info.effective_url);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  293|       |
  294|       |  /* No longer a dirty share, if it exists */
  295|  19.7k|  if(Curl_share_easy_unlink(data))
  ------------------
  |  Branch (295:6): [True: 0, False: 19.7k]
  ------------------
  296|  19.7k|    DEBUGASSERT(0);
  ------------------
  |  | 1016|  19.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (296:5): [Folded, False: 0]
  |  Branch (296:5): [Folded, False: 0]
  ------------------
  297|       |
  298|  19.7k|  Curl_hash_destroy(&data->meta_hash);
  299|  19.7k|  Curl_creds_unlink(&data->state.creds);
  300|  19.7k|#ifndef CURL_DISABLE_HTTP
  301|  19.7k|  curlx_safefree(data->state.rangeline);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  302|  19.7k|  curlx_safefree(data->state.http_host);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  303|  19.7k|#endif
  304|  19.7k|#ifndef CURL_DISABLE_RTSP
  305|  19.7k|  curlx_safefree(data->state.session_id);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  306|  19.7k|#endif
  307|  19.7k|#ifndef CURL_DISABLE_COOKIES
  308|  19.7k|  curlx_safefree(data->req.cookiehost);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  309|  19.7k|#endif
  310|       |
  311|  19.7k|#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_FORM_API)
  312|  19.7k|  Curl_mime_cleanpart(data->state.formp);
  313|  19.7k|  curlx_safefree(data->state.formp);
  ------------------
  |  | 1359|  19.7k|  do {                      \
  |  | 1360|  19.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  19.7k|    (ptr) = NULL;           \
  |  | 1362|  19.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 19.7k]
  |  |  ------------------
  ------------------
  314|  19.7k|#endif
  315|       |
  316|       |  /* destruct wildcard structures if it is needed */
  317|  19.7k|  Curl_wildcard_dtor(&data->wildcard);
  318|  19.7k|  Curl_freeset(data);
  319|  19.7k|  Curl_headers_cleanup(data);
  320|  19.7k|  Curl_netrc_cleanup(&data->state.netrc);
  321|  19.7k|#ifndef CURL_DISABLE_DIGEST_AUTH
  322|  19.7k|  curlx_free(data->state.envproxy);
  ------------------
  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  323|  19.7k|#endif
  324|  19.7k|  curlx_memzero(data, sizeof(*data));
  325|  19.7k|  curlx_free(data);
  ------------------
  |  | 1503|  19.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  326|  19.7k|  return CURLE_OK;
  327|  19.7k|}
Curl_init_userdefined:
  334|  19.7k|{
  335|  19.7k|  struct UserDefined *set = &data->set;
  336|       |
  337|  19.7k|  set->out = stdout;  /* default output to stdout */
  338|  19.7k|  set->in_set = stdin;  /* default input from stdin */
  339|  19.7k|  set->err = stderr;  /* default stderr to stderr */
  340|       |
  341|  19.7k|  Curl_u8_strset_init(&data->set.strings);
  342|       |
  343|  19.7k|#if defined(__clang__) && __clang_major__ >= 16
  344|  19.7k|#pragma clang diagnostic push
  345|  19.7k|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
  346|  19.7k|#endif
  347|       |  /* use fwrite as default function to store output */
  348|  19.7k|  set->fwrite_func = (curl_write_callback)fwrite;
  349|       |
  350|       |  /* use fread as default function to read input */
  351|  19.7k|  set->fread_func_set = (curl_read_callback)fread;
  352|  19.7k|#if defined(__clang__) && __clang_major__ >= 16
  353|  19.7k|#pragma clang diagnostic pop
  354|  19.7k|#endif
  355|  19.7k|  set->is_fread_set = 0;
  356|       |
  357|  19.7k|  set->seek_client = ZERO_NULL;
  ------------------
  |  | 1174|  19.7k|#define ZERO_NULL 0
  ------------------
  358|       |
  359|  19.7k|  set->filesize = -1;        /* we do not know the size */
  360|  19.7k|  set->postfieldsize = -1;   /* unknown size */
  361|  19.7k|  set->maxredirs = 30;       /* sensible default */
  362|       |
  363|  19.7k|  set->method = HTTPREQ_GET; /* Default HTTP request */
  364|  19.7k|#ifndef CURL_DISABLE_RTSP
  365|  19.7k|  set->rtspreq = RTSPREQ_OPTIONS; /* Default RTSP request */
  ------------------
  |  |   34|  19.7k|#define RTSPREQ_OPTIONS CURL_RTSPREQ_OPTIONS
  |  |  ------------------
  |  |  |  | 2367|  19.7k|#define CURL_RTSPREQ_OPTIONS       1L
  |  |  ------------------
  ------------------
  366|  19.7k|#endif
  367|  19.7k|#ifndef CURL_DISABLE_FTP
  368|  19.7k|  set->ftp_use_epsv = TRUE;   /* FTP defaults to EPSV operations */
  ------------------
  |  |  986|  19.7k|#define TRUE true
  ------------------
  369|  19.7k|  set->ftp_use_eprt = TRUE;   /* FTP defaults to EPRT operations */
  ------------------
  |  |  986|  19.7k|#define TRUE true
  ------------------
  370|  19.7k|  set->ftp_use_pret = FALSE;  /* mainly useful for drftpd servers */
  ------------------
  |  |  989|  19.7k|#define FALSE false
  ------------------
  371|  19.7k|  set->ftp_filemethod = FTPFILE_MULTICWD;
  372|  19.7k|  set->ftp_skip_ip = TRUE;    /* skip PASV IP by default */
  ------------------
  |  |  986|  19.7k|#define TRUE true
  ------------------
  373|  19.7k|#endif
  374|  19.7k|  set->dns_cache_timeout_ms = 60000; /* Timeout every 60 seconds by default */
  375|       |
  376|       |  /* Timeout every 24 hours by default */
  377|  19.7k|  set->ssl_ca_cache_timeout = 24 * 60 * 60;
  378|       |
  379|  19.7k|  set->httpauth = CURLAUTH_BASIC;  /* defaults to basic */
  ------------------
  |  |  833|  19.7k|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  380|       |
  381|  19.7k|  Curl_ssl_config_init(&data->set.ssl);
  382|  19.7k|#ifndef CURL_DISABLE_PROXY
  383|  19.7k|  Curl_ssl_config_init(&data->set.proxy_ssl);
  384|  19.7k|  set->proxyport = 0;
  385|  19.7k|  set->proxytype = CURLPROXY_HTTP; /* defaults to HTTP proxy */
  ------------------
  |  |  792|  19.7k|#define CURLPROXY_HTTP            0L /* added in 7.10, new in 7.19.4 default is
  ------------------
  386|  19.7k|  set->proxyauth = CURLAUTH_BASIC; /* defaults to basic */
  ------------------
  |  |  833|  19.7k|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
  387|       |  /* SOCKS5 proxy auth defaults to username/password + GSS-API */
  388|  19.7k|  set->socks5auth = CURLAUTH_BASIC | CURLAUTH_GSSAPI;
  ------------------
  |  |  833|  19.7k|#define CURLAUTH_BASIC        (((unsigned long)1) << 0)
  ------------------
                set->socks5auth = CURLAUTH_BASIC | CURLAUTH_GSSAPI;
  ------------------
  |  |  839|  19.7k|#define CURLAUTH_GSSAPI CURLAUTH_NEGOTIATE
  |  |  ------------------
  |  |  |  |  835|  19.7k|#define CURLAUTH_NEGOTIATE    (((unsigned long)1) << 2)
  |  |  ------------------
  ------------------
  389|  19.7k|#endif
  390|       |
  391|  19.7k|#ifndef CURL_DISABLE_DOH
  392|  19.7k|  set->doh_verifyhost = TRUE;
  ------------------
  |  |  986|  19.7k|#define TRUE true
  ------------------
  393|  19.7k|  set->doh_verifypeer = TRUE;
  ------------------
  |  |  986|  19.7k|#define TRUE true
  ------------------
  394|  19.7k|#endif
  395|       |#ifdef USE_SSH
  396|       |  /* defaults to any auth type */
  397|       |  set->ssh_auth_types = CURLSSH_AUTH_DEFAULT;
  398|       |  set->new_directory_perms = 0755; /* Default permissions */
  399|       |#endif
  400|       |
  401|  19.7k|  set->new_file_perms = 0644;    /* Default permissions */
  402|  19.7k|  set->allowed_protocols = (curl_prot_t)CURLPROTO_64ALL;
  ------------------
  |  |   67|  19.7k|#define CURLPROTO_64ALL ((uint64_t)0xffffffffffffffff)
  ------------------
  403|  19.7k|  set->redir_protocols = CURLPROTO_REDIR;
  ------------------
  |  |   70|  19.7k|#define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1088|  19.7k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1089|  19.7k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define CURLPROTO_REDIR (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | \
  |  |  ------------------
  |  |  |  | 1090|  19.7k|#define CURLPROTO_FTP     (1L << 2)
  |  |  ------------------
  |  |   71|  19.7k|                         CURLPROTO_FTPS)
  |  |  ------------------
  |  |  |  | 1091|  19.7k|#define CURLPROTO_FTPS    (1L << 3)
  |  |  ------------------
  ------------------
  404|       |
  405|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
  406|       |  /*
  407|       |   * disallow unprotected protection negotiation NEC reference implementation
  408|       |   * seem not to follow rfc1961 section 4.3/4.4
  409|       |   */
  410|       |  set->socks5_gssapi_nec = FALSE;
  411|       |#endif
  412|       |
  413|       |  /* set default minimum TLS version */
  414|  19.7k|#ifdef USE_SSL
  415|  19.7k|  Curl_setopt_SSLVERSION(data, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 2394|  19.7k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  416|  19.7k|#ifndef CURL_DISABLE_PROXY
  417|  19.7k|  Curl_setopt_SSLVERSION(data, CURLOPT_PROXY_SSLVERSION,
  418|  19.7k|                         CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 2394|  19.7k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
  419|  19.7k|#endif
  420|  19.7k|#endif
  421|  19.7k|#ifndef CURL_DISABLE_FTP
  422|  19.7k|  set->wildcard_enabled = FALSE;
  ------------------
  |  |  989|  19.7k|#define FALSE false
  ------------------
  423|  19.7k|  set->chunk_bgn = ZERO_NULL;
  ------------------
  |  | 1174|  19.7k|#define ZERO_NULL 0
  ------------------
  424|  19.7k|  set->chunk_end = ZERO_NULL;
  ------------------
  |  | 1174|  19.7k|#define ZERO_NULL 0
  ------------------
  425|  19.7k|  set->fnmatch = ZERO_NULL;
  ------------------
  |  | 1174|  19.7k|#define ZERO_NULL 0
  ------------------
  426|  19.7k|#endif
  427|  19.7k|  set->tcp_keepalive = FALSE;
  ------------------
  |  |  989|  19.7k|#define FALSE false
  ------------------
  428|  19.7k|  set->tcp_keepintvl = 60;
  429|  19.7k|  set->tcp_keepidle = 60;
  430|  19.7k|  set->tcp_keepcnt = 9;
  431|  19.7k|  set->tcp_fastopen = FALSE;
  ------------------
  |  |  989|  19.7k|#define FALSE false
  ------------------
  432|  19.7k|  set->tcp_nodelay = TRUE;
  ------------------
  |  |  986|  19.7k|#define TRUE true
  ------------------
  433|  19.7k|  set->ssl_enable_alpn = TRUE;
  ------------------
  |  |  986|  19.7k|#define TRUE true
  ------------------
  434|  19.7k|  set->expect_100_timeout = 1000L; /* Wait for a second by default. */
  435|  19.7k|  set->sep_headers = TRUE; /* separated header lists by default */
  ------------------
  |  |  986|  19.7k|#define TRUE true
  ------------------
  436|  19.7k|  set->buffer_size = READBUFFER_SIZE;
  ------------------
  |  |  120|  19.7k|#define READBUFFER_SIZE CURL_MAX_WRITE_SIZE
  |  |  ------------------
  |  |  |  |  267|  19.7k|#define CURL_MAX_WRITE_SIZE 16384
  |  |  ------------------
  ------------------
  437|  19.7k|  set->upload_buffer_size = UPLOADBUFFER_DEFAULT;
  ------------------
  |  |  132|  19.7k|#define UPLOADBUFFER_DEFAULT 65536
  ------------------
  438|  19.7k|  set->upload_flags = CURLULFLAG_SEEN;
  ------------------
  |  | 1054|  19.7k|#define CURLULFLAG_SEEN     (1L << 4)
  ------------------
  439|  19.7k|  set->happy_eyeballs_timeout = CURL_HET_DEFAULT;
  ------------------
  |  |  979|  19.7k|#define CURL_HET_DEFAULT 200L
  ------------------
  440|  19.7k|  set->upkeep_interval_ms = CURL_UPKEEP_INTERVAL_DEFAULT;
  ------------------
  |  |  982|  19.7k|#define CURL_UPKEEP_INTERVAL_DEFAULT 60000L
  ------------------
  441|  19.7k|  set->maxconnects = DEFAULT_CONNCACHE_SIZE; /* for easy handles */
  ------------------
  |  |   38|  19.7k|#define DEFAULT_CONNCACHE_SIZE 5
  ------------------
  442|  19.7k|  set->conn_max_idle_ms = 118 * 1000;
  443|  19.7k|  set->conn_max_age_ms = 24 * 3600 * 1000;
  444|  19.7k|  set->http09_allowed = FALSE;
  ------------------
  |  |  989|  19.7k|#define FALSE false
  ------------------
  445|  19.7k|  set->httpwant = CURL_HTTP_VERSION_NONE;
  ------------------
  |  | 2338|  19.7k|#define CURL_HTTP_VERSION_NONE  0L /* setting this means we do not care, and
  ------------------
  446|  19.7k|#if defined(USE_HTTP2) || defined(USE_HTTP3)
  447|  19.7k|  set->weight = 0;
  448|  19.7k|#endif
  449|  19.7k|  set->quick_exit = 0L;
  450|  19.7k|#ifndef CURL_DISABLE_WEBSOCKETS
  451|  19.7k|  set->ws_raw_mode = FALSE;
  ------------------
  |  |  989|  19.7k|#define FALSE false
  ------------------
  452|       |  set->ws_no_auto_pong = FALSE;
  ------------------
  |  |  989|  19.7k|#define FALSE false
  ------------------
  453|  19.7k|#endif
  454|  19.7k|}
Curl_open:
  475|  19.8k|{
  476|  19.8k|  struct Curl_easy *data;
  477|       |
  478|       |  /* simple start-up: alloc the struct, init it with zeroes and return */
  479|  19.8k|  data = curlx_calloc(1, sizeof(struct Curl_easy));
  ------------------
  |  | 1500|  19.8k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  480|  19.8k|  if(!data) {
  ------------------
  |  Branch (480:6): [True: 73, False: 19.7k]
  ------------------
  481|       |    /* this is a serious error */
  482|     73|    DEBUGF(curl_mfprintf(stderr, "Error: calloc of Curl_easy failed\n"));
  ------------------
  |  | 1002|     73|#define DEBUGF(x) x
  ------------------
  483|     73|    return CURLE_OUT_OF_MEMORY;
  484|     73|  }
  485|       |
  486|  19.7k|  data->magic = CURLEASY_MAGIC_NUMBER;
  ------------------
  |  |   28|  19.7k|#define CURLEASY_MAGIC_NUMBER 0xc0dedbadU
  ------------------
  487|       |  /* most recent connection is not yet defined */
  488|  19.7k|  data->state.last_conn_id = -1;
  489|  19.7k|  data->state.last_cpid = UINT32_MAX;
  490|       |  /* and not assigned an id yet */
  491|  19.7k|  data->id = -1;
  492|  19.7k|  data->mid = UINT32_MAX;
  493|  19.7k|  data->master_mid = UINT32_MAX;
  494|  19.7k|  data->progress.hide = TRUE;
  ------------------
  |  |  986|  19.7k|#define TRUE true
  ------------------
  495|       |
  496|  19.7k|  Curl_hash_init(&data->meta_hash, 23, CURL_HASH_TYPE_BYTES,
  497|  19.7k|                 easy_meta_freeentry);
  498|  19.7k|  DEBUGASSERT(STRING_LAST <= UINT8_MAX);
  ------------------
  |  | 1016|  19.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (498:3): [True: 0, Folded]
  |  Branch (498:3): [True: 19.7k, Folded]
  ------------------
  499|  19.7k|  Curl_u8_strset_init(&data->set.strings);
  500|  19.7k|  curlx_dyn_init(&data->state.headerb, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|  19.7k|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  501|  19.7k|  Curl_bufref_init(&data->state.url);
  502|  19.7k|  Curl_bufref_init(&data->state.referer);
  503|  19.7k|  Curl_req_init(&data->req);
  504|  19.7k|  Curl_initinfo(data);
  505|  19.7k|#ifndef CURL_DISABLE_HTTP
  506|  19.7k|  Curl_llist_init(&data->state.httphdrs, NULL);
  507|  19.7k|#endif
  508|  19.7k|  Curl_netrc_init(&data->state.netrc);
  509|  19.7k|  Curl_init_userdefined(data);
  510|       |
  511|  19.7k|  *curl = data;
  512|  19.7k|  return CURLE_OK;
  513|  19.7k|}
Curl_conn_free:
  516|  9.42k|{
  517|  9.42k|  DEBUGASSERT(conn);
  ------------------
  |  | 1016|  9.42k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (517:3): [True: 0, False: 9.42k]
  |  Branch (517:3): [True: 9.42k, False: 0]
  ------------------
  518|       |
  519|  9.42k|  if(conn->scheme && conn->scheme->run->disconnect &&
  ------------------
  |  Branch (519:6): [True: 9.42k, False: 0]
  |  Branch (519:22): [True: 0, False: 9.42k]
  ------------------
  520|      0|     !conn->bits.shutdown_handler)
  ------------------
  |  Branch (520:6): [True: 0, False: 0]
  ------------------
  521|      0|    conn->scheme->run->disconnect(data, conn, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  522|       |
  523|  9.42k|  Curl_cfchain_cleanup(&conn->chain, data);
  524|       |
  525|  9.42k|#ifndef CURL_DISABLE_PROXY
  526|  9.42k|  Curl_peer_unlink(&conn->http_proxy.peer);
  527|  9.42k|  Curl_peer_unlink(&conn->socks_proxy.peer);
  528|  9.42k|  Curl_creds_unlink(&conn->http_proxy.creds);
  529|  9.42k|  Curl_creds_unlink(&conn->socks_proxy.creds);
  530|  9.42k|#endif
  531|  9.42k|  Curl_creds_unlink(&conn->creds);
  532|  9.42k|  Curl_peer_unlink(&conn->creds_origin);
  533|  9.42k|  curlx_safefree(conn->options);
  ------------------
  |  | 1359|  9.42k|  do {                      \
  |  | 1360|  9.42k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.42k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.42k|    (ptr) = NULL;           \
  |  | 1362|  9.42k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.42k]
  |  |  ------------------
  ------------------
  534|  9.42k|  curlx_safefree(conn->interface_opts);
  ------------------
  |  | 1359|  9.42k|  do {                      \
  |  | 1360|  9.42k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.42k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.42k|    (ptr) = NULL;           \
  |  | 1362|  9.42k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.42k]
  |  |  ------------------
  ------------------
  535|  9.42k|  Curl_ssl_conn_config_cleanup(conn);
  536|       |
  537|  9.42k|  curlx_safefree(conn->destination);
  ------------------
  |  | 1359|  9.42k|  do {                      \
  |  | 1360|  9.42k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.42k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.42k|    (ptr) = NULL;           \
  |  | 1362|  9.42k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.42k]
  |  |  ------------------
  ------------------
  538|  9.42k|  Curl_hash_destroy(&conn->meta_hash);
  539|  9.42k|  Curl_peer_unlink(&conn->origin);
  540|  9.42k|  Curl_peer_unlink(&conn->via_peer);
  541|  9.42k|  Curl_peer_unlink(&conn->origin2);
  542|  9.42k|  Curl_peer_unlink(&conn->via_peer2);
  543|       |
  544|  9.42k|  curlx_free(conn); /* free all the connection oriented data */
  ------------------
  |  | 1503|  9.42k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  545|  9.42k|}
Curl_uc_to_curlcode:
 1170|    460|{
 1171|    460|  switch(uc) {
 1172|    341|  default:
  ------------------
  |  Branch (1172:3): [True: 341, False: 119]
  ------------------
 1173|    341|    return CURLE_URL_MALFORMAT;
 1174|      0|  case CURLUE_UNSUPPORTED_SCHEME:
  ------------------
  |  Branch (1174:3): [True: 0, False: 460]
  ------------------
 1175|      0|    return CURLE_UNSUPPORTED_PROTOCOL;
 1176|    119|  case CURLUE_OUT_OF_MEMORY:
  ------------------
  |  Branch (1176:3): [True: 119, False: 341]
  ------------------
 1177|    119|    return CURLE_OUT_OF_MEMORY;
 1178|      0|  case CURLUE_USER_NOT_ALLOWED:
  ------------------
  |  Branch (1178:3): [True: 0, False: 460]
  ------------------
 1179|      0|    return CURLE_LOGIN_DENIED;
 1180|    460|  }
 1181|    460|}
Curl_parse_login_details:
 1579|  2.76k|{
 1580|  2.76k|  char *ubuf = NULL;
 1581|  2.76k|  char *pbuf = NULL;
 1582|  2.76k|  const char *psep = NULL;
 1583|  2.76k|  const char *osep = NULL;
 1584|  2.76k|  size_t ulen;
 1585|  2.76k|  size_t plen;
 1586|  2.76k|  size_t olen;
 1587|       |
 1588|  2.76k|  DEBUGASSERT(userp);
  ------------------
  |  | 1016|  2.76k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1588:3): [True: 0, False: 2.76k]
  |  Branch (1588:3): [True: 2.76k, False: 0]
  ------------------
 1589|  2.76k|  DEBUGASSERT(passwdp);
  ------------------
  |  | 1016|  2.76k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1589:3): [True: 0, False: 2.76k]
  |  Branch (1589:3): [True: 2.76k, False: 0]
  ------------------
 1590|       |
 1591|       |  /* Attempt to find the password separator */
 1592|  2.76k|  psep = memchr(login, ':', len);
 1593|       |
 1594|       |  /* Attempt to find the options separator */
 1595|  2.76k|  if(optionsp)
  ------------------
  |  Branch (1595:6): [True: 0, False: 2.76k]
  ------------------
 1596|      0|    osep = memchr(login, ';', len);
 1597|       |
 1598|       |  /* Calculate the portion lengths */
 1599|  2.76k|  ulen = (psep ?
  ------------------
  |  Branch (1599:11): [True: 1.29k, False: 1.46k]
  ------------------
 1600|  1.29k|          (size_t)(osep && psep > osep ? osep - login : psep - login) :
  ------------------
  |  Branch (1600:20): [True: 0, False: 1.29k]
  |  Branch (1600:28): [True: 0, False: 0]
  ------------------
 1601|  2.76k|          (osep ? (size_t)(osep - login) : len));
  ------------------
  |  Branch (1601:12): [True: 0, False: 1.46k]
  ------------------
 1602|  2.76k|  plen = (psep ?
  ------------------
  |  Branch (1602:11): [True: 1.29k, False: 1.46k]
  ------------------
 1603|  1.29k|          (osep && osep > psep ? (size_t)(osep - psep) :
  ------------------
  |  Branch (1603:12): [True: 0, False: 1.29k]
  |  Branch (1603:20): [True: 0, False: 0]
  ------------------
 1604|  1.46k|           (size_t)(login + len - psep)) - 1 : 0);
 1605|  2.76k|  olen = (osep ?
  ------------------
  |  Branch (1605:11): [True: 0, False: 2.76k]
  ------------------
 1606|      0|          (psep && psep > osep ? (size_t)(psep - osep) :
  ------------------
  |  Branch (1606:12): [True: 0, False: 0]
  |  Branch (1606:20): [True: 0, False: 0]
  ------------------
 1607|  2.76k|           (size_t)(login + len - osep)) - 1 : 0);
 1608|       |
 1609|       |  /* Clone the user portion buffer, which can be zero length */
 1610|  2.76k|  ubuf = curlx_memdup0(login, ulen);
 1611|  2.76k|  if(!ubuf)
  ------------------
  |  Branch (1611:6): [True: 17, False: 2.74k]
  ------------------
 1612|     17|    goto error;
 1613|       |
 1614|       |  /* Clone the password portion buffer */
 1615|  2.74k|  if(psep) {
  ------------------
  |  Branch (1615:6): [True: 1.29k, False: 1.44k]
  ------------------
 1616|  1.29k|    pbuf = curlx_memdup0(&psep[1], plen);
 1617|  1.29k|    if(!pbuf)
  ------------------
  |  Branch (1617:8): [True: 11, False: 1.28k]
  ------------------
 1618|     11|      goto error;
 1619|  1.29k|  }
 1620|       |
 1621|       |  /* Allocate the options portion buffer */
 1622|  2.73k|  if(optionsp) {
  ------------------
  |  Branch (1622:6): [True: 0, False: 2.73k]
  ------------------
 1623|      0|    char *obuf = NULL;
 1624|      0|    if(olen) {
  ------------------
  |  Branch (1624:8): [True: 0, False: 0]
  ------------------
 1625|      0|      obuf = curlx_memdup0(&osep[1], olen);
 1626|      0|      if(!obuf)
  ------------------
  |  Branch (1626:10): [True: 0, False: 0]
  ------------------
 1627|      0|        goto error;
 1628|      0|    }
 1629|      0|    *optionsp = obuf;
 1630|      0|  }
 1631|  2.73k|  *userp = ubuf;
 1632|  2.73k|  *passwdp = pbuf;
 1633|  2.73k|  return CURLE_OK;
 1634|     28|error:
 1635|     28|  curlx_free(ubuf);
  ------------------
  |  | 1503|     28|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1636|     28|  curlx_free(pbuf);
  ------------------
  |  | 1503|     28|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1637|     28|  return CURLE_OUT_OF_MEMORY;
 1638|  2.73k|}
Curl_connect:
 2413|  9.66k|{
 2414|  9.66k|  CURLcode result;
 2415|  9.66k|  struct connectdata *conn = NULL;
 2416|  9.66k|  const struct curltime *pnow = NULL;
 2417|  9.66k|  *pconnected = FALSE;
  ------------------
  |  |  989|  9.66k|#define FALSE false
  ------------------
 2418|       |
 2419|       |  /* Set the request to virgin state based on transfer settings */
 2420|  9.66k|  Curl_req_hard_reset(&data->req, data);
 2421|       |  /* Determine the origin of the transfer and what credentials to use */
 2422|  9.66k|  result = url_set_data_origin_and_creds(data);
 2423|  9.66k|  if(result)
  ------------------
  |  Branch (2423:6): [True: 234, False: 9.43k]
  ------------------
 2424|    234|    goto out;
 2425|  9.43k|  if(!data->state.origin) { /* just make really sure */
  ------------------
  |  Branch (2425:6): [True: 0, False: 9.43k]
  ------------------
 2426|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2426:5): [Folded, False: 0]
  |  Branch (2426:5): [Folded, False: 0]
  ------------------
 2427|      0|    result = CURLE_FAILED_INIT;
 2428|      0|    goto out;
 2429|      0|  }
 2430|       |
 2431|       |  /* Get or create a connection for the transfer. */
 2432|  9.43k|  pnow = Curl_pgrs_now(data);
 2433|  9.43k|  Curl_pgrsTimeWas(data, TIMER_POSTQUEUE, *pnow);
 2434|  9.43k|  result = url_find_or_create_conn(data, pnow);
 2435|  9.43k|  conn = data->conn;
 2436|  9.43k|  if(result)
  ------------------
  |  Branch (2436:6): [True: 34, False: 9.39k]
  ------------------
 2437|     34|    goto out;
 2438|  9.39k|  if(!data->conn) { /* just make really sure */
  ------------------
  |  Branch (2438:6): [True: 0, False: 9.39k]
  ------------------
 2439|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2439:5): [Folded, False: 0]
  |  Branch (2439:5): [Folded, False: 0]
  ------------------
 2440|      0|    result = CURLE_FAILED_INIT;
 2441|      0|    goto out;
 2442|      0|  }
 2443|       |
 2444|  9.39k|  if(conn->bits.reuse) {
  ------------------
  |  Branch (2444:6): [True: 0, False: 9.39k]
  ------------------
 2445|      0|    if(conn->attached_xfers > 1)
  ------------------
  |  Branch (2445:8): [True: 0, False: 0]
  ------------------
 2446|       |      /* multiplexed */
 2447|      0|      *pconnected = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2448|      0|  }
 2449|  9.39k|  else if(conn->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  221|  9.39k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (2449:11): [True: 0, False: 9.39k]
  ------------------
 2450|      0|    Curl_pgrsTime(data, TIMER_NAMELOOKUP);
 2451|      0|    *pconnected = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2452|      0|  }
 2453|  9.39k|  else {
 2454|  9.39k|    result = Curl_conn_setup(data, conn, &conn->chain,
 2455|  9.39k|                             CURL_CF_SSL_DEFAULT);
  ------------------
  |  |  376|  9.39k|#define CURL_CF_SSL_DEFAULT  (-1)
  ------------------
 2456|  9.39k|    if(!result)
  ------------------
  |  Branch (2456:8): [True: 9.38k, False: 15]
  ------------------
 2457|  9.38k|      result = Curl_headers_init(data);
 2458|  9.39k|    CURL_TRC_M(data, "Curl_conn_setup() -> %d", (int)result);
  ------------------
  |  |  148|  9.39k|  do {                                   \
  |  |  149|  9.39k|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|  9.39k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.39k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  18.7k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.39k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 932, False: 8.46k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  18.7k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 932, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    932|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.39k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    932|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 186, False: 746]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  9.39k|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|  9.39k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 9.39k]
  |  |  ------------------
  ------------------
 2459|  9.39k|  }
 2460|       |
 2461|  9.66k|out:
 2462|  9.66k|  if(result == CURLE_NO_CONNECTION_AVAILABLE)
  ------------------
  |  Branch (2462:6): [True: 0, False: 9.66k]
  ------------------
 2463|  9.66k|    DEBUGASSERT(!conn);
  ------------------
  |  | 1016|  9.66k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2463:5): [True: 0, False: 0]
  |  Branch (2463:5): [True: 0, False: 0]
  ------------------
 2464|       |
 2465|  9.66k|  if(result && conn) {
  ------------------
  |  Branch (2465:6): [True: 293, False: 9.37k]
  |  Branch (2465:16): [True: 26, False: 267]
  ------------------
 2466|       |    /* Detach on error and close the connection if
 2467|       |     * - it was not reused (meaning, ok before we picked it)
 2468|       |     * - there are no other transfers attached to it */
 2469|     26|    Curl_detach_connection(data);
 2470|     26|    if(!conn->bits.reuse && !CONN_INUSE(conn))
  ------------------
  |  |  327|     26|#define CONN_INUSE(c) (!!(c)->attached_xfers)
  ------------------
  |  Branch (2470:8): [True: 26, False: 0]
  |  Branch (2470:29): [True: 26, False: 0]
  ------------------
 2471|     26|      Curl_conn_close(data, conn, TRUE);
  ------------------
  |  |  986|     26|#define TRUE true
  ------------------
 2472|     26|  }
 2473|       |
 2474|  9.66k|  return result;
 2475|  9.66k|}
Curl_init_transfer:
 2487|  9.39k|{
 2488|  9.39k|  CURLcode result;
 2489|       |
 2490|  9.39k|  if(conn) {
  ------------------
  |  Branch (2490:6): [True: 9.39k, False: 0]
  ------------------
 2491|  9.39k|    conn->bits.do_more = FALSE; /* by default there is no curl_do_more() to
  ------------------
  |  |  989|  9.39k|#define FALSE false
  ------------------
 2492|       |                                   use */
 2493|       |    /* if the protocol used does not support wildcards, switch it off */
 2494|  9.39k|    if(data->state.wildcardmatch &&
  ------------------
  |  Branch (2494:8): [True: 0, False: 9.39k]
  ------------------
 2495|      0|       !(conn->scheme->flags & PROTOPT_WILDCARD))
  ------------------
  |  |  237|      0|#define PROTOPT_WILDCARD (1 << 12)  /* protocol supports wildcard matching */
  ------------------
  |  Branch (2495:8): [True: 0, False: 0]
  ------------------
 2496|      0|      data->state.wildcardmatch = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2497|  9.39k|  }
 2498|       |
 2499|  9.39k|  data->state.done = FALSE; /* *_done() is not called yet */
  ------------------
  |  |  989|  9.39k|#define FALSE false
  ------------------
 2500|       |
 2501|  9.39k|  data->req.no_body = data->set.opt_no_body;
 2502|  9.39k|  if(data->req.no_body)
  ------------------
  |  Branch (2502:6): [True: 30, False: 9.36k]
  ------------------
 2503|       |    /* in HTTP lingo, no body means using the HEAD request... */
 2504|     30|    data->state.httpreq = HTTPREQ_HEAD;
 2505|       |
 2506|  9.39k|  result = Curl_req_start(&data->req, data);
 2507|  9.39k|  if(!result) {
  ------------------
  |  Branch (2507:6): [True: 9.39k, False: 0]
  ------------------
 2508|  9.39k|    Curl_pgrsReset(data);
 2509|  9.39k|  }
 2510|  9.39k|  return result;
 2511|  9.39k|}
Curl_data_priority_clear_state:
 2516|  9.67k|{
 2517|  9.67k|  data->state.weight = 0;
 2518|  9.67k|}
Curl_conn_meta_remove:
 2534|  9.39k|{
 2535|  9.39k|  Curl_hash_delete(&conn->meta_hash, key, strlen(key) + 1);
 2536|  9.39k|}
Curl_conn_meta_get:
 2539|  2.10k|{
 2540|  2.10k|  return Curl_hash_pick(&conn->meta_hash, key, strlen(key) + 1);
 2541|  2.10k|}
Curl_get_admin:
 2544|  28.1k|{
 2545|  28.1k|  struct Curl_easy *admin;
 2546|       |
 2547|  28.1k|  if(!data->mid) /* already an admin handle */
  ------------------
  |  Branch (2547:6): [True: 1.57k, False: 26.5k]
  ------------------
 2548|  1.57k|    admin = data;
 2549|  26.5k|  else if(data->multi)
  ------------------
  |  Branch (2549:11): [True: 26.5k, False: 0]
  ------------------
 2550|  26.5k|    admin = data->multi->admin;
 2551|      0|  else if(data->multi_easy)
  ------------------
  |  Branch (2551:11): [True: 0, False: 0]
  ------------------
 2552|      0|    admin = data->multi_easy->admin;
 2553|      0|  else {
 2554|      0|    DEBUGASSERT(0); /* we do not want this. does it happen? */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2554:5): [Folded, False: 0]
  |  Branch (2554:5): [Folded, False: 0]
  ------------------
 2555|      0|    admin = data;
 2556|      0|  }
 2557|  28.1k|  if(admin != data) {
  ------------------
  |  Branch (2557:6): [True: 26.5k, False: 1.57k]
  ------------------
 2558|  26.5k|    admin->set.conn_max_idle_ms = data->set.conn_max_idle_ms;
 2559|  26.5k|    admin->set.conn_max_age_ms = data->set.conn_max_age_ms;
 2560|  26.5k|    admin->set.upkeep_interval_ms = data->set.upkeep_interval_ms;
 2561|  26.5k|    admin->set.timeout = data->set.timeout;
 2562|  26.5k|    admin->set.server_response_timeout = data->set.server_response_timeout;
 2563|  26.5k|    admin->set.no_signal = data->set.no_signal;
 2564|  26.5k|  }
 2565|  28.1k|  return admin;
 2566|  28.1k|}
Curl_1st_fatal:
 2569|  31.4k|{
 2570|  31.4k|  if(r1 && (r1 != CURLE_AGAIN))
  ------------------
  |  Branch (2570:6): [True: 25.4k, False: 6.08k]
  |  Branch (2570:12): [True: 8.30k, False: 17.1k]
  ------------------
 2571|  8.30k|    return r1;
 2572|  23.1k|  if(r2 && (r2 != CURLE_AGAIN))
  ------------------
  |  Branch (2572:6): [True: 0, False: 23.1k]
  |  Branch (2572:12): [True: 0, False: 0]
  ------------------
 2573|      0|    return r2;
 2574|  23.1k|  return r1;
 2575|  23.1k|}
url.c:up_free:
  202|  29.4k|{
  203|  29.4k|  struct urlpieces *up = &data->state.up;
  204|  29.4k|  curlx_safefree(up->options);
  ------------------
  |  | 1359|  29.4k|  do {                      \
  |  | 1360|  29.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  29.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  29.4k|    (ptr) = NULL;           \
  |  | 1362|  29.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 29.4k]
  |  |  ------------------
  ------------------
  205|  29.4k|  curlx_safefree(up->path);
  ------------------
  |  | 1359|  29.4k|  do {                      \
  |  | 1360|  29.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  29.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  29.4k|    (ptr) = NULL;           \
  |  | 1362|  29.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 29.4k]
  |  |  ------------------
  ------------------
  206|  29.4k|  curlx_safefree(up->query);
  ------------------
  |  | 1359|  29.4k|  do {                      \
  |  | 1360|  29.4k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  29.4k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  29.4k|    (ptr) = NULL;           \
  |  | 1362|  29.4k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 29.4k]
  |  |  ------------------
  ------------------
  207|  29.4k|  curl_url_cleanup(data->state.uh);
  208|       |  data->state.uh = NULL;
  209|  29.4k|}
url.c:url_set_data_origin_and_creds:
 2037|  9.66k|{
 2038|  9.66k|  CURLcode result = CURLE_OK;
 2039|  9.66k|  CURLU *uh;
 2040|  9.66k|  CURLUcode uc = CURLUE_OK;
 2041|  9.66k|  bool use_set_uh = (data->set.uh && !data->state.this_is_a_follow);
  ------------------
  |  Branch (2041:22): [True: 0, False: 9.66k]
  |  Branch (2041:38): [True: 0, False: 0]
  ------------------
 2042|  9.66k|  uint16_t port_override = data->state.allow_port ? data->set.use_port : 0;
  ------------------
  |  Branch (2042:28): [True: 9.66k, False: 0]
  ------------------
 2043|  9.66k|  uint32_t scope_id = 0;
 2044|       |
 2045|       |  /*************************************************************
 2046|       |   * Check input data
 2047|       |   *************************************************************/
 2048|  9.66k|  if(!Curl_bufref_ptr(&data->state.url)) {
  ------------------
  |  Branch (2048:6): [True: 0, False: 9.66k]
  ------------------
 2049|      0|    result = CURLE_URL_MALFORMAT;
 2050|      0|    goto out;
 2051|      0|  }
 2052|       |
 2053|  9.66k|  up_free(data); /* cleanup previous leftovers first */
 2054|       |
 2055|       |  /* parse the URL */
 2056|  9.66k|  if(use_set_uh)
  ------------------
  |  Branch (2056:6): [True: 0, False: 9.66k]
  ------------------
 2057|      0|    uh = data->state.uh = curl_url_dup(data->set.uh);
 2058|  9.66k|  else
 2059|  9.66k|    uh = data->state.uh = curl_url();
 2060|  9.66k|  if(!uh) {
  ------------------
  |  Branch (2060:6): [True: 6, False: 9.65k]
  ------------------
 2061|      6|    result = CURLE_OUT_OF_MEMORY;
 2062|      6|    goto out;
 2063|      6|  }
 2064|       |
 2065|  9.65k|  if(!use_set_uh) {
  ------------------
  |  Branch (2065:6): [True: 9.65k, False: 0]
  ------------------
 2066|  9.65k|    bool prepend_sheme = FALSE;
  ------------------
  |  |  989|  9.65k|#define FALSE false
  ------------------
 2067|       |    /* special-case when 'file' is default as a normal path is not a valid URL
 2068|       |       without the 'file' scheme present */
 2069|  9.65k|    if(curl_strequal("file", CURL_EASY_STR(data, STRING_DEFAULT_PROTOCOL)) &&
  ------------------
  |  | 1206|  9.65k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  |  Branch (2069:8): [True: 0, False: 9.65k]
  ------------------
 2070|      0|       !Curl_is_absolute_url(Curl_bufref_ptr(&data->state.url), NULL, 0, TRUE))
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  |  Branch (2070:8): [True: 0, False: 0]
  ------------------
 2071|      0|      prepend_sheme = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2072|  9.65k|    else {
 2073|  9.65k|      uc = curl_url_set(uh, CURLUPART_URL, Curl_bufref_ptr(&data->state.url),
 2074|  9.65k|                        (unsigned int)
 2075|  9.65k|                        CURLU_GUESS_SCHEME |
  ------------------
  |  |   97|  9.65k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
 2076|  9.65k|                        CURLU_NON_SUPPORT_SCHEME |
  ------------------
  |  |   91|  9.65k|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
 2077|  9.65k|                        (data->set.disallow_username_in_url ?
  ------------------
  |  Branch (2077:26): [True: 32, False: 9.62k]
  ------------------
 2078|  9.62k|                         CURLU_DISALLOW_USER : 0) |
  ------------------
  |  |   93|     32|#define CURLU_DISALLOW_USER (1 << 5)      /* no user+password allowed */
  ------------------
 2079|  9.65k|                        (data->set.path_as_is ? CURLU_PATH_AS_IS : 0));
  ------------------
  |  |   92|     34|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  |  Branch (2079:26): [True: 34, False: 9.62k]
  ------------------
 2080|  9.65k|      if(uc) {
  ------------------
  |  Branch (2080:10): [True: 184, False: 9.47k]
  ------------------
 2081|    184|        failf(data, "URL rejected: %s", curl_url_strerror(uc));
  ------------------
  |  |   62|    184|#define failf Curl_failf
  ------------------
 2082|    184|        result = Curl_uc_to_curlcode(uc);
 2083|    184|        goto out;
 2084|    184|      }
 2085|       |
 2086|  9.47k|      if(CURL_EASY_STR(data, STRING_DEFAULT_PROTOCOL)) {
  ------------------
  |  | 1206|  9.47k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
 2087|       |        /* check if we there was a scheme provided */
 2088|      0|        char *scheme;
 2089|      0|        uc = curl_url_get(uh, CURLUPART_SCHEME, &scheme,
 2090|      0|                          CURLU_NO_GUESS_SCHEME);
  ------------------
  |  |  106|      0|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
 2091|      0|        if(uc == CURLUE_NO_SCHEME)
  ------------------
  |  Branch (2091:12): [True: 0, False: 0]
  ------------------
 2092|      0|          prepend_sheme = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2093|      0|        curl_free(scheme);
 2094|      0|        if(uc && uc != CURLUE_NO_SCHEME) {
  ------------------
  |  Branch (2094:12): [True: 0, False: 0]
  |  Branch (2094:18): [True: 0, False: 0]
  ------------------
 2095|      0|          result = Curl_uc_to_curlcode(uc);
 2096|      0|          goto out;
 2097|      0|        }
 2098|      0|      }
 2099|  9.47k|    }
 2100|       |
 2101|  9.47k|    if(prepend_sheme) {
  ------------------
  |  Branch (2101:8): [True: 0, False: 9.47k]
  ------------------
 2102|      0|      char *url = curl_maprintf("%s://%s",
 2103|      0|                                CURL_EASY_STR(data, STRING_DEFAULT_PROTOCOL),
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 2104|      0|                                Curl_bufref_ptr(&data->state.url));
 2105|      0|      if(!url) {
  ------------------
  |  Branch (2105:10): [True: 0, False: 0]
  ------------------
 2106|      0|        result = CURLE_OUT_OF_MEMORY;
 2107|      0|        goto out;
 2108|      0|      }
 2109|      0|      uc = curl_url_set(uh, CURLUPART_URL, url,
 2110|      0|                        (unsigned int)
 2111|      0|                        CURLU_GUESS_SCHEME |
  ------------------
  |  |   97|      0|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
 2112|      0|                        CURLU_NON_SUPPORT_SCHEME |
  ------------------
  |  |   91|      0|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
 2113|      0|                        (data->set.disallow_username_in_url ?
  ------------------
  |  Branch (2113:26): [True: 0, False: 0]
  ------------------
 2114|      0|                         CURLU_DISALLOW_USER : 0) |
  ------------------
  |  |   93|      0|#define CURLU_DISALLOW_USER (1 << 5)      /* no user+password allowed */
  ------------------
 2115|      0|                        (data->set.path_as_is ? CURLU_PATH_AS_IS : 0));
  ------------------
  |  |   92|      0|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  |  Branch (2115:26): [True: 0, False: 0]
  ------------------
 2116|      0|      curl_free(url);
 2117|      0|      if(uc) {
  ------------------
  |  Branch (2117:10): [True: 0, False: 0]
  ------------------
 2118|      0|        failf(data, "URL rejected: %s", curl_url_strerror(uc));
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2119|      0|        result = Curl_uc_to_curlcode(uc);
 2120|      0|        goto out;
 2121|      0|      }
 2122|      0|    }
 2123|  9.47k|    {
 2124|  9.47k|      char *newurl;
 2125|       |      /* after it was parsed, and possibly given a new scheme, get the
 2126|       |         normalized version */
 2127|  9.47k|      uc = curl_url_get(uh, CURLUPART_URL, &newurl, CURLU_GET_EMPTY);
  ------------------
  |  |  103|  9.47k|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
 2128|  9.47k|      if(uc) {
  ------------------
  |  Branch (2128:10): [True: 13, False: 9.46k]
  ------------------
 2129|     13|        result = Curl_uc_to_curlcode(uc);
 2130|     13|        goto out;
 2131|     13|      }
 2132|  9.46k|      if(prepend_sheme)
  ------------------
  |  Branch (2132:10): [True: 0, False: 9.46k]
  ------------------
 2133|      0|        infof(data, "Applied default protocol '%s'",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2134|  9.46k|              CURL_EASY_STR(data, STRING_DEFAULT_PROTOCOL));
 2135|  9.46k|      Curl_bufref_set(&data->state.url, newurl, 0, curl_free);
 2136|  9.46k|    }
 2137|  9.46k|  }
 2138|       |
 2139|  9.46k|#ifdef USE_IPV6
 2140|  9.46k|  scope_id = data->set.scope_id;
 2141|  9.46k|#endif
 2142|       |
 2143|       |  /* `uh` is now as the connection should use it, probably. */
 2144|  9.46k|  result = Curl_peer_from_url(uh, data, port_override, scope_id,
 2145|  9.46k|                              &data->state.origin);
 2146|  9.46k|  if(result)
  ------------------
  |  Branch (2146:6): [True: 21, False: 9.44k]
  ------------------
 2147|     21|    goto out;
 2148|       |  /* The origin might get changed when HSTS applies */
 2149|  9.44k|  result = hsts_upgrade(data, uh, port_override, scope_id);
 2150|  9.44k|  if(result)
  ------------------
  |  Branch (2150:6): [True: 0, False: 9.44k]
  ------------------
 2151|      0|    goto out;
 2152|       |
 2153|       |  /* When the transfers initial_origin is not set, this is the initial
 2154|       |   * request. Remember this starting point. */
 2155|  9.44k|  if(!data->state.initial_origin)
  ------------------
  |  Branch (2155:6): [True: 9.44k, False: 0]
  ------------------
 2156|  9.44k|    Curl_peer_link(&data->state.initial_origin, data->state.origin);
 2157|       |
 2158|  9.44k|  uc = curl_url_get(uh, CURLUPART_PATH, &data->state.up.path, CURLU_URLENCODE);
  ------------------
  |  |   95|  9.44k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 2159|  9.44k|  if(uc) {
  ------------------
  |  Branch (2159:6): [True: 8, False: 9.43k]
  ------------------
 2160|      8|    result = Curl_uc_to_curlcode(uc);
 2161|      8|    goto out;
 2162|      8|  }
 2163|  9.43k|  uc = curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query,
 2164|  9.43k|                    CURLU_GET_EMPTY);
  ------------------
  |  |  103|  9.43k|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
 2165|  9.43k|  if(uc && (uc != CURLUE_NO_QUERY)) {
  ------------------
  |  Branch (2165:6): [True: 9.39k, False: 37]
  |  Branch (2165:12): [True: 1, False: 9.39k]
  ------------------
 2166|      1|    result = CURLE_OUT_OF_MEMORY;
 2167|      1|    goto out;
 2168|      1|  }
 2169|       |
 2170|  9.43k|  uc = curl_url_get(uh, CURLUPART_OPTIONS, &data->state.up.options,
 2171|  9.43k|                    CURLU_URLDECODE);
  ------------------
  |  |   94|  9.43k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
 2172|  9.43k|  if(uc && (uc != CURLUE_NO_OPTIONS)) {
  ------------------
  |  Branch (2172:6): [True: 9.43k, False: 0]
  |  Branch (2172:12): [True: 0, False: 9.43k]
  ------------------
 2173|      0|    result = Curl_uc_to_curlcode(uc);
 2174|      0|    goto out;
 2175|      0|  }
 2176|       |
 2177|  9.43k|  result = url_set_data_creds(data, uh);
 2178|  9.43k|  if(result)
  ------------------
  |  Branch (2178:6): [True: 1, False: 9.43k]
  ------------------
 2179|      1|    goto out;
 2180|       |
 2181|  9.66k|out:
 2182|  9.66k|  return result;
 2183|  9.43k|}
url.c:hsts_upgrade:
 1188|  9.44k|{
 1189|       |  /* HSTS upgrade */
 1190|  9.44k|  if(data->hsts && (data->state.origin->scheme == &Curl_scheme_http) &&
  ------------------
  |  Branch (1190:6): [True: 9.39k, False: 45]
  |  Branch (1190:20): [True: 0, False: 9.39k]
  ------------------
 1191|      0|     Curl_hsts_applies(data->hsts, data->state.origin)) {
  ------------------
  |  Branch (1191:6): [True: 0, False: 0]
  ------------------
 1192|      0|    char *url;
 1193|      0|    CURLUcode uc;
 1194|      0|    CURLcode result;
 1195|       |
 1196|      0|    uc = curl_url_set(uh, CURLUPART_SCHEME, "https", 0);
 1197|      0|    if(uc)
  ------------------
  |  Branch (1197:8): [True: 0, False: 0]
  ------------------
 1198|      0|      return Curl_uc_to_curlcode(uc);
 1199|      0|    Curl_bufref_free(&data->state.url);
 1200|       |    /* after update, get the updated version */
 1201|      0|    uc = curl_url_get(uh, CURLUPART_URL, &url, 0);
 1202|      0|    if(uc)
  ------------------
  |  Branch (1202:8): [True: 0, False: 0]
  ------------------
 1203|      0|      return Curl_uc_to_curlcode(uc);
 1204|      0|    Curl_bufref_set(&data->state.url, url, 0, curl_free);
 1205|       |
 1206|      0|    result = Curl_peer_from_url(uh, data, port_override, scope_id,
 1207|      0|                                &data->state.origin);
 1208|      0|    if(result)
  ------------------
  |  Branch (1208:8): [True: 0, False: 0]
  ------------------
 1209|      0|      return result;
 1210|      0|    infof(data, "Switched from HTTP to HTTPS due to HSTS => %s", url);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1211|      0|  }
 1212|  9.44k|  return CURLE_OK;
 1213|  9.44k|}
url.c:url_set_data_creds:
 1339|  9.43k|{
 1340|  9.43k|  struct Curl_creds *newcreds = NULL;
 1341|  9.43k|  CURLcode result = CURLE_OK;
 1342|       |
 1343|  9.43k|  if((CURL_EASY_STR(data, STRING_USERNAME) ||
  ------------------
  |  | 1206|  18.8k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 147, False: 9.28k]
  |  |  ------------------
  ------------------
 1344|  9.28k|      CURL_EASY_STR(data, STRING_PASSWORD) ||
  ------------------
  |  | 1206|  18.7k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 52, False: 9.23k]
  |  |  ------------------
  ------------------
 1345|  9.23k|      CURL_EASY_STR(data, STRING_BEARER) ||
  ------------------
  |  | 1206|  18.6k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 41, False: 9.19k]
  |  |  ------------------
  ------------------
 1346|  9.19k|      CURL_EASY_STR(data, STRING_SASL_AUTHZID) ||
  ------------------
  |  | 1206|  18.6k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 9.19k]
  |  |  ------------------
  ------------------
 1347|  9.19k|      CURL_EASY_STR(data, STRING_SERVICE_NAME)) &&
  ------------------
  |  | 1206|  9.19k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 9.19k]
  |  |  ------------------
  ------------------
 1348|    240|     Curl_auth_allowed_to_origin(data, data->state.origin)) {
  ------------------
  |  Branch (1348:6): [True: 240, False: 0]
  ------------------
 1349|    240|    result = Curl_creds_create(CURL_EASY_STR(data, STRING_USERNAME),
  ------------------
  |  | 1206|    240|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1350|    240|                               CURL_EASY_STR(data, STRING_PASSWORD),
  ------------------
  |  | 1206|    240|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1351|    240|                               CURL_EASY_STR(data, STRING_BEARER),
  ------------------
  |  | 1206|    240|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1352|    240|                               CURL_EASY_STR(data, STRING_SASL_AUTHZID),
  ------------------
  |  | 1206|    240|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1353|    240|                               CURL_EASY_STR(data, STRING_SERVICE_NAME),
  ------------------
  |  | 1206|    240|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1354|    240|                               CREDS_OPTION, &newcreds);
  ------------------
  |  |   32|    240|#define CREDS_OPTION 2 /* username/passwd set with a CURLOPT_ */
  ------------------
 1355|    240|    if(result)
  ------------------
  |  Branch (1355:8): [True: 0, False: 240]
  ------------------
 1356|      0|      goto out;
 1357|    240|    if(newcreds &&
  ------------------
  |  Branch (1357:8): [True: 230, False: 10]
  ------------------
 1358|    230|       !(data->state.origin->scheme->flags & PROTOPT_USERPWDCTRL) &&
  ------------------
  |  |  238|    230|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
  |  Branch (1358:8): [True: 0, False: 230]
  ------------------
 1359|      0|       (str_has_ctrl(Curl_creds_user(newcreds)) ||
  ------------------
  |  |   82|      0|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (82:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1359:9): [True: 0, False: 0]
  ------------------
 1360|      0|        str_has_ctrl(Curl_creds_passwd(newcreds)))) {
  ------------------
  |  |   83|      0|#define Curl_creds_passwd(c)             ((c) ? (c)->passwd : "")
  |  |  ------------------
  |  |  |  Branch (83:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1360:9): [True: 0, False: 0]
  ------------------
 1361|       |      /* if the protocol cannot handle control codes in credentials, make
 1362|       |         sure there are none */
 1363|      0|      failf(data, "control code detected in credentials");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1364|      0|      result = CURLE_BAD_FUNCTION_ARGUMENT;
 1365|      0|      goto out;
 1366|      0|    }
 1367|    240|  }
 1368|       |
 1369|       |  /* Extract credentials from the URL only if there are none OR
 1370|       |   * if no CURLOPT_USER was set. */
 1371|  9.43k|  if(!newcreds || !Curl_creds_has_user(newcreds)) {
  ------------------
  |  |   76|    230|#define Curl_creds_has_user(c)           ((c) && (c)->user[0])
  |  |  ------------------
  |  |  |  Branch (76:43): [True: 230, False: 0]
  |  |  |  Branch (76:50): [True: 50, False: 180]
  |  |  ------------------
  ------------------
  |  Branch (1371:6): [True: 9.20k, False: 230]
  ------------------
 1372|  9.38k|    char *user = NULL;
 1373|  9.38k|    char *passwd = NULL;
 1374|  9.38k|    char *udecoded = NULL;
 1375|  9.38k|    char *pdecoded = NULL;
 1376|  9.38k|    CURLUcode uc;
 1377|       |
 1378|  9.38k|    uc = curl_url_get(uh, CURLUPART_USER, &user, 0);
 1379|  9.38k|    if(uc && (uc != CURLUE_NO_USER))
  ------------------
  |  Branch (1379:8): [True: 9.38k, False: 0]
  |  Branch (1379:14): [True: 0, False: 9.38k]
  ------------------
 1380|      0|      result = Curl_uc_to_curlcode(uc);
 1381|  9.38k|    if(!result) {
  ------------------
  |  Branch (1381:8): [True: 9.38k, False: 0]
  ------------------
 1382|  9.38k|      uc = curl_url_get(uh, CURLUPART_PASSWORD, &passwd, 0);
 1383|  9.38k|      if(uc && (uc != CURLUE_NO_PASSWORD))
  ------------------
  |  Branch (1383:10): [True: 9.38k, False: 0]
  |  Branch (1383:16): [True: 0, False: 9.38k]
  ------------------
 1384|      0|        result = Curl_uc_to_curlcode(uc);
 1385|  9.38k|    }
 1386|  9.38k|    if(!result && user) {
  ------------------
  |  Branch (1386:8): [True: 9.38k, False: 0]
  |  Branch (1386:19): [True: 0, False: 9.38k]
  ------------------
 1387|      0|      result = Curl_urldecode(user, 0, &udecoded, NULL,
 1388|      0|                              (data->state.origin->scheme->flags &
  ------------------
  |  Branch (1388:31): [True: 0, False: 0]
  ------------------
 1389|      0|                               PROTOPT_USERPWDCTRL) ?
  ------------------
  |  |  238|      0|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
 1390|      0|                              REJECT_ZERO : REJECT_CTRL);
 1391|      0|    }
 1392|  9.38k|    if(!result && passwd) {
  ------------------
  |  Branch (1392:8): [True: 9.38k, False: 0]
  |  Branch (1392:19): [True: 0, False: 9.38k]
  ------------------
 1393|      0|      result = Curl_urldecode(passwd, 0, &pdecoded, NULL,
 1394|      0|                              (data->state.origin->scheme->flags &
  ------------------
  |  Branch (1394:31): [True: 0, False: 0]
  ------------------
 1395|      0|                               PROTOPT_USERPWDCTRL) ?
  ------------------
  |  |  238|      0|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
 1396|      0|                              REJECT_ZERO : REJECT_CTRL);
 1397|      0|    }
 1398|  9.38k|    if(!result)
  ------------------
  |  Branch (1398:8): [True: 9.38k, False: 0]
  ------------------
 1399|  9.38k|      result = Curl_creds_merge(udecoded, pdecoded, newcreds,
 1400|  9.38k|                                CREDS_URL, &newcreds);
  ------------------
  |  |   31|  9.38k|#define CREDS_URL    1 /* username/passwd from URL */
  ------------------
 1401|       |
 1402|  9.38k|    curlx_free(udecoded);
  ------------------
  |  | 1503|  9.38k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1403|  9.38k|    curlx_free(pdecoded);
  ------------------
  |  | 1503|  9.38k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1404|  9.38k|    curlx_free(passwd);
  ------------------
  |  | 1503|  9.38k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1405|  9.38k|    curlx_free(user);
  ------------------
  |  | 1503|  9.38k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1406|  9.38k|    if(result) {
  ------------------
  |  Branch (1406:8): [True: 1, False: 9.38k]
  ------------------
 1407|      1|      failf(data, "error extracting credentials from URL");
  ------------------
  |  |   62|      1|#define failf Curl_failf
  ------------------
 1408|      1|      goto out;
 1409|      1|    }
 1410|  9.38k|  }
 1411|       |
 1412|  9.43k|#ifndef CURL_DISABLE_NETRC
 1413|       |  /* Check for overridden login details and set them accordingly so that
 1414|       |     they are known when protocol->setup_connection is called! */
 1415|  9.43k|  result = url_set_data_creds_netrc(data, &newcreds);
 1416|  9.43k|#endif /* CURL_DISABLE_NETRC */
 1417|       |
 1418|  9.43k|out:
 1419|  9.43k|  if(!result && !Curl_creds_equal(data->state.creds, newcreds)) {
  ------------------
  |  Branch (1419:6): [True: 9.43k, False: 1]
  |  Branch (1419:17): [True: 229, False: 9.20k]
  ------------------
 1420|       |    /* Do we have more things to trigger on credentials change? */
 1421|    229|    Curl_creds_link(&data->state.creds, newcreds);
 1422|    229|  }
 1423|  9.43k|  Curl_creds_unlink(&newcreds);
 1424|  9.43k|  return result;
 1425|  9.43k|}
url.c:url_set_data_creds_netrc:
 1238|  9.43k|{
 1239|  9.43k|  struct Curl_creds *ncreds_out = NULL;
 1240|  9.43k|  CURLcode result = CURLE_OK;
 1241|       |
 1242|  9.43k|  if(data->set.use_netrc) { /* not CURL_NETRC_IGNORED */
  ------------------
  |  Branch (1242:6): [True: 0, False: 9.43k]
  ------------------
 1243|      0|    struct Curl_creds *ncreds_in = NULL;
 1244|      0|    bool scan_netrc = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1245|      0|    NETRCcode ret;
 1246|      0|    CURLUcode uc;
 1247|       |
 1248|      0|    if(*pcreds) {
  ------------------
  |  Branch (1248:8): [True: 0, False: 0]
  ------------------
 1249|      0|      switch((*pcreds)->source) {
 1250|      0|      case CREDS_OPTION:
  ------------------
  |  |   32|      0|#define CREDS_OPTION 2 /* username/passwd set with a CURLOPT_ */
  ------------------
  |  Branch (1250:7): [True: 0, False: 0]
  ------------------
 1251|       |        /* we never override credentials set via CURLOPT_*, leave. */
 1252|      0|        scan_netrc = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1253|      0|        break;
 1254|      0|      case CREDS_URL: /* only apply when netrc is not required */
  ------------------
  |  |   31|      0|#define CREDS_URL    1 /* username/passwd from URL */
  ------------------
  |  Branch (1254:7): [True: 0, False: 0]
  ------------------
 1255|      0|        if(data->set.use_netrc == CURL_NETRC_REQUIRED) {
  ------------------
  |  | 2385|      0|#define CURL_NETRC_REQUIRED 2L /* A user:password in the URL is ignored.
  ------------------
  |  Branch (1255:12): [True: 0, False: 0]
  ------------------
 1256|       |          /* We ignore password from URL */
 1257|      0|          ncreds_in = *pcreds;
 1258|      0|        }
 1259|      0|        else if(!Curl_creds_has_user(*pcreds) ||
  ------------------
  |  |   76|      0|#define Curl_creds_has_user(c)           ((c) && (c)->user[0])
  |  |  ------------------
  |  |  |  Branch (76:43): [True: 0, False: 0]
  |  |  |  Branch (76:50): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1260|      0|                !Curl_creds_has_passwd(*pcreds)) {
  ------------------
  |  |   77|      0|#define Curl_creds_has_passwd(c)         ((c) && (c)->passwd[0])
  |  |  ------------------
  |  |  |  Branch (77:43): [True: 0, False: 0]
  |  |  |  Branch (77:50): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1261|       |          /* We use netrc to complete what is missing */
 1262|      0|          ncreds_in = *pcreds;
 1263|      0|        }
 1264|      0|        else
 1265|      0|          scan_netrc = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1266|      0|        break;
 1267|      0|      default: /* ignore credentials from other sources */
  ------------------
  |  Branch (1267:7): [True: 0, False: 0]
  ------------------
 1268|      0|        break;
 1269|      0|      }
 1270|      0|    }
 1271|       |
 1272|      0|    if(!scan_netrc)
  ------------------
  |  Branch (1272:8): [True: 0, False: 0]
  ------------------
 1273|      0|      goto out;
 1274|       |
 1275|      0|    ret = Curl_netrc_scan(data, &data->state.netrc,
 1276|      0|                          data->state.origin->hostname,
 1277|      0|                          Curl_creds_user(ncreds_in),
  ------------------
  |  |   82|      0|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (82:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1278|      0|                          CURL_EASY_STR(data, STRING_NETRC_FILE),
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1279|      0|                          &ncreds_out);
 1280|      0|    DEBUGASSERT(!ret || !ncreds_out);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1280:5): [True: 0, False: 0]
  |  Branch (1280:5): [True: 0, False: 0]
  |  Branch (1280:5): [True: 0, False: 0]
  |  Branch (1280:5): [True: 0, False: 0]
  ------------------
 1281|      0|    if(ret == NETRC_OUT_OF_MEMORY) {
  ------------------
  |  Branch (1281:8): [True: 0, False: 0]
  ------------------
 1282|      0|      result = CURLE_OUT_OF_MEMORY;
 1283|      0|      goto out;
 1284|      0|    }
 1285|      0|    else if(ret && ((ret == NETRC_NO_MATCH) ||
  ------------------
  |  Branch (1285:13): [True: 0, False: 0]
  |  Branch (1285:21): [True: 0, False: 0]
  ------------------
 1286|      0|                    (data->set.use_netrc == CURL_NETRC_OPTIONAL))) {
  ------------------
  |  | 2383|      0|#define CURL_NETRC_OPTIONAL 1L /* A user:password in the URL is preferred
  ------------------
  |  Branch (1286:21): [True: 0, False: 0]
  ------------------
 1287|      0|      infof(data, "Could not find host %s in the %s file; using defaults",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1288|      0|            data->state.origin->hostname,
 1289|      0|            (CURL_EASY_STR(data, STRING_NETRC_FILE) ?
 1290|      0|             CURL_EASY_STR(data, STRING_NETRC_FILE) : ".netrc"));
 1291|      0|    }
 1292|      0|    else if(ret) {
  ------------------
  |  Branch (1292:13): [True: 0, False: 0]
  ------------------
 1293|      0|      const char *m = Curl_netrc_strerror(ret);
 1294|      0|      failf(data, ".netrc error: %s", m);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1295|      0|      result = CURLE_READ_ERROR;
 1296|      0|      goto out;
 1297|      0|    }
 1298|      0|    else if(ncreds_out) {
  ------------------
  |  Branch (1298:13): [True: 0, False: 0]
  ------------------
 1299|      0|      if(!(data->state.origin->scheme->flags & PROTOPT_USERPWDCTRL) &&
  ------------------
  |  |  238|      0|#define PROTOPT_USERPWDCTRL (1 << 13) /* Allow "control bytes" (< 32 ASCII) in
  ------------------
  |  Branch (1299:10): [True: 0, False: 0]
  ------------------
 1300|       |         /* if the protocol cannot handle control codes in credentials, make
 1301|       |            sure there are none */
 1302|      0|         (str_has_ctrl(ncreds_out->user) ||
  ------------------
  |  Branch (1302:11): [True: 0, False: 0]
  ------------------
 1303|      0|          str_has_ctrl(ncreds_out->passwd))) {
  ------------------
  |  Branch (1303:11): [True: 0, False: 0]
  ------------------
 1304|      0|        failf(data, "control code detected in .netrc credentials");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1305|      0|        result = CURLE_READ_ERROR;
 1306|      0|        goto out;
 1307|      0|      }
 1308|      0|      CURL_TRC_M(data, "netrc: using credentials for %s as %s",
  ------------------
  |  |  148|      0|  do {                                   \
  |  |  149|      0|    if(CURL_TRC_M_is_verbose(data))      \
  |  |  ------------------
  |  |  |  |  135|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|      0|      Curl_trc_multi(data, __VA_ARGS__); \
  |  |  151|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (151:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1309|      0|                 data->state.origin->hostname, ncreds_out->user);
 1310|      0|      result = Curl_creds_merge(ncreds_out->user, ncreds_out->passwd,
 1311|      0|                                *pcreds, CREDS_NETRC, pcreds);
  ------------------
  |  |   33|      0|#define CREDS_NETRC  3 /* username/passwd found in netrc */
  ------------------
 1312|      0|      if(result)
  ------------------
  |  Branch (1312:10): [True: 0, False: 0]
  ------------------
 1313|      0|        goto out;
 1314|       |      /* for updated strings, we update them in the URL */
 1315|      0|      uc = curl_url_set(data->state.uh, CURLUPART_USER,
 1316|      0|                        Curl_creds_user(*pcreds), CURLU_URLENCODE);
  ------------------
  |  |   82|      0|#define Curl_creds_user(c)               ((c) ? (c)->user : "")
  |  |  ------------------
  |  |  |  Branch (82:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                      Curl_creds_user(*pcreds), CURLU_URLENCODE);
  ------------------
  |  |   95|      0|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 1317|      0|      if(!uc)
  ------------------
  |  Branch (1317:10): [True: 0, False: 0]
  ------------------
 1318|      0|        uc = curl_url_set(data->state.uh, CURLUPART_PASSWORD,
 1319|      0|                          Curl_creds_passwd(*pcreds),
  ------------------
  |  |   83|      0|#define Curl_creds_passwd(c)             ((c) ? (c)->passwd : "")
  |  |  ------------------
  |  |  |  Branch (83:43): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1320|      0|                          CURLU_URLENCODE);
  ------------------
  |  |   95|      0|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
 1321|      0|      if(uc)
  ------------------
  |  Branch (1321:10): [True: 0, False: 0]
  ------------------
 1322|      0|        result = Curl_uc_to_curlcode(uc);
 1323|      0|    }
 1324|      0|    else
 1325|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1325:7): [Folded, False: 0]
  |  Branch (1325:7): [Folded, False: 0]
  ------------------
 1326|      0|  }
 1327|       |
 1328|  9.43k|#ifdef CURLVERBOSE
 1329|  9.43k|  Curl_creds_trace(data, data->state.creds, "transfer credentials");
 1330|  9.43k|#endif
 1331|       |
 1332|  9.43k|out:
 1333|  9.43k|  Curl_creds_unlink(&ncreds_out);
 1334|  9.43k|  return result;
 1335|  9.43k|}
url.c:url_find_or_create_conn:
 2238|  9.43k|{
 2239|  9.43k|  struct connectdata *needle = NULL;
 2240|  9.43k|  struct url_conn_match match;
 2241|  9.43k|  bool match_initialized = FALSE;
  ------------------
  |  |  989|  9.43k|#define FALSE false
  ------------------
 2242|  9.43k|  CURLcode result;
 2243|       |
 2244|       |  /* create the template connection for transfer data. Use this needle to
 2245|       |   * find an existing connection or, if none exists, convert needle
 2246|       |   * to a full connection and attach it to data. */
 2247|  9.43k|  result = url_create_needle(data, &needle);
 2248|  9.43k|  if(result)
  ------------------
  |  Branch (2248:6): [True: 22, False: 9.40k]
  ------------------
 2249|     22|    goto out;
 2250|  9.40k|  DEBUGASSERT(needle);
  ------------------
  |  | 1016|  9.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2250:3): [True: 0, False: 9.40k]
  |  Branch (2250:3): [True: 9.40k, False: 0]
  ------------------
 2251|       |
 2252|  9.40k|  result = url_match_init(data, needle, &match);
 2253|  9.40k|  if(result)
  ------------------
  |  Branch (2253:6): [True: 0, False: 9.40k]
  ------------------
 2254|      0|    goto out;
 2255|  9.40k|  match_initialized = TRUE;
  ------------------
  |  |  986|  9.40k|#define TRUE true
  ------------------
 2256|       |
 2257|       |  /***********************************************************************
 2258|       |   * file: is a special case in that it does not need a network connection
 2259|       |   ***********************************************************************/
 2260|  9.40k|#ifndef CURL_DISABLE_FILE
 2261|  9.40k|  if(needle->scheme->flags & PROTOPT_NONETWORK) {
  ------------------
  |  |  221|  9.40k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
  |  Branch (2261:6): [True: 0, False: 9.40k]
  ------------------
 2262|      0|    bool done;
 2263|       |    /* this is supposed to be the connect function so we better at least check
 2264|       |       that the file is present here! */
 2265|      0|    DEBUGASSERT(needle->scheme->run->connect_it);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2265:5): [True: 0, False: 0]
  |  Branch (2265:5): [True: 0, False: 0]
  ------------------
 2266|      0|    data->info.conn_scheme = needle->scheme->name;
 2267|       |    /* conn_protocol can only provide "old" protocols */
 2268|      0|    data->info.conn_protocol = needle->scheme->protocol & CURLPROTO_MASK;
  ------------------
  |  |   78|      0|#define CURLPROTO_MASK   0x3fffffff
  ------------------
 2269|      0|    result = needle->scheme->run->connect_it(data, &done);
 2270|      0|    if(result)
  ------------------
  |  Branch (2270:8): [True: 0, False: 0]
  ------------------
 2271|      0|      goto out;
 2272|       |
 2273|       |    /* Setup a "faked" transfer that will do nothing */
 2274|      0|    result = Curl_cpool_add(data, needle, 0, 0, pnow);
 2275|      0|    Curl_attach_connection(data, needle, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2276|      0|    needle = NULL;
 2277|      0|    if(!result) {
  ------------------
  |  Branch (2277:8): [True: 0, False: 0]
  ------------------
 2278|       |      /* Setup whatever necessary for a resumed transfer */
 2279|      0|      result = setup_range(data);
 2280|      0|      if(!result) {
  ------------------
  |  Branch (2280:10): [True: 0, False: 0]
  ------------------
 2281|      0|        Curl_xfer_setup_nop(data);
 2282|      0|        result = Curl_init_transfer(data, data->conn);
 2283|      0|      }
 2284|      0|    }
 2285|       |
 2286|      0|    if(result) {
  ------------------
  |  Branch (2286:8): [True: 0, False: 0]
  ------------------
 2287|      0|      DEBUGASSERT(data->conn->scheme->run->done);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2287:7): [True: 0, False: 0]
  |  Branch (2287:7): [True: 0, False: 0]
  ------------------
 2288|       |      /* we ignore the return code for the protocol-specific DONE */
 2289|      0|      (void)data->conn->scheme->run->done(data, result, FALSE);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2290|      0|    }
 2291|      0|    goto out;
 2292|      0|  }
 2293|  9.40k|#endif
 2294|       |
 2295|       |  /*************************************************************
 2296|       |   * Reuse of existing connection is not allowed when
 2297|       |   * - connect_only is set or
 2298|       |   * - reuse_fresh is set and this is not a follow-up request
 2299|       |   *   (like with HTTP followlocation)
 2300|       |   *************************************************************/
 2301|  9.40k|  if((!data->set.reuse_fresh || data->state.followlocation) &&
  ------------------
  |  Branch (2301:7): [True: 9.36k, False: 47]
  |  Branch (2301:33): [True: 0, False: 47]
  ------------------
 2302|  9.36k|     !data->set.connect_only) {
  ------------------
  |  Branch (2302:6): [True: 9.36k, False: 0]
  ------------------
 2303|       |    /* Ok, try to find and attach an existing one */
 2304|  9.36k|    if(url_attach_existing(data, needle, &match, pnow)) {
  ------------------
  |  Branch (2304:8): [True: 0, False: 9.36k]
  ------------------
 2305|       |      /* We attached an existing connection for this transfer. Copy
 2306|       |       * over transfer specific properties over from needle. */
 2307|      0|      struct connectdata *conn = data->conn;
 2308|      0|      VERBOSE(bool tls_upgraded =
  ------------------
  |  | 1637|      0|#define VERBOSE(x) x
  |  |  ------------------
  |  |  |  Branch (1637:20): [True: 0, False: 0]
  |  |  |  Branch (1637:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2309|      0|        (!(needle->origin->scheme->flags & PROTOPT_SSL) &&
 2310|      0|         Curl_conn_is_ssl(conn)));
 2311|       |
 2312|      0|      DEBUGASSERT(conn);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2312:7): [True: 0, False: 0]
  |  Branch (2312:7): [True: 0, False: 0]
  ------------------
 2313|      0|      conn->bits.reuse = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2314|      0|      url_conn_reuse_adjust(data, needle);
 2315|       |
 2316|      0|#ifndef CURL_DISABLE_PROXY
 2317|      0|      infof(data, "Reusing existing %s: connection%s with %s %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2318|      0|            conn->origin->scheme->name,
 2319|      0|            tls_upgraded ? " (upgraded to SSL)" : "",
 2320|      0|            (conn->socks_proxy.peer || conn->http_proxy.peer) ?
 2321|      0|            "proxy" : "host",
 2322|      0|            conn->socks_proxy.peer ? conn->socks_proxy.peer->user_hostname :
 2323|      0|            conn->http_proxy.peer ? conn->http_proxy.peer->user_hostname :
 2324|      0|            conn->origin->hostname);
 2325|       |#else
 2326|       |      infof(data, "Reusing existing %s: connection%s with host %s",
 2327|       |            conn->origin->scheme->name,
 2328|       |            tls_upgraded ? " (upgraded to SSL)" : "",
 2329|       |            conn->origin->hostname);
 2330|       |#endif
 2331|      0|    }
 2332|  9.36k|  }
 2333|       |
 2334|  9.40k|  if(!data->conn) {
  ------------------
  |  Branch (2334:6): [True: 9.40k, False: 0]
  ------------------
 2335|       |    /* We have not attached an existing connection. `needle` may become
 2336|       |     * the connection to use, if
 2337|       |     * - we are not waiting on an existing connection result
 2338|       |     * - the total/host limits on active connections allow it
 2339|       |     */
 2340|  9.40k|    if(match.wait_pipe) {
  ------------------
  |  Branch (2340:8): [True: 0, False: 9.40k]
  ------------------
 2341|       |      /* There is a connection that *might* become usable for multiplexing
 2342|       |         "soon", and we wait for that */
 2343|      0|      infof(data, "Waiting on connection to negotiate possible multiplexing.");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2344|      0|      result = CURLE_NO_CONNECTION_AVAILABLE;
 2345|      0|      goto out;
 2346|      0|    }
 2347|       |
 2348|       |    /* Add needle to conn pool, observing the limits.
 2349|       |     * Initializes connection_id.
 2350|       |     * May fail due to limits with CURLE_NO_CONNECTION_AVAILABLE. */
 2351|  9.40k|    result = Curl_cpool_add(data, needle,
 2352|  9.40k|                            data->multi->max_total_connections,
 2353|  9.40k|                            data->multi->max_host_connections,
 2354|  9.40k|                            pnow);
 2355|  9.40k|    if(result)
  ------------------
  |  Branch (2355:8): [True: 11, False: 9.39k]
  ------------------
 2356|     11|      goto out;
 2357|       |
 2358|       |    /* All fine, attach it and forget needle */
 2359|  9.39k|    Curl_attach_connection(data, needle, TRUE);
  ------------------
  |  |  986|  9.39k|#define TRUE true
  ------------------
 2360|  9.39k|    needle = NULL;
 2361|       |
 2362|       |    /* Clone the SSL filter configs into the new connection. */
 2363|  9.39k|    result = Curl_ssl_conn_config_clone(&match.ssl_config,
 2364|  9.39k|#ifndef CURL_DISABLE_PROXY
 2365|  9.39k|                                        &match.proxy_ssl_config,
 2366|       |#else
 2367|       |                                        NULL,
 2368|       |#endif
 2369|  9.39k|                                        data->conn);
 2370|  9.39k|    if(result) {
  ------------------
  |  Branch (2370:8): [True: 1, False: 9.39k]
  ------------------
 2371|      1|      DEBUGF(infof(data, "Error: clone connection SSL config"));
  ------------------
  |  | 1002|      7|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 1, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 1]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 1]
  |  |  ------------------
  ------------------
 2372|      1|      goto out;
 2373|      1|    }
 2374|  9.39k|  }
 2375|       |
 2376|       |  /* COMMON setup code for reused and new connections from here on. */
 2377|       |
 2378|       |  /* Setup and init stuff before DO starts, in preparing for the transfer. */
 2379|  9.39k|  result = Curl_init_transfer(data, data->conn);
 2380|  9.39k|  if(result)
  ------------------
  |  Branch (2380:6): [True: 0, False: 9.39k]
  ------------------
 2381|      0|    goto out;
 2382|       |
 2383|       |  /* Setup whatever necessary for a resumed transfer */
 2384|  9.39k|  result = setup_range(data);
 2385|  9.39k|  if(result)
  ------------------
  |  Branch (2385:6): [True: 0, False: 9.39k]
  ------------------
 2386|      0|    goto out;
 2387|       |
 2388|       |  /* persist the scheme and handler the transfer is using */
 2389|  9.39k|  data->info.conn_scheme = data->conn->scheme->name;
 2390|       |  /* conn_protocol can only provide "old" protocols */
 2391|  9.39k|  data->info.conn_protocol = data->conn->scheme->protocol & CURLPROTO_MASK;
  ------------------
  |  |   78|  9.39k|#define CURLPROTO_MASK   0x3fffffff
  ------------------
 2392|  9.39k|  data->info.used_proxy =
 2393|       |#ifdef CURL_DISABLE_PROXY
 2394|       |    0
 2395|       |#else
 2396|  9.39k|    (data->conn->socks_proxy.peer || data->conn->http_proxy.peer)
  ------------------
  |  Branch (2396:6): [True: 0, False: 9.39k]
  |  Branch (2396:38): [True: 7.27k, False: 2.12k]
  ------------------
 2397|  9.39k|#endif
 2398|  9.39k|    ;
 2399|       |
 2400|       |  /* Lastly, inform connection filters that a new transfer is attached */
 2401|  9.39k|  result = Curl_conn_ev_data_setup(data);
 2402|       |
 2403|  9.43k|out:
 2404|  9.43k|  if(match_initialized)
  ------------------
  |  Branch (2404:6): [True: 9.40k, False: 22]
  ------------------
 2405|  9.40k|    url_match_destroy(&match);
 2406|  9.43k|  if(needle)
  ------------------
  |  Branch (2406:6): [True: 11, False: 9.41k]
  ------------------
 2407|     11|    Curl_conn_free(data, needle);
 2408|  9.43k|  DEBUGASSERT(result || data->conn);
  ------------------
  |  | 1016|  9.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2408:3): [True: 9.43k, False: 0]
  |  Branch (2408:3): [True: 0, False: 0]
  |  Branch (2408:3): [True: 34, False: 9.39k]
  |  Branch (2408:3): [True: 9.39k, False: 0]
  ------------------
 2409|  9.43k|  return result;
 2410|  9.43k|}
url.c:url_create_needle:
 1921|  9.43k|{
 1922|  9.43k|  struct connectdata *needle = NULL;
 1923|  9.43k|  CURLcode result = CURLE_OK;
 1924|  9.43k|  bool network_scheme = TRUE; /* almost all are */
  ------------------
  |  |  986|  9.43k|#define TRUE true
  ------------------
 1925|       |
 1926|       |  /* Allocate a temporary connection data struct (needle) and fill in for
 1927|       |     comparison purposes. */
 1928|  9.43k|  needle = allocate_conn(data);
 1929|  9.43k|  if(!needle) {
  ------------------
  |  Branch (1929:6): [True: 3, False: 9.42k]
  ------------------
 1930|      3|    result = CURLE_OUT_OF_MEMORY;
 1931|      3|    goto out;
 1932|      3|  }
 1933|       |
 1934|       |  /* Do the unfailable inits first, before checks that may early return */
 1935|  9.42k|  Curl_hash_init(&needle->meta_hash, 23, CURL_HASH_TYPE_BYTES,
 1936|  9.42k|                 conn_meta_freeentry);
 1937|       |
 1938|       |  /*************************************************************
 1939|       |   * Determine `conn->origin` and populate `data->state.up` and
 1940|       |   * other URL related properties.
 1941|       |   *************************************************************/
 1942|  9.42k|  result = url_set_conn_origin_etc(data, needle);
 1943|  9.42k|  if(result)
  ------------------
  |  Branch (1943:6): [True: 0, False: 9.42k]
  ------------------
 1944|      0|    goto out;
 1945|       |
 1946|  9.42k|  DEBUGASSERT(needle->origin);
  ------------------
  |  | 1016|  9.42k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1946:3): [True: 0, False: 9.42k]
  |  Branch (1946:3): [True: 9.42k, False: 0]
  ------------------
 1947|  9.42k|  network_scheme = !(needle->origin->scheme->flags & PROTOPT_NONETWORK);
  ------------------
  |  |  221|  9.42k|#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */
  ------------------
 1948|       |
 1949|  9.42k|#ifdef USE_UNIX_SOCKETS
 1950|       |  /*************************************************************
 1951|       |   * Set UDS first. It overrides "via_peer" and proxy settings.
 1952|       |   *************************************************************/
 1953|  9.42k|  if(network_scheme && CURL_EASY_STR(data, STRING_UNIX_SOCKET_PATH)) {
  ------------------
  |  | 1206|  9.42k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 9.42k]
  |  |  ------------------
  ------------------
  |  Branch (1953:6): [True: 9.42k, False: 0]
  ------------------
 1954|      0|    result = Curl_peer_uds_create(
 1955|      0|      needle->origin->scheme, CURL_EASY_STR(data, STRING_UNIX_SOCKET_PATH),
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 1956|      0|      (bool)data->set.abstract_unix_socket, &needle->via_peer);
 1957|      0|    if(result)
  ------------------
  |  Branch (1957:8): [True: 0, False: 0]
  ------------------
 1958|      0|      goto out;
 1959|      0|  }
 1960|  9.42k|#endif /* USE_UNIX_SOCKETS */
 1961|       |
 1962|  9.42k|  if(network_scheme && !needle->via_peer) {
  ------------------
  |  Branch (1962:6): [True: 9.42k, False: 0]
  |  Branch (1962:24): [True: 9.42k, False: 0]
  ------------------
 1963|       |    /*************************************************************
 1964|       |     * If the `via_peer` is not already set (via UDS above),
 1965|       |     * determine if we talk to `conn->origin` directly or use
 1966|       |     * `conn->via_peer` using "connect to" and "alt-svc" properties.
 1967|       |     *************************************************************/
 1968|  9.42k|    result = url_set_conn_peer(data, needle);
 1969|  9.42k|    if(result)
  ------------------
  |  Branch (1969:8): [True: 1, False: 9.42k]
  ------------------
 1970|      1|      goto out;
 1971|  9.42k|  }
 1972|       |
 1973|       |  /*************************************************************
 1974|       |   * Check whether the host and the "connect to host" are equal.
 1975|       |   * Do this after the hostnames have been IDN-converted and
 1976|       |   * before initializing the proxy.
 1977|       |   *************************************************************/
 1978|  9.42k|  if(Curl_peer_equal(needle->origin, needle->via_peer)) {
  ------------------
  |  Branch (1978:6): [True: 0, False: 9.42k]
  ------------------
 1979|      0|    Curl_peer_unlink(&needle->via_peer);
 1980|      0|  }
 1981|       |
 1982|  9.42k|#ifndef CURL_DISABLE_PROXY
 1983|       |  /* Going via a unix socket ignores any proxy settings */
 1984|  9.42k|  if(network_scheme &&
  ------------------
  |  Branch (1984:6): [True: 9.42k, False: 0]
  ------------------
 1985|  9.42k|     (!needle->via_peer || !needle->via_peer->unix_socket)) {
  ------------------
  |  Branch (1985:7): [True: 7.42k, False: 2.00k]
  |  Branch (1985:28): [True: 2.00k, False: 0]
  ------------------
 1986|  9.42k|    result = Curl_proxy_init_conn(data, needle);
 1987|  9.42k|    if(result)
  ------------------
  |  Branch (1987:8): [True: 15, False: 9.41k]
  ------------------
 1988|     15|      goto out;
 1989|  9.42k|  }
 1990|  9.41k|#endif /* CURL_DISABLE_PROXY */
 1991|       |
 1992|  9.41k|  result = url_set_conn_login(data, needle); /* default credentials */
 1993|  9.41k|  if(result)
  ------------------
  |  Branch (1993:6): [True: 0, False: 9.41k]
  ------------------
 1994|      0|    goto out;
 1995|       |
 1996|       |  /*************************************************************
 1997|       |   * Setup internals depending on protocol. Needs to be done after
 1998|       |   * we figured out what/if proxy to use.
 1999|       |   *************************************************************/
 2000|  9.41k|  result = setup_connection_internals(data, needle);
 2001|  9.41k|  if(result)
  ------------------
  |  Branch (2001:6): [True: 3, False: 9.40k]
  ------------------
 2002|      3|    goto out;
 2003|       |
 2004|  9.40k|  if(needle->scheme->flags & PROTOPT_ALPN) {
  ------------------
  |  |  229|  9.40k|#define PROTOPT_ALPN (1 << 8) /* set ALPN for this */
  ------------------
  |  Branch (2004:6): [True: 9.40k, False: 0]
  ------------------
 2005|       |    /* The protocol wants it, so set the bits if enabled in the easy handle
 2006|       |       (default) */
 2007|  9.40k|    if(data->set.ssl_enable_alpn)
  ------------------
  |  Branch (2007:8): [True: 9.40k, False: 0]
  ------------------
 2008|  9.40k|      needle->bits.tls_enable_alpn = TRUE;
  ------------------
  |  |  986|  9.40k|#define TRUE true
  ------------------
 2009|  9.40k|  }
 2010|       |
 2011|  9.40k|  if(network_scheme) {
  ------------------
  |  Branch (2011:6): [True: 9.40k, False: 0]
  ------------------
 2012|       |    /* Setup callbacks for network connections */
 2013|  9.40k|    needle->do_recv = Curl_cf_recv;
 2014|  9.40k|    needle->do_send = Curl_cf_send;
 2015|  9.40k|    needle->bits.tcp_fastopen = data->set.tcp_fastopen;
 2016|  9.40k|#ifdef USE_UNIX_SOCKETS
 2017|  9.40k|    if(Curl_conn_get_first_peer(needle)->unix_socket)
  ------------------
  |  Branch (2017:8): [True: 0, False: 9.40k]
  ------------------
 2018|      0|      needle->transport_wanted = TRNSPRT_UNIX;
  ------------------
  |  |  228|      0|#define TRNSPRT_UNIX 6
  ------------------
 2019|  9.40k|#endif
 2020|  9.40k|  }
 2021|       |
 2022|  9.43k|out:
 2023|  9.43k|  if(!result) {
  ------------------
  |  Branch (2023:6): [True: 9.40k, False: 22]
  ------------------
 2024|  9.40k|    DEBUGASSERT(needle);
  ------------------
  |  | 1016|  9.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2024:5): [True: 0, False: 9.40k]
  |  Branch (2024:5): [True: 9.40k, False: 0]
  ------------------
 2025|  9.40k|    DEBUGASSERT(needle->origin);
  ------------------
  |  | 1016|  9.40k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2025:5): [True: 0, False: 9.40k]
  |  Branch (2025:5): [True: 9.40k, False: 0]
  ------------------
 2026|  9.40k|    *pneedle = needle;
 2027|  9.40k|  }
 2028|     22|  else {
 2029|     22|    *pneedle = NULL;
 2030|     22|    if(needle)
  ------------------
  |  Branch (2030:8): [True: 19, False: 3]
  ------------------
 2031|     19|      Curl_conn_free(data, needle);
 2032|     22|  }
 2033|  9.43k|  return result;
 2034|  9.43k|}
url.c:allocate_conn:
 1100|  9.43k|{
 1101|  9.43k|  struct connectdata *conn = curlx_calloc(1, sizeof(struct connectdata));
  ------------------
  |  | 1500|  9.43k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1102|  9.43k|  if(!conn)
  ------------------
  |  Branch (1102:6): [True: 3, False: 9.42k]
  ------------------
 1103|      3|    return NULL;
 1104|       |
 1105|       |  /* and we setup a few fields in case we end up actually using this struct */
 1106|  9.42k|  Curl_cfchain_init(&conn->chain, conn, TRUE);
  ------------------
  |  |  986|  9.42k|#define TRUE true
  ------------------
 1107|  9.42k|  conn->connection_id = -1;    /* no ID */
 1108|  9.42k|  conn->cpid = UINT32_MAX;  /* not in connection pool yet */
 1109|  9.42k|  conn->attached_xfers = 0;
 1110|  9.42k|  conn->connect_start_ms = -1;
 1111|       |
 1112|  9.42k|#ifndef CURL_DISABLE_FTP
 1113|  9.42k|  conn->bits.ftp_use_epsv = data->set.ftp_use_epsv;
 1114|  9.42k|  conn->bits.ftp_use_eprt = data->set.ftp_use_eprt;
 1115|  9.42k|#endif
 1116|  9.42k|  conn->ip_version = data->set.ipver;
 1117|  9.42k|  conn->bits.connect_only = (bool)data->set.connect_only;
 1118|  9.42k|  conn->transport_wanted = TRNSPRT_TCP; /* most of them are TCP streams */
  ------------------
  |  |  225|  9.42k|#define TRNSPRT_TCP  3
  ------------------
 1119|       |
 1120|       |  /* Store the local bind parameters that will be used for this connection */
 1121|  9.42k|  if(CURL_EASY_STR(data, STRING_INTERFACE_OPT)) {
  ------------------
  |  | 1206|  9.42k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 9.42k]
  |  |  ------------------
  ------------------
 1122|      0|    conn->interface_opts =
 1123|      0|      curlx_strdup(CURL_EASY_STR(data, STRING_INTERFACE_OPT));
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1124|      0|    if(!conn->interface_opts)
  ------------------
  |  Branch (1124:8): [True: 0, False: 0]
  ------------------
 1125|      0|      goto error;
 1126|      0|  }
 1127|  9.42k|#ifndef CURL_DISABLE_BINDLOCAL
 1128|  9.42k|  conn->localportrange = data->set.localportrange;
 1129|  9.42k|  conn->localport = data->set.localport;
 1130|  9.42k|#endif
 1131|       |
 1132|       |  /* the close socket stuff needs to be copied to the connection struct as
 1133|       |     it may live on without (this specific) Curl_easy */
 1134|  9.42k|  conn->fclosesocket = data->set.fclosesocket;
 1135|  9.42k|  conn->closesocket_client = data->set.closesocket_client;
 1136|       |#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
 1137|       |  conn->gssapi_delegation = data->set.gssapi_delegation;
 1138|       |#endif
 1139|  9.42k|  return conn;
 1140|      0|error:
 1141|       |
 1142|      0|  curlx_free(conn->interface_opts);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1143|      0|  curlx_free(conn);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1144|       |  return NULL;
 1145|  9.42k|}
url.c:url_set_conn_origin_etc:
 1429|  9.42k|{
 1430|  9.42k|  CURLcode result = CURLE_OK;
 1431|       |
 1432|  9.42k|  Curl_peer_link(&conn->origin, data->state.origin);
 1433|       |
 1434|       |  /* set the connection scheme */
 1435|  9.42k|  result = url_set_conn_scheme(data, conn);
 1436|  9.42k|  if(result)
  ------------------
  |  Branch (1436:6): [True: 0, False: 9.42k]
  ------------------
 1437|      0|    goto out;
 1438|       |
 1439|       |  /* set the connection options */
 1440|  9.42k|  if(CURL_EASY_STR(data, STRING_OPTIONS)) {
  ------------------
  |  | 1206|  9.42k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 9.42k]
  |  |  ------------------
  ------------------
 1441|      0|    conn->options = curlx_strdup(CURL_EASY_STR(data, STRING_OPTIONS));
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1442|      0|    if(!conn->options) {
  ------------------
  |  Branch (1442:8): [True: 0, False: 0]
  ------------------
 1443|      0|      result = CURLE_OUT_OF_MEMORY;
 1444|      0|      goto out;
 1445|      0|    }
 1446|      0|  }
 1447|  9.42k|  else if(data->state.up.options) {
  ------------------
  |  Branch (1447:11): [True: 0, False: 9.42k]
  ------------------
 1448|      0|    conn->options = curlx_strdup(data->state.up.options);
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1449|      0|    if(!conn->options) {
  ------------------
  |  Branch (1449:8): [True: 0, False: 0]
  ------------------
 1450|      0|      result = CURLE_OUT_OF_MEMORY;
 1451|      0|      goto out;
 1452|      0|    }
 1453|      0|  }
 1454|       |
 1455|  9.42k|out:
 1456|  9.42k|  return result;
 1457|  9.42k|}
url.c:url_set_conn_scheme:
 1149|  9.42k|{
 1150|       |  /* URL scheme is usable for connection when it is
 1151|       |   * - allowed
 1152|       |   * - not from a redirect or an allowed redirect protocol */
 1153|  9.42k|  const struct Curl_scheme *scheme = conn->origin->scheme;
 1154|  9.42k|  if(scheme->run &&
  ------------------
  |  Branch (1154:6): [True: 9.42k, False: 0]
  ------------------
 1155|  9.42k|     (data->set.allowed_protocols & scheme->protocol) &&
  ------------------
  |  Branch (1155:6): [True: 9.42k, False: 0]
  ------------------
 1156|  9.42k|     (!data->state.this_is_a_follow ||
  ------------------
  |  Branch (1156:7): [True: 9.42k, False: 0]
  ------------------
 1157|  9.42k|       (data->set.redir_protocols & scheme->protocol))) {
  ------------------
  |  Branch (1157:8): [True: 0, False: 0]
  ------------------
 1158|  9.42k|    conn->scheme = scheme;
 1159|  9.42k|    return CURLE_OK;
 1160|  9.42k|  }
 1161|      0|  if(scheme->flags & PROTOPT_NO_TRANSFER)
  ------------------
  |  |  245|      0|#define PROTOPT_NO_TRANSFER (1 << 17) /* this protocol is not for transfers */
  ------------------
  |  Branch (1161:6): [True: 0, False: 0]
  ------------------
 1162|      0|    failf(data, "Protocol \"%s\" is not for transfers", scheme->name);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1163|      0|  else
 1164|      0|    failf(data, "Protocol \"%s\" is disabled%s", scheme->name,
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1165|      0|          data->state.this_is_a_follow ? " (in redirect)" : "");
  ------------------
  |  Branch (1165:11): [True: 0, False: 0]
  ------------------
 1166|      0|  return CURLE_UNSUPPORTED_PROTOCOL;
 1167|  9.42k|}
url.c:url_set_conn_peer:
 1733|  9.42k|{
 1734|  9.42k|  CURLcode result = CURLE_OK;
 1735|  9.42k|  struct Curl_peer *origin = conn->origin;
 1736|  9.42k|  struct Curl_peer *via_peer = NULL;
 1737|  9.42k|  struct Curl_frzn_strs *cto_strs = data->set.a.connect_to;
 1738|  9.42k|  const char *s;
 1739|  9.42k|  size_t i;
 1740|       |
 1741|  9.42k|  DEBUGASSERT(!conn->via_peer);
  ------------------
  |  | 1016|  9.42k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1741:3): [True: 0, False: 9.42k]
  |  Branch (1741:3): [True: 9.42k, False: 0]
  ------------------
 1742|  9.42k|  Curl_peer_unlink(&conn->via_peer);
 1743|       |
 1744|  11.4k|  for(i = 0; (i < Curl_frzn_strs_count(cto_strs)) && !via_peer; ++i) {
  ------------------
  |  |   38|  11.4k|  ((fstrs) ? (fstrs)->n : 0)
  |  |  ------------------
  |  |  |  Branch (38:4): [True: 4.00k, False: 7.42k]
  |  |  ------------------
  ------------------
  |  Branch (1744:14): [True: 2.00k, False: 9.42k]
  |  Branch (1744:54): [True: 2.00k, False: 0]
  ------------------
 1745|  2.00k|    s = Curl_frzn_strs_get_str(cto_strs, i);
  ------------------
  |  |   43|  2.00k|  ((fstrs) && ((idx) < (fstrs)->n) ? (fstrs)->strs[(idx)].str : NULL)
  |  |  ------------------
  |  |  |  Branch (43:4): [True: 2.00k, False: 0]
  |  |  |  Branch (43:15): [True: 2.00k, False: 0]
  |  |  ------------------
  ------------------
 1746|  2.00k|    if(!s)
  ------------------
  |  Branch (1746:8): [True: 0, False: 2.00k]
  ------------------
 1747|      0|      continue;
 1748|  2.00k|    result = parse_connect_to_string(data, origin, s, &via_peer);
 1749|  2.00k|    if(result)
  ------------------
  |  Branch (1749:8): [True: 1, False: 2.00k]
  ------------------
 1750|      1|      return result;
 1751|  2.00k|  }
 1752|       |
 1753|  9.42k|#ifndef CURL_DISABLE_ALTSVC
 1754|  9.42k|  if(data->asi && !via_peer &&
  ------------------
  |  Branch (1754:6): [True: 9.40k, False: 22]
  |  Branch (1754:19): [True: 7.40k, False: 1.99k]
  ------------------
 1755|  7.40k|     ((conn->scheme->protocol == CURLPROTO_HTTPS) ||
  ------------------
  |  | 1089|  7.40k|#define CURLPROTO_HTTPS   (1L << 1)
  ------------------
  |  Branch (1755:7): [True: 7.40k, False: 0]
  ------------------
 1756|      0|#ifdef DEBUGBUILD
 1757|       |      /* allow debug builds to circumvent the HTTPS restriction */
 1758|      0|      getenv("CURL_ALTSVC_HTTP")
  ------------------
  |  Branch (1758:7): [True: 0, False: 0]
  ------------------
 1759|       |#else
 1760|       |      0
 1761|       |#endif
 1762|  7.40k|       )) {
 1763|       |    /* no connect_to match, try alt-svc! */
 1764|  7.40k|    enum alpnid srcalpnid = ALPN_none;
 1765|  7.40k|    bool hit = FALSE;
  ------------------
  |  |  989|  7.40k|#define FALSE false
  ------------------
 1766|  7.40k|    struct altsvc *as = NULL;
 1767|  7.40k|    int allowed_alpns = ALPN_none;
 1768|  7.40k|    struct http_negotiation *neg = &data->state.http_neg;
 1769|  7.40k|    bool same_dest = FALSE;
  ------------------
  |  |  989|  7.40k|#define FALSE false
  ------------------
 1770|       |
 1771|  7.40k|    DEBUGF(infof(data, "Alt-svc check wanted=%x, allowed=%x",
  ------------------
  |  | 1002|  54.1k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 7.40k, False: 0]
  |  |  |  Branch (1002:19): [True: 775, False: 6.63k]
  |  |  |  Branch (1002:19): [True: 775, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 7.40k]
  |  |  ------------------
  ------------------
 1772|  7.40k|                 neg->wanted, neg->allowed));
 1773|  7.40k|#ifdef USE_HTTP3
 1774|  7.40k|    if(neg->allowed & CURL_HTTP_V3x)
  ------------------
  |  |   42|  7.40k|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (1774:8): [True: 7.40k, False: 0]
  ------------------
 1775|  7.40k|      allowed_alpns |= ALPN_h3;
 1776|  7.40k|#endif
 1777|  7.40k|#ifdef USE_HTTP2
 1778|  7.40k|    if(neg->allowed & CURL_HTTP_V2x)
  ------------------
  |  |   41|  7.40k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (1778:8): [True: 0, False: 7.40k]
  ------------------
 1779|      0|      allowed_alpns |= ALPN_h2;
 1780|  7.40k|#endif
 1781|  7.40k|    if(neg->allowed & CURL_HTTP_V1x)
  ------------------
  |  |   40|  7.40k|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (1781:8): [True: 0, False: 7.40k]
  ------------------
 1782|      0|      allowed_alpns |= ALPN_h1;
 1783|  7.40k|    allowed_alpns &= (int)data->asi->flags;
 1784|       |
 1785|  7.40k|    DEBUGF(infof(data, "check Alt-Svc for host '%s'", origin->hostname));
  ------------------
  |  | 1002|  54.1k|#define DEBUGF(x) x
  |  |  ------------------
  |  |  |  Branch (1002:19): [True: 7.40k, False: 0]
  |  |  |  Branch (1002:19): [True: 775, False: 6.63k]
  |  |  |  Branch (1002:19): [True: 775, False: 0]
  |  |  |  Branch (1002:19): [True: 0, False: 0]
  |  |  |  Branch (1002:19): [Folded, False: 7.40k]
  |  |  ------------------
  ------------------
 1786|  7.40k|#ifdef USE_HTTP3
 1787|  7.40k|    if(!hit && (neg->wanted & CURL_HTTP_V3x)) {
  ------------------
  |  |   42|  7.40k|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (1787:8): [True: 7.40k, False: 0]
  |  Branch (1787:16): [True: 7.40k, False: 0]
  ------------------
 1788|  7.40k|      srcalpnid = ALPN_h3;
 1789|  7.40k|      hit = Curl_altsvc_lookup(data->asi,
 1790|  7.40k|                               origin, ALPN_h3, /* from */
 1791|  7.40k|                               &as /* to */,
 1792|  7.40k|                               allowed_alpns, &same_dest);
 1793|  7.40k|    }
 1794|  7.40k|#endif
 1795|  7.40k|#ifdef USE_HTTP2
 1796|  7.40k|    if(!hit && (neg->wanted & CURL_HTTP_V2x) &&
  ------------------
  |  |   41|  7.40k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
  |  Branch (1796:8): [True: 7.40k, False: 0]
  |  Branch (1796:16): [True: 0, False: 7.40k]
  ------------------
 1797|      0|       !neg->h2_prior_knowledge) {
  ------------------
  |  Branch (1797:8): [True: 0, False: 0]
  ------------------
 1798|      0|      srcalpnid = ALPN_h2;
 1799|      0|      hit = Curl_altsvc_lookup(data->asi,
 1800|      0|                               origin, ALPN_h2, /* from */
 1801|      0|                               &as /* to */,
 1802|      0|                               allowed_alpns, &same_dest);
 1803|      0|    }
 1804|  7.40k|#endif
 1805|  7.40k|    if(!hit && (neg->wanted & CURL_HTTP_V1x) &&
  ------------------
  |  |   40|  7.40k|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
  |  Branch (1805:8): [True: 7.40k, False: 0]
  |  Branch (1805:16): [True: 0, False: 7.40k]
  ------------------
 1806|      0|       !neg->only_10) {
  ------------------
  |  Branch (1806:8): [True: 0, False: 0]
  ------------------
 1807|      0|      srcalpnid = ALPN_h1;
 1808|      0|      hit = Curl_altsvc_lookup(data->asi,
 1809|      0|                               origin, ALPN_h1, /* from */
 1810|      0|                               &as /* to */,
 1811|      0|                               allowed_alpns, &same_dest);
 1812|      0|    }
 1813|       |
 1814|  7.40k|    if(hit && same_dest) {
  ------------------
  |  Branch (1814:8): [True: 0, False: 7.40k]
  |  Branch (1814:15): [True: 0, False: 0]
  ------------------
 1815|       |      /* same destination, but more HTTPS version options */
 1816|      0|      switch(as->dst.alpnid) {
 1817|      0|      case ALPN_h1:
  ------------------
  |  Branch (1817:7): [True: 0, False: 0]
  ------------------
 1818|      0|        neg->wanted |= CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 1819|      0|        neg->preferred = CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 1820|      0|        break;
 1821|      0|      case ALPN_h2:
  ------------------
  |  Branch (1821:7): [True: 0, False: 0]
  ------------------
 1822|      0|        neg->wanted |= CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
 1823|      0|        neg->preferred = CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
 1824|      0|        break;
 1825|      0|      case ALPN_h3:
  ------------------
  |  Branch (1825:7): [True: 0, False: 0]
  ------------------
 1826|      0|        neg->wanted |= CURL_HTTP_V3x;
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
 1827|      0|        neg->preferred = CURL_HTTP_V3x;
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
 1828|      0|        break;
 1829|      0|      default: /* should not be possible */
  ------------------
  |  Branch (1829:7): [True: 0, False: 0]
  ------------------
 1830|      0|        break;
 1831|      0|      }
 1832|      0|    }
 1833|  7.40k|    else if(hit) {
  ------------------
  |  Branch (1833:13): [True: 0, False: 7.40k]
  ------------------
 1834|      0|      result = Curl_peer_create(data, conn->origin->scheme,
 1835|      0|                                as->dst.host, as->dst.port,
 1836|      0|                                &via_peer);
 1837|      0|      if(result)
  ------------------
  |  Branch (1837:10): [True: 0, False: 0]
  ------------------
 1838|      0|        return result;
 1839|      0|      infof(data, "Alt-svc connecting from [%s]%s:%u to [%s]%s:%u",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1840|      0|            Curl_alpnid2str(srcalpnid), origin->hostname, origin->port,
 1841|      0|            Curl_alpnid2str(as->dst.alpnid),
 1842|      0|            via_peer->hostname, via_peer->port);
 1843|      0|      conn->bits.altused = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1844|      0|      if(srcalpnid != as->dst.alpnid) {
  ------------------
  |  Branch (1844:10): [True: 0, False: 0]
  ------------------
 1845|       |        /* protocol version switch */
 1846|      0|        switch(as->dst.alpnid) {
 1847|      0|        case ALPN_h1:
  ------------------
  |  Branch (1847:9): [True: 0, False: 0]
  ------------------
 1848|      0|          neg->wanted = neg->allowed = CURL_HTTP_V1x;
  ------------------
  |  |   40|      0|#define CURL_HTTP_V1x   (1 << 0)
  ------------------
 1849|      0|          neg->only_10 = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1850|      0|          break;
 1851|      0|        case ALPN_h2:
  ------------------
  |  Branch (1851:9): [True: 0, False: 0]
  ------------------
 1852|      0|          neg->wanted = neg->allowed = CURL_HTTP_V2x;
  ------------------
  |  |   41|      0|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
 1853|      0|          break;
 1854|      0|        case ALPN_h3:
  ------------------
  |  Branch (1854:9): [True: 0, False: 0]
  ------------------
 1855|      0|          conn->transport_wanted = TRNSPRT_QUIC;
  ------------------
  |  |  227|      0|#define TRNSPRT_QUIC 5
  ------------------
 1856|      0|          neg->wanted = neg->allowed = CURL_HTTP_V3x;
  ------------------
  |  |   42|      0|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
 1857|      0|          break;
 1858|      0|        default: /* should not be possible */
  ------------------
  |  Branch (1858:9): [True: 0, False: 0]
  ------------------
 1859|      0|          break;
 1860|      0|        }
 1861|      0|      }
 1862|      0|    }
 1863|  7.40k|  }
 1864|  9.42k|#endif
 1865|       |
 1866|  9.42k|  if(via_peer)
  ------------------
  |  Branch (1866:6): [True: 2.00k, False: 7.42k]
  ------------------
 1867|  2.00k|    conn->via_peer = via_peer;
 1868|       |
 1869|  9.42k|  return result;
 1870|  9.42k|}
url.c:parse_connect_to_string:
 1673|  2.00k|{
 1674|  2.00k|  CURLcode result = CURLE_OK;
 1675|  2.00k|  const char *ptr = conn_to_line;
 1676|  2.00k|  bool host_match = FALSE;
  ------------------
  |  |  989|  2.00k|#define FALSE false
  ------------------
 1677|  2.00k|  bool port_match = FALSE;
  ------------------
  |  |  989|  2.00k|#define FALSE false
  ------------------
 1678|       |
 1679|  2.00k|  *pvia_dest = NULL;
 1680|       |
 1681|  2.00k|  if(*ptr == ':') {
  ------------------
  |  Branch (1681:6): [True: 2.00k, False: 0]
  ------------------
 1682|       |    /* an empty hostname always matches */
 1683|  2.00k|    host_match = TRUE;
  ------------------
  |  |  986|  2.00k|#define TRUE true
  ------------------
 1684|  2.00k|    ptr++;
 1685|  2.00k|  }
 1686|      0|  else {
 1687|       |    /* check whether the URL's hostname matches. Use the URL hostname
 1688|       |     * when it was an IPv6 address. Otherwise use the connection's hostname
 1689|       |     * that has IDN conversion. */
 1690|      0|    size_t hlen = strlen(dest->hostname);
 1691|      0|    host_match = curl_strnequal(ptr, dest->hostname, hlen);
 1692|      0|    if(!host_match && (dest->user_hostname != dest->hostname)) {
  ------------------
  |  Branch (1692:8): [True: 0, False: 0]
  |  Branch (1692:23): [True: 0, False: 0]
  ------------------
 1693|       |      /* hostname was normalized, could be IPv6 or IDN */
 1694|      0|      hlen = strlen(dest->user_hostname);
 1695|      0|      host_match = curl_strnequal(ptr, dest->user_hostname, hlen);
 1696|      0|    }
 1697|      0|    host_match = host_match && ptr[hlen] == ':';
  ------------------
  |  Branch (1697:18): [True: 0, False: 0]
  |  Branch (1697:32): [True: 0, False: 0]
  ------------------
 1698|      0|    if(host_match)
  ------------------
  |  Branch (1698:8): [True: 0, False: 0]
  ------------------
 1699|      0|      ptr += hlen + 1;
 1700|      0|  }
 1701|       |
 1702|  2.00k|  if(host_match) {
  ------------------
  |  Branch (1702:6): [True: 2.00k, False: 0]
  ------------------
 1703|  2.00k|    if(*ptr == ':') {
  ------------------
  |  Branch (1703:8): [True: 2.00k, False: 0]
  ------------------
 1704|       |      /* an empty port always matches */
 1705|  2.00k|      port_match = TRUE;
  ------------------
  |  |  986|  2.00k|#define TRUE true
  ------------------
 1706|  2.00k|      ptr++;
 1707|  2.00k|    }
 1708|      0|    else {
 1709|       |      /* check whether the URL's port matches */
 1710|      0|      const char *ptr_next = strchr(ptr, ':');
 1711|      0|      if(ptr_next) {
  ------------------
  |  Branch (1711:10): [True: 0, False: 0]
  ------------------
 1712|      0|        curl_off_t port_to_match;
 1713|      0|        if(!curlx_str_number(&ptr, &port_to_match, 0xffff) &&
  ------------------
  |  Branch (1713:12): [True: 0, False: 0]
  ------------------
 1714|      0|           ((uint16_t)port_to_match == dest->port)) {
  ------------------
  |  Branch (1714:12): [True: 0, False: 0]
  ------------------
 1715|      0|          port_match = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1716|      0|        }
 1717|      0|        ptr = ptr_next + 1;
 1718|      0|      }
 1719|      0|    }
 1720|  2.00k|  }
 1721|       |
 1722|  2.00k|  if(host_match && port_match && ptr && *ptr)
  ------------------
  |  Branch (1722:6): [True: 2.00k, False: 0]
  |  Branch (1722:20): [True: 2.00k, False: 0]
  |  Branch (1722:34): [True: 2.00k, False: 0]
  |  Branch (1722:41): [True: 2.00k, False: 0]
  ------------------
 1723|  2.00k|    result = Curl_peer_from_connect_to(data, dest, ptr, pvia_dest);
 1724|       |
 1725|  2.00k|  return result;
 1726|  2.00k|}
url.c:url_set_conn_login:
 1645|  9.41k|{
 1646|       |  /* If our protocol needs a password and we have none, use the defaults */
 1647|  9.41k|  if((conn->scheme->flags & PROTOPT_NEEDSPWD) && !conn->creds) {
  ------------------
  |  |  222|  9.41k|#define PROTOPT_NEEDSPWD (1 << 5)  /* needs a password, and if none is set it
  ------------------
  |  Branch (1647:6): [True: 0, False: 9.41k]
  |  Branch (1647:50): [True: 0, False: 0]
  ------------------
 1648|      0|    Curl_peer_link(&conn->creds_origin, data->state.origin);
 1649|      0|    if(data->state.creds)
  ------------------
  |  Branch (1649:8): [True: 0, False: 0]
  ------------------
 1650|      0|      Curl_creds_link(&conn->creds, data->state.creds);
 1651|      0|    else
 1652|      0|      return Curl_creds_create(CURL_DEFAULT_USER, CURL_DEFAULT_PASSWORD,
  ------------------
  |  |   29|      0|#define CURL_DEFAULT_USER     "anonymous"
  ------------------
                    return Curl_creds_create(CURL_DEFAULT_USER, CURL_DEFAULT_PASSWORD,
  ------------------
  |  |   30|      0|#define CURL_DEFAULT_PASSWORD "ftp@example.com"
  ------------------
 1653|      0|                               NULL, NULL, NULL, CREDS_NONE, &conn->creds);
  ------------------
  |  |   30|      0|#define CREDS_NONE   0 /* used for default username/passwd */
  ------------------
 1654|      0|  }
 1655|  9.41k|  else if(!(conn->scheme->flags & PROTOPT_CREDSPERREQUEST)) {
  ------------------
  |  |  226|  9.41k|#define PROTOPT_CREDSPERREQUEST (1 << 7) /* requires login credentials per
  ------------------
  |  Branch (1655:11): [True: 0, False: 9.41k]
  ------------------
 1656|       |    /* for protocols that do not handle credentials per request,
 1657|       |     * the connection credentials are set by the initial transfer. */
 1658|      0|    Curl_peer_link(&conn->creds_origin, data->state.origin);
 1659|      0|    Curl_creds_link(&conn->creds, data->state.creds);
 1660|      0|  }
 1661|       |
 1662|  9.41k|  return CURLE_OK;
 1663|  9.41k|}
url.c:setup_connection_internals:
 1501|  9.41k|{
 1502|  9.41k|  struct Curl_peer *peer = NULL;
 1503|       |
 1504|  9.41k|  if(conn->scheme->run->setup_connection) {
  ------------------
  |  Branch (1504:6): [True: 9.41k, False: 0]
  ------------------
 1505|  9.41k|    CURLcode result = conn->scheme->run->setup_connection(data, conn);
 1506|  9.41k|    if(result)
  ------------------
  |  Branch (1506:8): [True: 0, False: 9.41k]
  ------------------
 1507|      0|      return result;
 1508|  9.41k|  }
 1509|       |
 1510|       |  /* Now create the destination name */
 1511|  9.41k|  peer = Curl_conn_get_destination(conn);
 1512|  9.41k|  if(!peer)
  ------------------
  |  Branch (1512:6): [True: 0, False: 9.41k]
  ------------------
 1513|      0|    return CURLE_FAILED_INIT;
 1514|       |
 1515|       |  /* IPv6 addresses with a scope_id (0 is default == global) have a
 1516|       |   * printable representation with a '%<scope_id>' suffix. */
 1517|  9.41k|  if(peer->ipv6)
  ------------------
  |  Branch (1517:6): [True: 5.68k, False: 3.73k]
  ------------------
 1518|  5.68k|    if(peer->scopeid)
  ------------------
  |  Branch (1518:8): [True: 0, False: 5.68k]
  ------------------
 1519|      0|      conn->destination = curl_maprintf("[%s%%%u]:%u",
 1520|      0|        peer->hostname, peer->scopeid, peer->port);
 1521|  5.68k|    else
 1522|  5.68k|      conn->destination = curl_maprintf("[%s]:%u",
 1523|  5.68k|        peer->hostname, peer->port);
 1524|  3.73k|  else
 1525|  3.73k|    conn->destination = curl_maprintf("%s:%u", peer->hostname, peer->port);
 1526|  9.41k|  if(!conn->destination)
  ------------------
  |  Branch (1526:6): [True: 3, False: 9.40k]
  ------------------
 1527|      3|    return CURLE_OUT_OF_MEMORY;
 1528|       |
 1529|  9.40k|  Curl_strntolower(conn->destination, conn->destination,
 1530|  9.40k|                   strlen(conn->destination));
 1531|       |
 1532|  9.40k|#ifdef USE_IPV6
 1533|  9.40k|  if(data->set.scope_id)
  ------------------
  |  Branch (1533:6): [True: 0, False: 9.40k]
  ------------------
 1534|      0|    conn->scope_id = data->set.scope_id;
 1535|  9.40k|  else {
 1536|  9.40k|    peer = Curl_conn_get_first_peer(conn);
 1537|  9.40k|    if(!peer)
  ------------------
  |  Branch (1537:8): [True: 0, False: 9.40k]
  ------------------
 1538|      0|      return CURLE_FAILED_INIT;
 1539|  9.40k|    conn->scope_id = peer->scopeid;
 1540|  9.40k|  }
 1541|  9.40k|#endif
 1542|       |
 1543|  9.40k|  return CURLE_OK;
 1544|  9.40k|}
url.c:url_match_init:
 2188|  9.40k|{
 2189|  9.40k|  memset(m, 0, sizeof(*m));
 2190|  9.40k|  m->data = data;
 2191|  9.40k|  m->needle = needle;
 2192|  9.40k|  m->now = *Curl_pgrs_now(data);
 2193|  9.40k|  m->may_multiplex = xfer_may_multiplex(data, needle);
 2194|       |
 2195|       |#if !defined(CURL_DISABLE_HTTP) && defined(USE_SPNEGO)
 2196|       |  m->want_nego_http =
 2197|       |    (data->state.authhost.want & CURLAUTH_NEGOTIATE) &&
 2198|       |    (needle->scheme->protocol & PROTO_FAMILY_HTTP) &&
 2199|       |    Curl_auth_allowed_to_host(data);
 2200|       |#ifndef CURL_DISABLE_PROXY
 2201|       |  m->want_proxy_nego_http =
 2202|       |    needle->http_proxy.creds &&
 2203|       |    (data->state.authproxy.want & CURLAUTH_NEGOTIATE) &&
 2204|       |    (needle->scheme->protocol & PROTO_FAMILY_HTTP);
 2205|       |#endif
 2206|       |#endif
 2207|  9.40k|  m->require_tls = data->set.use_ssl >= CURLUSESSL_CONTROL;
  ------------------
  |  |  936|  9.40k|#define CURLUSESSL_CONTROL 2L /* SSL for the control connection or fail */
  ------------------
 2208|  9.40k|  m->may_tls = data->set.use_ssl > CURLUSESSL_NONE;
  ------------------
  |  |  934|  9.40k|#define CURLUSESSL_NONE    0L /* do not attempt to use SSL */
  ------------------
 2209|       |
 2210|       |  /* Get a shallow setup of filter configs for connection cache matching */
 2211|  9.40k|  return Curl_ssl_filter_config_tmp_init(data, needle->origin,
 2212|  9.40k|                                         &m->ssl_config,
 2213|  9.40k|#ifndef CURL_DISABLE_PROXY
 2214|  9.40k|                                         &m->proxy_ssl_config);
 2215|       |#else
 2216|       |                                         NULL);
 2217|       |#endif
 2218|  9.40k|}
url.c:xfer_may_multiplex:
  555|  9.40k|{
  556|  9.40k|#ifndef CURL_DISABLE_HTTP
  557|       |  /* If an HTTP protocol and multiplexing is enabled */
  558|  9.40k|  if((conn->scheme->protocol & PROTO_FAMILY_HTTP) &&
  ------------------
  |  |   83|  9.40k|#define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1088|  9.40k|#define CURLPROTO_HTTP    (1L << 0)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  | 1089|  9.40k|#define CURLPROTO_HTTPS   (1L << 1)
  |  |  ------------------
  |  |               #define PROTO_FAMILY_HTTP (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_WS | \
  |  |  ------------------
  |  |  |  |   62|  9.40k|#define CURLPROTO_WS     (1L << 30)
  |  |  ------------------
  |  |   84|  9.40k|                           CURLPROTO_WSS)
  |  |  ------------------
  |  |  |  |   63|  9.40k|#define CURLPROTO_WSS    ((curl_prot_t)1 << 31)
  |  |  ------------------
  ------------------
  |  Branch (558:6): [True: 9.40k, False: 0]
  ------------------
  559|  9.40k|     (!conn->bits.protoconnstart || !conn->bits.close)) {
  ------------------
  |  Branch (559:7): [True: 9.40k, False: 0]
  |  Branch (559:37): [True: 0, False: 0]
  ------------------
  560|       |
  561|  9.40k|    if(Curl_multiplex_wanted(data->multi) &&
  ------------------
  |  Branch (561:8): [True: 9.40k, False: 0]
  ------------------
  562|  9.40k|       (data->state.http_neg.allowed & (CURL_HTTP_V2x | CURL_HTTP_V3x)))
  ------------------
  |  |   41|  9.40k|#define CURL_HTTP_V2x   (1 << 1)
  ------------------
                     (data->state.http_neg.allowed & (CURL_HTTP_V2x | CURL_HTTP_V3x)))
  ------------------
  |  |   42|  9.40k|#define CURL_HTTP_V3x   (1 << 2)
  ------------------
  |  Branch (562:8): [True: 9.40k, False: 0]
  ------------------
  563|       |      /* allows HTTP/2 or newer */
  564|  9.40k|      return TRUE;
  ------------------
  |  |  986|  9.40k|#define TRUE true
  ------------------
  565|  9.40k|  }
  566|       |#else
  567|       |  (void)data;
  568|       |  (void)conn;
  569|       |#endif
  570|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  571|  9.40k|}
url.c:setup_range:
 1464|  9.39k|{
 1465|  9.39k|  struct UrlState *s = &data->state;
 1466|  9.39k|  s->resume_from = data->set.set_resume_from;
 1467|  9.39k|  if(s->resume_from || CURL_EASY_STR(data, STRING_SET_RANGE)) {
  ------------------
  |  | 1206|  9.25k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 32, False: 9.22k]
  |  |  ------------------
  ------------------
  |  Branch (1467:6): [True: 138, False: 9.25k]
  ------------------
 1468|    170|    if(s->rangestringalloc)
  ------------------
  |  Branch (1468:8): [True: 0, False: 170]
  ------------------
 1469|      0|      curlx_free(s->range);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1470|       |
 1471|    170|    if(s->resume_from)
  ------------------
  |  Branch (1471:8): [True: 138, False: 32]
  ------------------
 1472|    138|      s->range = curl_maprintf("%" FMT_OFF_T "-", s->resume_from);
 1473|     32|    else
 1474|     32|      s->range = curlx_strdup(CURL_EASY_STR(data, STRING_SET_RANGE));
  ------------------
  |  | 1497|     32|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1475|       |
 1476|    170|    if(!s->range)
  ------------------
  |  Branch (1476:8): [True: 0, False: 170]
  ------------------
 1477|      0|      return CURLE_OUT_OF_MEMORY;
 1478|       |
 1479|    170|    s->rangestringalloc = TRUE;
  ------------------
  |  |  986|    170|#define TRUE true
  ------------------
 1480|       |
 1481|       |    /* tell ourselves to fetch this range */
 1482|    170|    s->use_range = TRUE;        /* enable range download */
  ------------------
  |  |  986|    170|#define TRUE true
  ------------------
 1483|    170|  }
 1484|  9.22k|  else
 1485|  9.22k|    s->use_range = FALSE; /* disable range download */
  ------------------
  |  |  989|  9.22k|#define FALSE false
  ------------------
 1486|       |
 1487|  9.39k|  return CURLE_OK;
 1488|  9.39k|}
url.c:url_attach_existing:
 1089|  9.36k|{
 1090|       |  /* Find a connection in the pool that matches what "data + needle"
 1091|       |   * requires. If a suitable candidate is found, it is attached to "data". */
 1092|       |  return Curl_cpool_find(data, needle->destination, TRUE, pnow,
  ------------------
  |  |  986|  9.36k|#define TRUE true
  ------------------
 1093|  9.36k|                         url_match_conn, url_match_result, m);
 1094|  9.36k|}
url.c:url_match_result:
 1054|  9.36k|{
 1055|  9.36k|  struct url_conn_match *match = userdata;
 1056|  9.36k|  if(match->found) {
  ------------------
  |  Branch (1056:6): [True: 0, False: 9.36k]
  ------------------
 1057|       |    /* Attach it now while still under lock, so the connection does
 1058|       |     * no longer appear idle and can be reaped. */
 1059|      0|    Curl_attach_connection(match->data, match->found, TRUE);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1060|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1061|      0|  }
 1062|  9.36k|  else if(match->seen_single_use_conn && !match->seen_multiplex_conn) {
  ------------------
  |  Branch (1062:11): [True: 0, False: 9.36k]
  |  Branch (1062:42): [True: 0, False: 0]
  ------------------
 1063|       |    /* We have seen a single-use, existing connection to the destination and
 1064|       |     * no multiplexed one. It seems safe to assume that the server does
 1065|       |     * not support multiplexing. */
 1066|      0|    match->wait_pipe = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1067|      0|  }
 1068|  9.36k|  else if(match->seen_pending_conn && match->data->set.pipewait) {
  ------------------
  |  Branch (1068:11): [True: 0, False: 9.36k]
  |  Branch (1068:39): [True: 0, False: 0]
  ------------------
 1069|      0|    infof(match->data,
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1070|      0|          "Found pending candidate for reuse and CURLOPT_PIPEWAIT is set");
 1071|      0|    match->wait_pipe = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1072|      0|  }
 1073|  9.36k|  return FALSE;
  ------------------
  |  |  989|  9.36k|#define FALSE false
  ------------------
 1074|  9.36k|}
url.c:url_match_destroy:
 2221|  9.40k|{
 2222|  9.40k|  Curl_ssl_config_cleanup(&m->ssl_config);
 2223|  9.40k|#ifndef CURL_DISABLE_PROXY
 2224|  9.40k|  Curl_ssl_config_cleanup(&m->proxy_ssl_config);
 2225|  9.40k|#endif
 2226|  9.40k|}

urlencode_str:
  130|  9.43k|{
  131|       |  /* we must add this with whitespace-replacing */
  132|  9.43k|  const unsigned char *iptr;
  133|  9.43k|  const unsigned char *host_sep = (const unsigned char *)url;
  134|  9.43k|  CURLcode result = CURLE_OK;
  135|       |
  136|  9.43k|  DEBUGASSERT((query >= QUERY_NO) && (query <= QUERY_YES));
  ------------------
  |  | 1016|  9.43k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (136:3): [True: 0, False: 9.43k]
  |  Branch (136:3): [True: 0, False: 0]
  |  Branch (136:3): [True: 9.43k, False: 0]
  |  Branch (136:3): [True: 9.43k, False: 0]
  ------------------
  137|       |
  138|  9.43k|  if(!relative) {
  ------------------
  |  Branch (138:6): [True: 0, False: 9.43k]
  ------------------
  139|      0|    size_t n;
  140|      0|    host_sep = (const unsigned char *)find_host_sep(url);
  141|       |
  142|       |    /* output the first piece as-is */
  143|      0|    n = (const char *)host_sep - url;
  144|      0|    result = curlx_dyn_addn(o, url, n);
  145|      0|    len -= n;
  146|      0|  }
  147|       |
  148|   373k|  for(iptr = host_sep; len && !result;) {
  ------------------
  |  Branch (148:24): [True: 363k, False: 9.43k]
  |  Branch (148:31): [True: 363k, False: 0]
  ------------------
  149|   363k|    if(*iptr == ' ') {
  ------------------
  |  Branch (149:8): [True: 0, False: 363k]
  ------------------
  150|      0|      if(query != QUERY_YES)
  ------------------
  |  |   54|      0|#define QUERY_YES     4
  ------------------
  |  Branch (150:10): [True: 0, False: 0]
  ------------------
  151|      0|        result = curlx_dyn_addn(o, "%20", 3);
  152|      0|      else
  153|      0|        result = curlx_dyn_addn(o, "+", 1);
  154|      0|      iptr++;
  155|      0|      len--;
  156|      0|    }
  157|   363k|    else if((*iptr < ' ') || (*iptr >= 0x7f)) {
  ------------------
  |  Branch (157:13): [True: 0, False: 363k]
  |  Branch (157:30): [True: 307k, False: 56.2k]
  ------------------
  158|   307k|      unsigned char out[3] = { '%' };
  159|   307k|      Curl_hexbyte(&out[1], *iptr);
  160|   307k|      result = curlx_dyn_addn(o, out, 3);
  161|   307k|      iptr++;
  162|   307k|      len--;
  163|   307k|    }
  164|  56.2k|    else if(*iptr == '%' && (len >= 3) &&
  ------------------
  |  Branch (164:13): [True: 9.11k, False: 47.1k]
  |  Branch (164:29): [True: 9.10k, False: 11]
  ------------------
  165|  9.10k|            ISXDIGIT(iptr[1]) && ISXDIGIT(iptr[2]) &&
  ------------------
  |  |   37|  65.3k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  18.2k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 7.80k, False: 1.29k]
  |  |  |  |  |  Branch (42:38): [True: 1.74k, False: 6.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  16.4k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 4.12k, False: 3.23k]
  |  |  |  |  |  Branch (27:43): [True: 2.35k, False: 1.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  5.00k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 3.57k, False: 1.42k]
  |  |  |  |  |  Branch (28:43): [True: 1.78k, False: 1.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          ISXDIGIT(iptr[1]) && ISXDIGIT(iptr[2]) &&
  ------------------
  |  |   37|  62.1k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  11.7k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 5.04k, False: 846]
  |  |  |  |  |  Branch (42:38): [True: 333, False: 4.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  11.4k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 3.79k, False: 1.75k]
  |  |  |  |  |  Branch (27:43): [True: 3.30k, False: 493]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  2.25k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 1.40k, False: 849]
  |  |  |  |  |  Branch (28:43): [True: 850, False: 553]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|  4.48k|            (ISLOWER(iptr[1]) || ISLOWER(iptr[2]))) {
  ------------------
  |  |   41|  8.97k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (41:22): [True: 2.30k, False: 2.18k]
  |  |  |  Branch (41:38): [True: 2.30k, False: 0]
  |  |  ------------------
  ------------------
                          (ISLOWER(iptr[1]) || ISLOWER(iptr[2]))) {
  ------------------
  |  |   41|  2.18k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (41:22): [True: 1.86k, False: 321]
  |  |  |  Branch (41:38): [True: 1.86k, False: 0]
  |  |  ------------------
  ------------------
  167|       |      /* uppercase it */
  168|  4.16k|      unsigned char hex = (unsigned char)((curlx_hexval(iptr[1]) << 4) |
  ------------------
  |  |  113|  4.16k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  169|  4.16k|                                          curlx_hexval(iptr[2]));
  ------------------
  |  |  113|  4.16k|#define curlx_hexval(x) (unsigned char)(curlx_hexasciitable[(x) - '0'] & 0x0f)
  ------------------
  170|  4.16k|      unsigned char out[3] = { '%' };
  171|  4.16k|      Curl_hexbyte(&out[1], hex);
  172|  4.16k|      result = curlx_dyn_addn(o, out, 3);
  173|  4.16k|      iptr += 3;
  174|  4.16k|      len -= 3;
  175|  4.16k|    }
  176|  52.1k|    else {
  177|  52.1k|      const unsigned char *start = iptr;
  178|   344k|      while(len) {
  ------------------
  |  Branch (178:13): [True: 335k, False: 9.31k]
  ------------------
  179|   335k|        if(*iptr == ' ' || *iptr < ' ' || *iptr >= 0x7f)
  ------------------
  |  Branch (179:12): [True: 0, False: 335k]
  |  Branch (179:28): [True: 0, False: 335k]
  |  Branch (179:43): [True: 39.0k, False: 296k]
  ------------------
  180|  39.0k|          break;
  181|   296k|        if(*iptr == '%' && (len >= 3) &&
  ------------------
  |  Branch (181:12): [True: 26.8k, False: 269k]
  |  Branch (181:28): [True: 26.7k, False: 61]
  ------------------
  182|  26.7k|           ISXDIGIT(iptr[1]) && ISXDIGIT(iptr[2]) &&
  ------------------
  |  |   37|   323k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  53.5k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 22.6k, False: 4.09k]
  |  |  |  |  |  Branch (42:38): [True: 7.65k, False: 15.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  45.9k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 10.2k, False: 8.85k]
  |  |  |  |  |  Branch (27:43): [True: 2.72k, False: 7.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  16.4k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 12.0k, False: 4.33k]
  |  |  |  |  |  Branch (28:43): [True: 4.35k, False: 7.72k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                         ISXDIGIT(iptr[1]) && ISXDIGIT(iptr[2]) &&
  ------------------
  |  |   37|   311k|#define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   42|  29.4k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 11.7k, False: 2.97k]
  |  |  |  |  |  Branch (42:38): [True: 836, False: 10.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   27|  28.6k|#define ISLOWHEXALPHA(x) (((x) >= 'a') && ((x) <= 'f'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (27:27): [True: 4.62k, False: 9.27k]
  |  |  |  |  |  Branch (27:43): [True: 3.05k, False: 1.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISXDIGIT(x) (ISDIGIT(x) || ISLOWHEXALPHA(x) || ISUPHEXALPHA(x))
  |  |  ------------------
  |  |  |  |   28|  10.8k|#define ISUPHEXALPHA(x)  (((x) >= 'A') && ((x) <= 'F'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (28:27): [True: 7.84k, False: 3.00k]
  |  |  |  |  |  Branch (28:43): [True: 5.83k, False: 2.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|  9.72k|           (ISLOWER(iptr[1]) || ISLOWER(iptr[2])))
  ------------------
  |  |   41|  19.4k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (41:22): [True: 1.99k, False: 7.73k]
  |  |  |  Branch (41:38): [True: 1.99k, False: 0]
  |  |  ------------------
  ------------------
                         (ISLOWER(iptr[1]) || ISLOWER(iptr[2])))
  ------------------
  |  |   41|  7.73k|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  ------------------
  |  |  |  Branch (41:22): [True: 1.78k, False: 5.95k]
  |  |  |  Branch (41:38): [True: 1.78k, False: 0]
  |  |  ------------------
  ------------------
  184|  3.77k|          break;
  185|   292k|        if(*iptr == '?') {
  ------------------
  |  Branch (185:12): [True: 0, False: 292k]
  ------------------
  186|      0|          if(query == QUERY_NOT_YET) {
  ------------------
  |  |   53|      0|#define QUERY_NOT_YET 3 /* allow to change to query */
  ------------------
  |  Branch (186:14): [True: 0, False: 0]
  ------------------
  187|      0|            iptr++;
  188|      0|            len--;
  189|      0|            query = QUERY_YES;
  ------------------
  |  |   54|      0|#define QUERY_YES     4
  ------------------
  190|      0|            break;
  191|      0|          }
  192|      0|        }
  193|   292k|        iptr++;
  194|   292k|        len--;
  195|   292k|      }
  196|  52.1k|      result = curlx_dyn_addn(o, (const char *)start, (size_t)(iptr - start));
  197|  52.1k|    }
  198|   363k|  }
  199|       |
  200|  9.43k|  if(result)
  ------------------
  |  Branch (200:6): [True: 3, False: 9.43k]
  ------------------
  201|      3|    return cc2cu(result);
  ------------------
  |  |  105|      3|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 0, False: 3]
  |  |  ------------------
  ------------------
  202|  9.43k|  return CURLUE_OK;
  203|  9.43k|}
Curl_is_absolute_url:
  215|  53.6k|{
  216|  53.6k|  size_t i = 0;
  217|  53.6k|  DEBUGASSERT(!buf || (buflen > MAX_SCHEME_LEN));
  ------------------
  |  | 1016|  53.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (217:3): [True: 53.6k, False: 0]
  |  Branch (217:3): [True: 0, False: 0]
  |  Branch (217:3): [True: 26.8k, False: 26.8k]
  |  Branch (217:3): [True: 26.8k, False: 0]
  ------------------
  218|  53.6k|  (void)buflen; /* only used in debug-builds */
  219|  53.6k|  if(buf)
  ------------------
  |  Branch (219:6): [True: 26.8k, False: 26.8k]
  ------------------
  220|  26.8k|    buf[0] = 0; /* always leave a defined value in buf */
  221|       |#ifdef _WIN32
  222|       |  if(guess_scheme && STARTS_WITH_DRIVE_PREFIX(url))
  223|       |    return 0;
  224|       |#endif
  225|       |  /* shortcuts for http and https make the performance test run faster but
  226|       |     might also reflect reality? */
  227|  53.6k|  if((url[0] | 0x20) == 'h' &&
  ------------------
  |  Branch (227:6): [True: 53.6k, False: 5]
  ------------------
  228|  53.6k|     (url[1] | 0x20) == 't' &&
  ------------------
  |  Branch (228:6): [True: 53.6k, False: 0]
  ------------------
  229|  53.6k|     (url[2] | 0x20) == 't' &&
  ------------------
  |  Branch (229:6): [True: 53.6k, False: 0]
  ------------------
  230|  53.6k|     (url[3] | 0x20) == 'p') {
  ------------------
  |  Branch (230:6): [True: 53.6k, False: 0]
  ------------------
  231|  53.6k|    if((url[4] == ':') && ((url[5] == '/') || !guess_scheme)) {
  ------------------
  |  Branch (231:8): [True: 14.5k, False: 39.0k]
  |  Branch (231:28): [True: 14.5k, False: 0]
  |  Branch (231:47): [True: 0, False: 0]
  ------------------
  232|  14.5k|      if(buf)
  ------------------
  |  Branch (232:10): [True: 7.29k, False: 7.29k]
  ------------------
  233|  7.29k|        memcpy(buf, "http", 5);
  234|  14.5k|      return 4;
  235|  14.5k|    }
  236|  39.0k|    if(((url[4] | 0x20) == 's') && (url[5] == ':') &&
  ------------------
  |  Branch (236:8): [True: 39.0k, False: 1]
  |  Branch (236:36): [True: 39.0k, False: 0]
  ------------------
  237|  39.0k|       ((url[6] == '/') || !guess_scheme)) {
  ------------------
  |  Branch (237:9): [True: 39.0k, False: 0]
  |  Branch (237:28): [True: 0, False: 0]
  ------------------
  238|  39.0k|      if(buf)
  ------------------
  |  Branch (238:10): [True: 19.5k, False: 19.5k]
  ------------------
  239|  19.5k|        memcpy(buf, "https", 6);
  240|  39.0k|      return 5;
  241|  39.0k|    }
  242|  39.0k|  }
  243|      6|  if(ISALPHA(url[0])) {
  ------------------
  |  |   36|      6|#define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   41|     12|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:22): [True: 1, False: 5]
  |  |  |  |  |  Branch (41:38): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALPHA(x)  (ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   40|      5|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:22): [True: 1, False: 4]
  |  |  |  |  |  Branch (40:38): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  244|      2|    if(buf)
  ------------------
  |  Branch (244:8): [True: 0, False: 2]
  ------------------
  245|      0|      buf[0] = Curl_raw_tolower(url[0]);
  246|     12|    for(i = 1; i < MAX_SCHEME_LEN; ++i) {
  ------------------
  |  |   55|     12|#define MAX_SCHEME_LEN 40
  ------------------
  |  Branch (246:16): [True: 12, False: 0]
  ------------------
  247|     12|      char s = url[i];
  248|     12|      if(s && (ISALNUM(s) || (s == '+') || (s == '-') || (s == '.'))) {
  ------------------
  |  |   39|     24|#define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   42|     24|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:22): [True: 9, False: 3]
  |  |  |  |  |  Branch (42:38): [True: 0, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   41|     24|#define ISLOWER(x)  (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (41:22): [True: 6, False: 6]
  |  |  |  |  |  Branch (41:38): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(x)  (ISDIGIT(x) || ISLOWER(x) || ISUPPER(x))
  |  |  ------------------
  |  |  |  |   40|      6|#define ISUPPER(x)  (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (40:22): [True: 3, False: 3]
  |  |  |  |  |  Branch (40:38): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (248:10): [True: 12, False: 0]
  |  Branch (248:30): [True: 0, False: 3]
  |  Branch (248:44): [True: 0, False: 3]
  |  Branch (248:58): [True: 1, False: 2]
  ------------------
  249|     10|        if(buf)
  ------------------
  |  Branch (249:12): [True: 0, False: 10]
  ------------------
  250|      0|          buf[i] = Curl_raw_tolower(s);
  251|     10|      }
  252|      2|      else {
  253|      2|        break;
  254|      2|      }
  255|     12|    }
  256|      2|  }
  257|      6|  if(i && (url[i] == ':') && ((url[i + 1] == '/') || !guess_scheme)) {
  ------------------
  |  Branch (257:6): [True: 2, False: 4]
  |  Branch (257:11): [True: 0, False: 2]
  |  Branch (257:31): [True: 0, False: 0]
  |  Branch (257:54): [True: 0, False: 0]
  ------------------
  258|       |    /* If this does not guess scheme, the scheme always ends with the colon so
  259|       |       that this also detects data: URLs etc. In guessing mode, data: could
  260|       |       be the hostname "data" with a specified port number. */
  261|       |
  262|       |    /* the length of the scheme is the name part only */
  263|      0|    size_t len = i;
  264|      0|    if(buf)
  ------------------
  |  Branch (264:8): [True: 0, False: 0]
  ------------------
  265|      0|      buf[i] = 0;
  266|      0|    return len;
  267|      0|  }
  268|      6|  if(buf)
  ------------------
  |  Branch (268:6): [True: 0, False: 6]
  ------------------
  269|      0|    buf[0] = 0;
  270|      6|  return 0;
  271|      6|}
parse_hostname_login:
  356|  26.7k|{
  357|  26.7k|  CURLUcode ures = CURLUE_OK;
  358|  26.7k|  CURLcode result;
  359|  26.7k|  char *userp = NULL;
  360|  26.7k|  char *passwdp = NULL;
  361|  26.7k|  char *optionsp = NULL;
  362|  26.7k|  const struct Curl_scheme *h = NULL;
  363|       |
  364|       |  /* At this point, we assume all the other special cases have been taken
  365|       |   * care of, so the host is at most
  366|       |   *
  367|       |   *   [user[:password][;options]]@]hostname
  368|       |   *
  369|       |   * We need somewhere to put the embedded details, so do that first.
  370|       |   */
  371|  26.7k|  const char *ptr;
  372|       |
  373|  26.7k|  DEBUGASSERT(login);
  ------------------
  |  | 1016|  26.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (373:3): [True: 0, False: 26.7k]
  |  Branch (373:3): [True: 26.7k, False: 0]
  ------------------
  374|       |
  375|  26.7k|  *hostname_offset = 0;
  376|  26.7k|  ptr = memchr(login, '@', len);
  377|  26.7k|  if(!ptr) {
  ------------------
  |  Branch (377:6): [True: 26.7k, False: 0]
  ------------------
  378|  26.7k|    if(u->user)
  ------------------
  |  Branch (378:8): [True: 0, False: 26.7k]
  ------------------
  379|      0|      curlx_safefree(u->user);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  380|  26.7k|    if(u->password) {
  ------------------
  |  Branch (380:8): [True: 0, False: 26.7k]
  ------------------
  381|      0|      curlx_strzero(u->password);
  382|      0|      curlx_safefree(u->password);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  383|      0|    }
  384|  26.7k|    if(u->options)
  ------------------
  |  Branch (384:8): [True: 0, False: 26.7k]
  ------------------
  385|      0|      curlx_safefree(u->options);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  386|  26.7k|    return CURLUE_OK;
  387|  26.7k|  }
  388|       |
  389|       |  /* We will now try to extract the
  390|       |   * possible login information in a string like:
  391|       |   * ftp://user:password@ftp.site.example:8021/README */
  392|      0|  ptr++;
  393|       |
  394|       |  /* if this is a known scheme, get some details */
  395|      0|  if(u->scheme)
  ------------------
  |  Branch (395:6): [True: 0, False: 0]
  ------------------
  396|      0|    h = Curl_get_scheme(u->scheme);
  397|       |
  398|       |  /* We could use the login information in the URL so extract it. Only parse
  399|       |     options if the handler says we should. Note that 'h' might be NULL! */
  400|      0|  result = Curl_parse_login_details(login, ptr - login - 1,
  401|      0|                                    &userp, &passwdp,
  402|      0|                                    (h && (h->flags & PROTOPT_URLOPTIONS)) ?
  ------------------
  |  |  231|      0|#define PROTOPT_URLOPTIONS (1 << 10) /* allow options part in the userinfo
  ------------------
  |  Branch (402:38): [True: 0, False: 0]
  |  Branch (402:43): [True: 0, False: 0]
  ------------------
  403|      0|                                    &optionsp : NULL);
  404|      0|  if(result) {
  ------------------
  |  Branch (404:6): [True: 0, False: 0]
  ------------------
  405|       |    /* the only possible error from Curl_parse_login_details is out of
  406|       |       memory: */
  407|      0|    ures = CURLUE_OUT_OF_MEMORY;
  408|      0|    goto out;
  409|      0|  }
  410|       |
  411|      0|  if(userp) {
  ------------------
  |  Branch (411:6): [True: 0, False: 0]
  ------------------
  412|      0|    if(flags & CURLU_DISALLOW_USER) {
  ------------------
  |  |   93|      0|#define CURLU_DISALLOW_USER (1 << 5)      /* no user+password allowed */
  ------------------
  |  Branch (412:8): [True: 0, False: 0]
  ------------------
  413|       |      /* Option DISALLOW_USER is set and URL contains username. */
  414|      0|      ures = CURLUE_USER_NOT_ALLOWED;
  415|      0|      goto out;
  416|      0|    }
  417|      0|    curlx_free(u->user);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  418|      0|    u->user = userp;
  419|      0|  }
  420|       |
  421|      0|  if(passwdp) {
  ------------------
  |  Branch (421:6): [True: 0, False: 0]
  ------------------
  422|      0|    curlx_strzero(u->password);
  423|      0|    curlx_free(u->password);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  424|      0|    u->password = passwdp;
  425|      0|  }
  426|       |
  427|      0|  if(optionsp) {
  ------------------
  |  Branch (427:6): [True: 0, False: 0]
  ------------------
  428|      0|    curlx_free(u->options);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  429|      0|    u->options = optionsp;
  430|      0|  }
  431|       |
  432|      0|  if(userp && badoctets(userp, strlen(userp), flags))
  ------------------
  |  Branch (432:6): [True: 0, False: 0]
  |  Branch (432:15): [True: 0, False: 0]
  ------------------
  433|      0|    ures = CURLUE_BAD_USER;
  434|      0|  else if(passwdp && badoctets(passwdp, strlen(passwdp), flags))
  ------------------
  |  Branch (434:11): [True: 0, False: 0]
  |  Branch (434:22): [True: 0, False: 0]
  ------------------
  435|      0|    ures = CURLUE_BAD_PASSWORD;
  436|      0|  else if(optionsp && badoctets(optionsp, strlen(optionsp), flags))
  ------------------
  |  Branch (436:11): [True: 0, False: 0]
  |  Branch (436:23): [True: 0, False: 0]
  ------------------
  437|      0|    ures = CURLUE_MALFORMED_INPUT;
  438|       |
  439|      0|  userp = passwdp = optionsp = NULL;
  440|       |
  441|      0|  if(!ures) {
  ------------------
  |  Branch (441:6): [True: 0, False: 0]
  ------------------
  442|       |    /* the hostname starts at this offset */
  443|      0|    *hostname_offset = ptr - login;
  444|      0|    return CURLUE_OK;
  445|      0|  }
  446|       |
  447|      0|out:
  448|       |
  449|      0|  curlx_free(userp);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  450|      0|  curlx_strzero(passwdp);
  451|      0|  curlx_free(passwdp);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  452|      0|  curlx_free(optionsp);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  453|      0|  curlx_safefree(u->user);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  454|      0|  curlx_strzero(u->password);
  455|      0|  curlx_safefree(u->password);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  456|      0|  curlx_safefree(u->options);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  457|       |
  458|      0|  return ures;
  459|      0|}
parse_port:
  466|  26.7k|{
  467|  26.7k|  const char *portptr;
  468|  26.7k|  const char *hostname = curlx_dyn_ptr(host);
  469|  26.7k|  size_t hlen = curlx_dyn_len(host);
  470|       |  /*
  471|       |   * Find the end of an IPv6 address on the ']' ending bracket.
  472|       |   */
  473|  26.7k|  u->portnum = 0;
  474|  26.7k|  u->port_present = FALSE;
  ------------------
  |  |  989|  26.7k|#define FALSE false
  ------------------
  475|  26.7k|  if(hostname[0] == '[') {
  ------------------
  |  Branch (475:6): [True: 11.6k, False: 15.1k]
  ------------------
  476|  11.6k|    portptr = memchr(hostname + 1, ']', hlen - 1);
  477|  11.6k|    if(!portptr)
  ------------------
  |  Branch (477:8): [True: 0, False: 11.6k]
  ------------------
  478|      0|      return CURLUE_BAD_IPV6;
  479|  11.6k|    portptr++;
  480|       |    /* this is a RFC2732-style specified IP-address */
  481|  11.6k|    if(*portptr) {
  ------------------
  |  Branch (481:8): [True: 0, False: 11.6k]
  ------------------
  482|      0|      if(*portptr != ':')
  ------------------
  |  Branch (482:10): [True: 0, False: 0]
  ------------------
  483|      0|        return CURLUE_BAD_PORT_NUMBER;
  484|      0|    }
  485|  11.6k|    else
  486|  11.6k|      portptr = NULL;
  487|  11.6k|  }
  488|  15.1k|  else
  489|  15.1k|    portptr = memchr(hostname, ':', hlen);
  490|       |
  491|  26.7k|  if(portptr) {
  ------------------
  |  Branch (491:6): [True: 7.29k, False: 19.4k]
  ------------------
  492|  7.29k|    curl_off_t port;
  493|  7.29k|    size_t keep = portptr - hostname;
  494|  7.29k|    int rc;
  495|       |
  496|       |    /* Browser behavior adaptation. If there is a colon with no digits after,
  497|       |       cut off the name there which makes us ignore the colon and use the
  498|       |       default port. Firefox, Chrome and Safari all do that.
  499|       |
  500|       |       Do not do it if the URL has no scheme, to make something that looks like
  501|       |       a scheme not work! */
  502|  7.29k|    curlx_dyn_setlen(host, keep);
  503|  7.29k|    portptr++;
  504|  7.29k|    if(!*portptr)
  ------------------
  |  Branch (504:8): [True: 0, False: 7.29k]
  ------------------
  505|      0|      return has_scheme ? CURLUE_OK : CURLUE_BAD_PORT_NUMBER;
  ------------------
  |  Branch (505:14): [True: 0, False: 0]
  ------------------
  506|  7.29k|    if(*portptr == '\\')
  ------------------
  |  Branch (506:8): [True: 0, False: 7.29k]
  ------------------
  507|      0|      return CURLUE_BACKSLASH;
  508|  7.29k|    rc = curlx_str_number(&portptr, &port, 0xffff);
  509|  7.29k|    if(rc)
  ------------------
  |  Branch (509:8): [True: 0, False: 7.29k]
  ------------------
  510|      0|      return CURLUE_BAD_PORT_NUMBER;
  511|  7.29k|    else if(*portptr == '\\')
  ------------------
  |  Branch (511:13): [True: 0, False: 7.29k]
  ------------------
  512|      0|      return CURLUE_BACKSLASH;
  513|  7.29k|    else if(*portptr)
  ------------------
  |  Branch (513:13): [True: 0, False: 7.29k]
  ------------------
  514|      0|      return CURLUE_BAD_PORT_NUMBER;
  515|       |
  516|  7.29k|    u->portnum = (uint16_t)port;
  517|  7.29k|    u->port_present = TRUE;
  ------------------
  |  |  986|  7.29k|#define TRUE true
  ------------------
  518|  7.29k|  }
  519|       |
  520|  26.7k|  return CURLUE_OK;
  521|  26.7k|}
ipv6_parse:
  546|  11.6k|{
  547|  11.6k|  char *hp;
  548|  11.6k|  const char *endbracket;
  549|  11.6k|  const char *zonep = NULL;
  550|  11.6k|  size_t zonelen = 0;
  551|       |
  552|  11.6k|  DEBUGASSERT(*hostname == '[');
  ------------------
  |  | 1016|  11.6k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (552:3): [True: 0, False: 11.6k]
  |  Branch (552:3): [True: 11.6k, False: 0]
  ------------------
  553|  11.6k|  if((hlen < 4) || (hlen > (MAX_IPADR_LEN + MAX_ZONEID_LEN)))
  ------------------
  |  |   41|  11.6k|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
                if((hlen < 4) || (hlen > (MAX_IPADR_LEN + MAX_ZONEID_LEN)))
  ------------------
  |  |   56|  11.6k|#define MAX_ZONEID_LEN 16
  ------------------
  |  Branch (553:6): [True: 0, False: 11.6k]
  |  Branch (553:20): [True: 0, False: 11.6k]
  ------------------
  554|      0|    return CURLUE_BAD_IPV6;
  555|  11.6k|  endbracket = &hostname[hlen - 1];
  556|  11.6k|  if(*endbracket != ']')
  ------------------
  |  Branch (556:6): [True: 0, False: 11.6k]
  ------------------
  557|      0|    return CURLUE_BAD_IPV6;
  558|  11.6k|  hostname++;
  559|  11.6k|  hlen -= 2;
  560|       |
  561|       |  /* zone id */
  562|  11.6k|  hp = memchr(hostname, '%', hlen);
  563|  11.6k|  if(hp) {
  ------------------
  |  Branch (563:6): [True: 0, False: 11.6k]
  ------------------
  564|      0|    size_t i;
  565|      0|    zonep = hp + 1;
  566|      0|    zonelen = (size_t)(endbracket - zonep);
  567|      0|    if(!zonelen || (zonelen >= MAX_ZONEID_LEN))
  ------------------
  |  |   56|      0|#define MAX_ZONEID_LEN 16
  ------------------
  |  Branch (567:8): [True: 0, False: 0]
  |  Branch (567:20): [True: 0, False: 0]
  ------------------
  568|      0|      return CURLUE_BAD_IPV6;
  569|      0|    for(i = 0; i < zonelen; i++) {
  ------------------
  |  Branch (569:16): [True: 0, False: 0]
  ------------------
  570|      0|      if(invalid_host_char[(unsigned char)zonep[i]])
  ------------------
  |  Branch (570:10): [True: 0, False: 0]
  ------------------
  571|      0|        return CURLUE_BAD_IPV6;
  572|      0|    }
  573|      0|    hlen = (size_t)(hp - hostname);
  574|      0|  }
  575|       |
  576|  11.6k|  if((hlen < 2) || (hlen >= MAX_IPADR_LEN))
  ------------------
  |  |   41|  11.6k|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  |  Branch (576:6): [True: 0, False: 11.6k]
  |  Branch (576:20): [True: 0, False: 11.6k]
  ------------------
  577|      0|    return CURLUE_BAD_IPV6;
  578|  11.6k|  else {
  579|       |    /* Normalize the IPv6 address */
  580|  11.6k|    char addr[16]; /* fits a binary IPv6 address */
  581|  11.6k|    char dest[MAX_IPADR_LEN + 2];
  582|  11.6k|    char *zoneid = NULL;
  583|  11.6k|    size_t dlen;
  584|  11.6k|    CURLcode result;
  585|       |
  586|  11.6k|    hostname[hlen] = 0; /* end the address there */
  587|  11.6k|    if(curlx_inet_pton(AF_INET6, hostname, addr) != 1)
  ------------------
  |  Branch (587:8): [True: 0, False: 11.6k]
  ------------------
  588|      0|      return CURLUE_BAD_IPV6;
  589|       |
  590|  11.6k|    dest[0] = '[';
  591|  11.6k|    if(curlx_inet_ntop(AF_INET6, addr, &dest[1], MAX_IPADR_LEN))
  ------------------
  |  |   41|  11.6k|#define MAX_IPADR_LEN sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")
  ------------------
  |  Branch (591:8): [True: 0, False: 11.6k]
  ------------------
  592|      0|      return CURLUE_BAD_IPV6;
  593|  11.6k|    dlen = strlen(&dest[1]);
  594|  11.6k|    dest[1 + dlen] = ']';
  595|  11.6k|    dest[2 + dlen] = 0;
  596|       |
  597|  11.6k|    if(zonelen) {
  ------------------
  |  Branch (597:8): [True: 0, False: 11.6k]
  ------------------
  598|      0|      zoneid = curlx_memdup0(zonep, zonelen);
  599|      0|      if(!zoneid)
  ------------------
  |  Branch (599:10): [True: 0, False: 0]
  ------------------
  600|      0|        return CURLUE_OUT_OF_MEMORY;
  601|      0|    }
  602|       |
  603|  11.6k|    curlx_dyn_reset(host);
  604|  11.6k|    result = curlx_dyn_addn(host, dest, dlen + 2);
  605|  11.6k|    if(result) {
  ------------------
  |  Branch (605:8): [True: 0, False: 11.6k]
  ------------------
  606|      0|      curlx_free(zoneid);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  607|      0|      return cc2cu(result);
  ------------------
  |  |  105|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  608|      0|    }
  609|       |
  610|  11.6k|    if(zoneid) {
  ------------------
  |  Branch (610:8): [True: 0, False: 11.6k]
  ------------------
  611|      0|      curlx_free(u->zoneid);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  612|      0|      u->zoneid = zoneid;
  613|      0|    }
  614|  11.6k|  }
  615|  11.6k|  return CURLUE_OK;
  616|  11.6k|}
Curl_hostname_check:
  620|  7.85k|{
  621|  7.85k|  const unsigned char *h = (const unsigned char *)hostname;
  622|  7.85k|  size_t n = hlen;
  623|  7.85k|  if((hlen >= 2) &&
  ------------------
  |  Branch (623:6): [True: 7.85k, False: 0]
  ------------------
  624|  7.85k|     (hostname[hlen - 1] == '.') && (hostname[hlen - 2] == '.'))
  ------------------
  |  Branch (624:6): [True: 0, False: 7.85k]
  |  Branch (624:37): [True: 0, False: 0]
  ------------------
  625|       |    /* more than one trailing dot is not allowed */
  626|      0|    return CURLUE_BAD_HOSTNAME;
  627|  7.85k|  if((hlen == 1) && (hostname[0] == '.'))
  ------------------
  |  Branch (627:6): [True: 0, False: 7.85k]
  |  Branch (627:21): [True: 0, False: 0]
  ------------------
  628|       |    /* a single dot alone is not allowed */
  629|      0|    return CURLUE_BAD_HOSTNAME;
  630|       |
  631|       |  /* doing 8-byte and 4-byte checks makes a difference */
  632|  15.7k|  while(n >= 8) {
  ------------------
  |  Branch (632:9): [True: 7.85k, False: 7.85k]
  ------------------
  633|  7.85k|    if(invalid_host_char[h[0]] | invalid_host_char[h[1]] |
  ------------------
  |  Branch (633:8): [True: 0, False: 7.85k]
  ------------------
  634|  7.85k|       invalid_host_char[h[2]] | invalid_host_char[h[3]] |
  635|  7.85k|       invalid_host_char[h[4]] | invalid_host_char[h[5]] |
  636|  7.85k|       invalid_host_char[h[6]] | invalid_host_char[h[7]])
  637|      0|      return CURLUE_BAD_HOSTNAME;
  638|  7.85k|    h += 8;
  639|  7.85k|    n -= 8;
  640|  7.85k|  }
  641|  7.85k|  while(n >= 4) {
  ------------------
  |  Branch (641:9): [True: 0, False: 7.85k]
  ------------------
  642|      0|    if(invalid_host_char[h[0]] | invalid_host_char[h[1]] |
  ------------------
  |  Branch (642:8): [True: 0, False: 0]
  ------------------
  643|      0|       invalid_host_char[h[2]] | invalid_host_char[h[3]])
  644|      0|      return CURLUE_BAD_HOSTNAME;
  645|      0|    h += 4;
  646|      0|    n -= 4;
  647|      0|  }
  648|  7.85k|  while(n--) {
  ------------------
  |  Branch (648:9): [True: 0, False: 7.85k]
  ------------------
  649|      0|    if(invalid_host_char[*h++])
  ------------------
  |  Branch (649:8): [True: 0, False: 0]
  ------------------
  650|      0|      return CURLUE_BAD_HOSTNAME;
  651|      0|  }
  652|  7.85k|  return CURLUE_OK;
  653|  7.85k|}
ipv4_normalize:
  688|  7.29k|{
  689|  7.29k|  bool done = FALSE;
  ------------------
  |  |  989|  7.29k|#define FALSE false
  ------------------
  690|  7.29k|  int n = 0;
  691|  7.29k|  const char *c = curlx_dyn_ptr(host);
  692|  7.29k|  unsigned int parts[4] = { 0, 0, 0, 0 };
  693|  7.29k|  CURLcode result = CURLE_OK;
  694|       |
  695|  7.29k|  if(!ISDIGIT(*c))
  ------------------
  |  |   42|  7.29k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 7.29k, False: 0]
  |  |  |  Branch (42:38): [True: 7.29k, False: 0]
  |  |  ------------------
  ------------------
  696|      0|    return HOST_NAME;
  ------------------
  |  |   48|      0|#define HOST_NAME    1
  ------------------
  697|       |
  698|  36.4k|  while(!done) {
  ------------------
  |  Branch (698:9): [True: 29.1k, False: 7.29k]
  ------------------
  699|  29.1k|    int rc;
  700|  29.1k|    curl_off_t l;
  701|  29.1k|    if(*c == '0') {
  ------------------
  |  Branch (701:8): [True: 14.5k, False: 14.5k]
  ------------------
  702|  14.5k|      if((c[1] | 0x20) == 'x') {
  ------------------
  |  Branch (702:10): [True: 0, False: 14.5k]
  ------------------
  703|      0|        c += 2; /* skip the prefix */
  704|      0|        rc = curlx_str_hex(&c, &l, UINT_MAX);
  705|      0|        if(rc)
  ------------------
  |  Branch (705:12): [True: 0, False: 0]
  ------------------
  706|      0|          return HOST_NAME;
  ------------------
  |  |   48|      0|#define HOST_NAME    1
  ------------------
  707|      0|      }
  708|  14.5k|      else
  709|  14.5k|        rc = curlx_str_octal(&c, &l, UINT_MAX);
  710|  14.5k|    }
  711|  14.5k|    else
  712|  14.5k|      rc = curlx_str_number(&c, &l, UINT_MAX);
  713|       |
  714|  29.1k|    if(rc) {
  ------------------
  |  Branch (714:8): [True: 0, False: 29.1k]
  ------------------
  715|      0|      if(!n || (rc != STRE_NO_NUM) || *c)
  ------------------
  |  |   36|      0|#define STRE_NO_NUM   8
  ------------------
  |  Branch (715:10): [True: 0, False: 0]
  |  Branch (715:16): [True: 0, False: 0]
  |  Branch (715:39): [True: 0, False: 0]
  ------------------
  716|      0|        return HOST_NAME;
  ------------------
  |  |   48|      0|#define HOST_NAME    1
  ------------------
  717|      0|      n--;
  718|      0|    }
  719|  29.1k|    else
  720|  29.1k|      parts[n] = (unsigned int)l;
  721|       |
  722|  29.1k|    switch(*c) {
  723|  21.8k|    case '.':
  ------------------
  |  Branch (723:5): [True: 21.8k, False: 7.29k]
  ------------------
  724|  21.8k|      if(n == 3) {
  ------------------
  |  Branch (724:10): [True: 0, False: 21.8k]
  ------------------
  725|      0|        if(c[1])
  ------------------
  |  Branch (725:12): [True: 0, False: 0]
  ------------------
  726|       |          /* something follows this dot */
  727|      0|          return HOST_NAME;
  ------------------
  |  |   48|      0|#define HOST_NAME    1
  ------------------
  728|      0|        done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  729|      0|      }
  730|  21.8k|      else {
  731|  21.8k|        n++;
  732|  21.8k|        c++;
  733|  21.8k|      }
  734|  21.8k|      break;
  735|       |
  736|  21.8k|    case '\0':
  ------------------
  |  Branch (736:5): [True: 7.29k, False: 21.8k]
  ------------------
  737|  7.29k|      done = TRUE;
  ------------------
  |  |  986|  7.29k|#define TRUE true
  ------------------
  738|  7.29k|      break;
  739|       |
  740|      0|    default:
  ------------------
  |  Branch (740:5): [True: 0, False: 29.1k]
  ------------------
  741|      0|      return HOST_NAME;
  ------------------
  |  |   48|      0|#define HOST_NAME    1
  ------------------
  742|  29.1k|    }
  743|  29.1k|  }
  744|       |
  745|  7.29k|  switch(n) {
  ------------------
  |  Branch (745:10): [True: 7.29k, False: 0]
  ------------------
  746|      0|  case 0: /* a -- 32 bits */
  ------------------
  |  Branch (746:3): [True: 0, False: 7.29k]
  ------------------
  747|      0|    curlx_dyn_reset(host);
  748|       |
  749|      0|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  750|      0|                            (parts[0] >> 24),
  751|      0|                            ((parts[0] >> 16) & 0xff),
  752|      0|                            ((parts[0] >> 8) & 0xff),
  753|      0|                            (parts[0] & 0xff));
  754|      0|    break;
  755|      0|  case 1: /* a.b -- 8.24 bits */
  ------------------
  |  Branch (755:3): [True: 0, False: 7.29k]
  ------------------
  756|      0|    if((parts[0] > 0xff) || (parts[1] > 0xffffff))
  ------------------
  |  Branch (756:8): [True: 0, False: 0]
  |  Branch (756:29): [True: 0, False: 0]
  ------------------
  757|      0|      return HOST_NAME;
  ------------------
  |  |   48|      0|#define HOST_NAME    1
  ------------------
  758|      0|    curlx_dyn_reset(host);
  759|      0|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  760|      0|                            parts[0],
  761|      0|                            ((parts[1] >> 16) & 0xff),
  762|      0|                            ((parts[1] >> 8) & 0xff),
  763|      0|                            (parts[1] & 0xff));
  764|      0|    break;
  765|      0|  case 2: /* a.b.c -- 8.8.16 bits */
  ------------------
  |  Branch (765:3): [True: 0, False: 7.29k]
  ------------------
  766|      0|    if((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xffff))
  ------------------
  |  Branch (766:8): [True: 0, False: 0]
  |  Branch (766:29): [True: 0, False: 0]
  |  Branch (766:50): [True: 0, False: 0]
  ------------------
  767|      0|      return HOST_NAME;
  ------------------
  |  |   48|      0|#define HOST_NAME    1
  ------------------
  768|      0|    curlx_dyn_reset(host);
  769|      0|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  770|      0|                            parts[0],
  771|      0|                            parts[1],
  772|      0|                            ((parts[2] >> 8) & 0xff),
  773|      0|                            (parts[2] & 0xff));
  774|      0|    break;
  775|  7.29k|  case 3: /* a.b.c.d -- 8.8.8.8 bits */
  ------------------
  |  Branch (775:3): [True: 7.29k, False: 0]
  ------------------
  776|  7.29k|    if((parts[0] > 0xff) || (parts[1] > 0xff) || (parts[2] > 0xff) ||
  ------------------
  |  Branch (776:8): [True: 0, False: 7.29k]
  |  Branch (776:29): [True: 0, False: 7.29k]
  |  Branch (776:50): [True: 0, False: 7.29k]
  ------------------
  777|  7.29k|       (parts[3] > 0xff))
  ------------------
  |  Branch (777:8): [True: 0, False: 7.29k]
  ------------------
  778|      0|      return HOST_NAME;
  ------------------
  |  |   48|      0|#define HOST_NAME    1
  ------------------
  779|  7.29k|    curlx_dyn_reset(host);
  780|  7.29k|    result = curlx_dyn_addf(host, "%u.%u.%u.%u",
  781|  7.29k|                            parts[0],
  782|  7.29k|                            parts[1],
  783|  7.29k|                            parts[2],
  784|  7.29k|                            parts[3]);
  785|  7.29k|    break;
  786|  7.29k|  }
  787|  7.29k|  if(result)
  ------------------
  |  Branch (787:6): [True: 0, False: 7.29k]
  ------------------
  788|      0|    return HOST_ERROR;
  ------------------
  |  |   47|      0|#define HOST_ERROR   (-1) /* out of memory */
  ------------------
  789|  7.29k|  return HOST_IPV4;
  ------------------
  |  |   49|  7.29k|#define HOST_IPV4    2
  ------------------
  790|  7.29k|}
dedotdotify:
  963|  1.16k|{
  964|  1.16k|  struct dynbuf out;
  965|  1.16k|  CURLcode result = CURLE_OK;
  966|       |
  967|       |  /* variables for leading dot checks */
  968|  1.16k|  const char *dinput = input;
  969|  1.16k|  size_t dlen = clen;
  970|       |
  971|  1.16k|  *outp = NULL;
  972|  1.16k|  if(!needs_dedotdot(input, clen))
  ------------------
  |  Branch (972:6): [True: 658, False: 511]
  ------------------
  973|    658|    return 0;
  974|       |
  975|    511|  curlx_dyn_init(&out, clen + 1);
  976|       |
  977|       |  /* if the input buffer begins with a prefix of "../" or "./", then remove
  978|       |     that prefix from the input buffer; otherwise, */
  979|    511|  if(is_dot(&dinput, &dlen)) {
  ------------------
  |  Branch (979:6): [True: 0, False: 511]
  ------------------
  980|      0|    if(ISSLASH(*dinput)) {
  ------------------
  |  |  912|      0|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (912:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  981|       |      /* one dot followed by a slash */
  982|      0|      input = dinput + 1;
  983|      0|      clen = dlen - 1;
  984|      0|    }
  985|       |
  986|       |    /* if the input buffer consists only of "." or "..", then remove
  987|       |       that from the input buffer; otherwise, */
  988|      0|    else if(is_dot(&dinput, &dlen)) {
  ------------------
  |  Branch (988:13): [True: 0, False: 0]
  ------------------
  989|      0|      if(!dlen)
  ------------------
  |  Branch (989:10): [True: 0, False: 0]
  ------------------
  990|       |        /* .. [end] */
  991|      0|        goto end;
  992|      0|      else if(ISSLASH(*dinput)) {
  ------------------
  |  |  912|      0|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (912:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  993|       |        /* ../ */
  994|      0|        input = dinput + 1;
  995|      0|        clen = dlen - 1;
  996|      0|      }
  997|      0|    }
  998|      0|  }
  999|       |
 1000|   120k|  while(clen && !result) { /* until end of path content */
  ------------------
  |  Branch (1000:9): [True: 120k, False: 454]
  |  Branch (1000:17): [True: 120k, False: 1]
  ------------------
 1001|   120k|    const char *next;
 1002|   120k|    size_t seglen;
 1003|   120k|    if(ISSLASH(*input)) {
  ------------------
  |  |  912|   120k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (912:20): [True: 120k, False: 0]
  |  |  ------------------
  ------------------
 1004|   120k|      const char *p = &input[1];
 1005|   120k|      size_t blen = clen - 1;
 1006|       |      /* if the input buffer begins with a prefix of "/./" or "/.", where "."
 1007|       |         is a complete path segment, then replace that prefix with "/" in the
 1008|       |         input buffer; otherwise, */
 1009|   120k|      if(is_dot(&p, &blen)) {
  ------------------
  |  Branch (1009:10): [True: 18.3k, False: 102k]
  ------------------
 1010|  18.3k|        if(!blen) { /* /. */
  ------------------
  |  Branch (1010:12): [True: 30, False: 18.3k]
  ------------------
 1011|     30|          result = curlx_dyn_addn(&out, "/", 1);
 1012|     30|          break;
 1013|     30|        }
 1014|  18.3k|        else if(ISSLASH(*p)) { /* /./ */
  ------------------
  |  |  912|  18.3k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (912:20): [True: 528, False: 17.7k]
  |  |  ------------------
  ------------------
 1015|    528|          input = p;
 1016|    528|          clen = blen;
 1017|    528|          continue;
 1018|    528|        }
 1019|       |
 1020|       |        /* if the input buffer begins with a prefix of "/../" or "/..", where
 1021|       |           ".." is a complete path segment, then replace that prefix with "/"
 1022|       |           in the input buffer and remove the last segment and its preceding
 1023|       |           "/" (if any) from the output buffer; otherwise, */
 1024|  17.7k|        else if(is_dot(&p, &blen) && (ISSLASH(*p) || !blen)) {
  ------------------
  |  |  912|  19.1k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (912:20): [True: 7.77k, False: 1.80k]
  |  |  ------------------
  ------------------
  |  Branch (1024:17): [True: 9.58k, False: 8.20k]
  |  Branch (1024:54): [True: 26, False: 1.78k]
  ------------------
 1025|       |          /* remove the last segment from the output buffer */
 1026|  7.80k|          size_t len = curlx_dyn_len(&out);
 1027|  7.80k|          if(len) {
  ------------------
  |  Branch (1027:14): [True: 4.14k, False: 3.65k]
  ------------------
 1028|  4.14k|            const char *ptr = curlx_dyn_ptr(&out);
 1029|  4.14k|            const char *last = memrchr(ptr, '/', len);
 1030|  4.14k|            if(last)
  ------------------
  |  Branch (1030:16): [True: 4.14k, False: 0]
  ------------------
 1031|       |              /* trim the output at the slash */
 1032|  4.14k|              curlx_dyn_setlen(&out, last - ptr);
 1033|  4.14k|          }
 1034|       |
 1035|  7.80k|          if(blen) { /* /../ */
  ------------------
  |  Branch (1035:14): [True: 7.77k, False: 26]
  ------------------
 1036|  7.77k|            input = p;
 1037|  7.77k|            clen = blen;
 1038|  7.77k|            continue;
 1039|  7.77k|          }
 1040|     26|          result = curlx_dyn_addn(&out, "/", 1);
 1041|     26|          break;
 1042|  7.80k|        }
 1043|  18.3k|      }
 1044|   120k|    }
 1045|       |
 1046|       |    /* move the first path segment in the input buffer to the end of the
 1047|       |       output buffer, including the initial "/" character (if any) and any
 1048|       |       subsequent characters up to, but not including, the next "/" character
 1049|       |       or the end of the input buffer. */
 1050|       |
 1051|   112k|    next = memchr(input + 1, '/', clen - 1);
 1052|   112k|    seglen = next ? (size_t)(next - input) : clen;
  ------------------
  |  Branch (1052:14): [True: 111k, False: 454]
  ------------------
 1053|   112k|    result = curlx_dyn_addn(&out, input, seglen);
 1054|   112k|    input += seglen;
 1055|   112k|    clen -= seglen;
 1056|   112k|  }
 1057|    511|end:
 1058|    511|  if(!result) {
  ------------------
  |  Branch (1058:6): [True: 510, False: 1]
  ------------------
 1059|    510|    if(curlx_dyn_len(&out))
  ------------------
  |  Branch (1059:8): [True: 510, False: 0]
  ------------------
 1060|    510|      *outp = curlx_dyn_ptr(&out);
 1061|      0|    else {
 1062|      0|      *outp = curlx_strdup("");
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1063|      0|      if(!*outp)
  ------------------
  |  Branch (1063:10): [True: 0, False: 0]
  ------------------
 1064|      0|        return 1;
 1065|      0|    }
 1066|    510|  }
 1067|    511|  return result ? 1 : 0; /* success */
  ------------------
  |  Branch (1067:10): [True: 1, False: 510]
  ------------------
 1068|    511|}
curl_url:
 1554|  26.8k|{
 1555|  26.8k|  return curlx_calloc(1, sizeof(struct Curl_URL));
  ------------------
  |  | 1500|  26.8k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1556|  26.8k|}
curl_url_cleanup:
 1559|  48.5k|{
 1560|  48.5k|  if(u) {
  ------------------
  |  Branch (1560:6): [True: 26.8k, False: 21.6k]
  ------------------
 1561|  26.8k|    free_urlhandle(u);
 1562|  26.8k|    curlx_free(u);
  ------------------
  |  | 1503|  26.8k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1563|  26.8k|  }
 1564|  48.5k|}
curl_url_get:
 1835|   145k|{
 1836|   145k|  const char *ptr;
 1837|   145k|  CURLUcode ifmissing = CURLUE_UNKNOWN_PART;
 1838|   145k|  char portbuf[7];
 1839|   145k|  bool plusdecode = FALSE;
  ------------------
  |  |  989|   145k|#define FALSE false
  ------------------
 1840|   145k|  if(!u)
  ------------------
  |  Branch (1840:6): [True: 0, False: 145k]
  ------------------
 1841|      0|    return CURLUE_BAD_HANDLE;
 1842|   145k|  if(!part)
  ------------------
  |  Branch (1842:6): [True: 0, False: 145k]
  ------------------
 1843|      0|    return CURLUE_BAD_PARTPOINTER;
 1844|   145k|  *part = NULL;
 1845|       |
 1846|   145k|  switch(what) {
 1847|  24.0k|  case CURLUPART_SCHEME:
  ------------------
  |  Branch (1847:3): [True: 24.0k, False: 121k]
  ------------------
 1848|  24.0k|    ptr = u->scheme;
 1849|  24.0k|    ifmissing = CURLUE_NO_SCHEME;
 1850|  24.0k|    flags &= ~U_CURLU_URLDECODE; /* never for schemes */
  ------------------
  |  |   63|  24.0k|#define U_CURLU_URLDECODE  (unsigned int)CURLU_URLDECODE
  |  |  ------------------
  |  |  |  |   94|  24.0k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  |  |  ------------------
  ------------------
 1851|  24.0k|    if((flags & CURLU_NO_GUESS_SCHEME) && u->guessed_scheme)
  ------------------
  |  |  106|  24.0k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
  |  Branch (1851:8): [True: 14.5k, False: 9.46k]
  |  Branch (1851:43): [True: 0, False: 14.5k]
  ------------------
 1852|      0|      return CURLUE_NO_SCHEME;
 1853|  24.0k|    break;
 1854|  24.0k|  case CURLUPART_USER:
  ------------------
  |  Branch (1854:3): [True: 16.6k, False: 128k]
  ------------------
 1855|  16.6k|    ptr = u->user;
 1856|  16.6k|    ifmissing = CURLUE_NO_USER;
 1857|  16.6k|    break;
 1858|  16.6k|  case CURLUPART_PASSWORD:
  ------------------
  |  Branch (1858:3): [True: 16.6k, False: 128k]
  ------------------
 1859|  16.6k|    ptr = u->password;
 1860|  16.6k|    ifmissing = CURLUE_NO_PASSWORD;
 1861|  16.6k|    break;
 1862|  9.43k|  case CURLUPART_OPTIONS:
  ------------------
  |  Branch (1862:3): [True: 9.43k, False: 136k]
  ------------------
 1863|  9.43k|    ptr = u->options;
 1864|  9.43k|    ifmissing = CURLUE_NO_OPTIONS;
 1865|  9.43k|    break;
 1866|  16.7k|  case CURLUPART_HOST:
  ------------------
  |  Branch (1866:3): [True: 16.7k, False: 128k]
  ------------------
 1867|  16.7k|    ptr = u->host;
 1868|  16.7k|    ifmissing = CURLUE_NO_HOST;
 1869|  16.7k|    break;
 1870|  16.7k|  case CURLUPART_ZONEID:
  ------------------
  |  Branch (1870:3): [True: 16.7k, False: 128k]
  ------------------
 1871|  16.7k|    ptr = u->zoneid;
 1872|  16.7k|    ifmissing = CURLUE_NO_ZONEID;
 1873|  16.7k|    break;
 1874|  7.28k|  case CURLUPART_PORT:
  ------------------
  |  Branch (1874:3): [True: 7.28k, False: 138k]
  ------------------
 1875|  7.28k|    ptr = NULL;
 1876|  7.28k|    ifmissing = CURLUE_NO_PORT;
 1877|  7.28k|    flags &= ~U_CURLU_URLDECODE; /* never for port */
  ------------------
  |  |   63|  7.28k|#define U_CURLU_URLDECODE  (unsigned int)CURLU_URLDECODE
  |  |  ------------------
  |  |  |  |   94|  7.28k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  |  |  ------------------
  ------------------
 1878|  7.28k|    if(u->port_present) {
  ------------------
  |  Branch (1878:8): [True: 7.28k, False: 0]
  ------------------
 1879|  7.28k|      const struct Curl_scheme *h = u->scheme ?
  ------------------
  |  Branch (1879:37): [True: 7.28k, False: 0]
  ------------------
 1880|  7.28k|                                    Curl_get_scheme(u->scheme) : NULL;
 1881|       |      /* there is a stored port number, but ask to inhibit if
 1882|       |         it matches the default one for the scheme */
 1883|  7.28k|      if(h && (h->defport == u->portnum) &&
  ------------------
  |  Branch (1883:10): [True: 7.28k, False: 0]
  |  Branch (1883:15): [True: 7.28k, False: 0]
  ------------------
 1884|  7.28k|         (flags & CURLU_NO_DEFAULT_PORT)) {
  ------------------
  |  |   86|  7.28k|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
  |  Branch (1884:10): [True: 0, False: 7.28k]
  ------------------
 1885|      0|        ptr = NULL;
 1886|      0|      }
 1887|  7.28k|      else {
 1888|  7.28k|        curl_msnprintf(portbuf, sizeof(portbuf), "%u", u->portnum);
 1889|  7.28k|        ptr = portbuf;
 1890|  7.28k|      }
 1891|  7.28k|    }
 1892|      0|    else if((flags & CURLU_DEFAULT_PORT) && u->scheme) {
  ------------------
  |  |   85|      0|#define CURLU_DEFAULT_PORT (1 << 0)       /* return default port number */
  ------------------
  |  Branch (1892:13): [True: 0, False: 0]
  |  Branch (1892:45): [True: 0, False: 0]
  ------------------
 1893|       |      /* there is no stored port number, but asked to deliver
 1894|       |         a default one for the scheme */
 1895|      0|      const struct Curl_scheme *h = Curl_get_scheme(u->scheme);
 1896|      0|      if(h) {
  ------------------
  |  Branch (1896:10): [True: 0, False: 0]
  ------------------
 1897|      0|        curl_msnprintf(portbuf, sizeof(portbuf), "%u", h->defport);
 1898|      0|        ptr = portbuf;
 1899|      0|      }
 1900|      0|    }
 1901|  7.28k|    break;
 1902|  9.44k|  case CURLUPART_PATH:
  ------------------
  |  Branch (1902:3): [True: 9.44k, False: 136k]
  ------------------
 1903|  9.44k|    ptr = u->path;
 1904|  9.44k|    if(!ptr)
  ------------------
  |  Branch (1904:8): [True: 8.86k, False: 575]
  ------------------
 1905|  8.86k|      ptr = "/";
 1906|  9.44k|    break;
 1907|  9.43k|  case CURLUPART_QUERY:
  ------------------
  |  Branch (1907:3): [True: 9.43k, False: 136k]
  ------------------
 1908|  9.43k|    ptr = u->query;
 1909|  9.43k|    ifmissing = CURLUE_NO_QUERY;
 1910|  9.43k|    plusdecode = flags & CURLU_URLDECODE;
  ------------------
  |  |   94|  9.43k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
 1911|  9.43k|    if(ptr && !ptr[0] && !(flags & CURLU_GET_EMPTY))
  ------------------
  |  |  103|     26|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1911:8): [True: 38, False: 9.39k]
  |  Branch (1911:15): [True: 26, False: 12]
  |  Branch (1911:26): [True: 0, False: 26]
  ------------------
 1912|       |      /* there was a blank query and the user does not ask for it */
 1913|      0|      ptr = NULL;
 1914|  9.43k|    break;
 1915|      0|  case CURLUPART_FRAGMENT:
  ------------------
  |  Branch (1915:3): [True: 0, False: 145k]
  ------------------
 1916|      0|    ptr = u->fragment;
 1917|      0|    ifmissing = CURLUE_NO_FRAGMENT;
 1918|      0|    if(!ptr && u->fragment_present && flags & CURLU_GET_EMPTY)
  ------------------
  |  |  103|      0|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1918:8): [True: 0, False: 0]
  |  Branch (1918:16): [True: 0, False: 0]
  |  Branch (1918:39): [True: 0, False: 0]
  ------------------
 1919|       |      /* there was a blank fragment and the user asks for it */
 1920|      0|      ptr = "";
 1921|      0|    break;
 1922|  19.1k|  case CURLUPART_URL:
  ------------------
  |  Branch (1922:3): [True: 19.1k, False: 126k]
  ------------------
 1923|  19.1k|    return urlget_url(u, part, flags);
 1924|      0|  default:
  ------------------
  |  Branch (1924:3): [True: 0, False: 145k]
  ------------------
 1925|      0|    ptr = NULL;
 1926|      0|    break;
 1927|   145k|  }
 1928|   126k|  if(ptr)
  ------------------
  |  Branch (1928:6): [True: 57.5k, False: 68.8k]
  ------------------
 1929|  57.5k|    return urlget_format(u, what, ptr, part, plusdecode, flags);
 1930|       |
 1931|  68.8k|  return ifmissing;
 1932|   126k|}
curl_url_set:
 2243|  46.0k|{
 2244|  46.0k|  char **storep = NULL;
 2245|  46.0k|  bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0;
  ------------------
  |  |   95|  46.0k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (2245:20): [True: 0, False: 46.0k]
  ------------------
 2246|  46.0k|  bool plusencode = FALSE;
  ------------------
  |  |  989|  46.0k|#define FALSE false
  ------------------
 2247|  46.0k|  bool pathmode = FALSE;
  ------------------
  |  |  989|  46.0k|#define FALSE false
  ------------------
 2248|  46.0k|  bool leadingslash = FALSE;
  ------------------
  |  |  989|  46.0k|#define FALSE false
  ------------------
 2249|  46.0k|  bool appendquery = FALSE;
  ------------------
  |  |  989|  46.0k|#define FALSE false
  ------------------
 2250|  46.0k|  bool equalsencode = FALSE;
  ------------------
  |  |  989|  46.0k|#define FALSE false
  ------------------
 2251|  46.0k|  size_t nalloc;
 2252|       |
 2253|  46.0k|  if(!u)
  ------------------
  |  Branch (2253:6): [True: 0, False: 46.0k]
  ------------------
 2254|      0|    return CURLUE_BAD_HANDLE;
 2255|  46.0k|  if(!part)
  ------------------
  |  Branch (2255:6): [True: 19.2k, False: 26.8k]
  ------------------
 2256|       |    /* setting a part to NULL clears it */
 2257|  19.2k|    return urlset_clear(u, what);
 2258|       |
 2259|  26.8k|  nalloc = strlen(part);
 2260|  26.8k|  if(nalloc > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  26.8k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (2260:6): [True: 0, False: 26.8k]
  ------------------
 2261|       |    /* excessive input length */
 2262|      0|    return CURLUE_MALFORMED_INPUT;
 2263|       |
 2264|  26.8k|  switch(what) {
 2265|      0|  case CURLUPART_SCHEME: {
  ------------------
  |  Branch (2265:3): [True: 0, False: 26.8k]
  ------------------
 2266|      0|    CURLUcode status = set_url_scheme(u, part, flags);
 2267|      0|    if(status)
  ------------------
  |  Branch (2267:8): [True: 0, False: 0]
  ------------------
 2268|      0|      return status;
 2269|      0|    storep = &u->scheme;
 2270|      0|    urlencode = FALSE; /* never */
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2271|      0|    break;
 2272|      0|  }
 2273|      0|  case CURLUPART_USER:
  ------------------
  |  Branch (2273:3): [True: 0, False: 26.8k]
  ------------------
 2274|      0|    storep = &u->user;
 2275|      0|    break;
 2276|      0|  case CURLUPART_PASSWORD:
  ------------------
  |  Branch (2276:3): [True: 0, False: 26.8k]
  ------------------
 2277|      0|    storep = &u->password;
 2278|      0|    break;
 2279|      0|  case CURLUPART_OPTIONS:
  ------------------
  |  Branch (2279:3): [True: 0, False: 26.8k]
  ------------------
 2280|      0|    storep = &u->options;
 2281|      0|    break;
 2282|      0|  case CURLUPART_HOST:
  ------------------
  |  Branch (2282:3): [True: 0, False: 26.8k]
  ------------------
 2283|      0|    storep = &u->host;
 2284|      0|    curlx_safefree(u->zoneid);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2285|      0|    break;
 2286|      0|  case CURLUPART_ZONEID:
  ------------------
  |  Branch (2286:3): [True: 0, False: 26.8k]
  ------------------
 2287|      0|    storep = &u->zoneid;
 2288|      0|    break;
 2289|      0|  case CURLUPART_PORT:
  ------------------
  |  Branch (2289:3): [True: 0, False: 26.8k]
  ------------------
 2290|      0|    return set_url_port(u, part);
 2291|      0|  case CURLUPART_PATH:
  ------------------
  |  Branch (2291:3): [True: 0, False: 26.8k]
  ------------------
 2292|      0|    pathmode = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2293|      0|    leadingslash = TRUE; /* enforce */
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2294|      0|    storep = &u->path;
 2295|      0|    break;
 2296|      0|  case CURLUPART_QUERY:
  ------------------
  |  Branch (2296:3): [True: 0, False: 26.8k]
  ------------------
 2297|      0|    plusencode = urlencode;
 2298|      0|    appendquery = (flags & CURLU_APPENDQUERY) ? 1 : 0;
  ------------------
  |  |   96|      0|#define CURLU_APPENDQUERY (1 << 8)        /* append a form style part */
  ------------------
  |  Branch (2298:19): [True: 0, False: 0]
  ------------------
 2299|      0|    equalsencode = appendquery;
 2300|      0|    storep = &u->query;
 2301|      0|    u->query_present = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2302|      0|    break;
 2303|      0|  case CURLUPART_FRAGMENT:
  ------------------
  |  Branch (2303:3): [True: 0, False: 26.8k]
  ------------------
 2304|      0|    storep = &u->fragment;
 2305|      0|    u->fragment_present = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2306|      0|    break;
 2307|  26.8k|  case CURLUPART_URL:
  ------------------
  |  Branch (2307:3): [True: 26.8k, False: 0]
  ------------------
 2308|  26.8k|    return set_url(u, part, nalloc, flags);
 2309|      0|  default:
  ------------------
  |  Branch (2309:3): [True: 0, False: 26.8k]
  ------------------
 2310|      0|    return CURLUE_UNKNOWN_PART;
 2311|  26.8k|  }
 2312|      0|  DEBUGASSERT(storep);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2312:3): [True: 0, False: 0]
  |  Branch (2312:3): [True: 0, False: 0]
  ------------------
 2313|      0|  {
 2314|      0|    const char *newp = NULL;
 2315|      0|    struct dynbuf enc;
 2316|      0|    CURLUcode status;
 2317|      0|    curlx_dyn_init(&enc, (what == CURLUPART_HOST) ?
  ------------------
  |  Branch (2317:26): [True: 0, False: 0]
  ------------------
 2318|      0|                   CURLMAX((nalloc * 3) + 1, MAX_IPADR_LEN + 2) :
  ------------------
  |  | 1314|      0|#define CURLMAX(x, y) ((x) > (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1314:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2319|      0|                   (nalloc * 3) + 1 + leadingslash);
 2320|       |
 2321|      0|    if(leadingslash && (part[0] != '/')) {
  ------------------
  |  Branch (2321:8): [True: 0, False: 0]
  |  Branch (2321:24): [True: 0, False: 0]
  ------------------
 2322|      0|      CURLcode result = curlx_dyn_addn(&enc, "/", 1);
 2323|      0|      if(result)
  ------------------
  |  Branch (2323:10): [True: 0, False: 0]
  ------------------
 2324|      0|        return cc2cu(result);
  ------------------
  |  |  105|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2325|      0|    }
 2326|      0|    if(urlencode)
  ------------------
  |  Branch (2326:8): [True: 0, False: 0]
  ------------------
 2327|      0|      status = url_encode_part(&enc, part, plusencode, pathmode, equalsencode);
 2328|      0|    else
 2329|      0|      status = url_uppercasehex_part(&enc, part);
 2330|      0|    if(!status) {
  ------------------
  |  Branch (2330:8): [True: 0, False: 0]
  ------------------
 2331|      0|      newp = curlx_dyn_ptr(&enc);
 2332|       |
 2333|      0|      if(appendquery && newp)
  ------------------
  |  Branch (2333:10): [True: 0, False: 0]
  |  Branch (2333:25): [True: 0, False: 0]
  ------------------
 2334|      0|        return url_append_query(u, &enc);
 2335|      0|      else if(what == CURLUPART_HOST)
  ------------------
  |  Branch (2335:15): [True: 0, False: 0]
  ------------------
 2336|      0|        status = url_sethost(u, &enc, urlencode, flags);
 2337|      0|    }
 2338|      0|    if(status)
  ------------------
  |  Branch (2338:8): [True: 0, False: 0]
  ------------------
 2339|      0|      return status;
 2340|       |
 2341|      0|    if(what == CURLUPART_PASSWORD)
  ------------------
  |  Branch (2341:8): [True: 0, False: 0]
  ------------------
 2342|      0|      curlx_strzero(*storep);
 2343|      0|    curlx_free(*storep);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2344|      0|    *storep = curlx_dyn_ptr(&enc);
 2345|      0|  }
 2346|      0|  return CURLUE_OK;
 2347|      0|}
Curl_url_get_port:
 2385|  9.44k|{
 2386|  9.44k|  if(u->port_present) {
  ------------------
  |  Branch (2386:6): [True: 0, False: 9.44k]
  ------------------
 2387|      0|    *pport = u->portnum;
 2388|      0|    return CURLUE_OK;
 2389|      0|  }
 2390|  9.44k|  else if(u->scheme) {
  ------------------
  |  Branch (2390:11): [True: 9.44k, False: 0]
  ------------------
 2391|  9.44k|    const struct Curl_scheme *s = Curl_get_scheme(u->scheme);
 2392|  9.44k|    if(s && s->defport) {
  ------------------
  |  Branch (2392:8): [True: 9.44k, False: 0]
  |  Branch (2392:13): [True: 9.44k, False: 0]
  ------------------
 2393|  9.44k|      *pport = s->defport;
 2394|  9.44k|      return CURLUE_OK;
 2395|  9.44k|    }
 2396|  9.44k|  }
 2397|      0|  *pport = 0;
 2398|      0|  return CURLUE_NO_PORT;
 2399|  9.44k|}
urlapi.c:badoctets:
  275|  19.8k|{
  276|  19.8k|  const uint8_t *p = (const unsigned char *)input;
  277|  19.8k|  const uint8_t control = (flags & CURLU_ALLOW_SPACE) ? 0x1f : 0x20;
  ------------------
  |  |  100|  19.8k|#define CURLU_ALLOW_SPACE (1 << 11)       /* Allow spaces in the URL */
  ------------------
  |  Branch (277:27): [True: 0, False: 19.8k]
  ------------------
  278|       |  /* SWAR (SIMD within a register) 64-bit comparison:
  279|       |     Process 8 bytes at a time in 64-bit words to quickly detect bad octets
  280|       |     (byte <= control or byte == 127) without byte-by-byte branches.
  281|       |
  282|       |     1. Detect byte <= control:
  283|       |        'sub' contains (control + 1) in each byte (0x20 or 0x21). For any
  284|       |        byte < (control + 1), subtracting 'sub' borrows into the high bit
  285|       |        (0x80). Masking with (~w) ensures the byte had bit 7 clear initially,
  286|       |        so (~w) & (w - sub) has bit 7 set if and only if byte <= control.
  287|       |
  288|       |     2. Detect byte == 127 (0x7f):
  289|       |        XORing with 0x7f turns 0x7f bytes into 0x00. We then detect zero bytes
  290|       |        in 'x' using the standard zero-byte test: (~x) & (x - 0x0101...).
  291|       |
  292|       |     If any high bit is set in (low | del), at least one bad byte was found;
  293|       |     break out to the byte-by-byte loop to confirm and return TRUE. */
  294|  19.8k|  const uint64_t sub = (flags & CURLU_ALLOW_SPACE) ?
  ------------------
  |  |  100|  19.8k|#define CURLU_ALLOW_SPACE (1 << 11)       /* Allow spaces in the URL */
  ------------------
  |  Branch (294:24): [True: 0, False: 19.8k]
  ------------------
  295|  19.8k|    0x2020202020202020ULL : 0x2121212121212121ULL;
  296|       |
  297|   106k|  while(n >= 16) {
  ------------------
  |  Branch (297:9): [True: 87.2k, False: 19.5k]
  ------------------
  298|  87.2k|    uint64_t w1, w2;
  299|  87.2k|    uint64_t low, x1, x2, del;
  300|  87.2k|    memcpy(&w1, p, sizeof(w1));
  301|  87.2k|    memcpy(&w2, p + 8, sizeof(w2));
  302|       |    /* check for bytes <= control */
  303|  87.2k|    low = ((~w1) & (w1 - sub)) | ((~w2) & (w2 - sub));
  304|       |    /* check for 0x7f */
  305|  87.2k|    x1 = w1 ^ 0x7f7f7f7f7f7f7f7fULL;
  306|  87.2k|    x2 = w2 ^ 0x7f7f7f7f7f7f7f7fULL;
  307|  87.2k|    del = ((~x1) & (x1 - 0x0101010101010101ULL)) |
  308|  87.2k|          ((~x2) & (x2 - 0x0101010101010101ULL));
  309|  87.2k|    if((low | del) & 0x8080808080808080ULL)
  ------------------
  |  Branch (309:8): [True: 266, False: 87.0k]
  ------------------
  310|    266|      break;
  311|  87.0k|    p += 16;
  312|  87.0k|    n -= 16;
  313|  87.0k|  }
  314|  20.4k|  while(n >= 8) {
  ------------------
  |  Branch (314:9): [True: 958, False: 19.4k]
  ------------------
  315|    958|    uint64_t w;
  316|    958|    uint64_t low;
  317|    958|    uint64_t x;
  318|    958|    uint64_t del;
  319|    958|    memcpy(&w, p, sizeof(w));
  320|       |    /* check for bytes <= control */
  321|    958|    low = (~w) & (w - sub);
  322|       |    /* check for 0x7f (DEL) */
  323|    958|    x = w ^ 0x7f7f7f7f7f7f7f7fULL;
  324|    958|    del = (~x) & (x - 0x0101010101010101ULL);
  325|    958|    if((low | del) & 0x8080808080808080ULL)
  ------------------
  |  Branch (325:8): [True: 367, False: 591]
  ------------------
  326|    367|      break;
  327|    591|    p += 8;
  328|    591|    n -= 8;
  329|    591|  }
  330|  44.7k|  while(n--) {
  ------------------
  |  Branch (330:9): [True: 25.5k, False: 19.1k]
  ------------------
  331|  25.5k|    if(*p <= control || *p == 127)
  ------------------
  |  Branch (331:8): [True: 627, False: 24.9k]
  |  Branch (331:25): [True: 56, False: 24.8k]
  ------------------
  332|    683|      return TRUE;
  ------------------
  |  |  986|    683|#define TRUE true
  ------------------
  333|  24.8k|    p++;
  334|  24.8k|  }
  335|  19.1k|  return FALSE;
  ------------------
  |  |  989|  19.1k|#define FALSE false
  ------------------
  336|  19.8k|}
urlapi.c:parse_authority:
  825|  26.7k|{
  826|  26.7k|  size_t offset;
  827|  26.7k|  CURLUcode uc;
  828|  26.7k|  CURLcode result;
  829|       |
  830|       |  /*
  831|       |   * Parse the login details and strip them out of the hostname.
  832|       |   */
  833|  26.7k|  uc = parse_hostname_login(u, auth, authlen, flags, &offset);
  834|  26.7k|  if(uc)
  ------------------
  |  Branch (834:6): [True: 0, False: 26.7k]
  ------------------
  835|      0|    return uc;
  836|       |
  837|  26.7k|  result = curlx_dyn_addn(host, auth + offset, authlen - offset);
  838|  26.7k|  if(result) {
  ------------------
  |  Branch (838:6): [True: 33, False: 26.7k]
  ------------------
  839|     33|    uc = cc2cu(result);
  ------------------
  |  |  105|     33|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 0, False: 33]
  |  |  ------------------
  ------------------
  840|     33|    return uc;
  841|     33|  }
  842|       |
  843|       |  /* parse_port() also sets the hostname length correctly */
  844|  26.7k|  uc = parse_port(u, host, has_scheme);
  845|       |
  846|  26.7k|  if(!curlx_dyn_len(host))
  ------------------
  |  Branch (846:6): [True: 0, False: 26.7k]
  ------------------
  847|       |    /* this makes no-host errors override port number problems */
  848|      0|    uc = CURLUE_NO_HOST;
  849|  26.7k|  if(!uc)
  ------------------
  |  Branch (849:6): [True: 26.7k, False: 0]
  ------------------
  850|  26.7k|    uc = urldecode_host(host);
  851|  26.7k|  if(uc)
  ------------------
  |  Branch (851:6): [True: 0, False: 26.7k]
  ------------------
  852|      0|    ;
  853|  26.7k|  else if(auth[offset] == '[')
  ------------------
  |  Branch (853:11): [True: 11.6k, False: 15.1k]
  ------------------
  854|  11.6k|    uc = ipv6_parse(u, curlx_dyn_ptr(host), curlx_dyn_len(host), host);
  855|  15.1k|  else {
  856|  15.1k|    const char *hptr = curlx_dyn_ptr(host);
  857|  15.1k|    size_t hlen = curlx_dyn_len(host);
  858|       |    /* ipv4_normalize() returns *NAME, *IPV4 or *ERROR */
  859|  15.1k|    int type = ISDIGIT(hptr[0]) ? ipv4_normalize(host) : HOST_NAME;
  ------------------
  |  |   42|  15.1k|#define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
  |  |  ------------------
  |  |  |  Branch (42:22): [True: 15.1k, False: 0]
  |  |  |  Branch (42:38): [True: 7.29k, False: 7.85k]
  |  |  ------------------
  ------------------
                  int type = ISDIGIT(hptr[0]) ? ipv4_normalize(host) : HOST_NAME;
  ------------------
  |  |   48|  7.85k|#define HOST_NAME    1
  ------------------
  860|       |
  861|  15.1k|    if(type == HOST_NAME)
  ------------------
  |  |   48|  15.1k|#define HOST_NAME    1
  ------------------
  |  Branch (861:8): [True: 7.85k, False: 7.29k]
  ------------------
  862|  7.85k|      uc = Curl_hostname_check(hptr, hlen);
  863|  7.29k|    else if(type == HOST_ERROR)
  ------------------
  |  |   47|  7.29k|#define HOST_ERROR   (-1) /* out of memory */
  ------------------
  |  Branch (863:13): [True: 0, False: 7.29k]
  ------------------
  864|      0|      uc = CURLUE_OUT_OF_MEMORY;
  865|  15.1k|  }
  866|       |
  867|  26.7k|  return uc;
  868|  26.7k|}
urlapi.c:urldecode_host:
  794|  26.7k|{
  795|  26.7k|  const char *per;
  796|  26.7k|  size_t hlen = curlx_dyn_len(host);
  797|  26.7k|  const char *hostname = curlx_dyn_ptr(host);
  798|  26.7k|  per = memchr(hostname, '%', hlen);
  799|  26.7k|  if(!per)
  ------------------
  |  Branch (799:6): [True: 26.7k, False: 0]
  ------------------
  800|       |    /* nothing to decode */
  801|  26.7k|    return CURLUE_OK;
  802|      0|  else {
  803|       |    /* encoded */
  804|      0|    size_t dlen;
  805|      0|    char *decoded;
  806|      0|    CURLcode result = Curl_urldecode(hostname, 0, &decoded, &dlen,
  807|      0|                                     REJECT_CTRL);
  808|      0|    if(result)
  ------------------
  |  Branch (808:8): [True: 0, False: 0]
  ------------------
  809|      0|      return CURLUE_BAD_HOSTNAME;
  810|      0|    curlx_dyn_reset(host);
  811|      0|    result = curlx_dyn_addn(host, decoded, dlen);
  812|      0|    curlx_free(decoded);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  813|      0|    if(result)
  ------------------
  |  Branch (813:8): [True: 0, False: 0]
  ------------------
  814|      0|      return cc2cu(result);
  ------------------
  |  |  105|      0|  ((x) == CURLE_TOO_LARGE ? CURLUE_TOO_LARGE : CURLUE_OUT_OF_MEMORY)
  |  |  ------------------
  |  |  |  Branch (105:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  815|      0|  }
  816|       |
  817|      0|  return CURLUE_OK;
  818|  26.7k|}
urlapi.c:needs_dedotdot:
  916|  1.16k|{
  917|       |  /* a single byte path cannot be cleaned up */
  918|  1.16k|  if(pn < 2)
  ------------------
  |  Branch (918:6): [True: 0, False: 1.16k]
  ------------------
  919|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  920|  1.16k|  if(!memchr(p, '.', pn) && !memchr(p, '%', pn))
  ------------------
  |  Branch (920:6): [True: 479, False: 690]
  |  Branch (920:29): [True: 239, False: 240]
  ------------------
  921|    239|    return FALSE;
  ------------------
  |  |  989|    239|#define FALSE false
  ------------------
  922|  47.9k|  while(pn) {
  ------------------
  |  Branch (922:9): [True: 47.8k, False: 48]
  ------------------
  923|   481k|    while(pn && *p != '.' && *p != '%') {
  ------------------
  |  Branch (923:11): [True: 480k, False: 371]
  |  Branch (923:17): [True: 469k, False: 11.4k]
  |  Branch (923:30): [True: 433k, False: 36.0k]
  ------------------
  924|   433k|      p++;
  925|   433k|      pn--;
  926|   433k|    }
  927|  47.8k|    if(!pn)
  ------------------
  |  Branch (927:8): [True: 371, False: 47.4k]
  ------------------
  928|    371|      break;
  929|  47.4k|    if(is_dot(&p, &pn)) {
  ------------------
  |  Branch (929:8): [True: 12.9k, False: 34.5k]
  ------------------
  930|       |      /* "./" or dot before end of string */
  931|  12.9k|      if(!pn || ISSLASH(*p))
  ------------------
  |  |  912|  12.7k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (912:20): [True: 229, False: 12.5k]
  |  |  ------------------
  ------------------
  |  Branch (931:10): [True: 169, False: 12.7k]
  ------------------
  932|    398|        return TRUE;
  ------------------
  |  |  986|    398|#define TRUE true
  ------------------
  933|       |      /* "../" or ".." before end of string */
  934|  12.5k|      else if(is_dot(&p, &pn) && (!pn || ISSLASH(*p)))
  ------------------
  |  |  912|  2.19k|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (912:20): [True: 80, False: 2.11k]
  |  |  ------------------
  ------------------
  |  Branch (934:15): [True: 2.22k, False: 10.3k]
  |  Branch (934:35): [True: 33, False: 2.19k]
  ------------------
  935|    113|        return TRUE;
  ------------------
  |  |  986|    113|#define TRUE true
  ------------------
  936|  12.9k|    }
  937|  34.5k|    else {
  938|  34.5k|      p++;
  939|  34.5k|      pn--;
  940|  34.5k|    }
  941|  47.4k|  }
  942|    419|  return FALSE;
  ------------------
  |  |  989|    419|#define FALSE false
  ------------------
  943|    930|}
urlapi.c:is_dot:
  896|   198k|{
  897|   198k|  const char *p = *str;
  898|   198k|  if(*p == '.') {
  ------------------
  |  Branch (898:6): [True: 39.8k, False: 158k]
  ------------------
  899|  39.8k|    (*str)++;
  900|  39.8k|    (*clen)--;
  901|  39.8k|    return TRUE;
  ------------------
  |  |  986|  39.8k|#define TRUE true
  ------------------
  902|  39.8k|  }
  903|   158k|  else if((*clen >= 3) &&
  ------------------
  |  Branch (903:11): [True: 158k, False: 369]
  ------------------
  904|   158k|          (p[0] == '%') && (p[1] == '2') && ((p[2] | 0x20) == 'e')) {
  ------------------
  |  Branch (904:11): [True: 53.7k, False: 104k]
  |  Branch (904:28): [True: 17.1k, False: 36.5k]
  |  Branch (904:45): [True: 3.26k, False: 13.8k]
  ------------------
  905|  3.26k|    *str += 3;
  906|  3.26k|    *clen -= 3;
  907|  3.26k|    return TRUE;
  ------------------
  |  |  986|  3.26k|#define TRUE true
  ------------------
  908|  3.26k|  }
  909|   155k|  return FALSE;
  ------------------
  |  |  989|   155k|#define FALSE false
  ------------------
  910|   198k|}
urlapi.c:free_urlhandle:
   70|  53.6k|{
   71|  53.6k|  curlx_free(u->scheme);
  ------------------
  |  | 1503|  53.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   72|  53.6k|  curlx_free(u->user);
  ------------------
  |  | 1503|  53.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   73|  53.6k|  curlx_strzero(u->password);
   74|  53.6k|  curlx_free(u->password);
  ------------------
  |  | 1503|  53.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   75|  53.6k|  curlx_free(u->options);
  ------------------
  |  | 1503|  53.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   76|  53.6k|  curlx_free(u->host);
  ------------------
  |  | 1503|  53.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   77|  53.6k|  curlx_free(u->zoneid);
  ------------------
  |  | 1503|  53.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   78|  53.6k|  curlx_free(u->path);
  ------------------
  |  | 1503|  53.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   79|  53.6k|  curlx_free(u->query);
  ------------------
  |  | 1503|  53.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   80|  53.6k|  curlx_free(u->fragment);
  ------------------
  |  | 1503|  53.6k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   81|  53.6k|}
urlapi.c:urlget_url:
 1717|  19.1k|{
 1718|  19.1k|  char *url;
 1719|  19.1k|  char *allochost = NULL;
 1720|  19.1k|  const char *fragmentsep =
 1721|  19.1k|    (u->fragment || (u->fragment_present && flags & CURLU_GET_EMPTY)) ?
  ------------------
  |  |  103|  2.27k|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1721:6): [True: 39, False: 19.0k]
  |  Branch (1721:22): [True: 2.27k, False: 16.7k]
  |  Branch (1721:45): [True: 2.27k, False: 0]
  ------------------
 1722|  16.7k|    "#" : "";
 1723|  19.1k|  const char *querysep = ((u->query && u->query[0]) ||
  ------------------
  |  Branch (1723:28): [True: 81, False: 19.0k]
  |  Branch (1723:40): [True: 26, False: 55]
  ------------------
 1724|  19.0k|                          (u->query_present && flags & CURLU_GET_EMPTY)) ?
  ------------------
  |  |  103|     55|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
  |  Branch (1724:28): [True: 55, False: 19.0k]
  |  Branch (1724:48): [True: 55, False: 0]
  ------------------
 1725|  19.0k|    "?" : "";
 1726|  19.1k|  char portbuf[7];
 1727|  19.1k|  if(curl_strequal("file", u->scheme))
  ------------------
  |  Branch (1727:6): [True: 0, False: 19.1k]
  ------------------
 1728|      0|    return file_url(u, part, fragmentsep, querysep);
 1729|  19.1k|  else if(!u->host)
  ------------------
  |  Branch (1729:11): [True: 0, False: 19.1k]
  ------------------
 1730|      0|    return CURLUE_NO_HOST;
 1731|  19.1k|  else {
 1732|  19.1k|    const char *scheme;
 1733|  19.1k|    char *options = u->options;
 1734|  19.1k|    char *port = NULL;
 1735|  19.1k|    const struct Curl_scheme *h = NULL;
 1736|  19.1k|    char schemebuf[MAX_SCHEME_LEN + 5];
 1737|  19.1k|    if(u->scheme)
  ------------------
  |  Branch (1737:8): [True: 19.1k, False: 0]
  ------------------
 1738|  19.1k|      scheme = u->scheme;
 1739|      0|    else if(flags & CURLU_DEFAULT_SCHEME)
  ------------------
  |  |   89|      0|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
  |  Branch (1739:13): [True: 0, False: 0]
  ------------------
 1740|      0|      scheme = DEFAULT_SCHEME;
  ------------------
  |  |   67|      0|#define DEFAULT_SCHEME "https"
  ------------------
 1741|      0|    else
 1742|      0|      return CURLUE_NO_SCHEME;
 1743|       |
 1744|  19.1k|    if(u->port_present) {
  ------------------
  |  Branch (1744:8): [True: 0, False: 19.1k]
  ------------------
 1745|      0|      curl_msnprintf(portbuf, sizeof(portbuf), "%u", u->portnum);
 1746|      0|      port = portbuf;
 1747|      0|    }
 1748|       |
 1749|  19.1k|    h = Curl_get_scheme(scheme);
 1750|  19.1k|    if(h) {
  ------------------
  |  Branch (1750:8): [True: 19.1k, False: 0]
  ------------------
 1751|  19.1k|      if(!u->port_present && (flags & CURLU_DEFAULT_PORT)) {
  ------------------
  |  |   85|  19.1k|#define CURLU_DEFAULT_PORT (1 << 0)       /* return default port number */
  ------------------
  |  Branch (1751:10): [True: 19.1k, False: 0]
  |  Branch (1751:30): [True: 0, False: 19.1k]
  ------------------
 1752|       |        /* there is no stored port number, but asked to deliver a default one
 1753|       |           for the scheme */
 1754|      0|        curl_msnprintf(portbuf, sizeof(portbuf), "%u", h->defport);
 1755|      0|        port = portbuf;
 1756|      0|      }
 1757|  19.1k|      else if(u->port_present && (h->defport == u->portnum) &&
  ------------------
  |  Branch (1757:15): [True: 0, False: 19.1k]
  |  Branch (1757:34): [True: 0, False: 0]
  ------------------
 1758|      0|              (flags & CURLU_NO_DEFAULT_PORT)) {
  ------------------
  |  |   86|      0|#define CURLU_NO_DEFAULT_PORT (1 << 1)    /* act as if no port number was set,
  ------------------
  |  Branch (1758:15): [True: 0, False: 0]
  ------------------
 1759|       |        /* there is a stored port number, but asked to inhibit if it matches
 1760|       |           the default port for the scheme */
 1761|      0|        port = NULL;
 1762|      0|      }
 1763|       |
 1764|  19.1k|      if(!(h->flags & PROTOPT_URLOPTIONS))
  ------------------
  |  |  231|  19.1k|#define PROTOPT_URLOPTIONS (1 << 10) /* allow options part in the userinfo
  ------------------
  |  Branch (1764:10): [True: 19.1k, False: 0]
  ------------------
 1765|  19.1k|        options = NULL;
 1766|  19.1k|    }
 1767|       |
 1768|  19.1k|    if(u->host[0] == '[') {
  ------------------
  |  Branch (1768:8): [True: 11.5k, False: 7.59k]
  ------------------
 1769|  11.5k|      if(u->zoneid) {
  ------------------
  |  Branch (1769:10): [True: 0, False: 11.5k]
  ------------------
 1770|       |        /* make it '[ host %25 zoneid ]' */
 1771|      0|        struct dynbuf enc;
 1772|      0|        size_t hostlen = strlen(u->host);
 1773|      0|        curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|      0|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1774|      0|        if(curlx_dyn_addf(&enc, "%.*s%%25%s]", (int)hostlen - 1, u->host,
  ------------------
  |  Branch (1774:12): [True: 0, False: 0]
  ------------------
 1775|      0|                          u->zoneid))
 1776|      0|          return CURLUE_OUT_OF_MEMORY;
 1777|      0|        allochost = curlx_dyn_ptr(&enc);
 1778|      0|      }
 1779|  11.5k|    }
 1780|  7.59k|    else if(flags & CURLU_URLENCODE) {
  ------------------
  |  |   95|  7.59k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1780:13): [True: 0, False: 7.59k]
  ------------------
 1781|      0|      allochost = curl_easy_escape(NULL, u->host, 0);
 1782|      0|      if(!allochost)
  ------------------
  |  Branch (1782:10): [True: 0, False: 0]
  ------------------
 1783|      0|        return CURLUE_OUT_OF_MEMORY;
 1784|      0|    }
 1785|  7.59k|    else if(flags & CURLU_PUNYCODE) {
  ------------------
  |  |  101|  7.59k|#define CURLU_PUNYCODE (1 << 12)          /* get the hostname in punycode */
  ------------------
  |  Branch (1785:13): [True: 0, False: 7.59k]
  ------------------
 1786|      0|      if(!Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1786:10): [True: 0, False: 0]
  ------------------
 1787|      0|        CURLUcode ret = host_decode(u->host, &allochost);
 1788|      0|        if(!ret)
  ------------------
  |  Branch (1788:12): [True: 0, False: 0]
  ------------------
 1789|      0|          ret = Curl_hostname_check(allochost, strlen(allochost));
 1790|      0|        if(ret) {
  ------------------
  |  Branch (1790:12): [True: 0, False: 0]
  ------------------
 1791|      0|          curlx_safefree(allochost);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1792|      0|          return ret;
 1793|      0|        }
 1794|      0|      }
 1795|      0|    }
 1796|  7.59k|    else if(flags & CURLU_PUNY2IDN) {
  ------------------
  |  |  102|  7.59k|#define CURLU_PUNY2IDN (1 << 13)          /* punycode => IDN conversion */
  ------------------
  |  Branch (1796:13): [True: 0, False: 7.59k]
  ------------------
 1797|      0|      if(Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1797:10): [True: 0, False: 0]
  ------------------
 1798|      0|        CURLUcode ret = host_encode(u->host, &allochost);
 1799|      0|        if(ret)
  ------------------
  |  Branch (1799:12): [True: 0, False: 0]
  ------------------
 1800|      0|          return ret;
 1801|      0|      }
 1802|      0|    }
 1803|       |
 1804|  19.1k|    if(!(flags & CURLU_NO_GUESS_SCHEME) || !u->guessed_scheme)
  ------------------
  |  |  106|  19.1k|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
  |  Branch (1804:8): [True: 19.1k, False: 0]
  |  Branch (1804:44): [True: 0, False: 0]
  ------------------
 1805|  19.1k|      curl_msnprintf(schemebuf, sizeof(schemebuf), "%s://", scheme);
 1806|      0|    else
 1807|      0|      schemebuf[0] = 0;
 1808|       |
 1809|  19.1k|    url = curl_maprintf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
 1810|  19.1k|                        schemebuf,
 1811|  19.1k|                        u->user ? u->user : "",
  ------------------
  |  Branch (1811:25): [True: 0, False: 19.1k]
  ------------------
 1812|  19.1k|                        u->password ? ":" : "",
  ------------------
  |  Branch (1812:25): [True: 0, False: 19.1k]
  ------------------
 1813|  19.1k|                        u->password ? u->password : "",
  ------------------
  |  Branch (1813:25): [True: 0, False: 19.1k]
  ------------------
 1814|  19.1k|                        options ? ";" : "",
  ------------------
  |  Branch (1814:25): [True: 0, False: 19.1k]
  ------------------
 1815|  19.1k|                        options ? options : "",
  ------------------
  |  Branch (1815:25): [True: 0, False: 19.1k]
  ------------------
 1816|  19.1k|                        (u->user || u->password || options) ? "@" : "",
  ------------------
  |  Branch (1816:26): [True: 0, False: 19.1k]
  |  Branch (1816:37): [True: 0, False: 19.1k]
  |  Branch (1816:52): [True: 0, False: 19.1k]
  ------------------
 1817|  19.1k|                        allochost ? allochost : u->host,
  ------------------
  |  Branch (1817:25): [True: 0, False: 19.1k]
  ------------------
 1818|  19.1k|                        port ? ":" : "",
  ------------------
  |  Branch (1818:25): [True: 0, False: 19.1k]
  ------------------
 1819|  19.1k|                        port ? port : "",
  ------------------
  |  Branch (1819:25): [True: 0, False: 19.1k]
  ------------------
 1820|  19.1k|                        u->path ? u->path : "/",
  ------------------
  |  Branch (1820:25): [True: 1.17k, False: 17.9k]
  ------------------
 1821|  19.1k|                        querysep,
 1822|  19.1k|                        u->query ? u->query : "",
  ------------------
  |  Branch (1822:25): [True: 81, False: 19.0k]
  ------------------
 1823|  19.1k|                        fragmentsep,
 1824|  19.1k|                        u->fragment ? u->fragment : "");
  ------------------
  |  Branch (1824:25): [True: 39, False: 19.0k]
  ------------------
 1825|  19.1k|    curlx_free(allochost);
  ------------------
  |  | 1503|  19.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1826|  19.1k|  }
 1827|  19.1k|  if(!url)
  ------------------
  |  Branch (1827:6): [True: 21, False: 19.0k]
  ------------------
 1828|     21|    return CURLUE_OUT_OF_MEMORY;
 1829|  19.0k|  *part = url;
 1830|  19.0k|  return CURLUE_OK;
 1831|  19.1k|}
urlapi.c:urlget_format:
 1631|  57.5k|{
 1632|  57.5k|  CURLUcode uc = CURLUE_OK;
 1633|  57.5k|  size_t partlen = strlen(ptr);
 1634|  57.5k|  bool urldecode = (flags & CURLU_URLDECODE) ? 1 : 0;
  ------------------
  |  |   94|  57.5k|#define CURLU_URLDECODE (1 << 6)          /* URL decode on get */
  ------------------
  |  Branch (1634:20): [True: 7.28k, False: 50.2k]
  ------------------
 1635|  57.5k|  bool urlencode = (flags & CURLU_URLENCODE) ? 1 : 0;
  ------------------
  |  |   95|  57.5k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1635:20): [True: 9.44k, False: 48.0k]
  ------------------
 1636|  57.5k|  bool punycode = (flags & CURLU_PUNYCODE) && (what == CURLUPART_HOST);
  ------------------
  |  |  101|  57.5k|#define CURLU_PUNYCODE (1 << 12)          /* get the hostname in punycode */
  ------------------
  |  Branch (1636:19): [True: 0, False: 57.5k]
  |  Branch (1636:47): [True: 0, False: 0]
  ------------------
 1637|  57.5k|  bool depunyfy = (flags & CURLU_PUNY2IDN) && (what == CURLUPART_HOST);
  ------------------
  |  |  102|  57.5k|#define CURLU_PUNY2IDN (1 << 13)          /* punycode => IDN conversion */
  ------------------
  |  Branch (1637:19): [True: 0, False: 57.5k]
  |  Branch (1637:47): [True: 0, False: 0]
  ------------------
 1638|  57.5k|  char *part = curlx_memdup0(ptr, partlen);
 1639|  57.5k|  *partp = NULL;
 1640|  57.5k|  if(!part)
  ------------------
  |  Branch (1640:6): [True: 31, False: 57.5k]
  ------------------
 1641|     31|    return CURLUE_OUT_OF_MEMORY;
 1642|  57.5k|  if(plusdecode) {
  ------------------
  |  Branch (1642:6): [True: 0, False: 57.5k]
  ------------------
 1643|       |    /* convert + to space */
 1644|      0|    char *plus = part;
 1645|      0|    size_t i = 0;
 1646|      0|    for(i = 0; i < partlen; ++plus, i++) {
  ------------------
  |  Branch (1646:16): [True: 0, False: 0]
  ------------------
 1647|      0|      if(*plus == '+')
  ------------------
  |  Branch (1647:10): [True: 0, False: 0]
  ------------------
 1648|      0|        *plus = ' ';
 1649|      0|    }
 1650|      0|  }
 1651|  57.5k|  if(urldecode) {
  ------------------
  |  Branch (1651:6): [True: 7.28k, False: 50.2k]
  ------------------
 1652|  7.28k|    char *decoded;
 1653|  7.28k|    size_t dlen;
 1654|       |    /* this unconditional rejection of control bytes is documented API
 1655|       |       behavior */
 1656|  7.28k|    CURLcode result = Curl_urldecode(part, partlen, &decoded, &dlen,
 1657|  7.28k|                                     REJECT_CTRL);
 1658|  7.28k|    curlx_free(part);
  ------------------
  |  | 1503|  7.28k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1659|  7.28k|    if(result)
  ------------------
  |  Branch (1659:8): [True: 0, False: 7.28k]
  ------------------
 1660|      0|      return CURLUE_URLDECODE;
 1661|  7.28k|    part = decoded;
 1662|  7.28k|    partlen = dlen;
 1663|  7.28k|  }
 1664|  57.5k|  if(urlencode && partlen) {
  ------------------
  |  Branch (1664:6): [True: 9.43k, False: 48.0k]
  |  Branch (1664:19): [True: 9.43k, False: 0]
  ------------------
 1665|  9.43k|    struct dynbuf enc;
 1666|  9.43k|    curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|  9.43k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1667|  9.43k|    uc = urlencode_str(&enc, part, partlen, TRUE, what == CURLUPART_QUERY ?
  ------------------
  |  |  986|  9.43k|#define TRUE true
  ------------------
  |  Branch (1667:51): [True: 0, False: 9.43k]
  ------------------
 1668|  9.43k|                       QUERY_YES : QUERY_NO);
  ------------------
  |  |   54|      0|#define QUERY_YES     4
  ------------------
                                     QUERY_YES : QUERY_NO);
  ------------------
  |  |   52|  18.8k|#define QUERY_NO      2
  ------------------
 1669|  9.43k|    curlx_free(part);
  ------------------
  |  | 1503|  9.43k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1670|  9.43k|    if(uc)
  ------------------
  |  Branch (1670:8): [True: 3, False: 9.43k]
  ------------------
 1671|      3|      return uc;
 1672|  9.43k|    part = curlx_dyn_ptr(&enc);
 1673|  9.43k|  }
 1674|  48.0k|  else if(punycode) {
  ------------------
  |  Branch (1674:11): [True: 0, False: 48.0k]
  ------------------
 1675|      0|    if(!Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1675:8): [True: 0, False: 0]
  ------------------
 1676|      0|      char *punyversion = NULL;
 1677|      0|      uc = host_decode(part, &punyversion);
 1678|      0|      curlx_free(part);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1679|      0|      if(uc)
  ------------------
  |  Branch (1679:10): [True: 0, False: 0]
  ------------------
 1680|      0|        return uc;
 1681|      0|      uc = Curl_hostname_check(punyversion, strlen(punyversion));
 1682|      0|      if(uc) {
  ------------------
  |  Branch (1682:10): [True: 0, False: 0]
  ------------------
 1683|      0|        curlx_free(punyversion);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1684|      0|        return uc;
 1685|      0|      }
 1686|      0|      part = punyversion;
 1687|      0|    }
 1688|      0|  }
 1689|  48.0k|  else if(depunyfy && Curl_is_ASCII_name(u->host)) {
  ------------------
  |  Branch (1689:11): [True: 0, False: 48.0k]
  |  Branch (1689:23): [True: 0, False: 0]
  ------------------
 1690|      0|    char *unpunified = NULL;
 1691|      0|    uc = host_encode(part, &unpunified);
 1692|      0|    curlx_free(part);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1693|      0|    if(uc)
  ------------------
  |  Branch (1693:8): [True: 0, False: 0]
  ------------------
 1694|      0|      return uc;
 1695|      0|    part = unpunified;
 1696|      0|  }
 1697|  57.5k|  *partp = part;
 1698|  57.5k|  return CURLUE_OK;
 1699|  57.5k|}
urlapi.c:urlset_clear:
 2034|  19.2k|{
 2035|  19.2k|  switch(what) {
 2036|      0|  case CURLUPART_URL:
  ------------------
  |  Branch (2036:3): [True: 0, False: 19.2k]
  ------------------
 2037|      0|    free_urlhandle(u);
 2038|      0|    memset(u, 0, sizeof(struct Curl_URL));
 2039|      0|    break;
 2040|      0|  case CURLUPART_SCHEME:
  ------------------
  |  Branch (2040:3): [True: 0, False: 19.2k]
  ------------------
 2041|      0|    curlx_safefree(u->scheme);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2042|      0|    u->guessed_scheme = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2043|      0|    break;
 2044|  9.63k|  case CURLUPART_USER:
  ------------------
  |  Branch (2044:3): [True: 9.63k, False: 9.63k]
  ------------------
 2045|  9.63k|    curlx_safefree(u->user);
  ------------------
  |  | 1359|  9.63k|  do {                      \
  |  | 1360|  9.63k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.63k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.63k|    (ptr) = NULL;           \
  |  | 1362|  9.63k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.63k]
  |  |  ------------------
  ------------------
 2046|  9.63k|    break;
 2047|  9.63k|  case CURLUPART_PASSWORD:
  ------------------
  |  Branch (2047:3): [True: 9.63k, False: 9.63k]
  ------------------
 2048|  9.63k|    curlx_strzero(u->password);
 2049|  9.63k|    curlx_safefree(u->password);
  ------------------
  |  | 1359|  9.63k|  do {                      \
  |  | 1360|  9.63k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  9.63k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  9.63k|    (ptr) = NULL;           \
  |  | 1362|  9.63k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 9.63k]
  |  |  ------------------
  ------------------
 2050|  9.63k|    break;
 2051|      0|  case CURLUPART_OPTIONS:
  ------------------
  |  Branch (2051:3): [True: 0, False: 19.2k]
  ------------------
 2052|      0|    curlx_safefree(u->options);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2053|      0|    break;
 2054|      0|  case CURLUPART_HOST:
  ------------------
  |  Branch (2054:3): [True: 0, False: 19.2k]
  ------------------
 2055|      0|    curlx_safefree(u->host);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2056|      0|    break;
 2057|      0|  case CURLUPART_ZONEID:
  ------------------
  |  Branch (2057:3): [True: 0, False: 19.2k]
  ------------------
 2058|      0|    curlx_safefree(u->zoneid);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2059|      0|    break;
 2060|      0|  case CURLUPART_PORT:
  ------------------
  |  Branch (2060:3): [True: 0, False: 19.2k]
  ------------------
 2061|      0|    u->portnum = 0;
 2062|      0|    u->port_present = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2063|      0|    break;
 2064|      0|  case CURLUPART_PATH:
  ------------------
  |  Branch (2064:3): [True: 0, False: 19.2k]
  ------------------
 2065|      0|    curlx_safefree(u->path);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2066|      0|    break;
 2067|      0|  case CURLUPART_QUERY:
  ------------------
  |  Branch (2067:3): [True: 0, False: 19.2k]
  ------------------
 2068|      0|    curlx_safefree(u->query);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2069|      0|    u->query_present = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2070|      0|    break;
 2071|      0|  case CURLUPART_FRAGMENT:
  ------------------
  |  Branch (2071:3): [True: 0, False: 19.2k]
  ------------------
 2072|      0|    curlx_safefree(u->fragment);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2073|      0|    u->fragment_present = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2074|      0|    break;
 2075|      0|  default:
  ------------------
  |  Branch (2075:3): [True: 0, False: 19.2k]
  ------------------
 2076|      0|    return CURLUE_UNKNOWN_PART;
 2077|  19.2k|  }
 2078|  19.2k|  return CURLUE_OK;
 2079|  19.2k|}
urlapi.c:set_url:
 1981|  26.8k|{
 1982|       |  /*
 1983|       |   * Allow a new URL to replace the existing (if any) contents.
 1984|       |   *
 1985|       |   * If the existing contents is enough for a URL, allow a relative URL to
 1986|       |   * replace it.
 1987|       |   */
 1988|  26.8k|  CURLUcode uc;
 1989|  26.8k|  char *oldurl = NULL;
 1990|       |
 1991|  26.8k|  if(!part_size) {
  ------------------
  |  Branch (1991:6): [True: 0, False: 26.8k]
  ------------------
 1992|       |    /* a blank URL is not a valid URL unless we already have a complete one
 1993|       |       and this is a redirect */
 1994|      0|    uc = curl_url_get(u, CURLUPART_URL, &oldurl, flags);
 1995|      0|    if(!uc) {
  ------------------
  |  Branch (1995:8): [True: 0, False: 0]
  ------------------
 1996|       |      /* success, meaning the "" is a fine relative URL, and the new URL
 1997|       |         inherits scheme/authority/path/query, but not fragment, from the
 1998|       |         existing URL (RFC 3986 section 5.2.2) */
 1999|      0|      curlx_safefree(u->fragment);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2000|      0|      u->fragment_present = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 2001|      0|      curlx_free(oldurl);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2002|      0|      return CURLUE_OK;
 2003|      0|    }
 2004|      0|    if(uc == CURLUE_OUT_OF_MEMORY)
  ------------------
  |  Branch (2004:8): [True: 0, False: 0]
  ------------------
 2005|      0|      return uc;
 2006|      0|    return CURLUE_MALFORMED_INPUT;
 2007|      0|  }
 2008|       |
 2009|       |  /* if the new URL is absolute replace the existing with the new. */
 2010|  26.8k|  if(Curl_is_absolute_url(url, NULL, 0,
  ------------------
  |  Branch (2010:6): [True: 26.8k, False: 0]
  ------------------
 2011|  26.8k|                          flags & (CURLU_GUESS_SCHEME | CURLU_DEFAULT_SCHEME)))
  ------------------
  |  |   97|  26.8k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
                                        flags & (CURLU_GUESS_SCHEME | CURLU_DEFAULT_SCHEME)))
  ------------------
  |  |   89|  26.8k|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
 2012|  26.8k|    return parseurl_and_replace(url, u, flags);
 2013|       |
 2014|       |  /* if the old URL is incomplete (we cannot get an absolute URL in
 2015|       |     'oldurl'), replace the existing with the new.
 2016|       |     Always include "scheme://" to make the URL "complete" */
 2017|       |  /* Preserve empty query/fragment separators: they affect where relative
 2018|       |     references splice into the base URL. */
 2019|      0|  uc = curl_url_get(u, CURLUPART_URL, &oldurl,
 2020|      0|                    (flags & ~CURLU_NO_GUESS_SCHEME) | CURLU_GET_EMPTY);
  ------------------
  |  |  106|      0|#define CURLU_NO_GUESS_SCHEME (1 << 15)   /* for get, do not accept a guess */
  ------------------
                                  (flags & ~CURLU_NO_GUESS_SCHEME) | CURLU_GET_EMPTY);
  ------------------
  |  |  103|      0|#define CURLU_GET_EMPTY (1 << 14)         /* allow empty queries and fragments
  ------------------
 2021|      0|  if(uc == CURLUE_OUT_OF_MEMORY)
  ------------------
  |  Branch (2021:6): [True: 0, False: 0]
  ------------------
 2022|      0|    return uc;
 2023|      0|  else if(uc)
  ------------------
  |  Branch (2023:11): [True: 0, False: 0]
  ------------------
 2024|      0|    return parseurl_and_replace(url, u, flags);
 2025|       |
 2026|      0|  DEBUGASSERT(oldurl); /* it is set here */
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2026:3): [True: 0, False: 0]
  |  Branch (2026:3): [True: 0, False: 0]
  ------------------
 2027|       |  /* apply the relative part to create a new URL */
 2028|      0|  uc = redirect_url(oldurl, url, u, flags);
 2029|      0|  curlx_free(oldurl);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2030|      0|  return uc;
 2031|      0|}
urlapi.c:parseurl_and_replace:
 1460|  26.8k|{
 1461|  26.8k|  CURLUcode ures;
 1462|  26.8k|  CURLU tmpurl;
 1463|  26.8k|  memset(&tmpurl, 0, sizeof(tmpurl));
 1464|  26.8k|  ures = parseurl(url, &tmpurl, flags);
 1465|  26.8k|  if(!ures) {
  ------------------
  |  Branch (1465:6): [True: 26.4k, False: 421]
  ------------------
 1466|  26.4k|    free_urlhandle(u);
 1467|  26.4k|    *u = tmpurl;
 1468|  26.4k|  }
 1469|  26.8k|  return ures;
 1470|  26.8k|}
urlapi.c:parseurl:
 1362|  26.8k|{
 1363|  26.8k|  const char *path;
 1364|  26.8k|  size_t pathlen;
 1365|  26.8k|  char schemebuf[MAX_SCHEME_LEN + 1];
 1366|  26.8k|  size_t schemelen;
 1367|  26.8k|  size_t urllen;
 1368|  26.8k|  CURLUcode ures = CURLUE_OK;
 1369|  26.8k|  struct dynbuf host;
 1370|  26.8k|  bool is_file = FALSE;
  ------------------
  |  |  989|  26.8k|#define FALSE false
  ------------------
 1371|  26.8k|  bool badoctets_clean = FALSE;
  ------------------
  |  |  989|  26.8k|#define FALSE false
  ------------------
 1372|       |
 1373|  26.8k|  DEBUGASSERT(url);
  ------------------
  |  | 1016|  26.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1373:3): [True: 0, False: 26.8k]
  |  Branch (1373:3): [True: 26.8k, False: 0]
  ------------------
 1374|       |
 1375|  26.8k|  urllen = strlen(url);
 1376|  26.8k|  if(urllen > CURL_MAX_INPUT_LENGTH)
  ------------------
  |  |   45|  26.8k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
  |  Branch (1376:6): [True: 0, False: 26.8k]
  ------------------
 1377|      0|    return CURLUE_MALFORMED_INPUT;
 1378|       |
 1379|  26.8k|  curlx_dyn_init(&host, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|  26.8k|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1380|       |
 1381|  26.8k|  schemelen = Curl_is_absolute_url(url, schemebuf, sizeof(schemebuf),
 1382|  26.8k|                                   flags & (CURLU_GUESS_SCHEME |
  ------------------
  |  |   97|  26.8k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
 1383|  26.8k|                                            CURLU_DEFAULT_SCHEME));
  ------------------
  |  |   89|  26.8k|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
 1384|       |
 1385|       |  /* handle the file: scheme */
 1386|  26.8k|  if(schemelen == 4 && schemebuf[0] == 'f' && !memcmp(schemebuf, "file", 4)) {
  ------------------
  |  Branch (1386:6): [True: 7.29k, False: 19.5k]
  |  Branch (1386:24): [True: 0, False: 7.29k]
  |  Branch (1386:47): [True: 0, False: 0]
  ------------------
 1387|      0|    is_file = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1388|      0|    ures = parse_file(url, urllen, u, &path, &pathlen);
 1389|      0|  }
 1390|  26.8k|  else {
 1391|  26.8k|    const char *hostp = NULL;
 1392|  26.8k|    size_t hostlen;
 1393|  26.8k|    ures = parse_scheme(url, u, schemebuf, schemelen, flags, &hostp);
 1394|  26.8k|    if(ures)
  ------------------
  |  Branch (1394:8): [True: 29, False: 26.7k]
  ------------------
 1395|     29|      goto fail;
 1396|       |
 1397|       |    /* find the end of the hostname + port number */
 1398|  26.7k|    hostlen = strcspn(hostp, "/?#");
 1399|  26.7k|    path = hostp + hostlen;
 1400|       |
 1401|       |    /* this pathlen also contains the query and the fragment */
 1402|  26.7k|    pathlen = urllen - (path - url);
 1403|  26.7k|    if(hostlen) {
  ------------------
  |  Branch (1403:8): [True: 26.7k, False: 0]
  ------------------
 1404|  26.7k|      ures = parse_authority(u, hostp, hostlen, flags, &host, !!u->scheme);
 1405|  26.7k|      if(!ures && (flags & CURLU_GUESS_SCHEME) && !u->scheme)
  ------------------
  |  |   97|  26.7k|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
  |  Branch (1405:10): [True: 26.7k, False: 33]
  |  Branch (1405:19): [True: 16.9k, False: 9.82k]
  |  Branch (1405:51): [True: 0, False: 16.9k]
  ------------------
 1406|      0|        ures = guess_scheme(u, &host);
 1407|  26.7k|    }
 1408|      0|    else if(flags & CURLU_NO_AUTHORITY) {
  ------------------
  |  |   98|      0|#define CURLU_NO_AUTHORITY (1 << 10)      /* Allow empty authority when the
  ------------------
  |  Branch (1408:13): [True: 0, False: 0]
  ------------------
 1409|       |      /* allowed to be empty. */
 1410|      0|      if(curlx_dyn_add(&host, ""))
  ------------------
  |  Branch (1410:10): [True: 0, False: 0]
  ------------------
 1411|      0|        ures = CURLUE_OUT_OF_MEMORY;
 1412|      0|    }
 1413|      0|    else
 1414|      0|      ures = CURLUE_NO_HOST;
 1415|  26.7k|  }
 1416|  26.7k|  if(!ures) {
  ------------------
  |  Branch (1416:6): [True: 26.7k, False: 33]
  ------------------
 1417|  26.7k|    const char *fragment;
 1418|  26.7k|    if(pathlen && !(flags & CURLU_URLENCODE) &&
  ------------------
  |  |   95|  19.4k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1418:8): [True: 19.4k, False: 7.29k]
  |  Branch (1418:19): [True: 19.4k, False: 0]
  ------------------
 1419|  19.4k|       !badoctets(path, pathlen, flags))
  ------------------
  |  Branch (1419:8): [True: 19.1k, False: 342]
  ------------------
 1420|       |      /* there is a bad octet in there, but we do not know in which component
 1421|       |         so we just set the boolean for now */
 1422|  19.1k|      badoctets_clean = TRUE;
  ------------------
  |  |  986|  19.1k|#define TRUE true
  ------------------
 1423|       |
 1424|       |    /* The path might at this point contain a fragment and/or a query to
 1425|       |       handle */
 1426|  26.7k|    fragment = memchr(path, '#', pathlen);
 1427|  26.7k|    if(fragment) {
  ------------------
  |  Branch (1427:8): [True: 2.39k, False: 24.3k]
  ------------------
 1428|  2.39k|      size_t fraglen = pathlen - (fragment - path);
 1429|  2.39k|      ures = handle_fragment(u, fragment, fraglen, flags, badoctets_clean);
 1430|       |      /* after this, pathlen still contains the query */
 1431|  2.39k|      pathlen -= fraglen;
 1432|  2.39k|    }
 1433|  26.7k|  }
 1434|  26.7k|  if(!ures) {
  ------------------
  |  Branch (1434:6): [True: 26.6k, False: 106]
  ------------------
 1435|  26.6k|    const char *query = memchr(path, '?', pathlen);
 1436|  26.6k|    if(query) {
  ------------------
  |  Branch (1436:8): [True: 195, False: 26.4k]
  ------------------
 1437|    195|      size_t qlen = pathlen - (query - path);
 1438|    195|      ures = handle_query(u, query, qlen, flags, badoctets_clean);
 1439|    195|      pathlen -= qlen;
 1440|    195|    }
 1441|  26.6k|  }
 1442|  26.7k|  if(!ures)
  ------------------
  |  Branch (1442:6): [True: 26.5k, False: 195]
  ------------------
 1443|       |    /* the fragment and query parts are trimmed off from the path */
 1444|  26.5k|    ures = handle_path(u, path, pathlen, flags, is_file, badoctets_clean);
 1445|  26.7k|  if(!ures) {
  ------------------
  |  Branch (1445:6): [True: 26.4k, False: 392]
  ------------------
 1446|  26.4k|    u->host = curlx_dyn_ptr(&host);
 1447|  26.4k|    return CURLUE_OK;
 1448|  26.4k|  }
 1449|    421|fail:
 1450|    421|  curlx_dyn_free(&host);
 1451|    421|  free_urlhandle(u);
 1452|    421|  return ures;
 1453|  26.7k|}
urlapi.c:parse_scheme:
 1168|  26.8k|{
 1169|       |  /* clear path */
 1170|  26.8k|  const char *schemep = NULL;
 1171|       |
 1172|  26.8k|  if(schemelen) {
  ------------------
  |  Branch (1172:6): [True: 26.8k, False: 0]
  ------------------
 1173|  26.8k|    int num_slashes = 0;
 1174|  26.8k|    const char *p = &url[schemelen + 1];
 1175|  26.8k|    if(!(flags & CURLU_NON_SUPPORT_SCHEME) &&
  ------------------
  |  |   91|  26.8k|#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */
  ------------------
  |  Branch (1175:8): [True: 0, False: 26.8k]
  ------------------
 1176|      0|       !Curl_getn_scheme(schemebuf, schemelen))
  ------------------
  |  Branch (1176:8): [True: 0, False: 0]
  ------------------
 1177|      0|      return CURLUE_UNSUPPORTED_SCHEME;
 1178|       |
 1179|  26.8k|    if(!ISSLASH(*p))
  ------------------
  |  |  912|  26.8k|#define ISSLASH(x) ((x) == '/')
  ------------------
  |  Branch (1179:8): [True: 0, False: 26.8k]
  ------------------
 1180|       |      /* less than one */
 1181|      0|      return CURLUE_BAD_SLASHES;
 1182|  26.8k|    if(p[0] == '/' && p[1] == '/' && p[2] != '/') {
  ------------------
  |  Branch (1182:8): [True: 26.8k, False: 0]
  |  Branch (1182:23): [True: 26.8k, False: 0]
  |  Branch (1182:38): [True: 26.8k, False: 0]
  ------------------
 1183|  26.8k|      p += 2;
 1184|  26.8k|    }
 1185|      0|    else if((flags & CURLU_NO_AUTHORITY)) {
  ------------------
  |  |   98|      0|#define CURLU_NO_AUTHORITY (1 << 10)      /* Allow empty authority when the
  ------------------
  |  Branch (1185:13): [True: 0, False: 0]
  ------------------
 1186|      0|      while(ISSLASH(*p) && (num_slashes < 2)) {
  ------------------
  |  |  912|      0|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (912:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1186:28): [True: 0, False: 0]
  ------------------
 1187|      0|        p++;
 1188|      0|        num_slashes++;
 1189|      0|      }
 1190|      0|    }
 1191|      0|    else {
 1192|      0|      while(ISSLASH(*p) && (num_slashes < 4)) {
  ------------------
  |  |  912|      0|#define ISSLASH(x) ((x) == '/')
  |  |  ------------------
  |  |  |  Branch (912:20): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1192:28): [True: 0, False: 0]
  ------------------
 1193|      0|        p++;
 1194|      0|        num_slashes++;
 1195|      0|      }
 1196|      0|      if(num_slashes > 3)
  ------------------
  |  Branch (1196:10): [True: 0, False: 0]
  ------------------
 1197|      0|        return CURLUE_BAD_SLASHES;
 1198|      0|    }
 1199|       |
 1200|  26.8k|    schemep = schemebuf;
 1201|  26.8k|    *hostpp = p; /* hostname starts here */
 1202|  26.8k|  }
 1203|      0|  else {
 1204|       |    /* no scheme! */
 1205|       |
 1206|      0|    if(!(flags & (CURLU_DEFAULT_SCHEME | CURLU_GUESS_SCHEME)))
  ------------------
  |  |   89|      0|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
                  if(!(flags & (CURLU_DEFAULT_SCHEME | CURLU_GUESS_SCHEME)))
  ------------------
  |  |   97|      0|#define CURLU_GUESS_SCHEME (1 << 9)       /* legacy curl-style guessing */
  ------------------
  |  Branch (1206:8): [True: 0, False: 0]
  ------------------
 1207|      0|      return CURLUE_BAD_SCHEME;
 1208|       |
 1209|      0|    if(flags & CURLU_DEFAULT_SCHEME)
  ------------------
  |  |   89|      0|#define CURLU_DEFAULT_SCHEME (1 << 2)     /* return default scheme if
  ------------------
  |  Branch (1209:8): [True: 0, False: 0]
  ------------------
 1210|      0|      schemep = DEFAULT_SCHEME;
  ------------------
  |  |   67|      0|#define DEFAULT_SCHEME "https"
  ------------------
 1211|       |
 1212|       |    /*
 1213|       |     * The URL was badly formatted, let's try without scheme specified.
 1214|       |     */
 1215|      0|    *hostpp = url;
 1216|      0|  }
 1217|       |
 1218|  26.8k|  if(schemep) {
  ------------------
  |  Branch (1218:6): [True: 26.8k, False: 0]
  ------------------
 1219|  26.8k|    u->scheme = curlx_strdup(schemep);
  ------------------
  |  | 1497|  26.8k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1220|  26.8k|    if(!u->scheme)
  ------------------
  |  Branch (1220:8): [True: 29, False: 26.7k]
  ------------------
 1221|     29|      return CURLUE_OUT_OF_MEMORY;
 1222|  26.8k|  }
 1223|  26.7k|  return CURLUE_OK;
 1224|  26.8k|}
urlapi.c:handle_fragment:
 1257|  2.39k|{
 1258|  2.39k|  CURLUcode ures;
 1259|  2.39k|  u->fragment_present = TRUE;
  ------------------
  |  |  986|  2.39k|#define TRUE true
  ------------------
 1260|  2.39k|  if(fraglen > 1) {
  ------------------
  |  Branch (1260:6): [True: 122, False: 2.27k]
  ------------------
 1261|       |    /* skip the leading '#' in the copy but include the null-terminator */
 1262|    122|    if(flags & CURLU_URLENCODE) {
  ------------------
  |  |   95|    122|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1262:8): [True: 0, False: 122]
  ------------------
 1263|      0|      struct dynbuf enc;
 1264|      0|      curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|      0|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1265|      0|      ures = urlencode_str(&enc, fragment + 1, fraglen - 1, TRUE, QUERY_NO);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
                    ures = urlencode_str(&enc, fragment + 1, fraglen - 1, TRUE, QUERY_NO);
  ------------------
  |  |   52|      0|#define QUERY_NO      2
  ------------------
 1266|      0|      if(ures)
  ------------------
  |  Branch (1266:10): [True: 0, False: 0]
  ------------------
 1267|      0|        return ures;
 1268|      0|      u->fragment = curlx_dyn_ptr(&enc);
 1269|      0|    }
 1270|    122|    else {
 1271|    122|      if(!badoctets_clean && badoctets(fragment, fraglen, flags))
  ------------------
  |  Branch (1271:10): [True: 81, False: 41]
  |  Branch (1271:30): [True: 70, False: 11]
  ------------------
 1272|     70|        return CURLUE_BAD_FRAGMENT;
 1273|     52|      u->fragment = curlx_memdup0(fragment + 1, fraglen - 1);
 1274|     52|      if(!u->fragment)
  ------------------
  |  Branch (1274:10): [True: 3, False: 49]
  ------------------
 1275|      3|        return CURLUE_OUT_OF_MEMORY;
 1276|     52|    }
 1277|    122|  }
 1278|  2.32k|  return CURLUE_OK;
 1279|  2.39k|}
urlapi.c:handle_query:
 1284|    195|{
 1285|    195|  u->query_present = TRUE;
  ------------------
  |  |  986|    195|#define TRUE true
  ------------------
 1286|    195|  if(qlen > 1) {
  ------------------
  |  Branch (1286:6): [True: 137, False: 58]
  ------------------
 1287|    137|    if(flags & CURLU_URLENCODE) {
  ------------------
  |  |   95|    137|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1287:8): [True: 0, False: 137]
  ------------------
 1288|      0|      struct dynbuf enc;
 1289|      0|      CURLUcode ures;
 1290|      0|      curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|      0|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1291|       |      /* skip the leading question mark */
 1292|      0|      ures = urlencode_str(&enc, query + 1, qlen - 1, TRUE, QUERY_YES);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
                    ures = urlencode_str(&enc, query + 1, qlen - 1, TRUE, QUERY_YES);
  ------------------
  |  |   54|      0|#define QUERY_YES     4
  ------------------
 1293|      0|      if(ures)
  ------------------
  |  Branch (1293:10): [True: 0, False: 0]
  ------------------
 1294|      0|        return ures;
 1295|      0|      u->query = curlx_dyn_ptr(&enc);
 1296|      0|    }
 1297|    137|    else {
 1298|    137|      if(!badoctets_clean && badoctets(query, qlen, flags))
  ------------------
  |  Branch (1298:10): [True: 108, False: 29]
  |  Branch (1298:30): [True: 83, False: 25]
  ------------------
 1299|     83|        return CURLUE_BAD_QUERY;
 1300|       |
 1301|     54|      u->query = curlx_memdup0(query + 1, qlen - 1);
 1302|     54|      if(!u->query)
  ------------------
  |  Branch (1302:10): [True: 3, False: 51]
  ------------------
 1303|      3|        return CURLUE_OUT_OF_MEMORY;
 1304|     54|    }
 1305|    137|  }
 1306|     58|  else {
 1307|       |    /* single byte query */
 1308|     58|    u->query = curlx_strdup("");
  ------------------
  |  | 1497|     58|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 1309|     58|    if(!u->query)
  ------------------
  |  Branch (1309:8): [True: 3, False: 55]
  ------------------
 1310|      3|      return CURLUE_OUT_OF_MEMORY;
 1311|     58|  }
 1312|    106|  return CURLUE_OK;
 1313|    195|}
urlapi.c:handle_path:
 1319|  26.5k|{
 1320|  26.5k|  CURLUcode ures;
 1321|  26.5k|  if(pathlen && (flags & CURLU_URLENCODE)) {
  ------------------
  |  |   95|  18.1k|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1321:6): [True: 18.1k, False: 8.49k]
  |  Branch (1321:17): [True: 0, False: 18.1k]
  ------------------
 1322|      0|    struct dynbuf enc;
 1323|      0|    curlx_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
  ------------------
  |  |   45|      0|#define CURL_MAX_INPUT_LENGTH 8000000
  ------------------
 1324|      0|    ures = urlencode_str(&enc, path, pathlen, TRUE, QUERY_NO);
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
                  ures = urlencode_str(&enc, path, pathlen, TRUE, QUERY_NO);
  ------------------
  |  |   52|      0|#define QUERY_NO      2
  ------------------
 1325|      0|    if(ures)
  ------------------
  |  Branch (1325:8): [True: 0, False: 0]
  ------------------
 1326|      0|      return ures;
 1327|      0|    pathlen = curlx_dyn_len(&enc);
 1328|      0|    path = u->path = curlx_dyn_ptr(&enc);
 1329|      0|  }
 1330|       |
 1331|  26.5k|  if(pathlen >= (size_t)(1 + !is_file)) {
  ------------------
  |  Branch (1331:6): [True: 1.37k, False: 25.2k]
  ------------------
 1332|  1.37k|    if(!badoctets_clean && badoctets(path, pathlen, flags))
  ------------------
  |  Branch (1332:8): [True: 188, False: 1.18k]
  |  Branch (1332:28): [True: 188, False: 0]
  ------------------
 1333|    188|      return CURLUE_BAD_PATH;
 1334|       |
 1335|       |    /* paths for file:// scheme can be one byte, others need to be two */
 1336|  1.18k|    if(!u->path) {
  ------------------
  |  Branch (1336:8): [True: 1.18k, False: 0]
  ------------------
 1337|  1.18k|      u->path = curlx_memdup0(path, pathlen);
 1338|  1.18k|      if(!u->path)
  ------------------
  |  Branch (1338:10): [True: 8, False: 1.17k]
  ------------------
 1339|      8|        return CURLUE_OUT_OF_MEMORY;
 1340|  1.17k|      path = u->path;
 1341|  1.17k|    }
 1342|      0|    else if(flags & CURLU_URLENCODE)
  ------------------
  |  |   95|      0|#define CURLU_URLENCODE (1 << 7)          /* URL encode on set */
  ------------------
  |  Branch (1342:13): [True: 0, False: 0]
  ------------------
 1343|       |      /* it might have encoded more than the path so cut it */
 1344|      0|      u->path[pathlen] = 0;
 1345|       |
 1346|  1.17k|    if(!(flags & CURLU_PATH_AS_IS)) {
  ------------------
  |  |   92|  1.17k|#define CURLU_PATH_AS_IS (1 << 4)         /* leave dot sequences */
  ------------------
  |  Branch (1346:8): [True: 1.16k, False: 9]
  ------------------
 1347|       |      /* remove ../ and ./ sequences according to RFC3986 */
 1348|  1.16k|      char *dedot;
 1349|  1.16k|      int err = dedotdotify(path, pathlen, &dedot);
 1350|  1.16k|      if(err)
  ------------------
  |  Branch (1350:10): [True: 1, False: 1.16k]
  ------------------
 1351|      1|        return CURLUE_OUT_OF_MEMORY;
 1352|  1.16k|      if(dedot) {
  ------------------
  |  Branch (1352:10): [True: 510, False: 658]
  ------------------
 1353|    510|        curlx_free(u->path);
  ------------------
  |  | 1503|    510|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1354|    510|        u->path = dedot;
 1355|    510|      }
 1356|  1.16k|    }
 1357|  1.17k|  }
 1358|  26.4k|  return CURLUE_OK;
 1359|  26.5k|}

Curl_auth_digest_cleanup:
 1138|  64.3k|{
 1139|  64.3k|  Curl_peer_unlink(&digest->origin);
 1140|  64.3k|  Curl_creds_unlink(&digest->creds);
 1141|  64.3k|  curlx_safefree(digest->nonce);
  ------------------
  |  | 1359|  64.3k|  do {                      \
  |  | 1360|  64.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  64.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  64.3k|    (ptr) = NULL;           \
  |  | 1362|  64.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 64.3k]
  |  |  ------------------
  ------------------
 1142|  64.3k|  curlx_safefree(digest->cnonce);
  ------------------
  |  | 1359|  64.3k|  do {                      \
  |  | 1360|  64.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  64.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  64.3k|    (ptr) = NULL;           \
  |  | 1362|  64.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 64.3k]
  |  |  ------------------
  ------------------
 1143|  64.3k|  curlx_safefree(digest->realm);
  ------------------
  |  | 1359|  64.3k|  do {                      \
  |  | 1360|  64.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  64.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  64.3k|    (ptr) = NULL;           \
  |  | 1362|  64.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 64.3k]
  |  |  ------------------
  ------------------
 1144|  64.3k|  curlx_safefree(digest->opaque);
  ------------------
  |  | 1359|  64.3k|  do {                      \
  |  | 1360|  64.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  64.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  64.3k|    (ptr) = NULL;           \
  |  | 1362|  64.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 64.3k]
  |  |  ------------------
  ------------------
 1145|  64.3k|  curlx_safefree(digest->qop);
  ------------------
  |  | 1359|  64.3k|  do {                      \
  |  | 1360|  64.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  64.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  64.3k|    (ptr) = NULL;           \
  |  | 1362|  64.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 64.3k]
  |  |  ------------------
  ------------------
 1146|  64.3k|  curlx_safefree(digest->algorithm);
  ------------------
  |  | 1359|  64.3k|  do {                      \
  |  | 1360|  64.3k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  64.3k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  64.3k|    (ptr) = NULL;           \
  |  | 1362|  64.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 64.3k]
  |  |  ------------------
  ------------------
 1147|       |
 1148|  64.3k|  digest->nc = 0;
 1149|  64.3k|  digest->algo = ALGO_MD5; /* default algorithm */
  ------------------
  |  |   47|  64.3k|#define ALGO_MD5 0
  ------------------
 1150|  64.3k|  digest->stale = FALSE;   /* default means normal, not stale */
  ------------------
  |  |  989|  64.3k|#define FALSE false
  ------------------
 1151|       |  digest->userhash = FALSE;
  ------------------
  |  |  989|  64.3k|#define FALSE false
  ------------------
 1152|  64.3k|}

Curl_auth_allowed_to_host:
  141|     24|{
  142|     24|  return Curl_auth_allowed_to_origin(data, data->state.origin);
  143|     24|}
Curl_auth_allowed_to_origin:
  147|    264|{
  148|    264|  return data->set.allow_auth_to_other_hosts ||
  ------------------
  |  Branch (148:10): [True: 8, False: 256]
  ------------------
  149|    256|         Curl_peer_equal(data->state.initial_origin, origin);
  ------------------
  |  Branch (149:10): [True: 256, False: 0]
  ------------------
  150|    264|}

Curl_async_timeleft_ms:
   62|  20.5k|{
   63|  20.5k|  if(async->timeout_ms) {
  ------------------
  |  Branch (63:6): [True: 20.5k, False: 0]
  ------------------
   64|  20.5k|    timediff_t elapsed_ms =
   65|  20.5k|      curlx_ptimediff_ms(Curl_pgrs_now(data), &async->start);
   66|  20.5k|    return async->timeout_ms - elapsed_ms;
   67|  20.5k|  }
   68|      0|  return Curl_timeleft_ms(data);
   69|  20.5k|}
Curl_async_shutdown:
  212|  1.81k|{
  213|  1.81k|  if(async) {
  ------------------
  |  Branch (213:6): [True: 1.81k, False: 0]
  ------------------
  214|  1.81k|    CURL_TRC_DNS(data, "[%u] shutdown async", async->id);
  ------------------
  |  |  168|  1.81k|  do {                                 \
  |  |  169|  1.81k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  1.81k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  1.81k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  3.62k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 1.81k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 309, False: 1.50k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  3.62k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 309, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    309|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  1.81k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    309|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 70, False: 239]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  1.81k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  1.81k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 1.81k]
  |  |  ------------------
  ------------------
  215|  1.81k|    async->shutdown = TRUE;
  ------------------
  |  |  986|  1.81k|#define TRUE true
  ------------------
  216|       |#ifdef USE_RESOLV_ARES
  217|       |    Curl_async_ares_shutdown(data, async);
  218|       |#endif
  219|  1.81k|#ifdef USE_RESOLV_THREADED
  220|  1.81k|    Curl_async_thrdd_shutdown(data, async);
  221|  1.81k|#endif
  222|  1.81k|#ifndef CURL_DISABLE_DOH
  223|  1.81k|    Curl_doh_cleanup(data, async);
  224|  1.81k|#endif
  225|  1.81k|  }
  226|  1.81k|}
Curl_async_destroy:
  230|  1.82k|{
  231|  1.82k|  if(async) {
  ------------------
  |  Branch (231:6): [True: 1.82k, False: 0]
  ------------------
  232|  1.82k|    CURL_TRC_DNS(data, "[%u] destroy async", async->id);
  ------------------
  |  |  168|  1.82k|  do {                                 \
  |  |  169|  1.82k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  1.82k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  1.82k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  3.65k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 1.82k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 313, False: 1.51k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  3.65k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 313, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    313|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  1.82k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    313|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 73, False: 240]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  1.82k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  1.82k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 1.82k]
  |  |  ------------------
  ------------------
  233|  1.82k|    async->shutdown = TRUE;
  ------------------
  |  |  986|  1.82k|#define TRUE true
  ------------------
  234|       |#ifdef USE_RESOLV_ARES
  235|       |    Curl_async_ares_destroy(data, async);
  236|       |#endif
  237|  1.82k|#ifdef USE_RESOLV_THREADED
  238|  1.82k|    Curl_async_thrdd_destroy(data, async);
  239|  1.82k|#endif
  240|  1.82k|#ifndef CURL_DISABLE_DOH
  241|  1.82k|    Curl_doh_cleanup(data, async);
  242|  1.82k|#endif
  243|  1.82k|    if(async->ai_A)
  ------------------
  |  Branch (243:8): [True: 0, False: 1.82k]
  ------------------
  244|      0|      Curl_freeaddrinfo(async->ai_A);
  245|  1.82k|    if(async->ai_AAAA)
  ------------------
  |  Branch (245:8): [True: 0, False: 1.82k]
  ------------------
  246|      0|      Curl_freeaddrinfo(async->ai_AAAA);
  247|  1.82k|#ifdef USE_HTTPSRR
  248|  1.82k|    Curl_httpsrr_destroy(async->httpsrr);
  249|  1.82k|#endif
  250|  1.82k|    Curl_peer_unlink(&async->peer);
  251|       |    curlx_safefree(async);
  ------------------
  |  | 1359|  1.82k|  do {                      \
  |  | 1360|  1.82k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.82k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.82k|    (ptr) = NULL;           \
  |  | 1362|  1.82k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.82k]
  |  |  ------------------
  ------------------
  252|  1.82k|  }
  253|  1.82k|}
Curl_async_failed:
  258|  3.56k|{
  259|  3.56k|  const char *host_or_proxy = "host";
  260|  3.56k|  CURLcode result = CURLE_COULDNT_RESOLVE_HOST;
  261|       |
  262|  3.56k|#ifndef CURL_DISABLE_PROXY
  263|  3.56k|  if(async->for_proxy) {
  ------------------
  |  Branch (263:6): [True: 0, False: 3.56k]
  ------------------
  264|      0|    host_or_proxy = "proxy";
  265|      0|    result = CURLE_COULDNT_RESOLVE_PROXY;
  266|      0|  }
  267|  3.56k|#endif
  268|       |
  269|  3.56k|  if(async->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
  ------------------
  |  |   51|  3.56k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                if(async->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
  ------------------
  |  |   52|  3.56k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (269:6): [True: 136, False: 3.42k]
  ------------------
  270|    136|    failf(data, "Could not resolve %s: %s%s%s%s",
  ------------------
  |  |   62|    136|#define failf Curl_failf
  ------------------
  271|    136|          host_or_proxy, async->peer->hostname,
  272|    136|          detail ? " (" : "", detail ? detail : "", detail ? ")" : "");
  ------------------
  |  Branch (272:11): [True: 0, False: 136]
  |  Branch (272:31): [True: 0, False: 136]
  |  Branch (272:53): [True: 0, False: 136]
  ------------------
  273|  3.56k|  return result;
  274|  3.56k|}

Curl_async_global_init:
   81|      2|{
   82|       |#if defined(USE_ARES) && defined(CARES_HAVE_ARES_LIBRARY_INIT)
   83|       |  if(ares_library_init(ARES_LIB_INIT_ALL)) {
   84|       |    return CURLE_FAILED_INIT;
   85|       |  }
   86|       |#endif
   87|      2|  return CURLE_OK;
   88|      2|}
Curl_async_thrdd_shutdown:
  274|  3.59k|{
  275|  3.59k|  Curl_async_thrdd_destroy(data, async);
  276|  3.59k|}
Curl_async_thrdd_destroy:
  292|  5.41k|{
  293|  5.41k|  (void)data;
  294|  5.41k|  if(async->queries_ongoing && !async->done &&
  ------------------
  |  Branch (294:6): [True: 72, False: 5.34k]
  |  Branch (294:32): [True: 72, False: 0]
  ------------------
  295|     72|     data->multi && data->multi->resolv_thrdq) {
  ------------------
  |  Branch (295:6): [True: 43, False: 29]
  |  Branch (295:21): [True: 43, False: 0]
  ------------------
  296|       |    /* Remove any resolve items still queued */
  297|     43|    struct async_thrdd_match_ctx mctx;
  298|     43|    mctx.mid = data->mid;
  299|     43|    mctx.resolv_id = async->id;
  300|     43|    Curl_thrdq_clear(data->multi->resolv_thrdq,
  301|     43|                     async_thrdd_match_item, &mctx);
  302|     43|  }
  303|       |#ifdef USE_HTTPSRR_ARES
  304|       |  if(async->thrdd.rr.channel) {
  305|       |    ares_destroy(async->thrdd.rr.channel);
  306|       |    async->thrdd.rr.channel = NULL;
  307|       |  }
  308|       |#endif
  309|  5.41k|  async_thrdd_item_destroy(async->thrdd.res_A);
  310|  5.41k|  async->thrdd.res_A = NULL;
  311|  5.41k|  async_thrdd_item_destroy(async->thrdd.res_AAAA);
  312|       |  async->thrdd.res_AAAA = NULL;
  313|  5.41k|}
Curl_async_thrdd_multi_init:
  486|  9.77k|{
  487|  9.77k|  CURLcode result;
  488|  9.77k|  DEBUGASSERT(!multi->resolv_thrdq);
  ------------------
  |  | 1016|  9.77k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (488:3): [True: 0, False: 9.77k]
  |  Branch (488:3): [True: 9.77k, False: 0]
  ------------------
  489|  9.77k|  result = Curl_thrdq_create(&multi->resolv_thrdq, "DNS",
  490|  9.77k|                             min_threads, max_threads, idle_time_ms,
  491|  9.77k|                             async_thrdd_item_free,
  492|  9.77k|                             async_thrdd_item_process,
  493|  9.77k|                             async_thrdd_event,
  494|  9.77k|                             multi);
  495|  9.77k|#ifdef DEBUGBUILD
  496|  9.77k|  if(!result) {
  ------------------
  |  Branch (496:6): [True: 9.76k, False: 16]
  ------------------
  497|  9.76k|    const char *p = getenv("CURL_DBG_RESOLV_MAX_THREADS");
  498|  9.76k|    if(p) {
  ------------------
  |  Branch (498:8): [True: 0, False: 9.76k]
  ------------------
  499|      0|      curl_off_t l;
  500|      0|      if(!curlx_str_number(&p, &l, UINT32_MAX)) {
  ------------------
  |  Branch (500:10): [True: 0, False: 0]
  ------------------
  501|      0|        result = Curl_async_thrdd_multi_set_props(
  502|      0|          multi, min_threads, (uint32_t)l, idle_time_ms);
  503|      0|      }
  504|      0|    }
  505|  9.76k|  }
  506|  9.77k|#endif
  507|  9.77k|  return result;
  508|  9.77k|}
Curl_async_thrdd_multi_destroy:
  512|  9.82k|{
  513|  9.82k|  if(multi->resolv_thrdq) {
  ------------------
  |  Branch (513:6): [True: 9.76k, False: 68]
  ------------------
  514|  9.76k|#ifdef CURLVERBOSE
  515|  9.76k|    CURL_TRC_DNS(multi->admin, "destroy thread queue+pool, join=%d", join);
  ------------------
  |  |  168|  9.76k|  do {                                 \
  |  |  169|  9.76k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  9.76k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.76k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  19.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.76k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 9.76k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  19.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.76k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  9.76k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
  516|  9.76k|    CURL_THRDQ_TRACE(multi->resolv_thrdq, multi->admin);
  ------------------
  |  |  124|  9.76k|  do { \
  |  |  125|  9.76k|    if(Curl_trc_ft_is_verbose(d, &Curl_trc_feat_threads)) \
  |  |  ------------------
  |  |  |  |  329|  9.76k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  19.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.76k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 9.76k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  19.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  9.76k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  126|  9.76k|      Curl_thrdq_trace(t, d); \
  |  |  127|  9.76k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (127:11): [Folded, False: 9.76k]
  |  |  ------------------
  ------------------
  517|  9.76k|#endif
  518|  9.76k|    Curl_thrdq_destroy(multi->resolv_thrdq, join);
  519|       |    multi->resolv_thrdq = NULL;
  520|  9.76k|  }
  521|  9.82k|}
Curl_async_thrdd_multi_process:
  568|   122k|{
  569|   122k|  struct Curl_easy *data;
  570|   122k|  void *qitem;
  571|       |
  572|   122k|  while(!Curl_thrdq_recv(multi->resolv_thrdq, &qitem)) {
  ------------------
  |  Branch (572:9): [True: 150, False: 122k]
  ------------------
  573|       |    /* dispatch resolve result */
  574|    150|    struct async_thrdd_item *item = qitem;
  575|    150|    struct Curl_resolv_async *async = NULL;
  576|       |
  577|    150|    data = Curl_multi_get_easy(multi, item->mid);
  578|    150|    if(data)
  ------------------
  |  Branch (578:8): [True: 150, False: 0]
  ------------------
  579|    150|      async = Curl_async_get(data, item->resolv_id);
  580|    150|    if(async) {
  ------------------
  |  Branch (580:8): [True: 150, False: 0]
  ------------------
  581|    150|      struct async_thrdd_item **pdest = &async->thrdd.res_A;
  582|       |
  583|    150|#ifdef CURLRES_IPV6
  584|    150|      if(item->dns_queries & CURL_DNSQ_AAAA)
  ------------------
  |  |   52|    150|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (584:10): [True: 76, False: 74]
  ------------------
  585|     76|        pdest = &async->thrdd.res_AAAA;
  586|    150|#endif
  587|    150|      if(!*pdest) {
  ------------------
  |  Branch (587:10): [True: 150, False: 0]
  ------------------
  588|    150|        *pdest = item;
  589|    150|        item = NULL;
  590|    150|      }
  591|      0|      else
  592|    150|        DEBUGASSERT(0); /* should not receive duplicates here */
  ------------------
  |  | 1016|    150|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (592:9): [Folded, False: 0]
  |  Branch (592:9): [Folded, False: 0]
  ------------------
  593|       |
  594|    150|      --async->queries_ongoing;
  595|    150|      Curl_multi_mark_dirty(data);
  596|    150|    }
  597|    150|    async_thrdd_item_free(item);
  598|    150|  }
  599|   122k|  CURL_THRDQ_TRACE(multi->resolv_thrdq, multi->admin);
  ------------------
  |  |  124|   122k|  do { \
  |  |  125|   122k|    if(Curl_trc_ft_is_verbose(d, &Curl_trc_feat_threads)) \
  |  |  ------------------
  |  |  |  |  329|   122k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|   245k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 122k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 122k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   245k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|   122k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  126|   122k|      Curl_thrdq_trace(t, d); \
  |  |  127|   122k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (127:11): [Folded, False: 122k]
  |  |  ------------------
  ------------------
  600|   122k|}
Curl_async_getaddrinfo:
  641|  1.82k|{
  642|  1.82k|  CURLcode result = CURLE_FAILED_INIT;
  643|  1.82k|  void *resolver = NULL;
  644|       |
  645|  1.82k|  if(async->queries_ongoing || async->done)
  ------------------
  |  Branch (645:6): [True: 0, False: 1.82k]
  |  Branch (645:32): [True: 0, False: 1.82k]
  ------------------
  646|      0|    return CURLE_FAILED_INIT;
  647|       |
  648|       |#ifdef USE_HTTPSRR_ARES
  649|       |  DEBUGASSERT(!async->thrdd.rr.channel);
  650|       |  if((async->dns_queries & CURL_DNSQ_HTTPS) && !async->is_ipaddr) {
  651|       |    result = async_rr_init(data, async);
  652|       |    if(result)
  653|       |      goto out;
  654|       |    resolver = async->thrdd.rr.channel;
  655|       |  }
  656|       |#endif
  657|       |
  658|  1.82k|  result = Curl_resolv_announce_start(data, resolver);
  659|  1.82k|  if(result)
  ------------------
  |  Branch (659:6): [True: 0, False: 1.82k]
  ------------------
  660|      0|    return result;
  661|       |
  662|       |#ifdef USE_HTTPSRR_ARES
  663|       |  if(resolver) {
  664|       |    result = async_rr_start(data, async);
  665|       |    if(result)
  666|       |      goto out;
  667|       |  }
  668|       |#endif
  669|       |
  670|  1.82k|#ifdef CURLRES_IPV6
  671|       |  /* Do not start an AAAA query for an IPv4 address when
  672|       |   * we will start an A query for it. */
  673|  1.82k|  if((async->dns_queries & CURL_DNSQ_AAAA) &&
  ------------------
  |  |   52|  1.82k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (673:6): [True: 112, False: 1.71k]
  ------------------
  674|    112|     !(async->is_ipv4addr && (async->dns_queries & CURL_DNSQ_A))) {
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (674:8): [True: 0, False: 112]
  |  Branch (674:30): [True: 0, False: 0]
  ------------------
  675|    112|    result = async_thrdd_query(data, async, CURL_DNSQ_AAAA);
  ------------------
  |  |   52|    112|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  676|    112|    if(result)
  ------------------
  |  Branch (676:8): [True: 1, False: 111]
  ------------------
  677|      1|      goto out;
  678|    112|  }
  679|  1.82k|#endif
  680|  1.82k|  if(async->dns_queries & CURL_DNSQ_A) {
  ------------------
  |  |   51|  1.82k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (680:6): [True: 111, False: 1.71k]
  ------------------
  681|    111|    result = async_thrdd_query(data, async, CURL_DNSQ_A);
  ------------------
  |  |   51|    111|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  682|    111|    if(result)
  ------------------
  |  Branch (682:8): [True: 14, False: 97]
  ------------------
  683|     14|      goto out;
  684|    111|  }
  685|       |
  686|  1.81k|  CURL_THRDQ_TRACE(data->multi->resolv_thrdq, data);
  ------------------
  |  |  124|  1.81k|  do { \
  |  |  125|  1.81k|    if(Curl_trc_ft_is_verbose(d, &Curl_trc_feat_threads)) \
  |  |  ------------------
  |  |  |  |  329|  1.81k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.62k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.81k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 309, False: 1.50k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.62k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 309, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    309|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  1.81k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    309|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 70, False: 239]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  126|  1.81k|      Curl_thrdq_trace(t, d); \
  |  |  127|  1.81k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (127:11): [Folded, False: 1.81k]
  |  |  ------------------
  ------------------
  687|       |
  688|  1.82k|out:
  689|  1.82k|  if(!async->queries_ongoing)
  ------------------
  |  Branch (689:6): [True: 1.71k, False: 111]
  ------------------
  690|  1.71k|    async->done = TRUE;
  ------------------
  |  |  986|  1.71k|#define TRUE true
  ------------------
  691|       |
  692|  1.82k|  if(result)
  ------------------
  |  Branch (692:6): [True: 15, False: 1.81k]
  ------------------
  693|     15|    CURL_TRC_DNS(data, "error queueing query %s:%d -> %d",
  ------------------
  |  |  168|     15|  do {                                 \
  |  |  169|     15|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|     15|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|     15|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|     30|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 15, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 4, False: 11]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|     30|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 4, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      4|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|     15|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      4|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 3, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|     15|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|     15|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 15]
  |  |  ------------------
  ------------------
  694|  1.82k|                 async->peer->hostname, async->peer->port, (int)result);
  695|  1.82k|  return result;
  696|  1.81k|}
Curl_async_pollset:
  701|  20.5k|{
  702|  20.5k|  timediff_t timeout_ms;
  703|       |
  704|  20.5k|  timeout_ms = Curl_async_timeleft_ms(data, async);
  705|       |#ifdef USE_HTTPSRR_ARES
  706|       |  if(async->thrdd.rr.channel) {
  707|       |    CURLcode result = Curl_ares_pollset(data, async->thrdd.rr.channel, ps);
  708|       |    if(result)
  709|       |      return result;
  710|       |    timeout_ms = Curl_ares_timeout_ms(data, async, async->thrdd.rr.channel);
  711|       |  }
  712|       |#else
  713|  20.5k|  (void)ps;
  714|  20.5k|#endif
  715|       |
  716|  20.5k|  if(!async->done) {
  ------------------
  |  Branch (716:6): [True: 392, False: 20.1k]
  ------------------
  717|    392|    const struct curltime *pnow = Curl_pgrs_now(data);
  718|       |#ifndef ENABLE_INTERNAL_WAKEUP
  719|       |    timediff_t stutter_ms, elapsed_ms;
  720|       |    elapsed_ms = curlx_ptimediff_ms(pnow, &async->start);
  721|       |    if(elapsed_ms < 3)
  722|       |      stutter_ms = 1;
  723|       |    else if(elapsed_ms <= 50)
  724|       |      stutter_ms = elapsed_ms / 3;
  725|       |    else if(elapsed_ms <= 250)
  726|       |      stutter_ms = 50;
  727|       |    else
  728|       |      stutter_ms = 200;
  729|       |    timeout_ms = CURLMIN(stutter_ms, timeout_ms);
  730|       |#else
  731|    392|    if(async->queries_ongoing &&
  ------------------
  |  Branch (731:8): [True: 392, False: 0]
  ------------------
  732|    392|       !Curl_thrdq_check_started(data->multi->resolv_thrdq)) {
  ------------------
  |  Branch (732:8): [True: 14, False: 378]
  ------------------
  733|       |      /* The queue has items but starting a worker thread to process
  734|       |         them just failed again; expire soon to check once more,
  735|       |         instead of sleeping on the full resolve timeout. */
  736|     14|      CURL_TRC_DNS(data, "resolver thread start failed again, retrying");
  ------------------
  |  |  168|     14|  do {                                 \
  |  |  169|     14|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|     14|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|     14|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|     28|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 14, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 7, False: 7]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|     28|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 7, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      7|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|     14|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      7|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 2, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|     14|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|     14|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 14]
  |  |  ------------------
  ------------------
  737|     14|      timeout_ms = CURLMIN(100, timeout_ms);
  ------------------
  |  | 1315|     14|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 14, False: 0]
  |  |  ------------------
  ------------------
  738|     14|    }
  739|    392|#endif
  740|    392|    Curl_expire_set(data, EXPIRE_ASYNC_NAME, timeout_ms, pnow);
  741|    392|  }
  742|  20.5k|  return CURLE_OK;
  743|  20.5k|}
Curl_async_take_result:
  860|  2.09k|{
  861|  2.09k|  struct async_thrdd_ctx *thrdd = &async->thrdd;
  862|  2.09k|  struct Curl_dns_entry *dns = NULL;
  863|  2.09k|  CURLcode result = CURLE_OK;
  864|       |
  865|  2.09k|  DEBUGASSERT(pdns);
  ------------------
  |  | 1016|  2.09k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (865:3): [True: 0, False: 2.09k]
  |  Branch (865:3): [True: 2.09k, False: 0]
  ------------------
  866|  2.09k|  *pdns = NULL;
  867|       |
  868|       |#ifdef USE_HTTPSRR_ARES
  869|       |  /* best effort, ignore errors */
  870|       |  if(thrdd->rr.channel)
  871|       |    (void)Curl_ares_perform(thrdd->rr.channel, 0);
  872|       |#endif
  873|       |#ifndef ENABLE_INTERNAL_WAKEUP
  874|       |  Curl_async_thrdd_multi_process(data->multi);
  875|       |#endif
  876|       |
  877|  2.09k|  result = async_thrdd_check_done(data, async);
  878|  2.09k|  if(result)
  ------------------
  |  Branch (878:6): [True: 311, False: 1.78k]
  ------------------
  879|    311|    return result;
  880|       |
  881|  1.78k|  Curl_expire_clear(data, EXPIRE_ASYNC_NAME);
  882|       |
  883|       |  /* A failure is an authoritative negative answer, eligible for
  884|       |     negative caching, only when every A/AAAA query performed came
  885|       |     back answering that the name does not exist. A query that
  886|       |     failed transiently or never returned is not an answer. */
  887|  1.78k|  {
  888|  1.78k|    const uint8_t ip_queries =
  889|  1.78k|      async->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   51|  1.78k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                    async->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   52|  1.78k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  890|  1.78k|    bool negative = (async->dns_responses & ip_queries) == ip_queries;
  891|  1.78k|    if(thrdd->res_A && (async->ai_A || !thrdd->res_A->negative))
  ------------------
  |  Branch (891:8): [True: 68, False: 1.71k]
  |  Branch (891:25): [True: 0, False: 68]
  |  Branch (891:40): [True: 0, False: 68]
  ------------------
  892|      0|      negative = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  893|  1.78k|    if(thrdd->res_AAAA && (async->ai_AAAA || !thrdd->res_AAAA->negative))
  ------------------
  |  Branch (893:8): [True: 68, False: 1.71k]
  |  Branch (893:28): [True: 0, False: 68]
  |  Branch (893:46): [True: 0, False: 68]
  ------------------
  894|      0|      negative = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  895|  1.78k|    if(!thrdd->res_A && !thrdd->res_AAAA)
  ------------------
  |  Branch (895:8): [True: 1.71k, False: 68]
  |  Branch (895:25): [True: 1.71k, False: 0]
  ------------------
  896|  1.71k|      negative = FALSE;
  ------------------
  |  |  989|  1.71k|#define FALSE false
  ------------------
  897|  1.78k|    async->negative_answer = negative;
  898|  1.78k|  }
  899|       |
  900|  1.78k|  if(async->result) {
  ------------------
  |  Branch (900:6): [True: 0, False: 1.78k]
  ------------------
  901|      0|    result = async->result;
  902|      0|    goto out;
  903|      0|  }
  904|       |
  905|  1.78k|  if(async->ai_A || async->ai_AAAA) {
  ------------------
  |  Branch (905:6): [True: 0, False: 1.78k]
  |  Branch (905:21): [True: 0, False: 1.78k]
  ------------------
  906|      0|    dns = Curl_dnsc_mk_addr2(
  907|      0|      data, async->dns_queries, &async->ai_A, &async->ai_AAAA, async->peer);
  908|      0|    if(!dns) {
  ------------------
  |  Branch (908:8): [True: 0, False: 0]
  ------------------
  909|      0|      result = CURLE_OUT_OF_MEMORY;
  910|      0|      goto out;
  911|      0|    }
  912|      0|  }
  913|       |
  914|       |#ifdef USE_HTTPSRR_ARES
  915|       |  if(!dns && thrdd->rr.channel) {
  916|       |    Curl_httpsrr_trace(data, async->httpsrr);
  917|       |    dns = Curl_dnsc_mk_https(data, &async->httpsrr, async->peer);
  918|       |    if(!dns) {
  919|       |      result = CURLE_OUT_OF_MEMORY;
  920|       |      goto out;
  921|       |    }
  922|       |  }
  923|       |#endif
  924|       |
  925|  1.78k|  if(dns) {
  ------------------
  |  Branch (925:6): [True: 0, False: 1.78k]
  ------------------
  926|      0|    *pdns = dns;
  927|      0|    dns = NULL;
  928|      0|  }
  929|  1.78k|  CURL_THRDQ_TRACE(data->multi->resolv_thrdq, data);
  ------------------
  |  |  124|  1.78k|  do { \
  |  |  125|  1.78k|    if(Curl_trc_ft_is_verbose(d, &Curl_trc_feat_threads)) \
  |  |  ------------------
  |  |  |  |  329|  1.78k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.56k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.78k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 294, False: 1.48k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.56k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 294, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    294|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  1.78k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    294|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 64, False: 230]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  126|  1.78k|      Curl_thrdq_trace(t, d); \
  |  |  127|  1.78k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (127:11): [Folded, False: 1.78k]
  |  |  ------------------
  ------------------
  930|       |
  931|  1.78k|out:
  932|  1.78k|  Curl_dns_entry_unlink(data, &dns);
  933|  1.78k|  Curl_async_thrdd_shutdown(data, async);
  934|  1.78k|  if(!result && !*pdns)
  ------------------
  |  Branch (934:6): [True: 1.78k, False: 0]
  |  Branch (934:17): [True: 1.78k, False: 0]
  ------------------
  935|  1.78k|    result = Curl_async_failed(data, async, NULL);
  936|  1.78k|  if(result &&
  ------------------
  |  Branch (936:6): [True: 1.78k, False: 0]
  ------------------
  937|  1.78k|     (result != CURLE_COULDNT_RESOLVE_HOST) &&
  ------------------
  |  Branch (937:6): [True: 0, False: 1.78k]
  ------------------
  938|      0|     (result != CURLE_COULDNT_RESOLVE_PROXY)) {
  ------------------
  |  Branch (938:6): [True: 0, False: 0]
  ------------------
  939|      0|    CURL_TRC_DNS(data, "Error %d resolving %s:%d",
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  940|      0|                 (int)result, async->peer->hostname, async->peer->port);
  941|      0|  }
  942|  1.78k|  return result;
  943|  1.78k|}
asyn-thrdd.c:async_thrdd_match_item:
  284|     29|{
  285|     29|  const struct async_thrdd_match_ctx *ctx = match_data;
  286|     29|  struct async_thrdd_item *item = qitem;
  287|     29|  return (item->mid == ctx->mid) && (item->resolv_id == ctx->resolv_id);
  ------------------
  |  Branch (287:10): [True: 29, False: 0]
  |  Branch (287:37): [True: 29, False: 0]
  ------------------
  288|     29|}
asyn-thrdd.c:async_thrdd_item_destroy:
  131|  11.0k|{
  132|  11.0k|  if(item) {
  ------------------
  |  Branch (132:6): [True: 215, False: 10.8k]
  ------------------
  133|    215|    if(item->res)
  ------------------
  |  Branch (133:8): [True: 0, False: 215]
  ------------------
  134|      0|      Curl_freeaddrinfo(item->res);
  135|    215|    curlx_free(item);
  ------------------
  |  | 1503|    215|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  136|    215|  }
  137|  11.0k|}
asyn-thrdd.c:async_thrdd_item_free:
  477|    215|{
  478|    215|  async_thrdd_item_destroy(item);
  479|    215|}
asyn-thrdd.c:async_thrdd_item_process:
  377|    179|{
  378|    179|  struct async_thrdd_item *item = arg;
  379|    179|  struct addrinfo hints;
  380|    179|  char service[12];
  381|    179|  int pf = PF_INET;
  382|    179|  int rc;
  383|       |
  384|    179|#ifdef DEBUGBUILD
  385|    179|  if(item->delay_ms) {
  ------------------
  |  Branch (385:6): [True: 0, False: 179]
  ------------------
  386|      0|    curlx_wait_ms(item->delay_ms);
  387|      0|  }
  388|    179|  if(item->delay_fail_ms) {
  ------------------
  |  Branch (388:6): [True: 0, False: 179]
  ------------------
  389|      0|    curlx_wait_ms(item->delay_fail_ms);
  390|      0|    item->negative = item->dbg_negative;
  391|      0|    return;
  392|      0|  }
  393|    179|#endif
  394|       |
  395|    179|  memset(&hints, 0, sizeof(hints));
  396|    179|#ifdef CURLRES_IPV6
  397|    179|  if(item->dns_queries & CURL_DNSQ_AAAA) {
  ------------------
  |  |   52|    179|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (397:6): [True: 92, False: 87]
  ------------------
  398|     92|    pf = (item->dns_queries & CURL_DNSQ_A) ? PF_UNSPEC : PF_INET6;
  ------------------
  |  |   51|     92|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (398:10): [True: 0, False: 92]
  ------------------
  399|     92|  }
  400|    179|#endif
  401|    179|  hints.ai_family = pf;
  402|    179|  hints.ai_socktype = Curl_socktype_for_transport(item->transport);
  403|    179|  hints.ai_protocol = Curl_protocol_for_transport(item->transport);
  404|       |#ifdef __APPLE__
  405|       |  /* If we leave `ai_flags == 0` then macOS is looking for IPV4MAPPED
  406|       |   * when doing AAAA queries. We do not want this "help". */
  407|       |  hints.ai_flags = AI_ADDRCONFIG;
  408|       |#endif
  409|       |
  410|    179|  curl_msnprintf(service, sizeof(service), "%u", item->port);
  411|    179|#ifdef AI_NUMERICSERV
  412|    179|  hints.ai_flags |= AI_NUMERICSERV;
  413|    179|#endif
  414|       |
  415|    179|  rc = Curl_getaddrinfo_ex(item->hostname, service, &hints, &item->res);
  416|    179|  if(rc) {
  ------------------
  |  Branch (416:6): [True: 179, False: 0]
  ------------------
  417|    179|    item->sockerr = SOCKERRNO ? SOCKERRNO : rc;
  ------------------
  |  | 1105|    179|#define SOCKERRNO         errno
  ------------------
                  item->sockerr = SOCKERRNO ? SOCKERRNO : rc;
  ------------------
  |  | 1105|    179|#define SOCKERRNO         errno
  ------------------
  |  Branch (417:21): [True: 0, False: 179]
  ------------------
  418|    179|    if(item->sockerr == 0)
  ------------------
  |  Branch (418:8): [True: 0, False: 179]
  ------------------
  419|      0|      item->sockerr = RESOLVER_ENOMEM;
  ------------------
  |  |   46|      0|#define RESOLVER_ENOMEM  EAI_MEMORY  /* = WSA_NOT_ENOUGH_MEMORY on Windows */
  ------------------
  420|    179|    item->negative = gai_negative(rc);
  421|    179|  }
  422|      0|  else {
  423|      0|    Curl_addrinfo_set_port(item->res, item->port);
  424|      0|  }
  425|    179|}
asyn-thrdd.c:gai_negative:
  360|    179|{
  361|    179|  switch(rc) {
  362|      0|#ifdef EAI_NONAME
  363|    179|  case EAI_NONAME:
  ------------------
  |  Branch (363:3): [True: 179, False: 0]
  ------------------
  364|    179|#endif
  365|    179|#if defined(EAI_NODATA) && \
  366|    179|  (!defined(EAI_NONAME) || (EAI_NODATA != EAI_NONAME))
  367|    179|  case EAI_NODATA:
  ------------------
  |  Branch (367:3): [True: 0, False: 179]
  ------------------
  368|    179|#endif
  369|    179|    return TRUE;
  ------------------
  |  |  986|    179|#define TRUE true
  ------------------
  370|      0|  default:
  ------------------
  |  Branch (370:3): [True: 0, False: 179]
  ------------------
  371|       |    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  372|    179|  }
  373|    179|}
asyn-thrdd.c:async_thrdd_event:
  461|    150|{
  462|    150|  struct Curl_multi *multi = user_data;
  463|    150|  (void)tqueue;
  464|    150|  switch(ev) {
  465|    150|  case CURL_THRDQ_EV_ITEM_DONE:
  ------------------
  |  Branch (465:3): [True: 150, False: 0]
  ------------------
  466|    150|    Curl_multi_wakeup_internal(multi);
  467|    150|    break;
  468|      0|  default:
  ------------------
  |  Branch (468:3): [True: 0, False: 150]
  ------------------
  469|      0|    break;
  470|    150|  }
  471|    150|}
asyn-thrdd.c:async_thrdd_query:
  614|    223|{
  615|    223|  struct async_thrdd_item *item;
  616|    223|  CURLcode result;
  617|       |
  618|    223|  item = async_thrdd_item_create(data, async->id, dns_queries,
  619|    223|                                 async->peer->hostname, async->peer->port,
  620|    223|                                 async->transport);
  621|    223|  if(!item) {
  ------------------
  |  Branch (621:6): [True: 8, False: 215]
  ------------------
  622|      8|    result = CURLE_OUT_OF_MEMORY;
  623|      8|    goto out;
  624|      8|  }
  625|    215|  CURL_TRC_DNS(data, "queueing query %s", item->description);
  ------------------
  |  |  168|    215|  do {                                 \
  |  |  169|    215|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|    215|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|    215|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|    430|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 215, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 73, False: 142]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|    430|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 73, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|     73|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|    215|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|     73|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 23, False: 50]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|    215|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|    215|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 215]
  |  |  ------------------
  ------------------
  626|    215|  result = Curl_thrdq_send(data->multi->resolv_thrdq, item,
  627|    215|                           async_item_description(item), async->timeout_ms);
  ------------------
  |  |  104|    215|#define async_item_description(x)   (x)->description
  ------------------
  628|    215|  if(result)
  ------------------
  |  Branch (628:6): [True: 7, False: 208]
  ------------------
  629|      7|    goto out;
  630|    208|  item = NULL;
  631|    208|  async->queries_ongoing++;
  632|       |
  633|    223|out:
  634|    223|  if(item)
  ------------------
  |  Branch (634:6): [True: 7, False: 216]
  ------------------
  635|      7|    async_thrdd_item_free(item);
  636|    223|  return result;
  637|    208|}
asyn-thrdd.c:async_thrdd_item_create:
  145|    223|{
  146|    223|  size_t hostlen = strlen(hostname);
  147|    223|  struct async_thrdd_item *item;
  148|       |
  149|    223|  item = curlx_calloc(1, sizeof(*item) + hostlen);
  ------------------
  |  | 1500|    223|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  150|    223|  if(!item)
  ------------------
  |  Branch (150:6): [True: 8, False: 215]
  ------------------
  151|      8|    return NULL;
  152|       |
  153|    215|  if(hostlen) /* null-terminator of name already in struct size */
  ------------------
  |  Branch (153:6): [True: 215, False: 0]
  ------------------
  154|    215|    memcpy(item->hostname, hostname, hostlen);
  155|    215|  item->mid = data->mid;
  156|    215|  item->resolv_id = resolv_id;
  157|    215|  item->dns_queries = dns_queries;
  158|    215|  item->port = port;
  159|    215|  item->transport = transport;
  160|       |
  161|    215|#ifdef CURLVERBOSE
  162|    215|  curl_msnprintf(item->description, sizeof(item->description),
  163|    215|                 "[%" FMT_OFF_T "/%u] %s %s:%u",
  164|    215|                 data->id, item->resolv_id,
  165|    215|                 Curl_resolv_query_str(dns_queries),
  166|    215|                 item->hostname, item->port);
  167|    215|#endif
  168|       |
  169|    215|#ifdef DEBUGBUILD
  170|    215|  {
  171|    215|    const char *p = getenv("CURL_DBG_RESOLV_DELAY");
  172|    215|    if(p) {
  ------------------
  |  Branch (172:8): [True: 0, False: 215]
  ------------------
  173|      0|      curl_off_t l;
  174|      0|      if(!curlx_str_number(&p, &l, UINT32_MAX)) {
  ------------------
  |  Branch (174:10): [True: 0, False: 0]
  ------------------
  175|      0|        item->delay_ms = (uint32_t)l;
  176|      0|      }
  177|      0|    }
  178|    215|    p = getenv("CURL_DBG_RESOLV_FAIL_DELAY");
  179|    215|    if(p) {
  ------------------
  |  Branch (179:8): [True: 0, False: 215]
  ------------------
  180|      0|      curl_off_t l;
  181|      0|      if(!curlx_str_number(&p, &l, UINT32_MAX)) {
  ------------------
  |  Branch (181:10): [True: 0, False: 0]
  ------------------
  182|      0|        unsigned char c = 0;
  183|      0|        Curl_rand_bytes(data, FALSE, &c, 1);
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  184|      0|        item->delay_fail_ms = (uint32_t)l + c;
  185|      0|      }
  186|      0|    }
  187|    215|    if(getenv("CURL_DBG_RESOLV_FAIL_NEGATIVE"))
  ------------------
  |  Branch (187:8): [True: 0, False: 215]
  ------------------
  188|      0|      item->dbg_negative = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  189|    215|  }
  190|    215|#endif
  191|       |
  192|    215|  return item;
  193|    223|}
asyn-thrdd.c:async_thrdd_check_done:
  787|  2.09k|{
  788|  2.09k|  struct async_thrdd_ctx *thrdd = &async->thrdd;
  789|       |
  790|  2.09k|  (void)data;
  791|  2.09k|  if(thrdd->res_A && !thrdd->processed_A) {
  ------------------
  |  Branch (791:6): [True: 116, False: 1.97k]
  |  Branch (791:22): [True: 74, False: 42]
  ------------------
  792|     74|    VERBOSE(async_thrdd_report_item(data, thrdd->res_A));
  ------------------
  |  | 1637|     74|#define VERBOSE(x) x
  ------------------
  793|       |    /* move addrinfos to the async result member */
  794|     74|    async->dns_responses |= thrdd->res_A->dns_queries;
  795|     74|    async->ai_A = thrdd->res_A->res;
  796|     74|    thrdd->res_A->res = NULL;
  797|     74|    thrdd->processed_A = TRUE;
  ------------------
  |  |  986|     74|#define TRUE true
  ------------------
  798|     74|  }
  799|       |
  800|  2.09k|  if(thrdd->res_AAAA && !thrdd->processed_AAAA) {
  ------------------
  |  Branch (800:6): [True: 123, False: 1.97k]
  |  Branch (800:25): [True: 76, False: 47]
  ------------------
  801|     76|#if defined(USE_IPV6) && defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID)
  802|       |    /* do we accept the incoming AAAA response? */
  803|     76|    if(!(thrdd->res_AAAA->dns_queries & CURL_DNSQ_A) &&
  ------------------
  |  |   51|     76|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (803:8): [True: 76, False: 0]
  ------------------
  804|     76|       async_thrdd_item_missing_scope(data, thrdd->res_AAAA)) {
  ------------------
  |  Branch (804:8): [True: 0, False: 76]
  ------------------
  805|       |      /* We queried "only" AF_INET6. This may be problematic when the
  806|       |       * result has ipv6 link-local addresses and did not give
  807|       |       * any scope id for it. glibc has a long outstanding bug
  808|       |       * <https://sourceware.org/bugzilla/show_bug.cgi?id=14413>
  809|       |       * that gives scope ids only on AF_UNSPEC queries. */
  810|      0|      struct async_thrdd_item *item = thrdd->res_AAAA;
  811|      0|      CURLcode result;
  812|       |
  813|       |      /* Reuse the item and queue it again, this time with added
  814|       |       * CURL_DNSQ_A which resolves using AF_UNSPEC. */
  815|      0|      thrdd->res_AAAA = NULL;
  816|      0|      item->dns_queries |= CURL_DNSQ_A;
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  817|      0|      if(item->res) {
  ------------------
  |  Branch (817:10): [True: 0, False: 0]
  ------------------
  818|      0|        Curl_freeaddrinfo(item->res);
  819|      0|        item->res = NULL;
  820|      0|      }
  821|       |
  822|      0|      CURL_TRC_DNS(data, "re-queueing query %s for AF_UNSPEC resolve",
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  823|      0|                   item->description);
  824|      0|      result = Curl_thrdq_send(data->multi->resolv_thrdq, item,
  825|      0|                               async_item_description(item),
  ------------------
  |  |  104|      0|#define async_item_description(x)   (x)->description
  ------------------
  826|      0|                               async->timeout_ms);
  827|      0|      if(result) {
  ------------------
  |  Branch (827:10): [True: 0, False: 0]
  ------------------
  828|      0|        async_thrdd_item_free(item);
  829|      0|        return result;
  830|      0|      }
  831|      0|      async->queries_ongoing++;
  832|      0|      return CURLE_AGAIN;
  833|      0|    }
  834|       |    /* accepting the AAAA result, strip it of any AF_INET entries,
  835|       |     * as we might have resolved it with AF_UNSPEC. */
  836|     76|    async_thrdd_item_strip_results(thrdd->res_AAAA, AF_INET);
  837|     76|#endif /* USE_IPV6 && HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID */
  838|     76|    VERBOSE(async_thrdd_report_item(data, thrdd->res_AAAA));
  ------------------
  |  | 1637|     76|#define VERBOSE(x) x
  ------------------
  839|       |    /* move addrinfos to the async result member */
  840|     76|    async->dns_responses |= thrdd->res_AAAA->dns_queries;
  841|     76|    async->ai_AAAA = thrdd->res_AAAA->res;
  842|     76|    thrdd->res_AAAA->res = NULL;
  843|     76|    thrdd->processed_AAAA = TRUE;
  ------------------
  |  |  986|     76|#define TRUE true
  ------------------
  844|     76|  }
  845|       |
  846|  2.09k|  if(async->queries_ongoing)
  ------------------
  |  Branch (846:6): [True: 311, False: 1.78k]
  ------------------
  847|    311|    return CURLE_AGAIN;
  848|  1.78k|  async->done = TRUE;
  ------------------
  |  |  986|  1.78k|#define TRUE true
  ------------------
  849|  1.78k|  return CURLE_OK;
  850|  2.09k|}
asyn-thrdd.c:async_thrdd_report_item:
  526|    150|{
  527|    150|  char buf[MAX_IPADR_LEN];
  528|    150|  struct dynbuf tmp;
  529|    150|  const char *sep = "";
  530|    150|  const struct Curl_addrinfo *ai = item->res;
  531|    150|  CURLcode result;
  532|    150|  int ai_family;
  533|    150|#ifdef USE_IPV6
  534|    150|  ai_family = (item->dns_queries & CURL_DNSQ_AAAA) ? AF_INET6 : AF_INET;
  ------------------
  |  |   52|    150|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (534:15): [True: 76, False: 74]
  ------------------
  535|       |#else
  536|       |  ai_family = AF_INET;
  537|       |#endif
  538|       |
  539|    150|  if(!CURL_TRC_DNS_is_verbose(data))
  ------------------
  |  |  137|    150|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  ------------------
  |  |  |  |  329|    150|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    300|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 150, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 43, False: 107]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    300|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 43, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     43|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|    150|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     43|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 9, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  540|    141|    return;
  541|       |
  542|      9|  curlx_dyn_init(&tmp, 1024);
  543|      9|  for(; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (543:9): [True: 0, False: 9]
  ------------------
  544|      0|    if(ai->ai_family == ai_family) {
  ------------------
  |  Branch (544:8): [True: 0, False: 0]
  ------------------
  545|      0|      Curl_printable_address(ai, buf, sizeof(buf));
  546|      0|      result = curlx_dyn_addf(&tmp, "%s%s", sep, buf);
  547|      0|      if(result) {
  ------------------
  |  Branch (547:10): [True: 0, False: 0]
  ------------------
  548|      0|        CURL_TRC_DNS(data, "too many IP, cannot show");
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  549|      0|        goto out;
  550|      0|      }
  551|      0|      sep = ", ";
  552|      0|    }
  553|      0|  }
  554|       |
  555|      9|  CURL_TRC_DNS(data, "Host %s:%u resolved IPv%c: %s",
  ------------------
  |  |  168|      9|  do {                                 \
  |  |  169|      9|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      9|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      9|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|     18|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 9, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|     18|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 9, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      9|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      9|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      9|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 9, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|     36|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (170:26): [True: 4, False: 5]
  |  |  |  Branch (170:26): [True: 0, False: 9]
  |  |  ------------------
  |  |  171|      9|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 9]
  |  |  ------------------
  ------------------
  556|      9|               item->hostname, item->port,
  557|      9|               (item->dns_queries & CURL_DNSQ_AAAA) ? '6' : '4',
  558|      9|               (curlx_dyn_len(&tmp) ? curlx_dyn_ptr(&tmp) : "(none)"));
  559|      9|out:
  560|      9|  curlx_dyn_free(&tmp);
  561|      9|}
asyn-thrdd.c:async_thrdd_item_missing_scope:
  748|     76|{
  749|     76|  const struct Curl_addrinfo *ai;
  750|       |
  751|       |  /* scope id already globally set */
  752|     76|  if(data->conn && data->conn->scope_id)
  ------------------
  |  Branch (752:6): [True: 76, False: 0]
  |  Branch (752:20): [True: 0, False: 76]
  ------------------
  753|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  754|       |
  755|     76|  for(ai = item->res; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (755:23): [True: 0, False: 76]
  ------------------
  756|      0|    if(ai->ai_family == AF_INET6) {
  ------------------
  |  Branch (756:8): [True: 0, False: 0]
  ------------------
  757|      0|      struct sockaddr_in6 *sa6 = (void *)ai->ai_addr;
  758|      0|      if(IN6_IS_ADDR_LINKLOCAL(&sa6->sin6_addr) && !sa6->sin6_scope_id)
  ------------------
  |  Branch (758:10): [True: 0, False: 0]
  |  Branch (758:52): [True: 0, False: 0]
  ------------------
  759|      0|        return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  760|      0|    }
  761|      0|  }
  762|     76|  return FALSE;
  ------------------
  |  |  989|     76|#define FALSE false
  ------------------
  763|     76|}
asyn-thrdd.c:async_thrdd_item_strip_results:
  767|     76|{
  768|     76|  struct Curl_addrinfo *ai = item->res, **panchor = &item->res;
  769|     76|  while(ai) {
  ------------------
  |  Branch (769:9): [True: 0, False: 76]
  ------------------
  770|      0|    if(ai->ai_family == ai_family) {
  ------------------
  |  Branch (770:8): [True: 0, False: 0]
  ------------------
  771|      0|      *panchor = ai->ai_next;
  772|      0|      ai->ai_next = NULL;
  773|      0|      Curl_freeaddrinfo(ai);
  774|      0|      ai = *panchor;
  775|      0|    }
  776|      0|    else {
  777|      0|      panchor = &ai->ai_next;
  778|      0|      ai = ai->ai_next;
  779|      0|    }
  780|      0|  }
  781|     76|}

Curl_dns_cf_add_addr_resolve:
  575|  9.38k|{
  576|       |  /* should only have address query bits */
  577|  9.38k|  DEBUGASSERT(!(dns_queries & ~CURL_DNSQ_ADDR));
  ------------------
  |  | 1016|  9.38k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (577:3): [True: 0, False: 9.38k]
  |  Branch (577:3): [True: 9.38k, False: 0]
  ------------------
  578|  9.38k|  return cf_dns_add_resolve(data, cf, peer,
  579|  9.38k|                            (dns_queries & CURL_DNSQ_ADDR), transport);
  ------------------
  |  |   55|  9.38k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   51|  9.38k|#define CURL_DNSQ_A           (1U << 0)
  |  |  ------------------
  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   52|  9.38k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  ------------------
  ------------------
  580|  9.38k|}
Curl_dns_cf_addr_result:
  591|  9.30k|{
  592|  9.30k|  struct Curl_cfchain *chain;
  593|  18.6k|  for(chain = cf->chain; chain; chain = chain->parent) {
  ------------------
  |  Branch (593:26): [True: 18.6k, False: 0]
  ------------------
  594|  38.9k|    for(cf = chain->cf; cf; cf = cf->next) {
  ------------------
  |  Branch (594:25): [True: 29.5k, False: 9.30k]
  ------------------
  595|  29.5k|      if(cf->cft == &Curl_cft_dns) {
  ------------------
  |  Branch (595:10): [True: 10.9k, False: 18.6k]
  ------------------
  596|  10.9k|        struct cf_dns_ctx *ctx = cf->ctx;
  597|  10.9k|        if(Curl_peer_same_destination(ctx->peer, peer) &&
  ------------------
  |  Branch (597:12): [True: 9.39k, False: 1.58k]
  ------------------
  598|  9.39k|           (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))) {
  ------------------
  |  |   51|  9.39k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                         (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))) {
  ------------------
  |  |   52|  9.39k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (598:12): [True: 9.30k, False: 86]
  ------------------
  599|  9.30k|          if(ctx->dns || ctx->resolv_result)
  ------------------
  |  Branch (599:14): [True: 9.22k, False: 86]
  |  Branch (599:26): [True: 0, False: 86]
  ------------------
  600|  9.22k|            return ctx->resolv_result;
  601|     86|          return CURLE_AGAIN;
  602|  9.30k|        }
  603|  10.9k|      }
  604|  29.5k|    }
  605|  18.6k|  }
  606|      0|  return CURLE_FAILED_INIT; /* no one is resolving */
  607|  9.30k|}
Curl_dns_cf_get_ai:
  618|  34.3k|{
  619|  34.3k|  struct Curl_cfchain *chain;
  620|  68.6k|  for(chain = cf->chain; chain; chain = chain->parent) {
  ------------------
  |  Branch (620:26): [True: 68.6k, False: 0]
  ------------------
  621|   140k|    for(cf = chain->cf; cf; cf = cf->next) {
  ------------------
  |  Branch (621:25): [True: 106k, False: 34.3k]
  ------------------
  622|   106k|      if(cf->cft == &Curl_cft_dns) {
  ------------------
  |  Branch (622:10): [True: 37.8k, False: 68.6k]
  ------------------
  623|  37.8k|        struct cf_dns_ctx *ctx = cf->ctx;
  624|  37.8k|        if(Curl_peer_same_destination(ctx->peer, peer) &&
  ------------------
  |  Branch (624:12): [True: 34.6k, False: 3.17k]
  ------------------
  625|  34.6k|           (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))) {
  ------------------
  |  |   51|  34.6k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                         (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))) {
  ------------------
  |  |   52|  34.6k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (625:12): [True: 34.3k, False: 344]
  ------------------
  626|  34.3k|          CURL_TRC_CF(data, cf, "get %uth result for %s:%u, family=%d, dns=%d",
  ------------------
  |  |  153|  34.3k|  do {                                          \
  |  |  154|  34.3k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  34.3k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  68.6k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 34.3k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3.02k, False: 31.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  68.6k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3.02k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  3.02k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  34.3k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  3.02k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3.02k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 366, False: 2.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  34.3k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  34.3k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 34.3k]
  |  |  ------------------
  ------------------
  627|  34.3k|                      index, peer->hostname, peer->port, ai_family,
  628|  34.3k|                      !!ctx->dns);
  629|  34.3k|          if(ctx->resolv_result)
  ------------------
  |  Branch (629:14): [True: 0, False: 34.3k]
  ------------------
  630|      0|            return NULL;
  631|  34.3k|          else if(ctx->dns) {
  ------------------
  |  Branch (631:19): [True: 33.9k, False: 344]
  ------------------
  632|       |            /* A cached DNS entry may contain address families that we
  633|       |             * here never queried for. We want to give no results for those. */
  634|  33.9k|            if((ai_family == AF_INET) && !(ctx->dns_queries & CURL_DNSQ_A))
  ------------------
  |  |   51|  16.9k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (634:16): [True: 16.9k, False: 16.9k]
  |  Branch (634:42): [True: 0, False: 16.9k]
  ------------------
  635|      0|              return NULL;
  636|  33.9k|#ifdef USE_IPV6
  637|  33.9k|            if((ai_family == AF_INET6) && !(ctx->dns_queries & CURL_DNSQ_AAAA))
  ------------------
  |  |   52|  16.9k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (637:16): [True: 16.9k, False: 16.9k]
  |  Branch (637:43): [True: 0, False: 16.9k]
  ------------------
  638|      0|              return NULL;
  639|  33.9k|#endif
  640|  33.9k|            return Curl_addrinfo_get(ctx->dns->addr, ai_family, index);
  641|  33.9k|          }
  642|    344|          else
  643|    344|            return Curl_resolv_get_ai(data, ctx->resolv_id, ai_family, index);
  644|  34.3k|        }
  645|  37.8k|      }
  646|   106k|    }
  647|  68.6k|  }
  648|      0|  return NULL;
  649|  34.3k|}
Curl_dns_cf_add_https_resolve:
  655|  9.38k|{
  656|  9.38k|  return cf_dns_add_resolve(data, cf, peer, CURL_DNSQ_HTTPS,
  ------------------
  |  |   53|  9.38k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  657|  9.38k|                            CF_CONN(cf)->transport_wanted);
  ------------------
  |  |  260|  9.38k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  658|  9.38k|}
Curl_dns_cf_get_https:
  667|  9.29k|{
  668|  9.29k|  struct Curl_cfchain *chain;
  669|  16.9k|  for(chain = cf->chain; chain; chain = chain->parent) {
  ------------------
  |  Branch (669:26): [True: 9.29k, False: 7.64k]
  ------------------
  670|  24.5k|    for(cf = chain->cf; cf; cf = cf->next) {
  ------------------
  |  Branch (670:25): [True: 16.9k, False: 7.64k]
  ------------------
  671|  16.9k|      if(cf->cft == &Curl_cft_dns) {
  ------------------
  |  Branch (671:10): [True: 9.29k, False: 7.64k]
  ------------------
  672|  9.29k|        struct cf_dns_ctx *ctx = cf->ctx;
  673|  9.29k|        if(Curl_peer_same_destination(ctx->peer, peer) &&
  ------------------
  |  Branch (673:12): [True: 3.64k, False: 5.64k]
  ------------------
  674|  3.64k|           (ctx->dns_queries & CURL_DNSQ_HTTPS)) {
  ------------------
  |  |   53|  3.64k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (674:12): [True: 1.65k, False: 1.99k]
  ------------------
  675|  1.65k|          if(ctx->dns)
  ------------------
  |  Branch (675:14): [True: 0, False: 1.65k]
  ------------------
  676|      0|            return ctx->dns->hinfo;
  677|  1.65k|          else
  678|  1.65k|            return Curl_resolv_get_https(data, ctx->resolv_id);
  679|  1.65k|        }
  680|  9.29k|      }
  681|  16.9k|    }
  682|  9.29k|  }
  683|  7.64k|  return NULL;
  684|  9.29k|}
Curl_dns_cf_resolved_https:
  689|  9.29k|{
  690|  9.29k|  struct Curl_cfchain *chain;
  691|  16.9k|  for(chain = cf->chain; chain; chain = chain->parent) {
  ------------------
  |  Branch (691:26): [True: 9.29k, False: 7.64k]
  ------------------
  692|  24.5k|    for(cf = chain->cf; cf; cf = cf->next) {
  ------------------
  |  Branch (692:25): [True: 16.9k, False: 7.64k]
  ------------------
  693|  16.9k|      if(cf->cft == &Curl_cft_dns) {
  ------------------
  |  Branch (693:10): [True: 9.29k, False: 7.64k]
  ------------------
  694|  9.29k|        struct cf_dns_ctx *ctx = cf->ctx;
  695|  9.29k|        if(Curl_peer_same_destination(ctx->peer, peer) &&
  ------------------
  |  Branch (695:12): [True: 3.64k, False: 5.64k]
  ------------------
  696|  3.64k|           (ctx->dns_queries & CURL_DNSQ_HTTPS)) {
  ------------------
  |  |   53|  3.64k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (696:12): [True: 1.65k, False: 1.99k]
  ------------------
  697|  1.65k|          if(ctx->dns)
  ------------------
  |  Branch (697:14): [True: 0, False: 1.65k]
  ------------------
  698|      0|            return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  699|  1.65k|          else
  700|  1.65k|            return Curl_resolv_knows_https(data, ctx->resolv_id);
  701|  1.65k|        }
  702|  9.29k|      }
  703|  16.9k|    }
  704|  9.29k|  }
  705|  7.64k|  return TRUE;
  ------------------
  |  |  986|  7.64k|#define TRUE true
  ------------------
  706|  9.29k|}
cf-dns.c:cf_dns_destroy:
  362|  11.1k|{
  363|  11.1k|  struct cf_dns_ctx *ctx = cf->ctx;
  364|       |
  365|  11.1k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  11.1k|  do {                                          \
  |  |  154|  11.1k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  11.1k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  22.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 11.1k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 10.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  22.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  11.1k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 4, False: 143]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  11.1k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  11.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 11.1k]
  |  |  ------------------
  ------------------
  366|  11.1k|  cf_dns_ctx_destroy(data, ctx);
  367|  11.1k|}
cf-dns.c:cf_dns_ctx_destroy:
   93|  11.1k|{
   94|  11.1k|  if(ctx) {
  ------------------
  |  Branch (94:6): [True: 11.1k, False: 3]
  ------------------
   95|  11.1k|    Curl_peer_unlink(&ctx->peer);
   96|  11.1k|    Curl_dns_entry_unlink(data, &ctx->dns);
   97|  11.1k|    curlx_free(ctx);
  ------------------
  |  | 1503|  11.1k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   98|  11.1k|  }
   99|  11.1k|}
cf-dns.c:cf_dns_connect:
  290|   155k|{
  291|   155k|  struct cf_dns_ctx *ctx = cf->ctx;
  292|   155k|  bool ip_query = (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA));
  ------------------
  |  |   51|   155k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                bool ip_query = (ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA));
  ------------------
  |  |   52|   155k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  293|       |
  294|   155k|  if(cf->connected) {
  ------------------
  |  Branch (294:6): [True: 0, False: 155k]
  ------------------
  295|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  296|      0|    return CURLE_OK;
  297|      0|  }
  298|       |
  299|   155k|  *done = FALSE;
  ------------------
  |  |  989|   155k|#define FALSE false
  ------------------
  300|   155k|  if(!ctx->started) {
  ------------------
  |  Branch (300:6): [True: 11.0k, False: 144k]
  ------------------
  301|  11.0k|    ctx->started = TRUE;
  ------------------
  |  |  986|  11.0k|#define TRUE true
  ------------------
  302|  11.0k|    ctx->resolv_result = cf_dns_start(cf, data, &ctx->dns);
  303|  11.0k|  }
  304|       |
  305|   155k|  if(!ctx->dns && !ctx->resolv_result) {
  ------------------
  |  Branch (305:6): [True: 27.2k, False: 127k]
  |  Branch (305:19): [True: 2.09k, False: 25.1k]
  ------------------
  306|  2.09k|    ctx->resolv_result =
  307|  2.09k|      Curl_resolv_take_result(data, ctx->resolv_id, &ctx->dns);
  308|  2.09k|  }
  309|       |
  310|   155k|  if(ctx->resolv_result &&
  ------------------
  |  Branch (310:6): [True: 26.9k, False: 128k]
  ------------------
  311|  26.9k|     (ip_query || (ctx->resolv_result == CURLE_ABORTED_BY_CALLBACK))) {
  ------------------
  |  Branch (311:7): [True: 110, False: 26.8k]
  |  Branch (311:19): [True: 0, False: 26.8k]
  ------------------
  312|       |    /* a failed A|AAAA resolve, or an application-aborted HTTPS-RR
  313|       |       resolve, is a hard failure. Other HTTPS-RR errors are optional. */
  314|    110|    CURL_TRC_CF(data, cf, "[%s] error resolving: %d",
  ------------------
  |  |  153|    110|  do {                                          \
  |  |  154|    110|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    110|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    220|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 110, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 34, False: 76]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    220|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 34, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     34|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    110|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     34|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 34, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 14, False: 20]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    110|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    110|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 110]
  |  |  ------------------
  ------------------
  315|    110|                Curl_resolv_query_str(ctx->dns_queries),
  316|    110|                (int)ctx->resolv_result);
  317|    110|    return ctx->resolv_result;
  318|    110|  }
  319|       |
  320|   155k|  if(ctx->dns && !ctx->announced) {
  ------------------
  |  Branch (320:6): [True: 127k, False: 27.1k]
  |  Branch (320:18): [True: 9.23k, False: 118k]
  ------------------
  321|  9.23k|    ctx->announced = TRUE;
  ------------------
  |  |  986|  9.23k|#define TRUE true
  ------------------
  322|  9.23k|    if(CF_IS_PRIMARY(cf) && ip_query) {
  ------------------
  |  |  261|  18.4k|#define CF_IS_PRIMARY(cf)       (bool)(cf)->chain->primary
  |  |  ------------------
  |  |  |  Branch (261:33): [True: 9.23k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (322:29): [True: 9.23k, False: 0]
  ------------------
  323|  9.23k|      CF_CONN(cf)->bits.dns_resolved = TRUE;
  ------------------
  |  |  260|  9.23k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
                    CF_CONN(cf)->bits.dns_resolved = TRUE;
  ------------------
  |  |  986|  9.23k|#define TRUE true
  ------------------
  324|  9.23k|      Curl_pgrsTime(data, TIMER_NAMELOOKUP);
  325|  9.23k|    }
  326|  9.23k|    cf_dns_report(cf, data, ctx->dns);
  327|  9.23k|  }
  328|       |
  329|       |  /* Delay connection sub-filters when we are still waiting for AAAA */
  330|   155k|  if(!cf_dns_ready_to_connect(cf, data)) {
  ------------------
  |  Branch (330:6): [True: 222, False: 154k]
  ------------------
  331|    222|    return CURLE_OK;
  332|    222|  }
  333|       |
  334|   154k|  if(cf->next && !cf->next->connected) {
  ------------------
  |  Branch (334:6): [True: 154k, False: 0]
  |  Branch (334:18): [True: 154k, False: 0]
  ------------------
  335|   154k|    struct Curl_cfilter *cf_next;
  336|   154k|    bool sub_done;
  337|   154k|    CURLcode result;
  338|       |
  339|   154k|sub_chain_connect:
  340|   154k|    cf_next = cf->next;
  341|   154k|    sub_done = FALSE;
  ------------------
  |  |  989|   154k|#define FALSE false
  ------------------
  342|   154k|    result = Curl_conn_cf_connect(cf_next, data, &sub_done);
  343|       |    /* The sub-chain might insert new DNS filters and we cannot
  344|       |     * leave here without running them. Do so. */
  345|   154k|    if(!result && (cf_next != cf->next))
  ------------------
  |  Branch (345:8): [True: 146k, False: 7.93k]
  |  Branch (345:19): [True: 0, False: 146k]
  ------------------
  346|      0|      goto sub_chain_connect;
  347|   154k|    if(result || !sub_done)
  ------------------
  |  Branch (347:8): [True: 7.93k, False: 146k]
  |  Branch (347:18): [True: 144k, False: 1.95k]
  ------------------
  348|   152k|      return result;
  349|  1.95k|    DEBUGASSERT(sub_done);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (349:5): [True: 0, False: 1.95k]
  |  Branch (349:5): [True: 1.95k, False: 0]
  ------------------
  350|  1.95k|  }
  351|       |
  352|       |  /* sub filter chain is connected, this means the filter has done
  353|       |   * its work and is connected as well, if it has results or not. */
  354|  1.95k|  CURL_TRC_CF(data, cf, "connected filter chain below");
  ------------------
  |  |  153|  1.95k|  do {                                          \
  |  |  154|  1.95k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.95k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.91k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.91k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.95k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 4, False: 143]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.95k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.95k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
  355|  1.95k|  *done = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
  356|       |  cf->connected = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
  357|  1.95k|  Curl_resolv_destroy(data, ctx->resolv_id);
  358|  1.95k|  return CURLE_OK;
  359|   154k|}
cf-dns.c:cf_dns_start:
  187|  11.0k|{
  188|  11.0k|  struct cf_dns_ctx *ctx = cf->ctx;
  189|  11.0k|  timediff_t timeout_ms = Curl_timeleft_ms(data);
  190|  11.0k|  CURLcode result = CURLE_OK;
  191|       |
  192|  11.0k|  *pdns = NULL;
  193|       |
  194|  11.0k|  CURL_TRC_CF(data, cf, "[%s] cf_dns_start %s %s:%u",
  ------------------
  |  |  153|  11.0k|  do {                                          \
  |  |  154|  11.0k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  11.0k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  22.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 11.0k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 1.20k, False: 9.88k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  22.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 1.20k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  1.20k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  11.0k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  1.20k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 1.20k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 243, False: 958]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  11.0k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 243]
  |  |  ------------------
  |  |  156|  11.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 11.0k]
  |  |  ------------------
  ------------------
  195|  11.0k|              Curl_resolv_query_str(ctx->dns_queries),
  196|  11.0k|              ctx->peer->unix_socket ? "unix-domain-socket" : "host",
  197|  11.0k|              ctx->peer->hostname, ctx->peer->port);
  198|  11.0k|  if(ctx->peer->unix_socket)
  ------------------
  |  Branch (198:6): [True: 0, False: 11.0k]
  ------------------
  199|      0|    ctx->dns_queries = CURL_DNSQ_A; /* treat it like an A resolve */
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  200|       |
  201|  11.0k|  if(CURL_DNSQ_IS_ADDR(ctx->dns_queries)) {
  ------------------
  |  |   56|  11.0k|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|  11.0k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  11.0k|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.0k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (56:31): [True: 9.37k, False: 1.71k]
  |  |  ------------------
  ------------------
  202|  9.37k|    if(Curl_is_ipv4addr(ctx->peer->hostname))
  ------------------
  |  Branch (202:8): [True: 9.24k, False: 126]
  ------------------
  203|  9.24k|      ctx->dns_queries |= CURL_DNSQ_A;
  ------------------
  |  |   51|  9.24k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  204|    126|#ifdef USE_IPV6
  205|    126|    else if(ctx->peer->ipv6)
  ------------------
  |  Branch (205:13): [True: 7, False: 119]
  ------------------
  206|      7|      ctx->dns_queries |= CURL_DNSQ_AAAA;
  ------------------
  |  |   52|      7|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  207|  9.37k|#endif
  208|       |
  209|  9.37k|    result = Curl_resolv(data, ctx->peer, ctx->dns_queries, ctx->transport,
  210|  9.37k|                         (bool)ctx->for_proxy, timeout_ms,
  211|  9.37k|                         &ctx->resolv_id, pdns);
  212|  9.37k|  }
  213|  1.71k|#ifdef USE_HTTPSRR
  214|  1.71k|  else if(ctx->dns_queries == CURL_DNSQ_HTTPS) {
  ------------------
  |  |   53|  1.71k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (214:11): [True: 1.71k, False: 0]
  ------------------
  215|  1.71k|    result = Curl_resolv_https(data, ctx->peer, (bool)ctx->for_proxy,
  216|  1.71k|                               timeout_ms, &ctx->resolv_id, pdns);
  217|  1.71k|  }
  218|      0|#endif
  219|      0|  else {
  220|      0|    failf(data, "unsupported DNS queries %x", ctx->dns_queries);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  221|      0|    return CURLE_FAILED_INIT;
  222|      0|  }
  223|       |
  224|  11.0k|  DEBUGASSERT(!result || !*pdns);
  ------------------
  |  | 1016|  11.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (224:3): [True: 11.0k, False: 0]
  |  Branch (224:3): [True: 0, False: 0]
  |  Branch (224:3): [True: 9.23k, False: 1.85k]
  |  Branch (224:3): [True: 1.85k, False: 0]
  ------------------
  225|  11.0k|  if(!result) { /* resolved right away, either sync or from dnscache */
  ------------------
  |  Branch (225:6): [True: 9.23k, False: 1.85k]
  ------------------
  226|  9.23k|    DEBUGASSERT(*pdns);
  ------------------
  |  | 1016|  9.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (226:5): [True: 0, False: 9.23k]
  |  Branch (226:5): [True: 9.23k, False: 0]
  ------------------
  227|  9.23k|    return CURLE_OK;
  228|  9.23k|  }
  229|  1.85k|  else if(result == CURLE_AGAIN) { /* async resolv in progress */
  ------------------
  |  Branch (229:11): [True: 1.81k, False: 44]
  ------------------
  230|  1.81k|    return CURLE_OK;
  231|  1.81k|  }
  232|     44|  else if(result == CURLE_OPERATION_TIMEDOUT) { /* took too long */
  ------------------
  |  Branch (232:11): [True: 0, False: 44]
  ------------------
  233|      0|    failf(data, "Failed to resolve '%s' with timeout after %"
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  234|      0|          FMT_TIMEDIFF_T " ms", ctx->peer->hostname,
  235|      0|          Curl_pgrs_since_ms(data, NULL, TIMER_STARTSINGLE));
  236|      0|    return CURLE_OPERATION_TIMEDOUT;
  237|      0|  }
  238|     44|  else {
  239|     44|    DEBUGASSERT(result);
  ------------------
  |  | 1016|     44|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (239:5): [True: 0, False: 44]
  |  Branch (239:5): [True: 44, False: 0]
  ------------------
  240|     44|    if(ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
  ------------------
  |  |   51|     44|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                  if(ctx->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
  ------------------
  |  |   52|     44|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (240:8): [True: 42, False: 2]
  ------------------
  241|     42|      failf(data, "Could not resolve: %s", ctx->peer->hostname);
  ------------------
  |  |   62|     42|#define failf Curl_failf
  ------------------
  242|     44|    return result;
  243|     44|  }
  244|  11.0k|}
cf-dns.c:cf_dns_report:
  132|  9.23k|{
  133|  9.23k|  struct cf_dns_ctx *ctx = cf->ctx;
  134|  9.23k|  struct dynbuf tmp;
  135|       |
  136|  9.23k|  if(!Curl_trc_is_verbose(data) ||
  ------------------
  |  |  322|  18.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 9.23k, False: 0]
  |  |  |  Branch (322:14): [True: 876, False: 8.35k]
  |  |  ------------------
  |  |  323|  18.4k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 876, False: 0]
  |  |  ------------------
  |  |  324|    876|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  137|       |     /* ignore no name or numerical IP addresses */
  138|    876|     !dns->hostname[0] || Curl_host_is_ipnum(dns->hostname))
  ------------------
  |  Branch (138:6): [True: 0, False: 876]
  |  Branch (138:27): [True: 876, False: 0]
  ------------------
  139|  9.23k|    return;
  140|       |
  141|      0|  if(ctx->peer->unix_socket) {
  ------------------
  |  Branch (141:6): [True: 0, False: 0]
  ------------------
  142|      0|#ifdef USE_UNIX_SOCKETS
  143|      0|    CURL_TRC_CF(data, cf, "resolved unix://%s", ctx->peer->hostname);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  144|       |#else
  145|       |    DEBUGASSERT(0);
  146|       |#endif
  147|      0|  }
  148|      0|  else {
  149|      0|    curlx_dyn_init(&tmp, 1024);
  150|      0|    if(CURL_DNSQ_IS_ADDR(ctx->dns_queries)) {
  ------------------
  |  |   56|      0|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|      0|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (56:31): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  151|      0|      infof(data, "Host %s:%u was resolved.", dns->hostname, dns->port);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  152|      0|#ifdef CURLRES_IPV6
  153|      0|      cf_dns_report_addr(data, &tmp, "IPv6: ", AF_INET6, dns->addr);
  154|      0|#endif
  155|      0|      cf_dns_report_addr(data, &tmp, "IPv4: ", AF_INET, dns->addr);
  156|      0|    }
  157|      0|#ifdef USE_HTTPSRR
  158|      0|    else if(ctx->dns_queries & CURL_DNSQ_HTTPS) {
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|      if(!dns->hinfo)
  ------------------
  |  Branch (159:10): [True: 0, False: 0]
  ------------------
  160|      0|        infof(data, "HTTPS-RR %s:%u: -", dns->hostname, dns->port);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  161|      0|      else if(!Curl_httpsrr_applicable(data, dns->hinfo))
  ------------------
  |  Branch (161:15): [True: 0, False: 0]
  ------------------
  162|      0|        infof(data, "HTTPS-RR %s:%u: not applicable",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  163|      0|              dns->hostname, dns->port);
  164|      0|      else {
  165|      0|        CURLcode result = Curl_httpsrr_print(&tmp, dns->hinfo);
  166|      0|        if(!result)
  ------------------
  |  Branch (166:12): [True: 0, False: 0]
  ------------------
  167|      0|          infof(data, "HTTPS-RR %s:%u: %s",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  168|      0|                dns->hostname, dns->port, curlx_dyn_ptr(&tmp));
  169|      0|        else
  170|      0|          infof(data, "Error printing HTTPS-RR information");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  171|      0|      }
  172|      0|    }
  173|      0|#endif
  174|      0|    curlx_dyn_free(&tmp);
  175|      0|  }
  176|      0|}
cf-dns.c:cf_dns_ready_to_connect:
  248|   155k|{
  249|   155k|  struct cf_dns_ctx *ctx = cf->ctx;
  250|       |
  251|   155k|  if(ctx->resolv_result)
  ------------------
  |  Branch (251:6): [True: 26.8k, False: 128k]
  ------------------
  252|  26.8k|    return TRUE;
  ------------------
  |  |  986|  26.8k|#define TRUE true
  ------------------
  253|   128k|  else if(ctx->dns)
  ------------------
  |  Branch (253:11): [True: 127k, False: 311]
  ------------------
  254|   127k|    return TRUE;
  ------------------
  |  |  986|   127k|#define TRUE true
  ------------------
  255|    311|#ifdef USE_CURL_ASYNC
  256|    311|  else if(CURL_DNSQ_IS_ADDR(ctx->dns_queries)) {
  ------------------
  |  |   56|    311|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|    311|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|    311|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|    311|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (56:31): [True: 311, False: 0]
  |  |  ------------------
  ------------------
  257|    311|    const struct curltime *pnow;
  258|    311|    timediff_t remain_ms;
  259|       |    /* For Happy Eyeballing, we can start on either A or AAAA resolves,
  260|       |     * but AAAA is preferred. We enforce a small delay for missing
  261|       |     * AAAA to arrive, then we let the connect continue.
  262|       |     * Note: if AAAA was never started (-4), it is considered to have
  263|       |     * an answer (e.g. a negative one). */
  264|    311|    if(Curl_resolv_has_answers(data, ctx->resolv_id, CURL_DNSQ_AAAA))
  ------------------
  |  |   52|    311|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (264:8): [True: 55, False: 256]
  ------------------
  265|     55|      return TRUE;
  ------------------
  |  |  986|     55|#define TRUE true
  ------------------
  266|    256|    pnow = Curl_pgrs_now(data);
  267|    256|    remain_ms = ctx->he_aaaa_await_ms -
  268|    256|                Curl_resolv_elapsed_ms(data, ctx->resolv_id, pnow);
  269|    256|    if(remain_ms <= 0)
  ------------------
  |  Branch (269:8): [True: 34, False: 222]
  ------------------
  270|     34|      return TRUE;
  ------------------
  |  |  986|     34|#define TRUE true
  ------------------
  271|    222|    CURL_TRC_CF(data, cf, "[%s] still waiting %" FMT_TIMEDIFF_T
  ------------------
  |  |  153|    222|  do {                                          \
  |  |  154|    222|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    222|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    444|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 222, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 112, False: 110]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    444|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 112, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    112|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    222|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    112|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 112, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 47, False: 65]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    222|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    222|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 222]
  |  |  ------------------
  ------------------
  272|    222|                "ms for AAAA result",
  273|    222|                Curl_resolv_query_str(ctx->dns_queries), remain_ms);
  274|    222|    Curl_expire_set(data, EXPIRE_HAPPY_EYEBALLS, remain_ms, pnow);
  275|    222|    return FALSE;
  ------------------
  |  |  989|    222|#define FALSE false
  ------------------
  276|    256|  }
  277|      0|  else {
  278|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  279|      0|  }
  280|       |#else
  281|       |  (void)data;
  282|       |  DEBUGASSERT(0); /* We should not come here */
  283|       |  return FALSE;
  284|       |#endif /* USE_CURL_ASYNC */
  285|   155k|}
cf-dns.c:cf_dns_adjust_pollset:
  372|  69.3k|{
  373|  69.3k|#ifdef USE_CURL_ASYNC
  374|  69.3k|  if(!cf->connected) {
  ------------------
  |  Branch (374:6): [True: 69.3k, False: 0]
  ------------------
  375|       |    /* The pollset only works when we have started the resolving.
  376|       |     * Otherwise we might wait on the WAKEUP socketpair forever.
  377|       |     * Since DNS filters can be added in the middle of a connect
  378|       |     * attempt, they are not always started that way. */
  379|  69.3k|    struct cf_dns_ctx *ctx = cf->ctx;
  380|  69.3k|    if(!ctx->started) {
  ------------------
  |  Branch (380:8): [True: 0, False: 69.3k]
  ------------------
  381|      0|      CURL_TRC_CF(data, cf, "adjust_pollset, starting %s:%u queries=%s",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  382|      0|                  ctx->peer->hostname, ctx->peer->port,
  383|      0|                  Curl_resolv_query_str(ctx->dns_queries));
  384|      0|      ctx->started = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  385|      0|      ctx->resolv_result = cf_dns_start(cf, data, &ctx->dns);
  386|      0|      if(ctx->resolv_result || ctx->dns) {
  ------------------
  |  Branch (386:10): [True: 0, False: 0]
  |  Branch (386:32): [True: 0, False: 0]
  ------------------
  387|      0|        Curl_multi_mark_dirty(data);
  388|      0|      }
  389|      0|    }
  390|  69.3k|    return Curl_resolv_pollset(data, ps);
  391|  69.3k|  }
  392|       |#else
  393|       |  (void)cf;
  394|       |  (void)data;
  395|       |  (void)ps;
  396|       |#endif
  397|      0|  return CURLE_OK;
  398|  69.3k|}
cf-dns.c:cf_dns_cntrl:
  403|  36.1k|{
  404|  36.1k|  struct cf_dns_ctx *ctx = cf->ctx;
  405|  36.1k|  CURLcode result = CURLE_OK;
  406|       |
  407|  36.1k|  (void)arg1;
  408|  36.1k|  (void)arg2;
  409|  36.1k|  switch(event) {
  410|  9.12k|  case CF_CTRL_DATA_DONE:
  ------------------
  |  |  118|  9.12k|#define CF_CTRL_DATA_DONE               7  /* premature  NULL     ignored */
  ------------------
  |  Branch (410:3): [True: 9.12k, False: 27.0k]
  ------------------
  411|  9.12k|    if(ctx->dns) {
  ------------------
  |  Branch (411:8): [True: 7.27k, False: 1.85k]
  ------------------
  412|       |      /* Should only come here when the connect attempt failed and
  413|       |       * `data` is giving up on it. On a successful connect, we already
  414|       |       * unlinked the DNS entry. */
  415|  7.27k|      Curl_dns_entry_unlink(data, &ctx->dns);
  416|  7.27k|    }
  417|  9.12k|    break;
  418|  27.0k|  default:
  ------------------
  |  Branch (418:3): [True: 27.0k, False: 9.12k]
  ------------------
  419|  27.0k|    break;
  420|  36.1k|  }
  421|  36.1k|  return result;
  422|  36.1k|}
cf-dns.c:cf_dns_add_resolve:
  519|  18.7k|{
  520|  18.7k|  struct Curl_cfchain *chain, *top_chain;
  521|  18.7k|  struct Curl_cfilter *cf_dns = NULL;
  522|  18.7k|  bool is_addr = CURL_DNSQ_IS_ADDR(dns_queries);
  ------------------
  |  |   56|  18.7k|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|  18.7k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  18.7k|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  18.7k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  523|       |
  524|  18.7k|  if((dns_queries & CURL_DNSQ_HTTPS) &&
  ------------------
  |  |   53|  18.7k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (524:6): [True: 9.38k, False: 9.38k]
  ------------------
  525|  9.38k|     Curl_is_ipaddr(peer->hostname)) {
  ------------------
  |  Branch (525:6): [True: 7.66k, False: 1.72k]
  ------------------
  526|  7.66k|    dns_queries = (uint8_t)(dns_queries & ~CURL_DNSQ_HTTPS);
  ------------------
  |  |   53|  7.66k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  527|  7.66k|  }
  528|       |
  529|  18.7k|  top_chain = cf->chain;
  530|  18.7k|  while(top_chain->parent)
  ------------------
  |  Branch (530:9): [True: 0, False: 18.7k]
  ------------------
  531|      0|    top_chain = top_chain->parent;
  532|       |
  533|  37.5k|  for(chain = cf->chain; chain; chain = chain->parent) {
  ------------------
  |  Branch (533:26): [True: 18.7k, False: 18.7k]
  ------------------
  534|  18.7k|    top_chain = chain;
  535|  31.6k|    for(cf = chain->cf; cf && dns_queries; cf = cf->next) {
  ------------------
  |  Branch (535:25): [True: 20.4k, False: 11.1k]
  |  Branch (535:31): [True: 12.8k, False: 7.66k]
  ------------------
  536|  12.8k|      if(cf->cft == &Curl_cft_dns) {
  ------------------
  |  Branch (536:10): [True: 1.72k, False: 11.1k]
  ------------------
  537|  1.72k|        struct cf_dns_ctx *ctx = cf->ctx;
  538|  1.72k|        cf_dns = cf;
  539|  1.72k|        if(Curl_peer_same_destination(ctx->peer, peer)) {
  ------------------
  |  Branch (539:12): [True: 119, False: 1.60k]
  ------------------
  540|       |          /* subtract queries already being scheduled/ongoing */
  541|    119|          dns_queries = (uint8_t)(~ctx->dns_queries & dns_queries);
  542|    119|          if(!dns_queries) { /* already there */
  ------------------
  |  Branch (542:14): [True: 0, False: 119]
  ------------------
  543|      0|            return CURLE_OK;
  544|      0|          }
  545|    119|          else if(is_addr && !ctx->started &&
  ------------------
  |  Branch (545:19): [True: 119, False: 0]
  |  Branch (545:30): [True: 119, False: 0]
  ------------------
  546|    119|                  CURL_DNSQ_IS_ADDR(ctx->dns_queries)) {
  ------------------
  |  |   56|    119|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|    119|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|    119|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|    119|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (56:31): [True: 0, False: 119]
  |  |  ------------------
  ------------------
  547|      0|            ctx->dns_queries |= dns_queries;
  548|      0|            CURL_TRC_DNS(data, "[%s] added queries=%s for %s:%u",
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  549|      0|                         Curl_resolv_query_str(ctx->dns_queries),
  550|      0|                         Curl_resolv_query_str(dns_queries),
  551|      0|                         peer->hostname, peer->port);
  552|      0|            return CURLE_OK;
  553|      0|          }
  554|    119|        }
  555|  1.72k|      }
  556|  12.8k|    }
  557|  18.7k|  }
  558|       |
  559|  18.7k|  if(dns_queries) {
  ------------------
  |  Branch (559:6): [True: 11.1k, False: 7.66k]
  ------------------
  560|       |    /* No existing filter is handling these, add a new DNS filter
  561|       |     * (after the last one if there was one already. FCFS. */
  562|  11.1k|    if(cf_dns)
  ------------------
  |  Branch (562:8): [True: 1.72k, False: 9.38k]
  ------------------
  563|  1.72k|      return cf_dns_insert_after(cf_dns, data, peer, dns_queries, transport);
  564|  9.38k|    else
  565|  9.38k|      return cf_dns_add(data, top_chain, peer, dns_queries, transport);
  566|  11.1k|  }
  567|  7.66k|  return CURLE_OK;
  568|  18.7k|}
cf-dns.c:cf_dns_insert_after:
  504|  1.72k|{
  505|  1.72k|  struct Curl_cfilter *cf;
  506|  1.72k|  CURLcode result;
  507|       |
  508|  1.72k|  result = cf_dns_create(&cf, data, peer, dns_queries, transport, FALSE);
  ------------------
  |  |  989|  1.72k|#define FALSE false
  ------------------
  509|  1.72k|  if(!result)
  ------------------
  |  Branch (509:6): [True: 1.71k, False: 2]
  ------------------
  510|  1.71k|    Curl_conn_cf_insert_after(cf_at, cf);
  511|  1.72k|  return result;
  512|  1.72k|}
cf-dns.c:cf_dns_create:
  447|  11.1k|{
  448|  11.1k|  struct Curl_cfilter *cf = NULL;
  449|  11.1k|  struct cf_dns_ctx *ctx;
  450|  11.1k|  CURLcode result = CURLE_OK;
  451|       |
  452|  11.1k|  (void)data;
  453|  11.1k|  ctx = cf_dns_ctx_create(data, peer, dns_queries, transport, for_proxy);
  454|  11.1k|  if(!ctx) {
  ------------------
  |  Branch (454:6): [True: 3, False: 11.1k]
  ------------------
  455|      3|    result = CURLE_OUT_OF_MEMORY;
  456|      3|    goto out;
  457|      3|  }
  458|       |
  459|  11.1k|  result = Curl_cf_create(&cf, &Curl_cft_dns, ctx);
  460|       |
  461|  11.1k|out:
  462|  11.1k|  *pcf = result ? NULL : cf;
  ------------------
  |  Branch (462:10): [True: 7, False: 11.1k]
  ------------------
  463|  11.1k|  if(result)
  ------------------
  |  Branch (463:6): [True: 7, False: 11.1k]
  ------------------
  464|      7|    cf_dns_ctx_destroy(data, ctx);
  465|  11.1k|  return result;
  466|  11.1k|}
cf-dns.c:cf_dns_ctx_create:
   61|  11.1k|{
   62|  11.1k|  struct cf_dns_ctx *ctx;
   63|       |
   64|  11.1k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|  11.1k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
   65|  11.1k|  if(!ctx)
  ------------------
  |  Branch (65:6): [True: 3, False: 11.1k]
  ------------------
   66|      3|    return NULL;
   67|       |
   68|  11.1k|  Curl_peer_link(&ctx->peer, peer);
   69|  11.1k|  ctx->dns_queries = dns_queries;
   70|  11.1k|  ctx->transport = transport;
   71|  11.1k|  ctx->for_proxy = for_proxy;
   72|  11.1k|  ctx->he_aaaa_await_ms = CURL_HE_AAAA_AWAIT_MS;
  ------------------
  |  |   41|  11.1k|#define CURL_HE_AAAA_AWAIT_MS    25
  ------------------
   73|  11.1k|#ifdef DEBUGBUILD
   74|  11.1k|  {
   75|  11.1k|    const char *p = getenv("CURL_DBG_HE_AAAA_AWAIT_MS");
   76|  11.1k|    if(p) {
  ------------------
  |  Branch (76:8): [True: 0, False: 11.1k]
  ------------------
   77|      0|      curl_off_t l;
   78|      0|      if(!curlx_str_number(&p, &l, UINT32_MAX)) {
  ------------------
  |  Branch (78:10): [True: 0, False: 0]
  ------------------
   79|      0|        ctx->he_aaaa_await_ms = (uint32_t)l;
   80|      0|      }
   81|      0|    }
   82|  11.1k|  }
   83|  11.1k|#endif
   84|       |
   85|  11.1k|  CURL_TRC_DNS(data, "[%s] created DNS filter for %s:%u, transport=%x",
  ------------------
  |  |  168|  11.1k|  do {                                 \
  |  |  169|  11.1k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  11.1k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  11.1k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  22.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 11.1k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 1.20k, False: 9.90k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  22.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 1.20k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  1.20k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  11.1k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.20k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 244, False: 959]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  11.1k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  11.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 11.1k]
  |  |  ------------------
  ------------------
   86|  11.1k|               Curl_resolv_query_str(ctx->dns_queries),
   87|  11.1k|               peer->hostname, peer->port, ctx->transport);
   88|  11.1k|  return ctx;
   89|  11.1k|}
cf-dns.c:cf_dns_add:
  475|  9.38k|{
  476|  9.38k|  struct Curl_cfilter *cf = NULL;
  477|  9.38k|  bool for_proxy = FALSE;
  ------------------
  |  |  989|  9.38k|#define FALSE false
  ------------------
  478|  9.38k|  CURLcode result;
  479|       |
  480|  9.38k|  if(!peer)
  ------------------
  |  Branch (480:6): [True: 0, False: 9.38k]
  ------------------
  481|      0|    return CURLE_FAILED_INIT;
  482|  9.38k|#ifndef CURL_DISABLE_PROXY
  483|  9.38k|  for_proxy = (peer == chain->conn->socks_proxy.peer) ||
  ------------------
  |  Branch (483:15): [True: 0, False: 9.38k]
  ------------------
  484|  9.38k|              (peer == chain->conn->http_proxy.peer);
  ------------------
  |  Branch (484:15): [True: 5.66k, False: 3.72k]
  ------------------
  485|  9.38k|#endif
  486|       |
  487|  9.38k|  result = cf_dns_create(&cf, data, peer, dns_queries, transport, for_proxy);
  488|  9.38k|  if(!result)
  ------------------
  |  Branch (488:6): [True: 9.38k, False: 5]
  ------------------
  489|  9.38k|    Curl_cfchain_add(chain, cf);
  490|  9.38k|  return result;
  491|  9.38k|}

dnsc_peer2id:
   66|  22.4k|{
   67|  22.4k|  curlx_str_assign(&pid->name, peer->hostname, strlen(peer->hostname));
   68|  22.4k|  pid->port = peer->port;
   69|  22.4k|  pid->type = type;
   70|  22.4k|}
dnsc_id2key:
   88|  22.4k|{
   89|  22.4k|  size_t namelen = curlx_strlen(&id->name);
  ------------------
  |  |   50|  22.4k|#define curlx_strlen(x) ((x)->len)
  ------------------
   90|  22.4k|  if(namelen > (MAX_HOSTCACHE_LEN - 3))
  ------------------
  |  |   68|  22.4k|#define MAX_HOSTCACHE_LEN (255 + 3) /* max FQDN + type + port */
  ------------------
  |  Branch (90:6): [True: 0, False: 22.4k]
  ------------------
   91|      0|    namelen = MAX_HOSTCACHE_LEN - 3;
  ------------------
  |  |   68|      0|#define MAX_HOSTCACHE_LEN (255 + 3) /* max FQDN + type + port */
  ------------------
   92|       |  /* store and lower case the name */
   93|  22.4k|  key->data[0] = id->type;
   94|  22.4k|  key->data[1] = (uint8_t)((id->port >> 8) & 0xff);
   95|  22.4k|  key->data[2] = (uint8_t)(id->port & 0xff);
   96|  22.4k|  Curl_strntolower((char *)key->data + 3, curlx_str(&id->name), namelen);
  ------------------
  |  |   49|  22.4k|#define curlx_str(x)    ((x)->str)
  ------------------
   97|  22.4k|  key->len = namelen + 3;
   98|  22.4k|}
Curl_dnscache_prune:
  218|  9.37k|{
  219|  9.37k|  struct Curl_dnscache *dnscache = dnscache_get(data);
  220|       |  /* the timeout may be set -1 (forever) */
  221|  9.37k|  timediff_t timeout_ms = data->set.dns_cache_timeout_ms;
  222|       |
  223|  9.37k|  if(!dnscache || (timeout_ms == -1))
  ------------------
  |  Branch (223:6): [True: 0, False: 9.37k]
  |  Branch (223:19): [True: 0, False: 9.37k]
  ------------------
  224|       |    /* NULL hostcache means we cannot do it */
  225|      0|    return;
  226|       |
  227|  9.37k|  dnscache_lock(data, dnscache);
  228|       |
  229|  9.37k|  do {
  230|       |    /* Remove outdated and unused entries from the hostcache */
  231|  9.37k|    timediff_t oldest_ms =
  232|  9.37k|      dnscache_prune(&dnscache->entries, timeout_ms, pnow);
  233|       |
  234|  9.37k|    if(Curl_hash_count(&dnscache->entries) > MAX_DNS_CACHE_SIZE)
  ------------------
  |  |   59|  9.37k|#define MAX_DNS_CACHE_SIZE 29999
  ------------------
  |  Branch (234:8): [True: 0, False: 9.37k]
  ------------------
  235|       |      /* prune the ones over half this age */
  236|      0|      timeout_ms = oldest_ms / 2;
  237|  9.37k|    else
  238|  9.37k|      break;
  239|       |
  240|       |    /* if the cache size is still too big, use the oldest age as new prune
  241|       |       limit */
  242|  9.37k|  } while(timeout_ms);
  ------------------
  |  Branch (242:11): [True: 0, False: 0]
  ------------------
  243|       |
  244|  9.37k|  dnscache_unlock(data, dnscache);
  245|  9.37k|}
Curl_dnscache_get:
  355|  13.1k|{
  356|  13.1k|  struct Curl_dnscache *dnscache = dnscache_get(data);
  357|  13.1k|  struct Curl_dns_entry *dns = NULL;
  358|  13.1k|  CURLcode result = CURLE_OK;
  359|       |
  360|  13.1k|  dnscache_lock(data, dnscache);
  361|  13.1k|  result = fetch_entry(data, dnscache, dns_queries, peer, &dns);
  362|  13.1k|  if(!result && dns)
  ------------------
  |  Branch (362:6): [True: 13.1k, False: 0]
  |  Branch (362:17): [True: 0, False: 13.1k]
  ------------------
  363|      0|    dns->refcount++; /* we pass out a reference */
  364|  13.1k|  else if(result) {
  ------------------
  |  Branch (364:11): [True: 0, False: 13.1k]
  ------------------
  365|      0|    DEBUGASSERT(!dns);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (365:5): [True: 0, False: 0]
  |  Branch (365:5): [True: 0, False: 0]
  ------------------
  366|      0|    dns = NULL;
  367|      0|  }
  368|  13.1k|  dnscache_unlock(data, dnscache);
  369|       |
  370|  13.1k|  CURL_TRC_DNS(data, "cache lookup %s:%u queries=%s -> %d %sfound",
  ------------------
  |  |  168|  13.1k|  do {                                 \
  |  |  169|  13.1k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  13.1k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  13.1k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  26.3k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 13.1k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 1.63k, False: 11.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  26.3k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 1.63k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  1.63k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  13.1k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.63k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 358, False: 1.27k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  13.1k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (170:26): [True: 0, False: 358]
  |  |  ------------------
  |  |  171|  13.1k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 13.1k]
  |  |  ------------------
  ------------------
  371|  13.1k|               peer->hostname, peer->port, Curl_resolv_query_str(dns_queries),
  372|  13.1k|               (int)result, dns ? "" : "not ");
  373|  13.1k|  *pentry = dns;
  374|  13.1k|  return result;
  375|  13.1k|}
Curl_dnsc_mk_addr:
  566|  9.24k|{
  567|  9.24k|  struct dnsc_id id;
  568|  9.24k|  struct Curl_dns_entry *dns;
  569|       |
  570|  9.24k|  dnsc_peer2id(&id, CURL_DNST_ADDR, peer);
  ------------------
  |  |   42|  9.24k|#define CURL_DNST_ADDR      'A'
  ------------------
  571|  9.24k|  dns = dnsc_entry_create(&id, FALSE);
  ------------------
  |  |  989|  9.24k|#define FALSE false
  ------------------
  572|       |  dns = dnsc_entry_assign_addr(data, dns, dns_queries, paddr, NULL);
  573|  9.24k|  return dns;
  574|  9.24k|}
Curl_dnscache_add:
  730|  9.24k|{
  731|  9.24k|  struct Curl_dnscache *dnscache = dnscache_get(data);
  732|  9.24k|  struct Curl_str name;
  733|  9.24k|  struct dnsc_id id;
  734|  9.24k|  struct dnsc_key key;
  735|       |
  736|  9.24k|  if(!dnscache)
  ------------------
  |  Branch (736:6): [True: 0, False: 9.24k]
  ------------------
  737|      0|    return CURLE_FAILED_INIT;
  738|  9.24k|  if(!entry || (entry->type == CURL_DNST_INIT))
  ------------------
  |  |   41|  9.24k|#define CURL_DNST_INIT      '\0'
  ------------------
  |  Branch (738:6): [True: 0, False: 9.24k]
  |  Branch (738:16): [True: 0, False: 9.24k]
  ------------------
  739|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  740|       |
  741|  9.24k|  curlx_str_assign(&name, entry->hostname, entry->hostlen);
  742|  9.24k|  dnsc_str2id(&id, entry->type, &name, entry->port);
  743|  9.24k|  dnsc_id2key(&key, &id);
  744|       |
  745|       |  /* Store the resolved data in our DNS cache and up ref count */
  746|  9.24k|  dnscache_lock(data, dnscache);
  747|  9.24k|  if(!dnsc_add_entry(data, dnscache, &key, entry)) {
  ------------------
  |  Branch (747:6): [True: 10, False: 9.23k]
  ------------------
  748|     10|    dnscache_unlock(data, dnscache);
  749|     10|    return CURLE_OUT_OF_MEMORY;
  750|     10|  }
  751|  9.23k|  entry->refcount++;
  752|  9.23k|  dnscache_unlock(data, dnscache);
  753|  9.23k|  CURL_TRC_DNS(data, "cached entry for %s:%u queries=%s",
  ------------------
  |  |  168|  9.23k|  do {                                 \
  |  |  169|  9.23k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  9.23k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  9.23k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  18.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 9.23k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 876, False: 8.35k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  18.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 876, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    876|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  9.23k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    876|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 162, False: 714]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  9.23k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  9.23k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 9.23k]
  |  |  ------------------
  ------------------
  754|  9.23k|               entry->hostname, entry->port,
  755|  9.23k|               Curl_resolv_query_str(entry->dns_queries));
  756|  9.23k|  return CURLE_OK;
  757|  9.24k|}
Curl_dnscache_add_negative:
  762|     68|{
  763|     68|  struct Curl_dnscache *dnscache = dnscache_get(data);
  764|     68|  struct Curl_dns_entry *dns = NULL;
  765|     68|  struct dnsc_id id;
  766|     68|  CURLcode result = CURLE_OK;
  767|       |
  768|     68|  DEBUGASSERT(dnscache);
  ------------------
  |  | 1016|     68|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (768:3): [True: 0, False: 68]
  |  Branch (768:3): [True: 68, False: 0]
  ------------------
  769|     68|  if(!dnscache)
  ------------------
  |  Branch (769:6): [True: 0, False: 68]
  ------------------
  770|      0|    return CURLE_FAILED_INIT;
  771|       |
  772|     68|  dnscache_lock(data, dnscache);
  773|       |
  774|     68|  if(dns_queries & CURL_DNSQ_ADDR) {
  ------------------
  |  |   55|     68|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   51|     68|#define CURL_DNSQ_A           (1U << 0)
  |  |  ------------------
  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   52|     68|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  ------------------
  ------------------
  |  Branch (774:6): [True: 68, False: 0]
  ------------------
  775|       |    /* put this new host in the cache */
  776|     68|    dnsc_peer2id(&id, CURL_DNST_ADDR, peer);
  ------------------
  |  |   42|     68|#define CURL_DNST_ADDR      'A'
  ------------------
  777|     68|    dns = dnsc_add_peer_addr(data, dnscache, dns_queries, NULL, &id, FALSE);
  ------------------
  |  |  989|     68|#define FALSE false
  ------------------
  778|     68|    if(!dns)
  ------------------
  |  Branch (778:8): [True: 5, False: 63]
  ------------------
  779|      5|      result = CURLE_OUT_OF_MEMORY;
  780|     68|  }
  781|      0|#ifdef USE_HTTPSRR
  782|      0|  else if(dns_queries == CURL_DNSQ_HTTPS) {
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (782:11): [True: 0, False: 0]
  ------------------
  783|      0|    dnsc_peer2id(&id, CURL_DNST_HTTPS, peer);
  ------------------
  |  |   43|      0|#define CURL_DNST_HTTPS     'H'
  ------------------
  784|      0|    dns = dnsc_add_https(data, dnscache, NULL, &id);
  785|      0|    if(!dns)
  ------------------
  |  Branch (785:8): [True: 0, False: 0]
  ------------------
  786|      0|      result = CURLE_OUT_OF_MEMORY;
  787|      0|  }
  788|      0|#endif
  789|      0|  else {
  790|       |    /* a query we do not know, just cache nothing */
  791|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (791:5): [Folded, False: 0]
  |  Branch (791:5): [Folded, False: 0]
  ------------------
  792|      0|  }
  793|       |
  794|     68|  if(dns) {
  ------------------
  |  Branch (794:6): [True: 63, False: 5]
  ------------------
  795|       |    /* release the returned reference; the cache itself will keep the
  796|       |     * entry alive: */
  797|     63|    dns->refcount--;
  798|     63|    CURL_TRC_DNS(data, "cache negative name resolve for %s:%d type=%s",
  ------------------
  |  |  168|     63|  do {                                 \
  |  |  169|     63|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|     63|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|     63|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|    126|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 63, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 17, False: 46]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|    126|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 17, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|     17|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|     63|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|     17|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 2, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|     63|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|     63|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 63]
  |  |  ------------------
  ------------------
  799|     63|                 peer->hostname, peer->port,
  800|     63|                 Curl_resolv_query_str(dns_queries));
  801|     63|  }
  802|     68|  dnscache_unlock(data, dnscache);
  803|     68|  return result;
  804|     68|}
Curl_dns_entry_unlink:
  815|  20.2k|{
  816|  20.2k|  if(*pdns) {
  ------------------
  |  Branch (816:6): [True: 9.24k, False: 10.9k]
  ------------------
  817|  9.24k|    struct Curl_dnscache *dnscache = dnscache_get(data);
  818|  9.24k|    struct Curl_dns_entry *dns = *pdns;
  819|  9.24k|    *pdns = NULL;
  820|  9.24k|    dnscache_lock(data, dnscache);
  821|  9.24k|    dns->refcount--;
  822|  9.24k|    if(dns->refcount == 0)
  ------------------
  |  Branch (822:8): [True: 10, False: 9.23k]
  ------------------
  823|     10|      dnscache_entry_free(dns);
  824|  9.24k|    dnscache_unlock(data, dnscache);
  825|  9.24k|  }
  826|  20.2k|}
Curl_dnscache_init:
  841|  9.82k|{
  842|  9.82k|  Curl_hash_init(&dns->entries, size, CURL_HASH_TYPE_BYTES,
  843|  9.82k|                 dnscache_entry_dtor);
  844|  9.82k|}
Curl_dnscache_destroy:
  847|  9.82k|{
  848|  9.82k|  Curl_hash_destroy(&dns->entries);
  849|  9.82k|}
dnscache.c:dnscache_get:
  191|  41.1k|{
  192|  41.1k|  if(data->share && data->share->specifier & (1 << CURL_LOCK_DATA_DNS))
  ------------------
  |  Branch (192:6): [True: 0, False: 41.1k]
  |  Branch (192:21): [True: 0, False: 0]
  ------------------
  193|      0|    return &data->share->dnscache;
  194|  41.1k|  if(data->multi)
  ------------------
  |  Branch (194:6): [True: 41.1k, False: 0]
  ------------------
  195|  41.1k|    return &data->multi->dnscache;
  196|      0|  return NULL;
  197|  41.1k|}
dnscache.c:dnscache_lock:
  201|  41.1k|{
  202|  41.1k|  if(data->share && dnscache == &data->share->dnscache)
  ------------------
  |  Branch (202:6): [True: 0, False: 41.1k]
  |  Branch (202:21): [True: 0, False: 0]
  ------------------
  203|      0|    Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE);
  204|  41.1k|}
dnscache.c:dnscache_prune:
  176|  9.37k|{
  177|  9.37k|  struct dnscache_prune_data user;
  178|       |
  179|  9.37k|  user.max_age_ms = cache_timeout_ms;
  180|  9.37k|  user.pnow = pnow;
  181|  9.37k|  user.oldest_ms = 0;
  182|       |
  183|  9.37k|  Curl_hash_clean_with_criterium(hostcache,
  184|  9.37k|                                 (void *)&user,
  185|  9.37k|                                 dnscache_entry_is_stale);
  186|       |
  187|  9.37k|  return user.oldest_ms;
  188|  9.37k|}
dnscache.c:dnscache_entry_is_stale:
  140|  9.29k|{
  141|  9.29k|  struct dnscache_prune_data *prune = (struct dnscache_prune_data *)datap;
  142|  9.29k|  struct Curl_dns_entry *dns = (struct Curl_dns_entry *)hc;
  143|       |
  144|  9.29k|  if(!dns->permanent) {
  ------------------
  |  Branch (144:6): [True: 9.29k, False: 0]
  ------------------
  145|       |    /* get age in milliseconds */
  146|  9.29k|    timediff_t age_ms = curlx_ptimediff_ms(prune->pnow, &dns->added);
  147|  9.29k|    switch(dns->type) {
  148|  9.29k|    case CURL_DNST_ADDR:
  ------------------
  |  |   42|  9.29k|#define CURL_DNST_ADDR      'A'
  ------------------
  |  Branch (148:5): [True: 9.29k, False: 0]
  ------------------
  149|  9.29k|      if(!dns->addr)
  ------------------
  |  Branch (149:10): [True: 63, False: 9.23k]
  ------------------
  150|     63|        age_ms *= 2; /* negative entries age twice as fast */
  151|  9.29k|      break;
  152|      0|#ifdef USE_HTTPSRR
  153|      0|    case CURL_DNST_HTTPS:
  ------------------
  |  |   43|      0|#define CURL_DNST_HTTPS     'H'
  ------------------
  |  Branch (153:5): [True: 0, False: 9.29k]
  ------------------
  154|      0|      if(!dns->hinfo)
  ------------------
  |  Branch (154:10): [True: 0, False: 0]
  ------------------
  155|      0|        age_ms *= 2; /* negative entries age twice as fast */
  156|      0|      break;
  157|      0|#endif
  158|      0|    default:
  ------------------
  |  Branch (158:5): [True: 0, False: 9.29k]
  ------------------
  159|      0|      break;
  160|  9.29k|    }
  161|  9.29k|    if(age_ms >= prune->max_age_ms)
  ------------------
  |  Branch (161:8): [True: 0, False: 9.29k]
  ------------------
  162|      0|      return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  163|  9.29k|    if(age_ms > prune->oldest_ms)
  ------------------
  |  Branch (163:8): [True: 3.40k, False: 5.88k]
  ------------------
  164|  3.40k|      prune->oldest_ms = age_ms;
  165|  9.29k|  }
  166|  9.29k|  return FALSE;
  ------------------
  |  |  989|  9.29k|#define FALSE false
  ------------------
  167|  9.29k|}
dnscache.c:dnscache_unlock:
  208|  41.1k|{
  209|  41.1k|  if(data->share && dnscache == &data->share->dnscache)
  ------------------
  |  Branch (209:6): [True: 0, False: 41.1k]
  |  Branch (209:21): [True: 0, False: 0]
  ------------------
  210|      0|    Curl_share_unlock(data, CURL_LOCK_DATA_DNS);
  211|  41.1k|}
dnscache.c:fetch_entry:
  263|  13.1k|{
  264|  13.1k|  struct Curl_dns_entry *dns = NULL;
  265|  13.1k|  struct dnsc_id id;
  266|  13.1k|  struct dnsc_key key;
  267|  13.1k|  char type = CURL_DNSQ_IS_ADDR(dns_queries) ?
  ------------------
  |  |   56|  13.1k|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|  13.1k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  13.1k|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  13.1k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (56:31): [True: 9.75k, False: 3.43k]
  |  |  ------------------
  ------------------
  268|  9.75k|              CURL_DNST_ADDR : CURL_DNST_HTTPS;
  ------------------
  |  |   42|  9.75k|#define CURL_DNST_ADDR      'A'
  ------------------
                            CURL_DNST_ADDR : CURL_DNST_HTTPS;
  ------------------
  |  |   43|  16.6k|#define CURL_DNST_HTTPS     'H'
  ------------------
  269|  13.1k|  CURLcode result = CURLE_OK;
  270|       |
  271|  13.1k|  *pdns = NULL;
  272|  13.1k|  if(!dnscache)
  ------------------
  |  Branch (272:6): [True: 0, False: 13.1k]
  ------------------
  273|      0|    return CURLE_OK;
  274|       |
  275|  13.1k|  dnsc_peer2id(&id, type, peer);
  276|  13.1k|  dnsc_id2key(&key, &id);
  277|       |
  278|       |  /* See if it is already in our dns cache */
  279|  13.1k|  dns = Curl_hash_pick(&dnscache->entries, key.data, key.len);
  280|       |
  281|  13.1k|  if(dns && !dnsc_id_matches_entry(&id, dns)) {
  ------------------
  |  Branch (281:6): [True: 0, False: 13.1k]
  |  Branch (281:13): [True: 0, False: 0]
  ------------------
  282|       |    /* May happen on hostnames longer than MAX_HOSTCACHE_LEN */
  283|      0|    dns = NULL;
  284|      0|  }
  285|       |
  286|       |  /* No entry found in cache, check if we might have a wildcard entry */
  287|  13.1k|  if(!dns && (type == CURL_DNST_ADDR) && data->state.wildcard_resolve) {
  ------------------
  |  |   42|  13.1k|#define CURL_DNST_ADDR      'A'
  ------------------
  |  Branch (287:6): [True: 13.1k, False: 0]
  |  Branch (287:14): [True: 9.75k, False: 3.43k]
  |  Branch (287:42): [True: 0, False: 9.75k]
  ------------------
  288|      0|    struct Curl_str wildname;
  289|       |
  290|      0|    curlx_str_assign(&wildname, "*", 1);
  291|      0|    dnsc_str2id(&id, CURL_DNST_ADDR, &wildname, peer->port);
  ------------------
  |  |   42|      0|#define CURL_DNST_ADDR      'A'
  ------------------
  292|      0|    dnsc_id2key(&key, &id);
  293|       |
  294|       |    /* See if it is already in our dns cache */
  295|      0|    dns = Curl_hash_pick(&dnscache->entries, key.data, key.len);
  296|      0|  }
  297|       |
  298|  13.1k|  if(dns && (data->set.dns_cache_timeout_ms != -1)) {
  ------------------
  |  Branch (298:6): [True: 0, False: 13.1k]
  |  Branch (298:13): [True: 0, False: 0]
  ------------------
  299|       |    /* See whether the returned entry is stale. Done before we release lock */
  300|      0|    struct dnscache_prune_data user;
  301|       |
  302|      0|    user.pnow = Curl_pgrs_now(data);
  303|      0|    user.max_age_ms = data->set.dns_cache_timeout_ms;
  304|      0|    user.oldest_ms = 0;
  305|       |
  306|      0|    if(dnscache_entry_is_stale(&user, dns)) {
  ------------------
  |  Branch (306:8): [True: 0, False: 0]
  ------------------
  307|      0|      infof(data, "Hostname in DNS cache was stale, zapped");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  308|      0|      dns = NULL; /* the memory deallocation is being handled by the hash */
  309|      0|      Curl_hash_delete(&dnscache->entries, key.data, key.len);
  310|      0|    }
  311|      0|  }
  312|       |
  313|       |  /* We need to cache address information and HTTPS-RR separately. */
  314|  13.1k|  if(dns && CURL_DNSQ_IS_ADDR(dns_queries)) {
  ------------------
  |  |   56|      0|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|      0|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (56:31): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (314:6): [True: 0, False: 13.1k]
  ------------------
  315|      0|    if((uint8_t)(dns->dns_queries & dns_queries) !=
  ------------------
  |  Branch (315:8): [True: 0, False: 0]
  ------------------
  316|      0|       (uint8_t)(dns_queries & CURL_DNSQ_ADDR)) {
  ------------------
  |  |   55|      0|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  |  |  ------------------
  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  ------------------
  ------------------
  317|       |      /* The entry does not cover all wanted address queries, a miss. */
  318|      0|      dns = NULL;
  319|      0|    }
  320|      0|    else if(!(dns->dns_responses & dns_queries)) {
  ------------------
  |  Branch (320:13): [True: 0, False: 0]
  ------------------
  321|       |      /* The entry has no responses for the wanted DNS queries. */
  322|      0|      CURL_TRC_DNS(data, "cache entry does not have type=%s addresses",
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  323|      0|                   Curl_resolv_query_str(dns_queries));
  324|      0|      dns = NULL;
  325|      0|      result = CURLE_COULDNT_RESOLVE_HOST;
  326|      0|    }
  327|      0|    else if(dns && !dns->addr) { /* negative entry */
  ------------------
  |  Branch (327:13): [True: 0, False: 0]
  |  Branch (327:20): [True: 0, False: 0]
  ------------------
  328|      0|      dns = NULL;
  329|      0|      result = CURLE_COULDNT_RESOLVE_HOST;
  330|      0|    }
  331|      0|  }
  332|       |
  333|  13.1k|  *pdns = dns;
  334|  13.1k|  return result;
  335|  13.1k|}
dnscache.c:dnsc_entry_create:
  470|  9.31k|{
  471|  9.31k|  struct Curl_dns_entry *dns = NULL;
  472|       |
  473|  9.31k|  if(curlx_strlen(&pid->name) > UINT16_MAX)
  ------------------
  |  |   50|  9.31k|#define curlx_strlen(x) ((x)->len)
  ------------------
  |  Branch (473:6): [True: 0, False: 9.31k]
  ------------------
  474|      0|    goto out;
  475|       |
  476|       |  /* Create a new cache entry,
  477|       |     struct already has the hostname null-terminator */
  478|  9.31k|  dns = curlx_calloc(1, sizeof(struct Curl_dns_entry) +
  ------------------
  |  | 1500|  9.31k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  479|  9.31k|                     curlx_strlen(&pid->name));
  480|  9.31k|  if(!dns)
  ------------------
  |  Branch (480:6): [True: 7, False: 9.30k]
  ------------------
  481|      7|    goto out;
  482|       |
  483|  9.30k|  dns->refcount = 1; /* the cache has the first reference */
  484|  9.30k|  dns->port = pid->port;
  485|  9.30k|  dns->hostlen = (uint16_t)curlx_strlen(&pid->name);
  ------------------
  |  |   50|  9.30k|#define curlx_strlen(x) ((x)->len)
  ------------------
  486|  9.30k|  if(dns->hostlen)
  ------------------
  |  Branch (486:6): [True: 9.30k, False: 0]
  ------------------
  487|  9.30k|    memcpy(dns->hostname, curlx_str(&pid->name), dns->hostlen);
  ------------------
  |  |   49|  9.30k|#define curlx_str(x)    ((x)->str)
  ------------------
  488|  9.30k|  dns->permanent = permanent;
  489|       |
  490|  9.31k|out:
  491|  9.31k|  return dns;
  492|  9.30k|}
dnscache.c:dnsc_entry_assign_addr:
  500|  9.31k|{
  501|  9.31k|  if(!dns)
  ------------------
  |  Branch (501:6): [True: 7, False: 9.30k]
  ------------------
  502|      7|    goto out;
  503|       |  /* only do this when this is the only reference */
  504|  9.30k|  DEBUGASSERT(dns->refcount == 1);
  ------------------
  |  | 1016|  9.30k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (504:3): [True: 0, False: 9.30k]
  |  Branch (504:3): [True: 9.30k, False: 0]
  ------------------
  505|  9.30k|  DEBUGASSERT(dns->type == CURL_DNST_INIT);
  ------------------
  |  | 1016|  9.30k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (505:3): [True: 0, False: 9.30k]
  |  Branch (505:3): [True: 9.30k, False: 0]
  ------------------
  506|       |
  507|  9.30k|  dns->type = CURL_DNST_ADDR;
  ------------------
  |  |   42|  9.30k|#define CURL_DNST_ADDR      'A'
  ------------------
  508|       |  /* queries should only be about addresses */
  509|  9.30k|  DEBUGASSERT(!(dns_queries & ~CURL_DNSQ_ADDR));
  ------------------
  |  | 1016|  9.30k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (509:3): [True: 0, False: 9.30k]
  |  Branch (509:3): [True: 9.30k, False: 0]
  ------------------
  510|  9.30k|  dns->dns_queries = (dns_queries & CURL_DNSQ_ADDR);
  ------------------
  |  |   55|  9.30k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   51|  9.30k|#define CURL_DNSQ_A           (1U << 0)
  |  |  ------------------
  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   52|  9.30k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  ------------------
  ------------------
  511|       |
  512|       |  /* Take the given address lists into the entry */
  513|  9.30k|  if(paddr1 && *paddr1) {
  ------------------
  |  Branch (513:6): [True: 9.24k, False: 64]
  |  Branch (513:16): [True: 9.24k, False: 0]
  ------------------
  514|  9.24k|    dns->addr = *paddr1;
  515|  9.24k|    *paddr1 = NULL;
  516|  9.24k|  }
  517|  9.30k|  if(paddr2 && *paddr2) {
  ------------------
  |  Branch (517:6): [True: 0, False: 9.30k]
  |  Branch (517:16): [True: 0, False: 0]
  ------------------
  518|      0|    struct Curl_addrinfo **phead = &dns->addr;
  519|      0|    while(*phead)
  ------------------
  |  Branch (519:11): [True: 0, False: 0]
  ------------------
  520|      0|      phead = &(*phead)->ai_next;
  521|      0|    *phead = *paddr2;
  522|      0|    *paddr2 = NULL;
  523|      0|  }
  524|       |
  525|  9.30k|  if((dns_queries & CURL_DNSQ_A) &&
  ------------------
  |  |   51|  9.30k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (525:6): [True: 9.30k, False: 0]
  ------------------
  526|  9.30k|     dnscache_ai_has_family(dns->addr, PF_INET))
  ------------------
  |  Branch (526:6): [True: 9.23k, False: 70]
  ------------------
  527|  9.23k|    dns->dns_responses |= CURL_DNSQ_A;
  ------------------
  |  |   51|  9.23k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  528|       |
  529|  9.30k|#ifdef USE_IPV6
  530|  9.30k|  if((dns_queries & CURL_DNSQ_AAAA) &&
  ------------------
  |  |   52|  9.30k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (530:6): [True: 9.30k, False: 0]
  ------------------
  531|  9.30k|     dnscache_ai_has_family(dns->addr, PF_INET6))
  ------------------
  |  Branch (531:6): [True: 6, False: 9.30k]
  ------------------
  532|      6|    dns->dns_responses |= CURL_DNSQ_AAAA;
  ------------------
  |  |   52|      6|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  533|  9.30k|#endif /* USE_IPV6 */
  534|       |
  535|  9.30k|#ifndef CURL_DISABLE_SHUFFLE_DNS
  536|       |  /* shuffle addresses if requested */
  537|  9.30k|  if(data->set.dns_shuffle_addresses && dns->addr) {
  ------------------
  |  Branch (537:6): [True: 0, False: 9.30k]
  |  Branch (537:41): [True: 0, False: 0]
  ------------------
  538|      0|    CURLcode result = dns_shuffle_addr(data, &dns->addr);
  539|      0|    if(result) {
  ------------------
  |  Branch (539:8): [True: 0, False: 0]
  ------------------
  540|       |      /* free without lock, we are the sole owner */
  541|      0|      dnscache_entry_free(dns);
  542|      0|      dns = NULL;
  543|      0|      goto out;
  544|      0|    }
  545|      0|  }
  546|       |#else
  547|       |  (void)data;
  548|       |#endif
  549|       |
  550|  9.31k|out:
  551|  9.31k|  if(paddr1 && *paddr1) {
  ------------------
  |  Branch (551:6): [True: 9.24k, False: 68]
  |  Branch (551:16): [True: 3, False: 9.24k]
  ------------------
  552|      3|    Curl_freeaddrinfo(*paddr1);
  553|      3|    *paddr1 = NULL;
  554|      3|  }
  555|  9.31k|  if(paddr2 && *paddr2) {
  ------------------
  |  Branch (555:6): [True: 0, False: 9.31k]
  |  Branch (555:16): [True: 0, False: 0]
  ------------------
  556|      0|    Curl_freeaddrinfo(*paddr2);
  557|       |    *paddr2 = NULL;
  558|      0|  }
  559|  9.31k|  return dns;
  560|  9.30k|}
dnscache.c:dnscache_ai_has_family:
  460|  18.6k|{
  461|  27.8k|  for(; ai; ai = ai->ai_next) {
  ------------------
  |  Branch (461:9): [True: 18.4k, False: 9.37k]
  ------------------
  462|  18.4k|    if(ai->ai_family == ai_family)
  ------------------
  |  Branch (462:8): [True: 9.24k, False: 9.24k]
  ------------------
  463|  9.24k|      return TRUE;
  ------------------
  |  |  986|  9.24k|#define TRUE true
  ------------------
  464|  18.4k|  }
  465|  9.37k|  return FALSE;
  ------------------
  |  |  989|  9.37k|#define FALSE false
  ------------------
  466|  18.6k|}
dnscache.c:dnsc_str2id:
   74|  9.24k|{
   75|  9.24k|  pid->name = *name;
   76|  9.24k|  pid->port = port;
   77|  9.24k|  pid->type = type;
   78|  9.24k|}
dnscache.c:dnsc_add_entry:
  595|  9.30k|{
  596|  9.30k|  entry->added = *Curl_pgrs_now(data);
  597|  9.30k|  return Curl_hash_add(&dnscache->entries, key->data, key->len, entry);
  598|  9.30k|}
dnscache.c:dnsc_add_peer_addr:
  705|     68|{
  706|     68|  struct Curl_dns_entry *dns;
  707|     68|  struct Curl_dns_entry *dns2;
  708|     68|  struct dnsc_key key;
  709|       |
  710|     68|  dns = dnsc_entry_create(id, permanent);
  711|     68|  dns = dnsc_entry_assign_addr(data, dns, dns_queries, paddr, NULL);
  712|     68|  if(!dns)
  ------------------
  |  Branch (712:6): [True: 4, False: 64]
  ------------------
  713|      4|    return NULL;
  714|       |
  715|       |  /* Store the resolved data in our DNS cache. */
  716|     64|  dnsc_id2key(&key, id);
  717|     64|  dns2 = dnsc_add_entry(data, dnscache, &key, dns);
  718|     64|  if(!dns2) {
  ------------------
  |  Branch (718:6): [True: 1, False: 63]
  ------------------
  719|      1|    dnscache_entry_free(dns);
  720|      1|    return NULL;
  721|      1|  }
  722|       |
  723|     63|  dns = dns2;
  724|     63|  dns->refcount++; /* mark entry as in-use */
  725|     63|  return dns;
  726|     64|}
dnscache.c:dnscache_entry_free:
  118|  9.30k|{
  119|  9.30k|  Curl_freeaddrinfo(dns->addr);
  120|  9.30k|#ifdef USE_HTTPSRR
  121|  9.30k|  Curl_httpsrr_destroy(dns->hinfo);
  122|  9.30k|#endif
  123|  9.30k|  curlx_free(dns);
  ------------------
  |  | 1503|  9.30k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  124|  9.30k|}
dnscache.c:dnscache_entry_dtor:
  829|  9.29k|{
  830|  9.29k|  struct Curl_dns_entry *dns = (struct Curl_dns_entry *)entry;
  831|  9.29k|  DEBUGASSERT(dns && (dns->refcount > 0));
  ------------------
  |  | 1016|  9.29k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (831:3): [True: 0, False: 9.29k]
  |  Branch (831:3): [True: 0, False: 0]
  |  Branch (831:3): [True: 9.29k, False: 0]
  |  Branch (831:3): [True: 9.29k, False: 0]
  ------------------
  832|  9.29k|  dns->refcount--;
  833|  9.29k|  if(dns->refcount == 0)
  ------------------
  |  Branch (833:6): [True: 9.29k, False: 0]
  ------------------
  834|  9.29k|    dnscache_entry_free(dns);
  835|  9.29k|}

Curl_doh_cleanup:
 1283|  3.63k|{
 1284|  3.63k|  struct doh_probes *dohp = async->doh;
 1285|  3.63k|  if(dohp) {
  ------------------
  |  Branch (1285:6): [True: 0, False: 3.63k]
  ------------------
 1286|      0|    doh_close(data, async);
 1287|       |    curlx_safefree(async->doh);
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1288|      0|  }
 1289|  3.63k|}

Curl_resolv_dns_queries:
  126|  9.38k|{
  127|  9.38k|  (void)data;
  128|  9.38k|  switch(ip_version) {
  129|      0|  case CURL_IPRESOLVE_V6:
  ------------------
  |  | 2332|      0|#define CURL_IPRESOLVE_V6       2L /* uses only IPv6 addresses/connections */
  ------------------
  |  Branch (129:3): [True: 0, False: 9.38k]
  ------------------
  130|      0|    return CURL_DNSQ_AAAA;
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  131|      0|  case CURL_IPRESOLVE_V4:
  ------------------
  |  | 2331|      0|#define CURL_IPRESOLVE_V4       1L /* uses only IPv4 addresses/connections */
  ------------------
  |  Branch (131:3): [True: 0, False: 9.38k]
  ------------------
  132|      0|    return CURL_DNSQ_A;
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  133|  9.38k|  default:
  ------------------
  |  Branch (133:3): [True: 9.38k, False: 0]
  ------------------
  134|  9.38k|    if(ipv6works(data))
  ------------------
  |  Branch (134:8): [True: 9.38k, False: 0]
  ------------------
  135|  9.38k|      return (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   51|  9.38k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                    return (CURL_DNSQ_A | CURL_DNSQ_AAAA);
  ------------------
  |  |   52|  9.38k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  136|      0|    else
  137|      0|      return CURL_DNSQ_A;
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  138|  9.38k|  }
  139|  9.38k|}
Curl_resolv_query_str:
  143|  1.87k|{
  144|  1.87k|  switch(dns_queries) {
  145|      0|  case (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                case (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
                case (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (145:3): [True: 0, False: 1.87k]
  ------------------
  146|      0|    return "A+AAAA+HTTPS";
  147|  1.24k|  case (CURL_DNSQ_A | CURL_DNSQ_AAAA):
  ------------------
  |  |   51|  1.24k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                case (CURL_DNSQ_A | CURL_DNSQ_AAAA):
  ------------------
  |  |   52|  1.24k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (147:3): [True: 1.24k, False: 632]
  ------------------
  148|  1.24k|    return "A+AAAA";
  149|      0|  case (CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
                case (CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (149:3): [True: 0, False: 1.87k]
  ------------------
  150|      0|    return "AAAA+HTTPS";
  151|    111|  case (CURL_DNSQ_AAAA):
  ------------------
  |  |   52|    111|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (151:3): [True: 111, False: 1.76k]
  ------------------
  152|    111|    return "AAAA";
  153|      0|  case (CURL_DNSQ_A | CURL_DNSQ_HTTPS):
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                case (CURL_DNSQ_A | CURL_DNSQ_HTTPS):
  ------------------
  |  |   53|      0|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (153:3): [True: 0, False: 1.87k]
  ------------------
  154|      0|    return "A+HTTPS";
  155|    108|  case (CURL_DNSQ_A):
  ------------------
  |  |   51|    108|#define CURL_DNSQ_A           (1U << 0)
  ------------------
  |  Branch (155:3): [True: 108, False: 1.76k]
  ------------------
  156|    108|    return "A";
  157|    366|  case (CURL_DNSQ_HTTPS):
  ------------------
  |  |   53|    366|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (157:3): [True: 366, False: 1.50k]
  ------------------
  158|    366|    return "HTTPS";
  159|     47|  case 0:
  ------------------
  |  Branch (159:3): [True: 47, False: 1.82k]
  ------------------
  160|     47|    return "-";
  161|      0|  default:
  ------------------
  |  Branch (161:3): [True: 0, False: 1.87k]
  ------------------
  162|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (162:5): [Folded, False: 0]
  |  Branch (162:5): [Folded, False: 0]
  ------------------
  163|      0|    return "???";
  164|  1.87k|  }
  165|  1.87k|}
Curl_probeipv6:
  290|  9.77k|{
  291|       |  /* probe to see if we have a working IPv6 stack */
  292|  9.77k|  curl_socket_t s = CURL_SOCKET(PF_INET6, SOCK_DGRAM, 0);
  ------------------
  |  | 1456|  9.77k|  curl_dbg_socket((int)(domain), type, protocol, __LINE__, __FILE__)
  ------------------
  293|  9.77k|  multi->ipv6_works = FALSE;
  ------------------
  |  |  989|  9.77k|#define FALSE false
  ------------------
  294|  9.77k|  if(s == CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  9.77k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (294:6): [True: 0, False: 9.77k]
  ------------------
  295|      0|    if(SOCKERRNO == SOCKENOMEM)
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
                  if(SOCKERRNO == SOCKENOMEM)
  ------------------
  |  | 1143|      0|#define SOCKENOMEM        ENOMEM
  ------------------
  |  Branch (295:8): [True: 0, False: 0]
  ------------------
  296|      0|      return CURLE_OUT_OF_MEMORY;
  297|      0|  }
  298|  9.77k|  else {
  299|  9.77k|    multi->ipv6_works = TRUE;
  ------------------
  |  |  986|  9.77k|#define TRUE true
  ------------------
  300|  9.77k|    sclose(s);
  ------------------
  |  | 1448|  9.77k|#define sclose(sockfd) curl_dbg_sclose(sockfd, __LINE__, __FILE__)
  ------------------
  301|  9.77k|  }
  302|  9.77k|  return CURLE_OK;
  303|  9.77k|}
Curl_host_is_ipnum:
  321|  3.59k|{
  322|  3.59k|  struct in_addr in;
  323|  3.59k|#ifdef USE_IPV6
  324|  3.59k|  struct in6_addr in6;
  325|  3.59k|#endif
  326|  3.59k|  if(!hostname || !*hostname)
  ------------------
  |  Branch (326:6): [True: 0, False: 3.59k]
  |  Branch (326:19): [True: 0, False: 3.59k]
  ------------------
  327|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  328|  3.59k|  if(curlx_inet_pton(AF_INET, hostname, &in) > 0
  ------------------
  |  Branch (328:6): [True: 946, False: 2.65k]
  ------------------
  329|  2.65k|#ifdef USE_IPV6
  330|  2.65k|     || curlx_inet_pton(AF_INET6, hostname, &in6) > 0
  ------------------
  |  Branch (330:9): [True: 357, False: 2.29k]
  ------------------
  331|  3.59k|#endif
  332|  3.59k|    )
  333|  1.30k|    return TRUE;
  ------------------
  |  |  986|  1.30k|#define TRUE true
  ------------------
  334|  2.29k|  return FALSE;
  ------------------
  |  |  989|  2.29k|#define FALSE false
  ------------------
  335|  3.59k|}
Curl_resolv_announce_start:
  366|  11.0k|{
  367|  11.0k|  if(data->set.resolver_start) {
  ------------------
  |  Branch (367:6): [True: 0, False: 11.0k]
  ------------------
  368|      0|    struct Curl_mapi_guard guard;
  369|      0|    int rc;
  370|       |
  371|      0|    CURL_TRC_DNS(data, "announcing resolve to application");
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  372|      0|    CURL_CBAPI_START(&guard, data, easy_resolver_start);
  ------------------
  |  |  201|      0|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
  373|      0|    rc = data->set.resolver_start(resolver, NULL,
  374|      0|                                  data->set.resolver_start_client);
  375|      0|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|      0|  Curl_cbapi_leave(g)
  ------------------
  376|      0|    if(rc) {
  ------------------
  |  Branch (376:8): [True: 0, False: 0]
  ------------------
  377|      0|      CURL_TRC_DNS(data, "application aborted resolve");
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  378|      0|      return CURLE_ABORTED_BY_CALLBACK;
  379|      0|    }
  380|      0|  }
  381|  11.0k|  return CURLE_OK;
  382|  11.0k|}
Curl_resolv_elapsed_ms:
  477|    256|{
  478|    256|  struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
  479|    256|  if(!async)
  ------------------
  |  Branch (479:6): [True: 0, False: 256]
  ------------------
  480|      0|    return CURL_TIMEOUT_RESOLVE_MS;
  ------------------
  |  |   38|      0|#define CURL_TIMEOUT_RESOLVE_MS (300 * 1000)
  ------------------
  481|    256|  return curlx_ptimediff_ms(pnow, &async->start);
  482|    256|}
Curl_resolv_has_answers:
  486|    311|{
  487|    311|  struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
  488|    311|  uint8_t check_queries;
  489|       |  /* a no longer existing/running resolve has all answers. */
  490|    311|  if(!async || async->done)
  ------------------
  |  Branch (490:6): [True: 0, False: 311]
  |  Branch (490:16): [True: 0, False: 311]
  ------------------
  491|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  492|       |  /* Relevant are only queries undertaken. Others are considered answered. */
  493|    311|  check_queries = (dns_queries & async->dns_queries);
  494|    311|  if((check_queries & async->dns_responses) != check_queries) {
  ------------------
  |  Branch (494:6): [True: 256, False: 55]
  ------------------
  495|    256|    return FALSE;
  ------------------
  |  |  989|    256|#define FALSE false
  ------------------
  496|    256|  }
  497|     55|  return TRUE;
  ------------------
  |  |  986|     55|#define TRUE true
  ------------------
  498|    311|}
Curl_resolv_get_ai:
  504|    344|{
  505|    344|  struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
  506|    344|  if(!async || !CURL_DNSQ_IS_ADDR(async->dns_queries))
  ------------------
  |  |   56|    344|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|    344|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|    344|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|    344|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (506:6): [True: 0, False: 344]
  |  Branch (506:16): [True: 0, False: 344]
  ------------------
  507|      0|    return NULL;
  508|    344|  switch(ai_family) {
  509|    172|  case AF_INET:
  ------------------
  |  Branch (509:3): [True: 172, False: 172]
  ------------------
  510|    172|    return Curl_addrinfo_get(async->ai_A, ai_family, index);
  511|      0|#ifdef USE_IPV6
  512|    172|  case AF_INET6:
  ------------------
  |  Branch (512:3): [True: 172, False: 172]
  ------------------
  513|    172|    return Curl_addrinfo_get(async->ai_AAAA, ai_family, index);
  514|      0|#endif
  515|      0|  default:
  ------------------
  |  Branch (515:3): [True: 0, False: 344]
  ------------------
  516|       |    return NULL;
  517|    344|  }
  518|    344|}
Curl_resolv_https:
  528|  1.71k|{
  529|  1.71k|  return Curl_resolv(data, peer, CURL_DNSQ_HTTPS, TRNSPRT_TCP,
  ------------------
  |  |   53|  1.71k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
                return Curl_resolv(data, peer, CURL_DNSQ_HTTPS, TRNSPRT_TCP,
  ------------------
  |  |  225|  1.71k|#define TRNSPRT_TCP  3
  ------------------
  530|  1.71k|                     for_proxy, timeout_ms, presolv_id, pdns);
  531|  1.71k|}
Curl_resolv_get_https:
  535|  1.65k|{
  536|  1.65k|  struct Curl_resolv_async *async;
  537|  1.65k|  if(!Curl_resolv_knows_https(data, resolv_id))
  ------------------
  |  Branch (537:6): [True: 0, False: 1.65k]
  ------------------
  538|      0|    return NULL;
  539|  1.65k|  async = Curl_async_get(data, resolv_id);
  540|  1.65k|  return async ? async->httpsrr : NULL;
  ------------------
  |  Branch (540:10): [True: 1.64k, False: 2]
  ------------------
  541|  1.65k|}
Curl_resolv_knows_https:
  544|  3.30k|{
  545|  3.30k|  struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
  546|  3.30k|  if(async && (async->dns_queries & CURL_DNSQ_HTTPS))
  ------------------
  |  |   53|  3.29k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (546:6): [True: 3.29k, False: 4]
  |  Branch (546:15): [True: 3.29k, False: 0]
  ------------------
  547|  3.29k|    return ((async->dns_responses & CURL_DNSQ_HTTPS) ||
  ------------------
  |  |   53|  3.29k|#define CURL_DNSQ_HTTPS       (1U << 2)
  ------------------
  |  Branch (547:13): [True: 0, False: 3.29k]
  ------------------
  548|  3.29k|            !async->queries_ongoing);
  ------------------
  |  Branch (548:13): [True: 3.29k, False: 0]
  ------------------
  549|      4|  return TRUE; /* we know it will never come */
  ------------------
  |  |  986|      4|#define TRUE true
  ------------------
  550|  3.30k|}
Curl_resolv:
 1034|  11.0k|{
 1035|  11.0k|  *presolv_id = 0;
 1036|  11.0k|  *pdns = NULL;
 1037|       |
 1038|  11.0k|  if(timeout_ms < 0)
  ------------------
  |  Branch (1038:6): [True: 0, False: 11.0k]
  ------------------
 1039|       |    /* got an already expired timeout */
 1040|      0|    return CURLE_OPERATION_TIMEDOUT;
 1041|  11.0k|  else if(!timeout_ms)
  ------------------
  |  Branch (1041:11): [True: 0, False: 11.0k]
  ------------------
 1042|      0|    timeout_ms = CURL_TIMEOUT_RESOLVE_MS;
  ------------------
  |  |   38|      0|#define CURL_TIMEOUT_RESOLVE_MS (300 * 1000)
  ------------------
 1043|       |
 1044|  11.0k|#ifdef USE_UNIX_SOCKETS
 1045|  11.0k|  if((dns_queries & CURL_DNSQ_ADDR) && peer->unix_socket)
  ------------------
  |  |   55|  11.0k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   51|  11.0k|#define CURL_DNSQ_A           (1U << 0)
  |  |  ------------------
  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  ------------------
  |  |  |  |   52|  11.0k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  ------------------
  ------------------
  |  Branch (1045:6): [True: 9.37k, False: 1.71k]
  |  Branch (1045:40): [True: 0, False: 9.37k]
  ------------------
 1046|      0|    return resolv_unix(data, peer, pdns);
 1047|       |#else
 1048|       |  if(peer->unix_socket)
 1049|       |    return hostip_resolv_failed(data, peer, for_proxy);
 1050|       |#endif
 1051|       |
 1052|       |#ifdef USE_ALARM_TIMEOUT
 1053|       |  if(dns_queries & CURL_DNSQ_ADDR) {
 1054|       |    if(timeout_ms && data->set.no_signal) {
 1055|       |      /* Cannot use ALARM when signals are disabled */
 1056|       |      timeout_ms = 0;
 1057|       |    }
 1058|       |    if(timeout_ms && !Curl_doh_wanted(data)) {
 1059|       |      return resolv_alarm_timeout(data, dns_queries, peer, transport,
 1060|       |                                  for_proxy, timeout_ms, presolv_id, pdns);
 1061|       |    }
 1062|       |  }
 1063|       |#endif /* !USE_ALARM_TIMEOUT */
 1064|       |
 1065|       |#ifndef CURLRES_ASYNCH
 1066|       |  if(timeout_ms)
 1067|       |    infof(data, "timeout on name lookup is not supported");
 1068|       |#endif
 1069|       |
 1070|  11.0k|  return hostip_resolv(data, dns_queries, peer, transport,
 1071|       |                       for_proxy, timeout_ms, TRUE, presolv_id, pdns);
  ------------------
  |  |  986|  11.0k|#define TRUE true
  ------------------
 1072|  11.0k|}
Curl_async_get:
 1078|  8.10k|{
 1079|  8.10k|  struct Curl_resolv_async *async = data->state.async;
 1080|  8.28k|  for(; async; async = async->next) {
  ------------------
  |  Branch (1080:9): [True: 8.28k, False: 6]
  ------------------
 1081|  8.28k|    if(async->id == resolv_id)
  ------------------
  |  Branch (1081:8): [True: 8.09k, False: 183]
  ------------------
 1082|  8.09k|      return async;
 1083|  8.28k|  }
 1084|      6|  return NULL;
 1085|  8.10k|}
Curl_resolv_take_result:
 1089|  2.09k|{
 1090|  2.09k|  struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
 1091|  2.09k|  CURLcode result;
 1092|       |
 1093|       |  /* If async resolving is ongoing, this must be set */
 1094|  2.09k|  if(!async)
  ------------------
  |  Branch (1094:6): [True: 0, False: 2.09k]
  ------------------
 1095|      0|    return CURLE_FAILED_INIT;
 1096|       |
 1097|       |  /* check if we have the name resolved by now (from someone else) */
 1098|  2.09k|  result = Curl_dnscache_get(data, async->dns_queries, async->peer, pdns);
 1099|  2.09k|  if(*pdns) {
  ------------------
  |  Branch (1099:6): [True: 0, False: 2.09k]
  ------------------
 1100|       |    /* Tell a possibly async resolver we no longer need the results. */
 1101|      0|    infof(data, "Hostname '%s' was found in DNS cache", async->peer->hostname);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1102|      0|    Curl_async_shutdown(data, async);
 1103|      0|    return CURLE_OK;
 1104|      0|  }
 1105|  2.09k|  else if(result) {
  ------------------
  |  Branch (1105:11): [True: 0, False: 2.09k]
  ------------------
 1106|      0|    Curl_async_shutdown(data, async);
 1107|      0|    return Curl_async_failed(data, async, NULL);
 1108|      0|  }
 1109|       |
 1110|  2.09k|  result = hostip_resolv_take_result(data, async, pdns);
 1111|       |
 1112|  2.09k|  if(*pdns) {
  ------------------
  |  Branch (1112:6): [True: 0, False: 2.09k]
  ------------------
 1113|       |    /* Add to cache */
 1114|      0|    result = Curl_dnscache_add(data, *pdns);
 1115|      0|    if(result)
  ------------------
  |  Branch (1115:8): [True: 0, False: 0]
  ------------------
 1116|      0|      Curl_dns_entry_unlink(data, pdns);
 1117|      0|  }
 1118|  2.09k|  else if(IS_RESOLV_FAIL(result)) {
  ------------------
  |  |   77|  2.09k|  (((result) == CURLE_COULDNT_RESOLVE_HOST) || \
  |  |  ------------------
  |  |  |  Branch (77:4): [True: 1.78k, False: 311]
  |  |  ------------------
  |  |   78|  2.09k|   ((result) == CURLE_COULDNT_RESOLVE_PROXY))
  |  |  ------------------
  |  |  |  Branch (78:4): [True: 0, False: 311]
  |  |  ------------------
  ------------------
 1119|       |    /* Only cache the failure when the resolver answered that the
 1120|       |       name does not exist. Transient failures, e.g. an unreachable
 1121|       |       or overloaded DNS server or local resource shortages, say
 1122|       |       nothing about the name and would poison the cache for every
 1123|       |       transfer using it. */
 1124|  1.78k|    if(async->negative_answer)
  ------------------
  |  Branch (1124:8): [True: 68, False: 1.71k]
  ------------------
 1125|     68|      Curl_dnscache_add_negative(data, async->dns_queries, async->peer);
 1126|  1.78k|    if(async->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
  ------------------
  |  |   51|  1.78k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                  if(async->dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
  ------------------
  |  |   52|  1.78k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (1126:8): [True: 68, False: 1.71k]
  ------------------
 1127|     68|      failf(data, "Could not resolve: %s:%u",
  ------------------
  |  |   62|     68|#define failf Curl_failf
  ------------------
 1128|     68|            async->peer->hostname, async->peer->port);
 1129|  1.78k|  }
 1130|    311|  else if(result) {
  ------------------
  |  Branch (1130:11): [True: 0, False: 311]
  ------------------
 1131|      0|    failf(data, "Error %d resolving %s:%u",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1132|      0|          (int)result, async->peer->hostname, async->peer->port);
 1133|      0|  }
 1134|  2.09k|  return result;
 1135|  2.09k|}
Curl_resolv_pollset:
 1139|  69.3k|{
 1140|  69.3k|  struct Curl_resolv_async *async = data->state.async;
 1141|  69.3k|  CURLcode result = CURLE_OK;
 1142|       |
 1143|  69.3k|  (void)ps;
 1144|  89.9k|  for(; async && !result; async = async->next) {
  ------------------
  |  Branch (1144:9): [True: 20.5k, False: 69.3k]
  |  Branch (1144:18): [True: 20.5k, False: 0]
  ------------------
 1145|  20.5k|#ifndef CURL_DISABLE_DOH
 1146|  20.5k|    if(async->doh) /* DoH has nothing for the pollset */
  ------------------
  |  Branch (1146:8): [True: 0, False: 20.5k]
  ------------------
 1147|      0|      continue;
 1148|  20.5k|#endif
 1149|  20.5k|    result = Curl_async_pollset(data, async, ps);
 1150|  20.5k|  }
 1151|  69.3k|  return result;
 1152|  69.3k|}
Curl_resolv_destroy:
 1155|  1.95k|{
 1156|  1.95k|  struct Curl_resolv_async **panchor = &data->state.async;
 1157|       |
 1158|  1.95k|  for(; *panchor; panchor = &(*panchor)->next) {
  ------------------
  |  Branch (1158:9): [True: 0, False: 1.95k]
  ------------------
 1159|      0|    struct Curl_resolv_async *async = *panchor;
 1160|      0|    if(async->id == resolv_id) {
  ------------------
  |  Branch (1160:8): [True: 0, False: 0]
  ------------------
 1161|      0|      *panchor = async->next;
 1162|      0|      Curl_async_destroy(data, async);
 1163|      0|      break;
 1164|      0|    }
 1165|      0|  }
 1166|  1.95k|}
Curl_resolv_shutdown_all:
 1169|  9.37k|{
 1170|  9.37k|  struct Curl_resolv_async *async = data->state.async;
 1171|  11.1k|  for(; async; async = async->next) {
  ------------------
  |  Branch (1171:9): [True: 1.81k, False: 9.37k]
  ------------------
 1172|  1.81k|    Curl_async_shutdown(data, async);
 1173|  1.81k|  }
 1174|  9.37k|}
Curl_resolv_destroy_all:
 1177|  29.4k|{
 1178|  31.2k|  while(data->state.async) {
  ------------------
  |  Branch (1178:9): [True: 1.81k, False: 29.4k]
  ------------------
 1179|  1.81k|    struct Curl_resolv_async *async = data->state.async;
 1180|  1.81k|    data->state.async = async->next;
 1181|  1.81k|    Curl_async_destroy(data, async);
 1182|  1.81k|  }
 1183|  29.4k|}
hostip.c:ipv6works:
  309|  9.38k|{
  310|  9.38k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  9.38k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (310:3): [True: 0, False: 9.38k]
  |  Branch (310:3): [True: 9.38k, False: 0]
  ------------------
  311|  9.38k|  DEBUGASSERT(data->multi);
  ------------------
  |  | 1016|  9.38k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (311:3): [True: 0, False: 9.38k]
  |  Branch (311:3): [True: 9.38k, False: 0]
  ------------------
  312|  9.38k|  return data ? data->multi->ipv6_works : FALSE;
  ------------------
  |  |  989|  9.38k|#define FALSE false
  ------------------
  |  Branch (312:10): [True: 9.38k, False: 0]
  ------------------
  313|  9.38k|}
hostip.c:hostip_resolv:
  715|  11.0k|{
  716|  11.0k|  size_t hostname_len;
  717|  11.0k|  CURLcode result = RESOLV_FAIL(for_proxy);
  ------------------
  |  |   74|  11.0k|  ((for_proxy) ? CURLE_COULDNT_RESOLVE_PROXY : CURLE_COULDNT_RESOLVE_HOST)
  |  |  ------------------
  |  |  |  Branch (74:4): [True: 5.65k, False: 5.43k]
  |  |  ------------------
  ------------------
  718|  11.0k|  bool cache_dns = FALSE;
  ------------------
  |  |  989|  11.0k|#define FALSE false
  ------------------
  719|  11.0k|  bool negative = FALSE;
  ------------------
  |  |  989|  11.0k|#define FALSE false
  ------------------
  720|       |
  721|  11.0k|  (void)timeout_ms; /* not used in all ifdefs */
  722|  11.0k|  *presolv_id = 0;
  723|  11.0k|  *pdns = NULL;
  724|       |
  725|       |#ifdef CURL_DISABLE_DOH
  726|       |  (void)allowDOH;
  727|       |#endif
  728|       |
  729|       |  /* We should intentionally error and not resolve .onion TLDs */
  730|  11.0k|  hostname_len = strlen(peer->hostname);
  731|  11.0k|  DEBUGASSERT(hostname_len);
  ------------------
  |  | 1016|  11.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (731:3): [True: 0, False: 11.0k]
  |  Branch (731:3): [True: 11.0k, False: 0]
  ------------------
  732|  11.0k|  if(hostname_len >= 7 &&
  ------------------
  |  Branch (732:6): [True: 11.0k, False: 7]
  ------------------
  733|  11.0k|     (curl_strequal(&peer->hostname[hostname_len - 6], ".onion") ||
  ------------------
  |  Branch (733:7): [True: 0, False: 11.0k]
  ------------------
  734|  11.0k|      curl_strequal(&peer->hostname[hostname_len - 7], ".onion."))) {
  ------------------
  |  Branch (734:7): [True: 0, False: 11.0k]
  ------------------
  735|      0|    failf(data, "Not resolving .onion address (RFC 7686)");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  736|      0|    goto out;
  737|      0|  }
  738|       |
  739|  11.0k|#ifdef DEBUGBUILD
  740|  11.0k|  CURL_TRC_DNS(data, "[%s] hostip_resolv(%s:%u)",
  ------------------
  |  |  168|  11.0k|  do {                                 \
  |  |  169|  11.0k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  11.0k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  11.0k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  22.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 11.0k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 1.20k, False: 9.88k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  22.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 1.20k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  1.20k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  11.0k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.20k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 243, False: 958]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  11.0k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  11.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 11.0k]
  |  |  ------------------
  ------------------
  741|  11.0k|               Curl_resolv_query_str(dns_queries), peer->hostname, peer->port);
  742|  11.0k|  if((CURL_DNSQ_IS_ADDR(dns_queries) == CURL_DNSQ_AAAA) &&
  ------------------
  |  |   56|  11.0k|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|  11.0k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  11.0k|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  11.0k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                if((CURL_DNSQ_IS_ADDR(dns_queries) == CURL_DNSQ_AAAA) &&
  ------------------
  |  |   52|  11.0k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (742:6): [True: 0, False: 11.0k]
  ------------------
  743|      0|     getenv("CURL_DBG_RESOLV_FAIL_IPV6")) {
  ------------------
  |  Branch (743:6): [True: 0, False: 0]
  ------------------
  744|      0|    infof(data, "DEBUG fail ipv6 resolve");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  745|      0|    result = hostip_resolv_failed(data, peer, for_proxy);
  746|      0|    goto out;
  747|      0|  }
  748|  11.0k|#endif
  749|       |  /* Let's check our DNS cache first */
  750|  11.0k|  result = Curl_dnscache_get(data, dns_queries, peer, pdns);
  751|  11.0k|  if(*pdns) {
  ------------------
  |  Branch (751:6): [True: 0, False: 11.0k]
  ------------------
  752|      0|    infof(data, "Hostname %s was found in DNS cache", peer->hostname);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  753|      0|    result = CURLE_OK;
  754|      0|  }
  755|  11.0k|  else if(result) {
  ------------------
  |  Branch (755:11): [True: 0, False: 11.0k]
  ------------------
  756|      0|    infof(data, "Negative DNS entry");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  757|      0|    result = hostip_resolv_failed(data, peer, for_proxy);
  758|      0|  }
  759|  11.0k|  else {
  760|       |    /* No luck, we need to start resolving. */
  761|  11.0k|    cache_dns = TRUE;
  ------------------
  |  |  986|  11.0k|#define TRUE true
  ------------------
  762|  11.0k|    result = hostip_resolv_start(data, dns_queries, peer, transport,
  763|  11.0k|                                 for_proxy, timeout_ms, allowDOH,
  764|  11.0k|                                 presolv_id, pdns, &negative);
  765|  11.0k|    CURL_TRC_DNS(data, "[%s] hostip_resolv started -> %d",
  ------------------
  |  |  168|  11.0k|  do {                                 \
  |  |  169|  11.0k|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|  11.0k|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|  11.0k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|  22.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 11.0k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 1.20k, False: 9.88k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|  22.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 1.20k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|  1.20k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|  11.0k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.20k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 243, False: 958]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|  11.0k|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|  11.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 11.0k]
  |  |  ------------------
  ------------------
  766|  11.0k|                 Curl_resolv_query_str(dns_queries), (int)result);
  767|  11.0k|  }
  768|       |
  769|  11.0k|out:
  770|  11.0k|  if(result && (result != CURLE_AGAIN)) {
  ------------------
  |  Branch (770:6): [True: 1.84k, False: 9.24k]
  |  Branch (770:16): [True: 34, False: 1.81k]
  ------------------
  771|     34|    Curl_dns_entry_unlink(data, pdns);
  772|     34|    if(IS_RESOLV_FAIL(result)) {
  ------------------
  |  |   77|     34|  (((result) == CURLE_COULDNT_RESOLVE_HOST) || \
  |  |  ------------------
  |  |  |  Branch (77:4): [True: 0, False: 34]
  |  |  ------------------
  |  |   78|     34|   ((result) == CURLE_COULDNT_RESOLVE_PROXY))
  |  |  ------------------
  |  |  |  Branch (78:4): [True: 0, False: 34]
  |  |  ------------------
  ------------------
  773|      0|      if(cache_dns && negative)
  ------------------
  |  Branch (773:10): [True: 0, False: 0]
  |  Branch (773:23): [True: 0, False: 0]
  ------------------
  774|      0|        Curl_dnscache_add_negative(data, dns_queries, peer);
  775|      0|      if(dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
  ------------------
  |  |   51|      0|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                    if(dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA))
  ------------------
  |  |   52|      0|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (775:10): [True: 0, False: 0]
  ------------------
  776|      0|        failf(data, "Could not resolve: %s:%u", peer->hostname, peer->port);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  777|      0|    }
  778|     34|    else {
  779|     34|      failf(data, "Error %d resolving %s:%u",
  ------------------
  |  |   62|     34|#define failf Curl_failf
  ------------------
  780|     34|            (int)result, peer->hostname, peer->port);
  781|     34|    }
  782|     34|  }
  783|  11.0k|  else if(cache_dns && *pdns) {
  ------------------
  |  Branch (783:11): [True: 11.0k, False: 0]
  |  Branch (783:24): [True: 9.24k, False: 1.81k]
  ------------------
  784|  9.24k|    result = Curl_dnscache_add(data, *pdns);
  785|  9.24k|    if(result)
  ------------------
  |  Branch (785:8): [True: 10, False: 9.23k]
  ------------------
  786|     10|      Curl_dns_entry_unlink(data, pdns);
  787|  9.24k|  }
  788|       |
  789|  11.0k|  return result;
  790|  11.0k|}
hostip.c:hostip_resolv_start:
  570|  11.0k|{
  571|  11.0k|#ifdef USE_CURL_ASYNC
  572|  11.0k|  struct Curl_resolv_async *async = NULL;
  573|  11.0k|#endif
  574|  11.0k|  struct Curl_addrinfo *addr = NULL;
  575|  11.0k|  size_t hostname_len;
  576|  11.0k|  bool addr_queries = (dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA));
  ------------------
  |  |   51|  11.0k|#define CURL_DNSQ_A           (1U << 0)
  ------------------
                bool addr_queries = (dns_queries & (CURL_DNSQ_A | CURL_DNSQ_AAAA));
  ------------------
  |  |   52|  11.0k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  577|  11.0k|  CURLcode result = CURLE_OK;
  578|       |
  579|  11.0k|  *pnegative = FALSE;
  ------------------
  |  |  989|  11.0k|#define FALSE false
  ------------------
  580|       |
  581|  11.0k|  (void)timeout_ms; /* not in all ifdefs */
  582|  11.0k|  *presolv_id = 0;
  583|  11.0k|  *pdns = NULL;
  584|       |
  585|       |  /* Check for "known" things to resolve ourselves. */
  586|  11.0k|  if(addr_queries) {
  ------------------
  |  Branch (586:6): [True: 9.37k, False: 1.71k]
  ------------------
  587|  9.37k|#ifndef USE_RESOLVE_ON_IPS
  588|  9.37k|    if(Curl_is_ipaddr(peer->hostname)) {
  ------------------
  |  Branch (588:8): [True: 9.25k, False: 119]
  ------------------
  589|       |      /* test655 verifies that the announce is done, even though there
  590|       |       * is no real resolving. So, keep doing this. */
  591|  9.25k|      result = Curl_resolv_announce_start(data, NULL);
  592|  9.25k|      if(result)
  ------------------
  |  Branch (592:10): [True: 0, False: 9.25k]
  ------------------
  593|      0|        goto out;
  594|       |      /* shortcut literal IP addresses, if we are not told to resolve them. */
  595|  9.25k|      result = Curl_str2addr(peer->hostname, peer->port, &addr);
  596|  9.25k|      goto out;
  597|  9.25k|    }
  598|    119|#endif
  599|       |
  600|    119|    hostname_len = strlen(peer->hostname);
  601|    119|    if(curl_strequal(peer->hostname, "localhost") ||
  ------------------
  |  Branch (601:8): [True: 0, False: 119]
  ------------------
  602|    119|       curl_strequal(peer->hostname, "localhost.") ||
  ------------------
  |  Branch (602:8): [True: 0, False: 119]
  ------------------
  603|    119|       tailmatch(peer->hostname, hostname_len, STRCONST(".localhost")) ||
  ------------------
  |  | 1324|    119|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|    119|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (603:8): [True: 0, False: 119]
  ------------------
  604|    119|       tailmatch(peer->hostname, hostname_len, STRCONST(".localhost."))) {
  ------------------
  |  | 1324|    119|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|    119|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  |  Branch (604:8): [True: 0, False: 119]
  ------------------
  605|      0|      result = Curl_resolv_announce_start(data, NULL);
  606|      0|      if(result)
  ------------------
  |  Branch (606:10): [True: 0, False: 0]
  ------------------
  607|      0|        goto out;
  608|      0|      addr = get_localhost(peer->port, peer->hostname);
  609|      0|      if(!addr)
  ------------------
  |  Branch (609:10): [True: 0, False: 0]
  ------------------
  610|      0|        result = CURLE_OUT_OF_MEMORY;
  611|      0|      goto out;
  612|      0|    }
  613|    119|  }
  614|  1.83k|#ifndef CURL_DISABLE_DOH
  615|  1.83k|  if(!Curl_is_ipaddr(peer->hostname) && allowDOH && data->set.doh) {
  ------------------
  |  Branch (615:6): [True: 1.83k, False: 0]
  |  Branch (615:41): [True: 1.83k, False: 0]
  |  Branch (615:53): [True: 0, False: 1.83k]
  ------------------
  616|      0|    result = Curl_resolv_announce_start(data, NULL);
  617|      0|    if(result)
  ------------------
  |  Branch (617:8): [True: 0, False: 0]
  ------------------
  618|      0|      goto out;
  619|      0|    if(!async) {
  ------------------
  |  Branch (619:8): [True: 0, False: 0]
  ------------------
  620|      0|      async = hostip_async_new(data, dns_queries, peer, transport,
  621|      0|                               for_proxy, timeout_ms);
  622|      0|      if(!async) {
  ------------------
  |  Branch (622:10): [True: 0, False: 0]
  ------------------
  623|      0|        result = CURLE_OUT_OF_MEMORY;
  624|      0|        goto out;
  625|      0|      }
  626|      0|    }
  627|      0|    result = Curl_doh(data, async);
  628|      0|    goto out;
  629|      0|  }
  630|       |#else
  631|       |  (void)allowDOH;
  632|       |#endif
  633|       |
  634|       |  /* Can we provide the requested IP specifics in resolving? */
  635|  1.83k|  if(!can_resolve_dns_queries(data, dns_queries)) {
  ------------------
  |  Branch (635:6): [True: 0, False: 1.83k]
  ------------------
  636|      0|    result = RESOLV_FAIL(for_proxy);
  ------------------
  |  |   74|      0|  ((for_proxy) ? CURLE_COULDNT_RESOLVE_PROXY : CURLE_COULDNT_RESOLVE_HOST)
  |  |  ------------------
  |  |  |  Branch (74:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  637|      0|    goto out;
  638|      0|  }
  639|       |
  640|  1.83k|#ifdef CURLRES_ASYNCH
  641|  1.83k|  (void)addr;
  642|  1.83k|  if(!async) {
  ------------------
  |  Branch (642:6): [True: 1.83k, False: 0]
  ------------------
  643|  1.83k|    async = hostip_async_new(data, dns_queries, peer, transport,
  644|  1.83k|                             for_proxy, timeout_ms);
  645|  1.83k|    if(!async) {
  ------------------
  |  Branch (645:8): [True: 9, False: 1.82k]
  ------------------
  646|      9|      result = CURLE_OUT_OF_MEMORY;
  647|      9|      goto out;
  648|      9|    }
  649|  1.83k|  }
  650|  1.82k|  result = Curl_async_getaddrinfo(data, async);
  651|  1.82k|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (651:6): [True: 0, False: 1.82k]
  ------------------
  652|       |    /* the answer might be there already. Check. */
  653|      0|    CURLcode r2 = hostip_resolv_take_result(data, async, pdns);
  654|      0|    if(r2)
  ------------------
  |  Branch (654:8): [True: 0, False: 0]
  ------------------
  655|      0|      result = r2;
  656|      0|    else if(*pdns)
  ------------------
  |  Branch (656:13): [True: 0, False: 0]
  ------------------
  657|      0|      result = CURLE_OK;
  658|      0|  }
  659|       |#else
  660|       |  result = Curl_resolv_announce_start(data, NULL);
  661|       |  if(result)
  662|       |    goto out;
  663|       |  addr = Curl_sync_getaddrinfo(data, dns_queries, peer->hostname, peer->port,
  664|       |                               transport);
  665|       |  if(!addr) {
  666|       |    result = RESOLV_FAIL(for_proxy);
  667|       |    /* the synchronous resolvers do not tell a transient failure from
  668|       |       an authoritative negative answer, treat it as before */
  669|       |    *pnegative = TRUE;
  670|       |  }
  671|       |#endif
  672|       |
  673|  11.0k|out:
  674|  11.0k|  if(!result) {
  ------------------
  |  Branch (674:6): [True: 11.0k, False: 31]
  ------------------
  675|  11.0k|    if(addr) {
  ------------------
  |  Branch (675:8): [True: 9.24k, False: 1.81k]
  ------------------
  676|       |      /* we got a response, create a dns entry, add to cache, return */
  677|  9.24k|      DEBUGASSERT(!*pdns);
  ------------------
  |  | 1016|  9.24k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (677:7): [True: 0, False: 9.24k]
  |  Branch (677:7): [True: 9.24k, False: 0]
  ------------------
  678|  9.24k|      *pdns = Curl_dnsc_mk_addr(data, dns_queries, &addr, peer);
  679|  9.24k|      if(!*pdns)
  ------------------
  |  Branch (679:10): [True: 3, False: 9.24k]
  ------------------
  680|      3|        result = CURLE_OUT_OF_MEMORY;
  681|  9.24k|    }
  682|  1.81k|    else if(!*pdns)
  ------------------
  |  Branch (682:13): [True: 1.81k, False: 0]
  ------------------
  683|  1.81k|      result = CURLE_AGAIN;
  684|  11.0k|  }
  685|     31|  else if(*pdns)
  ------------------
  |  Branch (685:11): [True: 0, False: 31]
  ------------------
  686|      0|    Curl_dns_entry_unlink(data, pdns);
  687|     31|  else if(addr)
  ------------------
  |  Branch (687:11): [True: 0, False: 31]
  ------------------
  688|      0|    Curl_freeaddrinfo(addr);
  689|       |
  690|  11.0k|#ifdef USE_CURL_ASYNC
  691|  11.0k|  if(async) {
  ------------------
  |  Branch (691:6): [True: 1.82k, False: 9.26k]
  ------------------
  692|  1.82k|    if(result == CURLE_AGAIN) { /* still need it, link, return id. */
  ------------------
  |  Branch (692:8): [True: 1.81k, False: 15]
  ------------------
  693|  1.81k|      *presolv_id = async->id;
  694|  1.81k|      async->next = data->state.async;
  695|  1.81k|      data->state.async = async;
  696|  1.81k|    }
  697|     15|    else {
  698|     15|      *pnegative = !!async->negative_answer;
  699|     15|      Curl_async_destroy(data, async);
  700|     15|    }
  701|  1.82k|  }
  702|  11.0k|#endif
  703|  11.0k|  return result;
  704|  11.0k|}
hostip.c:tailmatch:
  340|    238|{
  341|    238|  if(plen > flen)
  ------------------
  |  Branch (341:6): [True: 238, False: 0]
  ------------------
  342|    238|    return FALSE;
  ------------------
  |  |  989|    238|#define FALSE false
  ------------------
  343|      0|  return curl_strnequal(part, &full[flen - plen], plen);
  344|    238|}
hostip.c:hostip_async_new:
  392|  1.83k|{
  393|  1.83k|  struct Curl_resolv_async *async;
  394|       |
  395|  1.83k|  if(!data->multi) {
  ------------------
  |  Branch (395:6): [True: 0, False: 1.83k]
  ------------------
  396|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (396:5): [Folded, False: 0]
  |  Branch (396:5): [Folded, False: 0]
  ------------------
  397|      0|    return NULL;
  398|      0|  }
  399|       |
  400|       |  /* struct size already includes the null-terminator for hostname */
  401|  1.83k|  async = curlx_calloc(1, sizeof(*async));
  ------------------
  |  | 1500|  1.83k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  402|  1.83k|  if(!async)
  ------------------
  |  Branch (402:6): [True: 9, False: 1.82k]
  ------------------
  403|      9|    return NULL;
  404|       |
  405|       |  /* Give every async resolve operation a "unique" id. This may
  406|       |   * wrap around after a long time, making collisions highly unlikely.
  407|       |   * As we keep the async structs at the easy handle, chances of
  408|       |   * easy `mid plus resolv->id` colliding should be astronomical.
  409|       |   * `resolv_id == 0` is never used. */
  410|  1.82k|  if(data->multi->last_resolv_id == UINT32_MAX)
  ------------------
  |  Branch (410:6): [True: 0, False: 1.82k]
  ------------------
  411|      0|    data->multi->last_resolv_id = 1; /* wrap around */
  412|  1.82k|  else
  413|  1.82k|    data->multi->last_resolv_id++;
  414|  1.82k|  async->id = data->multi->last_resolv_id;
  415|  1.82k|  Curl_peer_link(&async->peer, peer);
  416|  1.82k|  async->dns_queries = dns_queries;
  417|  1.82k|  async->transport = transport;
  418|  1.82k|  async->for_proxy = for_proxy;
  419|  1.82k|  async->start = *Curl_pgrs_now(data);
  420|  1.82k|  async->timeout_ms = timeout_ms;
  421|  1.82k|  async->is_ipaddr = Curl_is_ipaddr(peer->hostname);
  422|  1.82k|  if(async->is_ipaddr)
  ------------------
  |  Branch (422:6): [True: 0, False: 1.82k]
  ------------------
  423|      0|    async->is_ipv4addr = Curl_is_ipv4addr(peer->hostname);
  424|       |
  425|  1.82k|  return async;
  426|  1.83k|}
hostip.c:can_resolve_dns_queries:
  357|  1.83k|{
  358|  1.83k|  (void)data;
  359|  1.83k|  if((CURL_DNSQ_IS_ADDR(dns_queries) == CURL_DNSQ_AAAA) && !ipv6works(data))
  ------------------
  |  |   56|  1.83k|#define CURL_DNSQ_IS_ADDR(x)  (uint8_t)((x)&(CURL_DNSQ_ADDR))
  |  |  ------------------
  |  |  |  |   55|  1.83k|#define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   51|  1.83k|#define CURL_DNSQ_A           (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |               #define CURL_DNSQ_ADDR        (uint8_t)(CURL_DNSQ_A | CURL_DNSQ_AAAA)
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|  1.83k|#define CURL_DNSQ_AAAA        (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                if((CURL_DNSQ_IS_ADDR(dns_queries) == CURL_DNSQ_AAAA) && !ipv6works(data))
  ------------------
  |  |   52|  1.83k|#define CURL_DNSQ_AAAA        (1U << 1)
  ------------------
  |  Branch (359:6): [True: 0, False: 1.83k]
  |  Branch (359:60): [True: 0, False: 0]
  ------------------
  360|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  361|  1.83k|  return TRUE;
  ------------------
  |  |  986|  1.83k|#define TRUE true
  ------------------
  362|  1.83k|}
hostip.c:hostip_resolv_take_result:
  431|  2.09k|{
  432|  2.09k|  CURLcode result;
  433|       |
  434|       |  /* If async resolving is ongoing, this must be set */
  435|  2.09k|  if(!async)
  ------------------
  |  Branch (435:6): [True: 0, False: 2.09k]
  ------------------
  436|      0|    return CURLE_FAILED_INIT;
  437|       |
  438|  2.09k|#ifndef CURL_DISABLE_DOH
  439|  2.09k|  if(async->doh)
  ------------------
  |  Branch (439:6): [True: 0, False: 2.09k]
  ------------------
  440|      0|    result = Curl_doh_take_result(data, async, pdns);
  441|  2.09k|  else
  442|  2.09k|#endif
  443|  2.09k|  result = Curl_async_take_result(data, async, pdns);
  444|       |
  445|  2.09k|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (445:6): [True: 311, False: 1.78k]
  ------------------
  446|    311|    CURL_TRC_DNS(data, "[%s] resolve incomplete, responses=%s, "
  ------------------
  |  |  168|    311|  do {                                 \
  |  |  169|    311|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|    311|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|    311|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|    622|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 311, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 137, False: 174]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|    622|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 137, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|    137|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|    311|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|    137|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 51, False: 86]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|    311|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|    311|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 311]
  |  |  ------------------
  ------------------
  447|    311|                 "ongoing=%d for %s:%d",
  448|    311|                 Curl_resolv_query_str(async->dns_queries),
  449|    311|                 Curl_resolv_query_str(async->dns_responses),
  450|    311|                 async->queries_ongoing,
  451|    311|                 async->peer->hostname, async->peer->port);
  452|    311|    result = CURLE_OK;
  453|    311|  }
  454|  1.78k|  else if(IS_RESOLV_FAIL(result)) {
  ------------------
  |  |   77|  1.78k|  (((result) == CURLE_COULDNT_RESOLVE_HOST) || \
  |  |  ------------------
  |  |  |  Branch (77:4): [True: 1.78k, False: 0]
  |  |  ------------------
  |  |   78|  1.78k|   ((result) == CURLE_COULDNT_RESOLVE_PROXY))
  |  |  ------------------
  |  |  |  Branch (78:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  455|  1.78k|    result = Curl_async_failed(data, async, NULL);
  456|  1.78k|  }
  457|      0|  else if(result) {
  ------------------
  |  Branch (457:11): [True: 0, False: 0]
  ------------------
  458|       |    /* a local failure, not a resolve answer. Keep the error as it
  459|       |       is so it does not get treated as one. */
  460|      0|    CURL_TRC_DNS(data, "[%s] resolve error %d for %s:%u",
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  461|      0|                 Curl_resolv_query_str(async->dns_queries),
  462|      0|                 (int)result, async->peer->hostname, async->peer->port);
  463|      0|  }
  464|      0|  else {
  465|      0|    CURL_TRC_DNS(data, "[%s] resolve complete for %s:%u",
  ------------------
  |  |  168|      0|  do {                                 \
  |  |  169|      0|    if(CURL_TRC_DNS_is_verbose(data))  \
  |  |  ------------------
  |  |  |  |  137|      0|  Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
  |  |  |  |  ------------------
  |  |  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  170|      0|      Curl_trc_dns(data, __VA_ARGS__); \
  |  |  171|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (171:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  466|      0|                 Curl_resolv_query_str(async->dns_queries),
  467|      0|                 async->peer->hostname, async->peer->port);
  468|      0|    DEBUGASSERT(*pdns);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (468:5): [True: 0, False: 0]
  |  Branch (468:5): [True: 0, False: 0]
  ------------------
  469|      0|  }
  470|       |
  471|  2.09k|  return result;
  472|  2.09k|}

Curl_httpsrr_destroy:
  229|  11.1k|{
  230|  11.1k|  if(rrinfo) {
  ------------------
  |  Branch (230:6): [True: 0, False: 11.1k]
  ------------------
  231|      0|    curlx_free(rrinfo->target);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  232|      0|    curlx_free(rrinfo->echconfiglist);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  233|      0|    curlx_free(rrinfo->ipv4hints);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  234|      0|    curlx_free(rrinfo->ipv6hints);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  235|      0|    curlx_free(rrinfo);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  236|      0|  }
  237|  11.1k|}
Curl_httpsrr_applicable:
  241|  9.29k|{
  242|  9.29k|  if(!data->conn)
  ------------------
  |  Branch (242:6): [True: 0, False: 9.29k]
  ------------------
  243|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  244|  9.29k|  return Curl_httpsrr_is_for_peer(data->conn->origin, rr);
  245|  9.29k|}
Curl_httpsrr_is_for_peer:
  249|  9.29k|{
  250|  9.29k|  if(!peer || !rr)
  ------------------
  |  Branch (250:6): [True: 0, False: 9.29k]
  |  Branch (250:15): [True: 9.29k, False: 0]
  ------------------
  251|  9.29k|    return FALSE;
  ------------------
  |  |  989|  9.29k|#define FALSE false
  ------------------
  252|      0|  return (!rr->target || !rr->target[0] ||
  ------------------
  |  Branch (252:11): [True: 0, False: 0]
  |  Branch (252:26): [True: 0, False: 0]
  ------------------
  253|      0|          (rr->target[0] == '.' && !rr->target[1])) &&
  ------------------
  |  Branch (253:12): [True: 0, False: 0]
  |  Branch (253:36): [True: 0, False: 0]
  ------------------
  254|      0|         (!rr->port_set || rr->port == peer->port);
  ------------------
  |  Branch (254:11): [True: 0, False: 0]
  |  Branch (254:28): [True: 0, False: 0]
  ------------------
  255|  9.29k|}

capsule_encap_udp_hdr:
  155|  2.68k|{
  156|  2.68k|  size_t off = 0;
  157|  2.68k|  DEBUGASSERT(hdrlen >= HTTP_CAPSULE_HEADER_MAX_SIZE);
  ------------------
  |  | 1016|  2.68k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (157:3): [True: 0, False: 2.68k]
  |  Branch (157:3): [True: 2.68k, False: 0]
  ------------------
  158|  2.68k|  if(hdrlen < HTTP_CAPSULE_HEADER_MAX_SIZE)
  ------------------
  |  |   35|  2.68k|#define HTTP_CAPSULE_HEADER_MAX_SIZE    10
  ------------------
  |  Branch (158:6): [True: 0, False: 2.68k]
  ------------------
  159|      0|    return 0;
  160|  2.68k|  hdr[off++] = 0; /* capsule type: HTTP Datagram */
  161|  2.68k|  off += capsule_encode_varint_buf(hdr + off, (uint64_t)payload_len + 1);
  162|  2.68k|  hdr[off++] = 0; /* context ID */
  163|  2.68k|  return off;
  164|  2.68k|}
Curl_capsule_encap_udp_datagram:
  168|  2.68k|{
  169|  2.68k|  CURLcode result;
  170|  2.68k|  uint8_t hdr[HTTP_CAPSULE_HEADER_MAX_SIZE];
  171|  2.68k|  size_t hdr_len, nwritten;
  172|       |
  173|  2.68k|  hdr_len = capsule_encap_udp_hdr(hdr, sizeof(hdr), blen);
  174|  2.68k|  DEBUGASSERT(hdr_len);
  ------------------
  |  | 1016|  2.68k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (174:3): [True: 0, False: 2.68k]
  |  Branch (174:3): [True: 2.68k, False: 0]
  ------------------
  175|  2.68k|  if(!hdr_len)
  ------------------
  |  Branch (175:6): [True: 0, False: 2.68k]
  ------------------
  176|      0|    return CURLE_FAILED_INIT;
  177|       |
  178|  2.68k|  result = Curl_bufq_write(q, hdr, hdr_len, &nwritten);
  179|  2.68k|  if(!result && (nwritten != hdr_len))
  ------------------
  |  Branch (179:6): [True: 2.68k, False: 4]
  |  Branch (179:17): [True: 0, False: 2.68k]
  ------------------
  180|      0|    return CURLE_WRITE_ERROR;
  181|  2.68k|  if(!result) {
  ------------------
  |  Branch (181:6): [True: 2.68k, False: 4]
  ------------------
  182|  2.68k|    result = Curl_bufq_write(q, buf, blen, &nwritten);
  183|  2.68k|    if(!result && (nwritten != blen))
  ------------------
  |  Branch (183:8): [True: 2.68k, False: 0]
  |  Branch (183:19): [True: 0, False: 2.68k]
  ------------------
  184|      0|      return CURLE_WRITE_ERROR;
  185|  2.68k|  }
  186|  2.68k|  if(result == CURLE_AGAIN)
  ------------------
  |  Branch (186:6): [True: 0, False: 2.68k]
  ------------------
  187|      0|    return CURLE_WRITE_ERROR;
  188|  2.68k|  return result;
  189|  2.68k|}
Curl_capsule_process_udp_raw:
  196|   125k|{
  197|   125k|  const unsigned char *context_id, *capsule_type;
  198|   125k|  size_t read_size, varint_len;
  199|   125k|  uint64_t capsule_length;
  200|   125k|  size_t offset, payload_len;
  201|   125k|  size_t bytes_read = 0;
  202|   125k|  CURLcode result = CURLE_OK;
  203|       |
  204|   125k|  if(!len) {
  ------------------
  |  Branch (204:6): [True: 0, False: 125k]
  ------------------
  205|      0|    *err = CURLE_BAD_FUNCTION_ARGUMENT;
  206|      0|    return 0;
  207|      0|  }
  208|       |
  209|   125k|  if(Curl_bufq_is_empty(recvbufq)) {
  ------------------
  |  Branch (209:6): [True: 68.0k, False: 57.3k]
  ------------------
  210|  68.0k|    *err = CURLE_AGAIN;
  211|  68.0k|    return 0;
  212|  68.0k|  }
  213|       |
  214|  57.3k|  if(!Curl_bufq_peek(recvbufq, &capsule_type, &read_size) || !read_size) {
  ------------------
  |  Branch (214:6): [True: 0, False: 57.3k]
  |  Branch (214:62): [True: 0, False: 57.3k]
  ------------------
  215|      0|    *err = CURLE_AGAIN;
  216|      0|    return 0;
  217|      0|  }
  218|       |
  219|  57.3k|  if(capsule_type[0]) {
  ------------------
  |  Branch (219:6): [True: 218, False: 57.1k]
  ------------------
  220|    218|    infof(data, "Error! Invalid capsule type: %d", capsule_type[0]);
  ------------------
  |  |  143|    218|  do {                               \
  |  |  144|    218|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    218|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 218, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 42, False: 176]
  |  |  |  |  ------------------
  |  |  |  |  323|    218|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 42, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     42|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    218|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    218|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 218]
  |  |  ------------------
  ------------------
  221|    218|    Curl_bufq_skip(recvbufq, 1);
  222|    218|    *err = CURLE_RECV_ERROR;
  223|    218|    return 0;
  224|    218|  }
  225|       |
  226|  57.1k|  offset = 1;
  227|  57.1k|  result = capsule_decode_varint_at(recvbufq, offset, &capsule_length,
  228|  57.1k|                                    &varint_len);
  229|  57.1k|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (229:6): [True: 11.9k, False: 45.2k]
  ------------------
  230|  11.9k|    *err = CURLE_AGAIN;
  231|  11.9k|    return 0;
  232|  11.9k|  }
  233|  45.2k|  else if(result) {
  ------------------
  |  Branch (233:11): [True: 0, False: 45.2k]
  ------------------
  234|      0|    *err = CURLE_RECV_ERROR;
  235|      0|    return 0;
  236|      0|  }
  237|  45.2k|  offset += varint_len;
  238|       |
  239|  45.2k|  if(!Curl_bufq_peek_at(recvbufq, offset, &context_id, &read_size) ||
  ------------------
  |  Branch (239:6): [True: 15.0k, False: 30.1k]
  ------------------
  240|  30.1k|     !read_size) {
  ------------------
  |  Branch (240:6): [True: 0, False: 30.1k]
  ------------------
  241|  15.0k|    *err = CURLE_AGAIN;
  242|  15.0k|    return 0;
  243|  15.0k|  }
  244|       |
  245|  30.1k|  if(*context_id) {
  ------------------
  |  Branch (245:6): [True: 38, False: 30.1k]
  ------------------
  246|     38|    infof(data, "Error! Invalid context ID: %02x", *context_id);
  ------------------
  |  |  143|     38|  do {                               \
  |  |  144|     38|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     38|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 38, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 7, False: 31]
  |  |  |  |  ------------------
  |  |  |  |  323|     38|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      7|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     38|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     38|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 38]
  |  |  ------------------
  ------------------
  247|     38|    Curl_bufq_skip(recvbufq, offset + 1);
  248|     38|    *err = CURLE_RECV_ERROR;
  249|     38|    return 0;
  250|     38|  }
  251|  30.1k|  offset += 1;
  252|       |
  253|  30.1k|  if(!capsule_length) {
  ------------------
  |  Branch (253:6): [True: 67, False: 30.0k]
  ------------------
  254|     67|    infof(data, "Error! Invalid capsule length: 0");
  ------------------
  |  |  143|     67|  do {                               \
  |  |  144|     67|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     67|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 67, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 15, False: 52]
  |  |  |  |  ------------------
  |  |  |  |  323|     67|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 15, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|     15|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     67|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     67|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 67]
  |  |  ------------------
  ------------------
  255|     67|    Curl_bufq_skip(recvbufq, offset);
  256|     67|    *err = CURLE_RECV_ERROR;
  257|     67|    return 0;
  258|     67|  }
  259|  30.0k|  if(capsule_length - 1 > (uint64_t)(SIZE_MAX - offset)) {
  ------------------
  |  Branch (259:6): [True: 0, False: 30.0k]
  ------------------
  260|      0|    infof(data, "Error! Capsule length too large: %" CURL_FORMAT_CURL_OFF_T,
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  261|      0|          (curl_off_t)capsule_length);
  262|      0|    *err = CURLE_RECV_ERROR;
  263|      0|    return 0;
  264|      0|  }
  265|  30.0k|  payload_len = (size_t)(capsule_length - 1);
  266|       |
  267|  30.0k|  if(payload_len > len) {
  ------------------
  |  Branch (267:6): [True: 146, False: 29.9k]
  ------------------
  268|    146|    infof(data, "UDP payload does not fit destination buffer: %zu > %zu",
  ------------------
  |  |  143|    146|  do {                               \
  |  |  144|    146|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    146|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 146, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 7, False: 139]
  |  |  |  |  ------------------
  |  |  |  |  323|    146|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      7|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    146|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    146|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 146]
  |  |  ------------------
  ------------------
  269|    146|          payload_len, len);
  270|    146|    Curl_bufq_skip(recvbufq, offset + payload_len);
  271|    146|    *err = CURLE_RECV_ERROR;
  272|    146|    return 0;
  273|    146|  }
  274|       |
  275|  29.9k|  if(Curl_bufq_len(recvbufq) < offset + payload_len) {
  ------------------
  |  Branch (275:6): [True: 12.1k, False: 17.8k]
  ------------------
  276|  12.1k|    if(Curl_bufq_is_full(recvbufq)) {
  ------------------
  |  Branch (276:8): [True: 0, False: 12.1k]
  ------------------
  277|      0|      infof(data, "Error! Capsule does not fit the receive buffer: %zu",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  278|      0|            payload_len);
  279|      0|      *err = CURLE_RECV_ERROR;
  280|      0|      return 0;
  281|      0|    }
  282|  12.1k|    *err = CURLE_AGAIN;
  283|  12.1k|    return 0;
  284|  12.1k|  }
  285|       |
  286|  17.8k|  Curl_bufq_skip(recvbufq, offset);
  287|  17.8k|  if(!payload_len) {
  ------------------
  |  Branch (287:6): [True: 1.20k, False: 16.6k]
  ------------------
  288|  1.20k|    *err = CURLE_OK;
  289|  1.20k|    return 0;
  290|  1.20k|  }
  291|  16.6k|  result = Curl_bufq_read(recvbufq, buf, payload_len, &bytes_read);
  292|  16.6k|  if(result || (bytes_read != payload_len)) {
  ------------------
  |  Branch (292:6): [True: 0, False: 16.6k]
  |  Branch (292:16): [True: 0, False: 16.6k]
  ------------------
  293|      0|    infof(data, "Error! Read less than expected %zu %zu",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  294|      0|          payload_len, bytes_read);
  295|      0|    *err = CURLE_RECV_ERROR;
  296|      0|    return 0;
  297|      0|  }
  298|       |
  299|  16.6k|  if(cf && data) {
  ------------------
  |  Branch (299:6): [True: 16.6k, False: 0]
  |  Branch (299:12): [True: 16.6k, False: 0]
  ------------------
  300|  16.6k|    CURL_TRC_CF(data, cf, "Processed UDP capsule raw: size=%zu "
  ------------------
  |  |  153|  16.6k|  do {                                          \
  |  |  154|  16.6k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  16.6k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  33.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 16.6k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 353, False: 16.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  33.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 353, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    353|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  16.6k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    353|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 353, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 353]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  16.6k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  16.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 16.6k]
  |  |  ------------------
  ------------------
  301|  16.6k|                "length_left %zu", payload_len, Curl_bufq_len(recvbufq));
  302|  16.6k|  }
  303|  16.6k|  *err = CURLE_OK;
  304|  16.6k|  return bytes_read;
  305|  16.6k|}
capsule.c:capsule_encode_varint_buf:
   72|  2.68k|{
   73|  2.68k|  DEBUGASSERT(value <= 0x3FFFFFFFFFFFFFFF);
  ------------------
  |  | 1016|  2.68k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (73:3): [True: 0, False: 2.68k]
  |  Branch (73:3): [True: 2.68k, False: 0]
  ------------------
   74|       |
   75|  2.68k|  if(value <= 0x3F) {
  ------------------
  |  Branch (75:6): [True: 0, False: 2.68k]
  ------------------
   76|      0|    buf[0] = (uint8_t)value;
   77|      0|    return 1;
   78|      0|  }
   79|  2.68k|  else if(value <= 0x3FFF) {
  ------------------
  |  Branch (79:11): [True: 2.68k, False: 0]
  ------------------
   80|  2.68k|    uint16_t encoded = (uint16_t)value & 0x3FFF;
   81|  2.68k|    encoded = ntohs(encoded | 0x4000);
   82|  2.68k|    memcpy(buf, &encoded, 2);
   83|  2.68k|    return 2;
   84|  2.68k|  }
   85|      0|  else if(value <= 0x3FFFFFFF) {
  ------------------
  |  Branch (85:11): [True: 0, False: 0]
  ------------------
   86|      0|    uint32_t encoded = (uint32_t)value & 0x3FFFFFFF;
   87|      0|    encoded = ntohl(encoded | 0x80000000);
   88|      0|    memcpy(buf, &encoded, 4);
   89|      0|    return 4;
   90|      0|  }
   91|      0|  else {
   92|      0|    uint64_t encoded = (uint64_t)value & 0x3FFFFFFFFFFFFFFF;
   93|      0|    encoded = capsule_ntohll(encoded | 0xC000000000000000);
   94|      0|    memcpy(buf, &encoded, 8);
   95|      0|    return 8;
   96|      0|  }
   97|  2.68k|}
capsule.c:capsule_decode_varint_at:
  116|  57.1k|{
  117|  57.1k|  uint8_t first_byte, byte;
  118|  57.1k|  uint64_t value;
  119|  57.1k|  size_t nbytes;
  120|  57.1k|  size_t i;
  121|  57.1k|  CURLcode result;
  122|       |
  123|  57.1k|  result = capsule_peek_u8(recvbufq, offset, &first_byte);
  124|  57.1k|  if(result)
  ------------------
  |  Branch (124:6): [True: 7.37k, False: 49.7k]
  ------------------
  125|  7.37k|    return result;
  126|       |
  127|  49.7k|  nbytes = (size_t)1 << (first_byte >> 6); /* 1, 2, 4 or 8 bytes */
  128|  49.7k|  value = first_byte & 0x3F;
  129|       |
  130|  95.0k|  for(i = 1; i < nbytes; ++i) {
  ------------------
  |  Branch (130:14): [True: 49.8k, False: 45.2k]
  ------------------
  131|  49.8k|    result = capsule_peek_u8(recvbufq, offset + i, &byte);
  132|  49.8k|    if(result)
  ------------------
  |  Branch (132:8): [True: 4.54k, False: 45.2k]
  ------------------
  133|  4.54k|      return result;
  134|  45.2k|    value = (value << 8) | byte;
  135|  45.2k|  }
  136|       |
  137|  45.2k|  *pvalue = value;
  138|  45.2k|  *pconsumed = nbytes;
  139|  45.2k|  return CURLE_OK;
  140|  49.7k|}
capsule.c:capsule_peek_u8:
  102|   106k|{
  103|   106k|  const unsigned char *peek = NULL;
  104|   106k|  size_t peeklen = 0;
  105|       |
  106|   106k|  if(!Curl_bufq_peek_at(recvbufq, offset, &peek, &peeklen) || !peeklen)
  ------------------
  |  Branch (106:6): [True: 11.9k, False: 95.0k]
  |  Branch (106:63): [True: 0, False: 95.0k]
  ------------------
  107|  11.9k|    return CURLE_AGAIN;
  108|  95.0k|  *pbyte = peek[0];
  109|  95.0k|  return CURLE_OK;
  110|   106k|}

Curl_cf_capsule_insert_after:
  296|  1.38k|{
  297|  1.38k|  struct Curl_cfilter *cf;
  298|  1.38k|  CURLcode result;
  299|       |
  300|  1.38k|  result = cf_capsule_create(&cf, data, CF_CONN(cf_at));
  ------------------
  |  |  260|  1.38k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
  301|  1.38k|  if(!result)
  ------------------
  |  Branch (301:6): [True: 1.38k, False: 2]
  ------------------
  302|  1.38k|    Curl_conn_cf_insert_after(cf_at, cf);
  303|  1.38k|  return result;
  304|  1.38k|}
cf-capsule.c:cf_capsule_destroy:
   48|  1.38k|{
   49|  1.38k|  struct cf_capsule_ctx *ctx = cf->ctx;
   50|  1.38k|  (void)data;
   51|  1.38k|  if(ctx) {
  ------------------
  |  Branch (51:6): [True: 1.38k, False: 0]
  ------------------
   52|  1.38k|    Curl_bufq_free(&ctx->recvbuf);
   53|  1.38k|    Curl_bufq_free(&ctx->sendbuf);
   54|       |    curlx_safefree(ctx);
  ------------------
  |  | 1359|  1.38k|  do {                      \
  |  | 1360|  1.38k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  1.38k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  1.38k|    (ptr) = NULL;           \
  |  | 1362|  1.38k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 1.38k]
  |  |  ------------------
  ------------------
   55|  1.38k|  }
   56|  1.38k|}
cf-capsule.c:cf_capsule_connect:
   61|  1.37k|{
   62|  1.37k|  if(cf->connected) {
  ------------------
  |  Branch (62:6): [True: 0, False: 1.37k]
  ------------------
   63|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
   64|      0|    return CURLE_OK;
   65|      0|  }
   66|  1.37k|  if(cf->next) {
  ------------------
  |  Branch (66:6): [True: 1.37k, False: 0]
  ------------------
   67|  1.37k|    CURLcode result = cf->next->cft->do_connect(cf->next, data, done);
   68|  1.37k|    if(!result && *done)
  ------------------
  |  Branch (68:8): [True: 1.37k, False: 0]
  |  Branch (68:19): [True: 1.37k, False: 0]
  ------------------
   69|  1.37k|      cf->connected = TRUE;
  ------------------
  |  |  986|  1.37k|#define TRUE true
  ------------------
   70|  1.37k|    return result;
   71|  1.37k|  }
   72|      0|  *done = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
   73|      0|  return CURLE_OK;
   74|  1.37k|}
cf-capsule.c:cf_capsule_flush:
   78|  8.43k|{
   79|  8.43k|  struct cf_capsule_ctx *ctx = cf->ctx;
   80|  8.43k|  CURLcode result = CURLE_OK;
   81|  8.43k|  size_t nwritten;
   82|       |
   83|  8.43k|  if(Curl_bufq_is_empty(&ctx->sendbuf))
  ------------------
  |  Branch (83:6): [True: 0, False: 8.43k]
  ------------------
   84|      0|    return CURLE_OK;
   85|       |
   86|  8.43k|  result = Curl_cf_send_bufq(cf->next, data, &ctx->sendbuf, NULL, 0,
   87|  8.43k|                             &nwritten);
   88|  8.43k|  if(result) {
  ------------------
  |  Branch (88:6): [True: 5.77k, False: 2.66k]
  ------------------
   89|  5.77k|    if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (89:8): [True: 5.77k, False: 0]
  ------------------
   90|  5.77k|      CURL_TRC_CF(data, cf, "flush send buffer(%zu) -> EAGAIN",
  ------------------
  |  |  153|  5.77k|  do {                                          \
  |  |  154|  5.77k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  5.77k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  11.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 5.77k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 2.84k, False: 2.92k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  11.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 2.84k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  2.84k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  5.77k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  2.84k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 2.84k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 2.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  5.77k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  5.77k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 5.77k]
  |  |  ------------------
  ------------------
   91|  5.77k|                  Curl_bufq_len(&ctx->sendbuf));
   92|  5.77k|    }
   93|  5.77k|    return result;
   94|  5.77k|  }
   95|  2.66k|  return Curl_bufq_is_empty(&ctx->sendbuf) ? CURLE_OK : CURLE_AGAIN;
  ------------------
  |  Branch (95:10): [True: 2.66k, False: 2]
  ------------------
   96|  8.43k|}
cf-capsule.c:cf_capsule_adjust_pollset:
  215|  55.0k|{
  216|  55.0k|  struct cf_capsule_ctx *ctx = cf->ctx;
  217|       |
  218|  55.0k|  if(!Curl_bufq_is_empty(&ctx->sendbuf)) {
  ------------------
  |  Branch (218:6): [True: 30, False: 55.0k]
  ------------------
  219|     30|    curl_socket_t sock = cf->chain->sock;
  220|     30|    if(sock != CURL_SOCKET_BAD)
  ------------------
  |  |  147|     30|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (220:8): [True: 30, False: 0]
  ------------------
  221|     30|      return Curl_pollset_add_out(data, ps, sock);
  ------------------
  |  |  156|     30|  Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, 0)
  |  |  ------------------
  |  |  |  |  284|     30|#define CURL_POLL_OUT    2
  |  |  ------------------
  ------------------
  222|     30|  }
  223|  55.0k|  return CURLE_OK;
  224|  55.0k|}
cf-capsule.c:cf_capsule_send:
  102|  2.68k|{
  103|  2.68k|  struct cf_capsule_ctx *ctx = cf->ctx;
  104|  2.68k|  CURLcode result;
  105|       |
  106|  2.68k|  (void)eos;
  107|  2.68k|  *pnwritten = 0;
  108|       |
  109|  2.68k|  if(Curl_bufq_is_full(&ctx->sendbuf)) {
  ------------------
  |  Branch (109:6): [True: 0, False: 2.68k]
  ------------------
  110|      0|    result = cf_capsule_flush(cf, data);
  111|      0|    if(result)
  ------------------
  |  Branch (111:8): [True: 0, False: 0]
  ------------------
  112|      0|      return result;
  113|      0|  }
  114|       |
  115|       |  /* encapsulate new payload into a capsule */
  116|  2.68k|  result = Curl_capsule_encap_udp_datagram(&ctx->sendbuf, buf, len);
  117|  2.68k|  if(result)
  ------------------
  |  Branch (117:6): [True: 4, False: 2.68k]
  ------------------
  118|      4|    return result;
  119|       |
  120|  2.68k|  result = cf_capsule_flush(cf, data);
  121|  2.68k|  if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (121:6): [True: 50, False: 2.63k]
  ------------------
  122|       |    /* Could not send it (or all), report success nevertheless as we
  123|       |     * have the payload buffered now and will flush it later. */
  124|     50|    result = CURLE_OK;
  125|     50|  }
  126|       |
  127|  2.68k|  if(!result)
  ------------------
  |  Branch (127:6): [True: 2.68k, False: 0]
  ------------------
  128|  2.68k|    *pnwritten = len;
  129|  2.68k|  return result;
  130|  2.68k|}
cf-capsule.c:cf_capsule_recv:
  136|   125k|{
  137|   125k|  struct cf_capsule_ctx *ctx = cf->ctx;
  138|   125k|  CURLcode result;
  139|   125k|  size_t nread;
  140|       |
  141|   125k|  *pnread = 0;
  142|       |
  143|       |  /* fill our receive buffer from the filter below */
  144|   129k|  while(!Curl_bufq_is_full(&ctx->recvbuf)) {
  ------------------
  |  Branch (144:9): [True: 129k, False: 0]
  ------------------
  145|   129k|    result = Curl_cf_recv_bufq(cf->next, data, &ctx->recvbuf, 0, &nread);
  146|   129k|    if(result == CURLE_AGAIN)
  ------------------
  |  Branch (146:8): [True: 4.99k, False: 124k]
  ------------------
  147|  4.99k|      break;
  148|   124k|    if(result)
  ------------------
  |  Branch (148:8): [True: 1, False: 124k]
  ------------------
  149|      1|      return result;
  150|   124k|    if(!nread)
  ------------------
  |  Branch (150:8): [True: 120k, False: 4.08k]
  ------------------
  151|   120k|      break;
  152|   124k|  }
  153|       |
  154|       |  /* try to extract a complete capsule datagram */
  155|   125k|  *pnread = Curl_capsule_process_udp_raw(cf, data, &ctx->recvbuf,
  156|   125k|                                         (unsigned char *)buf, len,
  157|   125k|                                         &result);
  158|   125k|  return result;
  159|   125k|}
cf-capsule.c:cf_capsule_cntrl:
  174|  7.66k|{
  175|  7.66k|  CURLcode result = CURLE_OK;
  176|       |
  177|  7.66k|  (void)arg1;
  178|  7.66k|  (void)arg2;
  179|  7.66k|  switch(event) {
  180|  5.75k|  case CF_CTRL_FLUSH:
  ------------------
  |  |  123|  5.75k|#define CF_CTRL_FLUSH            (256 + 2) /* 0          NULL     first fail */
  ------------------
  |  Branch (180:3): [True: 5.75k, False: 1.90k]
  ------------------
  181|  5.75k|    result = cf_capsule_flush(cf, data);
  182|  5.75k|    break;
  183|  1.90k|  default:
  ------------------
  |  Branch (183:3): [True: 1.90k, False: 5.75k]
  ------------------
  184|  1.90k|    break;
  185|  7.66k|  }
  186|  7.66k|  return result;
  187|  7.66k|}
cf-capsule.c:cf_capsule_query:
  192|   111k|{
  193|   111k|  struct cf_capsule_ctx *ctx = cf->ctx;
  194|       |
  195|   111k|  (void)pres2;
  196|   111k|  switch(query) {
  197|   108k|  case CF_QUERY_NEED_FLUSH: {
  ------------------
  |  |  171|   108k|#define CF_QUERY_NEED_FLUSH         7  /* TRUE/FALSE - */
  ------------------
  |  Branch (197:3): [True: 108k, False: 2.42k]
  ------------------
  198|   108k|    if(!Curl_bufq_is_empty(&ctx->sendbuf)) {
  ------------------
  |  Branch (198:8): [True: 5.75k, False: 103k]
  ------------------
  199|  5.75k|      *pres1 = TRUE;
  ------------------
  |  |  986|  5.75k|#define TRUE true
  ------------------
  200|  5.75k|      return CURLE_OK;
  201|  5.75k|    }
  202|   103k|    break;
  203|   108k|  }
  204|   103k|  default:
  ------------------
  |  Branch (204:3): [True: 2.42k, False: 108k]
  ------------------
  205|  2.42k|    break;
  206|   111k|  }
  207|   105k|  return cf->next ?
  ------------------
  |  Branch (207:10): [True: 105k, False: 0]
  ------------------
  208|   105k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
  209|   105k|    CURLE_UNKNOWN_OPTION;
  210|   111k|}
cf-capsule.c:cf_capsule_create:
  263|  1.38k|{
  264|  1.38k|  struct Curl_cfilter *cf = NULL;
  265|  1.38k|  struct cf_capsule_ctx *ctx;
  266|  1.38k|  CURLcode result;
  267|       |
  268|  1.38k|  (void)data;
  269|  1.38k|  (void)conn;
  270|  1.38k|  *pcf = NULL;
  271|  1.38k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|  1.38k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  272|  1.38k|  if(!ctx) {
  ------------------
  |  Branch (272:6): [True: 0, False: 1.38k]
  ------------------
  273|      0|    result = CURLE_OUT_OF_MEMORY;
  274|      0|    goto out;
  275|      0|  }
  276|       |
  277|  1.38k|  Curl_bufq_init2(&ctx->recvbuf, CAPSULE_CHUNK_SIZE, CAPSULE_RECV_CHUNKS,
  ------------------
  |  |   39|  1.38k|#define CAPSULE_CHUNK_SIZE     (16 * 1024)
  ------------------
                Curl_bufq_init2(&ctx->recvbuf, CAPSULE_CHUNK_SIZE, CAPSULE_RECV_CHUNKS,
  ------------------
  |  |   37|  1.38k|#define CAPSULE_RECV_CHUNKS    4
  ------------------
  278|  1.38k|                  BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|  1.38k|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
  279|  1.38k|  Curl_bufq_init2(&ctx->sendbuf, CAPSULE_CHUNK_SIZE, CAPSULE_SEND_CHUNKS,
  ------------------
  |  |   39|  1.38k|#define CAPSULE_CHUNK_SIZE     (16 * 1024)
  ------------------
                Curl_bufq_init2(&ctx->sendbuf, CAPSULE_CHUNK_SIZE, CAPSULE_SEND_CHUNKS,
  ------------------
  |  |   38|  1.38k|#define CAPSULE_SEND_CHUNKS    4
  ------------------
  280|  1.38k|                  BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|  1.38k|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
  281|       |
  282|  1.38k|  result = Curl_cf_create(&cf, &Curl_cft_capsule, ctx);
  283|       |
  284|  1.38k|out:
  285|  1.38k|  *pcf = (!result) ? cf : NULL;
  ------------------
  |  Branch (285:10): [True: 1.38k, False: 2]
  ------------------
  286|  1.38k|  if(result && ctx) {
  ------------------
  |  Branch (286:6): [True: 2, False: 1.38k]
  |  Branch (286:16): [True: 2, False: 0]
  ------------------
  287|      2|    Curl_bufq_free(&ctx->recvbuf);
  288|      2|    Curl_bufq_free(&ctx->sendbuf);
  289|      2|    curlx_free(ctx);
  ------------------
  |  | 1503|      2|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  290|      2|  }
  291|  1.38k|  return result;
  292|  1.38k|}

Curl_cf_ngtcp2_h3_stream_ctx_free:
   87|  1.94k|{
   88|  1.94k|  Curl_bufq_free(&stream->sendbuf);
   89|  1.94k|  Curl_h1_req_parse_free(&stream->h1);
   90|  1.94k|  curlx_free(stream);
  ------------------
  |  | 1503|  1.94k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
   91|  1.94k|}
Curl_cf_ngtcp2_h3_err_set:
  108|      3|{
  109|      3|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  110|      3|  if(!ctx->last_error.error_code) {
  ------------------
  |  Branch (110:6): [True: 3, False: 0]
  ------------------
  111|      3|    ngtcp2_ccerr_set_application_error(&ctx->last_error,
  112|      3|      nghttp3_err_infer_quic_app_error_code(code), NULL, 0);
  113|      3|  }
  114|      3|  if(cf_ngtcp2_h3_err_is_fatal(code))
  ------------------
  |  Branch (114:6): [True: 3, False: 0]
  ------------------
  115|      3|    Curl_cf_ngtcp2_cmn_conn_close(cf, data);
  116|      3|}
Curl_cf_ngtcp2_ctx_init:
  123|  3.36k|{
  124|  3.36k|  DEBUGASSERT(!ctx->initialized);
  ------------------
  |  | 1016|  3.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (124:3): [True: 0, False: 3.36k]
  |  Branch (124:3): [True: 3.36k, False: 0]
  ------------------
  125|  3.36k|  ctx->qlogfd = -1;
  126|  3.36k|  ctx->tunnel_inbuf = NULL;
  127|  3.36k|  ctx->tunnel_inbuf_len = 0;
  128|  3.36k|  ctx->version = NGTCP2_PROTO_VER_MAX;
  129|  3.36k|  Curl_bufcp_init(&ctx->stream_bufcp, H3_STREAM_CHUNK_SIZE,
  ------------------
  |  |   87|  3.36k|#define H3_STREAM_CHUNK_SIZE  (64 * 1024)
  ------------------
  130|  3.36k|                  H3_STREAM_POOL_SPARES);
  ------------------
  |  |   95|  3.36k|#define H3_STREAM_POOL_SPARES      5
  ------------------
  131|  3.36k|  curlx_dyn_init(&ctx->scratch, CURL_MAX_HTTP_HEADER);
  ------------------
  |  |  274|  3.36k|#define CURL_MAX_HTTP_HEADER (100 * 1024)
  ------------------
  132|  3.36k|  Curl_u32_ptrset_init(&ctx->streams, h3_stream_set_free);
  133|  3.36k|  ctx->init_h3_conn_cb = init_h3_conn_cb;
  134|       |  ctx->initialized = TRUE;
  ------------------
  |  |  986|  3.36k|#define TRUE true
  ------------------
  135|  3.36k|  return Curl_vquic_tls_peer_init(origin, peer, sslc, &ctx->ssl_peer);
  136|  3.36k|}
Curl_cf_ngtcp2_ctx_cleanup:
  139|  3.36k|{
  140|  3.36k|  if(ctx && ctx->initialized) {
  ------------------
  |  Branch (140:6): [True: 3.36k, False: 0]
  |  Branch (140:13): [True: 3.36k, False: 0]
  ------------------
  141|  3.36k|    if(ctx->qlogfd != -1) {
  ------------------
  |  Branch (141:8): [True: 0, False: 3.36k]
  ------------------
  142|      0|      curlx_close(ctx->qlogfd);
  ------------------
  |  |   73|      0|#define curlx_close             close
  ------------------
  143|      0|      ctx->qlogfd = -1;
  144|      0|    }
  145|       |    /* Cleanup TLS instances first as ngtcp2 objects
  146|       |     * might be registered there. */
  147|  3.36k|    Curl_vquic_tls_cleanup(&ctx->tls);
  148|  3.36k|    Curl_vquic_ctx_free(&ctx->q);
  149|  3.36k|    if(ctx->h3conn) {
  ------------------
  |  Branch (149:8): [True: 1.96k, False: 1.40k]
  ------------------
  150|  1.96k|      nghttp3_conn_del(ctx->h3conn);
  151|  1.96k|      ctx->h3conn = NULL;
  152|  1.96k|    }
  153|  3.36k|    Curl_ngtcp2_conn_del(&ctx->qconn);
  154|  3.36k|#ifdef OPENSSL_QUIC_API2
  155|  3.36k|    if(ctx->ossl_ctx) {
  ------------------
  |  Branch (155:8): [True: 3.33k, False: 32]
  ------------------
  156|  3.33k|      ngtcp2_crypto_ossl_ctx_del(ctx->ossl_ctx);
  157|  3.33k|      ctx->ossl_ctx = NULL;
  158|  3.33k|    }
  159|  3.36k|#endif
  160|  3.36k|    Curl_bufcp_free(&ctx->stream_bufcp);
  161|  3.36k|    curlx_dyn_free(&ctx->scratch);
  162|  3.36k|    Curl_u32_ptrset_clear(&ctx->streams);
  163|  3.36k|    Curl_ssl_peer_cleanup(&ctx->ssl_peer);
  164|       |    curlx_safefree(ctx->tunnel_inbuf);
  ------------------
  |  | 1359|  3.36k|  do {                      \
  |  | 1360|  3.36k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  3.36k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  3.36k|    (ptr) = NULL;           \
  |  | 1362|  3.36k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 3.36k]
  |  |  ------------------
  ------------------
  165|  3.36k|    ctx->tunnel_inbuf_len = 0;
  166|  3.36k|  }
  167|  3.36k|}
Curl_cf_ngtcp2_get_xfer:
  172|  13.6k|{
  173|  13.6k|  struct h3_stream_ctx *stream = stream_user_data;
  174|       |
  175|  13.6k|  if(pstream)
  ------------------
  |  Branch (175:6): [True: 12.7k, False: 909]
  ------------------
  176|  12.7k|    *pstream = stream;
  177|  13.6k|  if(stream && (stream->mid != UINT32_MAX)) {
  ------------------
  |  Branch (177:6): [True: 7.71k, False: 5.98k]
  |  Branch (177:16): [True: 7.71k, False: 0]
  ------------------
  178|  7.71k|    struct Curl_easy *data, *call_data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  685|  7.71k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  157|  7.71k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (685:30): [True: 7.71k, False: 0]
  |  |  ------------------
  ------------------
  179|  7.71k|    if(!call_data || !call_data->multi) {
  ------------------
  |  Branch (179:8): [True: 0, False: 7.71k]
  |  Branch (179:22): [True: 0, False: 7.71k]
  ------------------
  180|      0|      DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (180:7): [Folded, False: 0]
  |  Branch (180:7): [Folded, False: 0]
  ------------------
  181|      0|      return NULL;
  182|      0|    }
  183|  7.71k|    data = Curl_multi_get_easy(call_data->multi, stream->mid);
  184|  7.71k|    if(data && (data->id == stream->xfer_id))
  ------------------
  |  Branch (184:8): [True: 7.71k, False: 0]
  |  Branch (184:16): [True: 7.71k, False: 0]
  ------------------
  185|  7.71k|      return data;
  186|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (186:5): [Folded, False: 0]
  |  Branch (186:5): [Folded, False: 0]
  ------------------
  187|      0|  }
  188|  5.98k|  return NULL;
  189|  13.6k|}
Curl_cf_ngtcp2_cmn_connect:
 1162|   116k|{
 1163|   116k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1164|   116k|  CURLcode result = CURLE_OK;
 1165|   116k|  struct cf_call_data save;
 1166|   116k|  struct cf_ngtcp2_io_ctx pktx;
 1167|       |
 1168|   116k|  if(cf->connected) {
  ------------------
  |  Branch (1168:6): [True: 0, False: 116k]
  ------------------
 1169|      0|    *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1170|      0|    return CURLE_OK;
 1171|      0|  }
 1172|       |
 1173|       |  /* Connect the sub-chain */
 1174|   116k|  if(cf->next && !cf->next->connected) {
  ------------------
  |  Branch (1174:6): [True: 116k, False: 0]
  |  Branch (1174:18): [True: 3.35k, False: 112k]
  ------------------
 1175|  3.35k|    result = Curl_conn_cf_connect(cf->next, data, done);
 1176|  3.35k|    if(result || !*done)
  ------------------
  |  Branch (1176:8): [True: 6, False: 3.34k]
  |  Branch (1176:18): [True: 0, False: 3.34k]
  ------------------
 1177|      6|      return result;
 1178|  3.35k|  }
 1179|       |
 1180|   116k|  *done = FALSE;
  ------------------
  |  |  989|   116k|#define FALSE false
  ------------------
 1181|       |
 1182|   116k|  if(Curl_ssl_need_httpsrr(cf) &&
  ------------------
  |  Branch (1182:6): [True: 0, False: 116k]
  ------------------
 1183|      0|     !Curl_dns_cf_resolved_https(data, cf, ctx->ssl_peer.peer)) {
  ------------------
  |  Branch (1183:6): [True: 0, False: 0]
  ------------------
 1184|      0|    CURL_TRC_CF(data, cf, "need HTTPS-RR, delaying connect");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1185|      0|    return CURLE_OK;
 1186|      0|  }
 1187|       |
 1188|   116k|  Curl_cf_ngtcp2_io_ctx_init(&pktx, cf, data);
 1189|   116k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  656|   116k|  do { \
  |  |  657|   116k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  157|   116k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  658|   116k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|   116k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  659|   116k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  157|   116k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  660|   116k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  157|   116k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  793|   116k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  661|   116k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (661:11): [Folded, False: 116k]
  |  |  ------------------
  ------------------
  |  Branch (1189:3): [True: 116k, False: 0]
  |  Branch (1189:3): [True: 0, False: 0]
  |  Branch (1189:3): [True: 116k, False: 0]
  |  Branch (1189:3): [True: 0, False: 0]
  ------------------
 1190|       |
 1191|   116k|  if(!Curl_ngtcp2_conn(&ctx->qconn)) {
  ------------------
  |  Branch (1191:6): [True: 3.34k, False: 112k]
  ------------------
 1192|  3.34k|    ctx->started_at = *Curl_pgrs_now(data);
 1193|  3.34k|    result = cf_connect_start(cf, data, &pktx);
 1194|  3.34k|    if(result)
  ------------------
  |  Branch (1194:8): [True: 13, False: 3.33k]
  ------------------
 1195|     13|      goto out;
 1196|  3.33k|    if(cf->connected) {
  ------------------
  |  Branch (1196:8): [True: 0, False: 3.33k]
  ------------------
 1197|      0|      *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1198|      0|      goto out;
 1199|      0|    }
 1200|  3.33k|    result = Curl_cf_ngtcp2_progress_egress(cf, data, &pktx);
 1201|       |    /* we do not expect to be able to recv anything yet */
 1202|  3.33k|    goto out;
 1203|  3.33k|  }
 1204|       |
 1205|   112k|  result = Curl_cf_ngtcp2_progress_ingress(cf, data, &pktx);
 1206|   112k|  if(result)
  ------------------
  |  Branch (1206:6): [True: 488, False: 112k]
  ------------------
 1207|    488|    goto out;
 1208|       |
 1209|   112k|  result = Curl_cf_ngtcp2_progress_egress(cf, data, &pktx);
 1210|   112k|  if(result)
  ------------------
  |  Branch (1210:6): [True: 1, False: 112k]
  ------------------
 1211|      1|    goto out;
 1212|       |
 1213|   112k|  if(Curl_ngtcp2_conn_get_handshake_completed(&ctx->qconn)) {
  ------------------
  |  Branch (1213:6): [True: 1.95k, False: 110k]
  ------------------
 1214|  1.95k|    result = ctx->tls_vrfy_result;
 1215|  1.95k|    if(!result) {
  ------------------
  |  Branch (1215:8): [True: 1.95k, False: 0]
  ------------------
 1216|  1.95k|      CURL_TRC_CF(data, cf, "peer verified");
  ------------------
  |  |  153|  1.95k|  do {                                          \
  |  |  154|  1.95k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.95k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.91k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.91k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.95k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 5, False: 142]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.95k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.95k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
 1217|  1.95k|      cf->connected = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
 1218|  1.95k|      *done = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
 1219|  1.95k|    }
 1220|  1.95k|  }
 1221|       |
 1222|   116k|out:
 1223|   116k|  if(ctx->tls_vrfy_result)
  ------------------
  |  Branch (1223:6): [True: 0, False: 116k]
  ------------------
 1224|      0|    result = ctx->tls_vrfy_result;
 1225|   116k|  if(Curl_ngtcp2_conn(&ctx->qconn) &&
  ------------------
  |  Branch (1225:6): [True: 116k, False: 13]
  ------------------
 1226|   116k|     ((result == CURLE_RECV_ERROR) || (result == CURLE_SEND_ERROR)) &&
  ------------------
  |  Branch (1226:7): [True: 478, False: 115k]
  |  Branch (1226:39): [True: 23, False: 115k]
  ------------------
 1227|    501|     Curl_ngtcp2_conn_in_draining_period(&ctx->qconn)) {
  ------------------
  |  Branch (1227:6): [True: 0, False: 501]
  ------------------
 1228|      0|    const ngtcp2_ccerr *cerr = Curl_ngtcp2_conn_get_ccerr(&ctx->qconn);
 1229|       |
 1230|      0|    result = CURLE_COULDNT_CONNECT;
 1231|      0|    if(cerr) {
  ------------------
  |  Branch (1231:8): [True: 0, False: 0]
  ------------------
 1232|      0|      CURL_TRC_CF(data, cf, "connect error, type=%d, code=%" PRIu64,
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1233|      0|                  (int)cerr->type, cerr->error_code);
 1234|      0|      switch(cerr->type) {
 1235|      0|      case NGTCP2_CCERR_TYPE_VERSION_NEGOTIATION:
  ------------------
  |  Branch (1235:7): [True: 0, False: 0]
  ------------------
 1236|      0|        CURL_TRC_CF(data, cf, "error in version negotiation");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1237|      0|        break;
 1238|      0|      default:
  ------------------
  |  Branch (1238:7): [True: 0, False: 0]
  ------------------
 1239|      0|        if(cerr->error_code >= NGTCP2_CRYPTO_ERROR) {
  ------------------
  |  Branch (1239:12): [True: 0, False: 0]
  ------------------
 1240|      0|          CURL_TRC_CF(data, cf, "crypto error, tls alert=%u",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1241|      0|                      (unsigned int)(cerr->error_code & 0xffU));
 1242|      0|        }
 1243|      0|        else if(cerr->error_code == NGTCP2_CONNECTION_REFUSED) {
  ------------------
  |  Branch (1243:17): [True: 0, False: 0]
  ------------------
 1244|      0|          CURL_TRC_CF(data, cf, "connection refused by server");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1245|       |          /* When a QUIC server instance is shutting down, it may send us a
 1246|       |           * CONNECTION_CLOSE with this code right away. We want
 1247|       |           * to keep on trying in this case. */
 1248|      0|          result = CURLE_WEIRD_SERVER_REPLY;
 1249|      0|        }
 1250|      0|      }
 1251|      0|    }
 1252|      0|  }
 1253|       |
 1254|   116k|#ifdef CURLVERBOSE
 1255|   116k|  if(result) {
  ------------------
  |  Branch (1255:6): [True: 530, False: 115k]
  ------------------
 1256|    530|    if(ctx->q.sockfd != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|    530|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1256:8): [True: 14, False: 516]
  ------------------
 1257|       |      /* Direct UDP socket - get IP info for error reporting */
 1258|     14|      struct ip_quadruple ip;
 1259|       |
 1260|     14|      if(!Curl_cf_socket_peek(cf->next, data, NULL, NULL, &ip))
  ------------------
  |  Branch (1260:10): [True: 14, False: 0]
  ------------------
 1261|     14|        infof(data, "QUIC connect to %s port %u failed: %s",
  ------------------
  |  |  143|     14|  do {                               \
  |  |  144|     14|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     14|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 14, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 1, False: 13]
  |  |  |  |  ------------------
  |  |  |  |  323|     14|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      1|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     14|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     14|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 14]
  |  |  ------------------
  ------------------
 1262|     14|              ip.remote_ip, ip.remote_port, curl_easy_strerror(result));
 1263|     14|    }
 1264|    530|  }
 1265|   116k|#endif
 1266|   116k|  if(!result && Curl_ngtcp2_conn(&ctx->qconn)) {
  ------------------
  |  Branch (1266:6): [True: 115k, False: 530]
  |  Branch (1266:17): [True: 115k, False: 0]
  ------------------
 1267|   115k|    result = Curl_cf_ngtcp2_cmn_set_expiry(cf, data, &pktx);
 1268|   115k|  }
 1269|   116k|  if(result || *done)
  ------------------
  |  Branch (1269:6): [True: 530, False: 115k]
  |  Branch (1269:16): [True: 1.95k, False: 113k]
  ------------------
 1270|  2.48k|    CURL_TRC_CF(data, cf, "connect -> %d, done=%d", (int)result, *done);
  ------------------
  |  |  153|  2.48k|  do {                                          \
  |  |  154|  2.48k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  2.48k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  4.97k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 2.48k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 225, False: 2.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  4.97k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 225, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    225|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  2.48k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    225|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 225, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 20, False: 205]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.48k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.48k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.48k]
  |  |  ------------------
  ------------------
 1271|   116k|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  664|   116k|  do { \
  |  |  665|   116k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1016|   116k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  666|   116k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|   116k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  667|   116k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  157|   116k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  668|   116k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (668:11): [Folded, False: 116k]
  |  |  ------------------
  ------------------
  |  Branch (1271:3): [True: 0, False: 116k]
  |  Branch (1271:3): [True: 116k, False: 0]
  |  Branch (1271:3): [True: 116k, False: 0]
  |  Branch (1271:3): [True: 0, False: 0]
  |  Branch (1271:3): [True: 116k, False: 0]
  |  Branch (1271:3): [True: 0, False: 0]
  ------------------
 1272|   116k|  return result;
 1273|   116k|}
Curl_cf_ngtcp2_cmn_shutdown:
 1277|  5.05k|{
 1278|  5.05k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1279|  5.05k|  struct cf_call_data save;
 1280|  5.05k|  struct cf_ngtcp2_io_ctx pktx;
 1281|  5.05k|  CURLcode result = CURLE_OK;
 1282|       |
 1283|  5.05k|  if(cf->shutdown || !Curl_ngtcp2_conn(&ctx->qconn)) {
  ------------------
  |  Branch (1283:6): [True: 1.57k, False: 3.47k]
  |  Branch (1283:22): [True: 0, False: 3.47k]
  ------------------
 1284|  1.57k|    *done = TRUE;
  ------------------
  |  |  986|  1.57k|#define TRUE true
  ------------------
 1285|  1.57k|    return CURLE_OK;
 1286|  1.57k|  }
 1287|       |
 1288|  3.47k|  if(!cf->next) {
  ------------------
  |  Branch (1288:6): [True: 1.76k, False: 1.71k]
  ------------------
 1289|  1.76k|    Curl_bufq_reset(&ctx->q.sendbuf);
 1290|  1.76k|    *done = TRUE;
  ------------------
  |  |  986|  1.76k|#define TRUE true
  ------------------
 1291|  1.76k|    return CURLE_OK;
 1292|  1.76k|  }
 1293|       |
 1294|  1.71k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  656|  1.71k|  do { \
  |  |  657|  1.71k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  157|  1.71k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  658|  1.71k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  1.71k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  659|  1.71k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  157|  1.71k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  660|  1.71k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  157|  1.71k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  793|  1.71k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  661|  1.71k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (661:11): [Folded, False: 1.71k]
  |  |  ------------------
  ------------------
  |  Branch (1294:3): [True: 1.71k, False: 0]
  |  Branch (1294:3): [True: 0, False: 0]
  |  Branch (1294:3): [True: 1.57k, False: 141]
  |  Branch (1294:3): [True: 141, False: 0]
  ------------------
 1295|  1.71k|  *done = FALSE;
  ------------------
  |  |  989|  1.71k|#define FALSE false
  ------------------
 1296|  1.71k|  Curl_cf_ngtcp2_io_ctx_init(&pktx, cf, data);
 1297|       |
 1298|  1.71k|  if(!ctx->shutdown_started) {
  ------------------
  |  Branch (1298:6): [True: 1.66k, False: 53]
  ------------------
 1299|  1.66k|    char buffer[NGTCP2_MAX_UDP_PAYLOAD_SIZE];
 1300|  1.66k|    ngtcp2_ssize nwritten;
 1301|       |
 1302|  1.66k|    if(!Curl_bufq_is_empty(&ctx->q.sendbuf)) {
  ------------------
  |  Branch (1302:8): [True: 0, False: 1.66k]
  ------------------
 1303|      0|      CURL_TRC_CF(data, cf, "shutdown, flushing sendbuf");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1304|      0|      result = Curl_ngtcp2_restricted(&ctx->qconn) ?
  ------------------
  |  Branch (1304:16): [True: 0, False: 0]
  ------------------
 1305|      0|        Curl_vquic_flush(cf, data, &ctx->q) :
 1306|      0|        Curl_cf_ngtcp2_progress_egress(cf, data, &pktx);
 1307|      0|      if(!Curl_bufq_is_empty(&ctx->q.sendbuf)) {
  ------------------
  |  Branch (1307:10): [True: 0, False: 0]
  ------------------
 1308|      0|        CURL_TRC_CF(data, cf, "sending shutdown packets blocked");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1309|      0|        result = CURLE_OK;
 1310|      0|        goto out;
 1311|      0|      }
 1312|      0|      else if(result) {
  ------------------
  |  Branch (1312:15): [True: 0, False: 0]
  ------------------
 1313|      0|        CURL_TRC_CF(data, cf, "shutdown, error %d flushing sendbuf",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1314|      0|                    (int)result);
 1315|      0|        *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1316|      0|        goto out;
 1317|      0|      }
 1318|      0|    }
 1319|       |
 1320|  1.66k|    DEBUGASSERT(Curl_bufq_is_empty(&ctx->q.sendbuf));
  ------------------
  |  | 1016|  1.66k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1320:5): [True: 0, False: 1.66k]
  |  Branch (1320:5): [True: 1.66k, False: 0]
  ------------------
 1321|  1.66k|    ctx->shutdown_started = TRUE;
  ------------------
  |  |  986|  1.66k|#define TRUE true
  ------------------
 1322|  1.66k|    nwritten = Curl_ngtcp2_conn_write_connection_close(
 1323|  1.66k|      &ctx->qconn, NULL, /* path */
 1324|  1.66k|      NULL, /* pkt_info */
 1325|  1.66k|      (uint8_t *)buffer, sizeof(buffer),
 1326|  1.66k|      &ctx->last_error, pktx.ts);
 1327|  1.66k|    CURL_TRC_CF(data, cf, "start shutdown(err_type=%d, err_code=%"
  ------------------
  |  |  153|  1.66k|  do {                                          \
  |  |  154|  1.66k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.66k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.32k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.66k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 8, False: 1.65k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.32k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 8, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      8|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.66k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      8|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 8, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 4, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.66k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.66k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.66k]
  |  |  ------------------
  ------------------
 1328|  1.66k|                PRIu64 ") -> %zd", (int)ctx->last_error.type,
 1329|  1.66k|                ctx->last_error.error_code, (ssize_t)nwritten);
 1330|       |    /* there are cases listed in ngtcp2 documentation where this call
 1331|       |     * may fail. Since we are doing a connection shutdown as graceful
 1332|       |     * as we can, such an error is ignored here. */
 1333|  1.66k|    if(nwritten > 0) {
  ------------------
  |  Branch (1333:8): [True: 1.64k, False: 22]
  ------------------
 1334|       |      /* Ignore amount written. sendbuf was empty and has always room for
 1335|       |       * NGTCP2_MAX_UDP_PAYLOAD_SIZE. It can only completely fail, in which
 1336|       |       * case `result` is set non zero. */
 1337|  1.64k|      size_t n;
 1338|  1.64k|      result = Curl_bufq_write(&ctx->q.sendbuf, (const unsigned char *)buffer,
 1339|  1.64k|                               (size_t)nwritten, &n);
 1340|  1.64k|      if(result) {
  ------------------
  |  Branch (1340:10): [True: 0, False: 1.64k]
  ------------------
 1341|      0|        CURL_TRC_CF(data, cf, "error %d adding shutdown packets to sendbuf, "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1342|      0|                    "aborting shutdown", (int)result);
 1343|      0|        goto out;
 1344|      0|      }
 1345|       |
 1346|  1.64k|      ctx->q.no_gso = TRUE;
  ------------------
  |  |  986|  1.64k|#define TRUE true
  ------------------
 1347|  1.64k|      ctx->q.gsolen = (size_t)nwritten;
 1348|  1.64k|      ctx->q.split_len = 0;
 1349|  1.64k|    }
 1350|  1.66k|  }
 1351|       |
 1352|  1.71k|  if(!Curl_bufq_is_empty(&ctx->q.sendbuf)) {
  ------------------
  |  Branch (1352:6): [True: 1.64k, False: 75]
  ------------------
 1353|  1.64k|    CURL_TRC_CF(data, cf, "shutdown, flushing egress");
  ------------------
  |  |  153|  1.64k|  do {                                          \
  |  |  154|  1.64k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.64k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.28k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.64k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 5, False: 1.63k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.28k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 5, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      5|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.64k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      5|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 5, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 2, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.64k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.64k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.64k]
  |  |  ------------------
  ------------------
 1354|  1.64k|    result = Curl_vquic_flush(cf, data, &ctx->q);
 1355|  1.64k|    if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (1355:8): [True: 0, False: 1.64k]
  ------------------
 1356|      0|      CURL_TRC_CF(data, cf, "sending shutdown packets blocked");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1357|      0|      result = CURLE_OK;
 1358|      0|      goto out;
 1359|      0|    }
 1360|  1.64k|    else if(result) {
  ------------------
  |  Branch (1360:13): [True: 0, False: 1.64k]
  ------------------
 1361|      0|      CURL_TRC_CF(data, cf, "shutdown, error %d flushing sendbuf",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1362|      0|                  (int)result);
 1363|      0|      *done = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1364|      0|      goto out;
 1365|      0|    }
 1366|  1.64k|  }
 1367|       |
 1368|  1.71k|  if(Curl_bufq_is_empty(&ctx->q.sendbuf)) {
  ------------------
  |  Branch (1368:6): [True: 1.71k, False: 0]
  ------------------
 1369|       |    /* Sent everything off. ngtcp2 seems to have no support for graceful
 1370|       |     * shutdowns. We are done. */
 1371|  1.71k|    CURL_TRC_CF(data, cf, "shutdown completely sent off, done");
  ------------------
  |  |  153|  1.71k|  do {                                          \
  |  |  154|  1.71k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.71k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.43k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.71k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 11, False: 1.70k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.43k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 11, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     11|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.71k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     11|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 11, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 5, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.71k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.71k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.71k]
  |  |  ------------------
  ------------------
 1372|  1.71k|    *done = TRUE;
  ------------------
  |  |  986|  1.71k|#define TRUE true
  ------------------
 1373|  1.71k|    result = CURLE_OK;
 1374|  1.71k|  }
 1375|  1.71k|out:
 1376|  1.71k|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  664|  1.71k|  do { \
  |  |  665|  1.71k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1016|  1.71k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  666|  1.71k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  1.71k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  667|  1.71k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  157|  1.71k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  668|  1.71k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (668:11): [Folded, False: 1.71k]
  |  |  ------------------
  ------------------
  |  Branch (1376:3): [True: 0, False: 1.71k]
  |  Branch (1376:3): [True: 1.71k, False: 0]
  |  Branch (1376:3): [True: 1.71k, False: 0]
  |  Branch (1376:3): [True: 0, False: 0]
  |  Branch (1376:3): [True: 1.57k, False: 141]
  |  Branch (1376:3): [True: 141, False: 0]
  ------------------
 1377|  1.71k|  return result;
 1378|  1.71k|}
Curl_cf_ngtcp2_cmn_conn_close:
 1382|  3.47k|{
 1383|       |  bool done;
 1384|  3.47k|  Curl_cf_ngtcp2_cmn_shutdown(cf, data, &done);
 1385|  3.47k|}
Curl_cf_ngtcp2_cmn_err_set:
 1396|    795|{
 1397|    795|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1398|    795|  if(!ctx->last_error.error_code) {
  ------------------
  |  Branch (1398:6): [True: 414, False: 381]
  ------------------
 1399|    414|    if(NGTCP2_ERR_CRYPTO == code) {
  ------------------
  |  Branch (1399:8): [True: 7, False: 407]
  ------------------
 1400|      7|      ngtcp2_ccerr_set_tls_alert(
 1401|      7|        &ctx->last_error, Curl_ngtcp2_conn_get_tls_alert(&ctx->qconn),
 1402|      7|        NULL, 0);
 1403|      7|    }
 1404|    407|    else {
 1405|    407|      ngtcp2_ccerr_set_liberr(&ctx->last_error, code, NULL, 0);
 1406|    407|    }
 1407|    414|  }
 1408|    795|  if(cf_ngtcp2_err_is_fatal(code))
  ------------------
  |  Branch (1408:6): [True: 138, False: 657]
  ------------------
 1409|    138|    Curl_cf_ngtcp2_cmn_conn_close(cf, data);
 1410|    795|}
Curl_cf_ngtcp2_io_ctx_init:
 1415|   130k|{
 1416|   130k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1417|       |
 1418|   130k|  io_ctx->cf = cf;
 1419|   130k|  io_ctx->data = data;
 1420|   130k|  io_ctx->now = *Curl_pgrs_now(data);
 1421|   130k|  ngtcp2_path_storage_zero(&io_ctx->ps);
 1422|   130k|  Curl_vquic_ctx_set_time(&ctx->q, &io_ctx->now);
 1423|   130k|  io_ctx->ts = ((ngtcp2_tstamp)io_ctx->now.tv_sec * NGTCP2_SECONDS) +
 1424|       |               ((ngtcp2_tstamp)io_ctx->now.tv_usec * NGTCP2_MICROSECONDS);
 1425|   130k|}
Curl_cf_ngtcp2_io_ctx_update_time:
 1430|   275k|{
 1431|   275k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1432|       |
 1433|   275k|  io_ctx->now = *Curl_pgrs_now(data);
 1434|   275k|  Curl_vquic_ctx_update_time(&ctx->q, &io_ctx->now);
 1435|   275k|  io_ctx->ts = ((ngtcp2_tstamp)io_ctx->now.tv_sec * NGTCP2_SECONDS) +
 1436|       |               ((ngtcp2_tstamp)io_ctx->now.tv_usec * NGTCP2_MICROSECONDS);
 1437|   275k|}
Curl_cf_ngtcp2_progress_egress:
 1581|   128k|{
 1582|   128k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1583|   128k|  size_t nread;
 1584|   128k|  size_t max_payload_size, path_max_payload_size;
 1585|   128k|  size_t pktcnt = 0;
 1586|   128k|  size_t gsolen = 0;  /* this disables gso until we have a clue */
 1587|   128k|  size_t send_quantum;
 1588|   128k|  CURLcode result;
 1589|   128k|  struct cf_ngtcp2_io_ctx local_pktx;
 1590|       |
 1591|   128k|  if(!pktx) {
  ------------------
  |  Branch (1591:6): [True: 850, False: 127k]
  ------------------
 1592|    850|    Curl_cf_ngtcp2_io_ctx_init(&local_pktx, cf, data);
 1593|    850|    pktx = &local_pktx;
 1594|    850|  }
 1595|   127k|  else {
 1596|   127k|    Curl_cf_ngtcp2_io_ctx_update_time(data, pktx, cf);
 1597|   127k|    ngtcp2_path_storage_zero(&pktx->ps);
 1598|   127k|  }
 1599|       |
 1600|   128k|  result = Curl_vquic_flush(cf, data, &ctx->q);
 1601|   128k|  if(result) {
  ------------------
  |  Branch (1601:6): [True: 0, False: 128k]
  ------------------
 1602|      0|    if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (1602:8): [True: 0, False: 0]
  ------------------
 1603|      0|      Curl_expire_set(data, EXPIRE_QUIC, 1, &pktx->now);
 1604|      0|      return CURLE_OK;
 1605|      0|    }
 1606|      0|    return result;
 1607|      0|  }
 1608|       |
 1609|       |  /* In UDP, there is a maximum theoretical packet payload length and
 1610|       |   * a minimum payload length that is "guaranteed" to work.
 1611|       |   * To detect if this minimum payload can be increased, ngtcp2 sends
 1612|       |   * now and then a packet payload larger than the minimum. It that
 1613|       |   * is ACKed by the peer, both parties know that it works and
 1614|       |   * the subsequent packets can use a larger one.
 1615|       |   * This is called PMTUD (Path Maximum Transmission Unit Discovery).
 1616|       |   * Since a PMTUD might be rejected right on send, we do not want it
 1617|       |   * be followed by other packets of lesser size. Because those would
 1618|       |   * also fail then. If we detect a PMTUD while buffering, we flush.
 1619|       |   */
 1620|   128k|  max_payload_size = Curl_ngtcp2_conn_get_max_tx_udp_payload_size(&ctx->qconn);
 1621|   128k|  path_max_payload_size =
 1622|   128k|    Curl_ngtcp2_conn_get_path_max_tx_udp_payload_size(&ctx->qconn);
 1623|   128k|  send_quantum = Curl_ngtcp2_conn_get_send_quantum(&ctx->qconn);
 1624|   128k|  CURL_TRC_CF(data, cf, "egress, collect and send packets, quantum=%zu",
  ------------------
  |  |  153|   128k|  do {                                          \
  |  |  154|   128k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|   128k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|   256k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 128k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 34.6k, False: 93.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   256k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 34.6k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  34.6k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|   128k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  34.6k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 34.6k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 16.9k, False: 17.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   128k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|   128k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 128k]
  |  |  ------------------
  ------------------
 1625|   128k|              send_quantum);
 1626|   152k|  for(;;) {
 1627|       |    /* add the next packet to send, if any, to our buffer */
 1628|   152k|    result = Curl_bufq_sipn(&ctx->q.sendbuf, max_payload_size,
 1629|   152k|                            read_pkt_to_send, pktx, &nread);
 1630|   152k|    if(result == CURLE_AGAIN)
  ------------------
  |  Branch (1630:8): [True: 127k, False: 24.2k]
  ------------------
 1631|   127k|      break;
 1632|  24.2k|    else if(result)
  ------------------
  |  Branch (1632:13): [True: 403, False: 23.8k]
  ------------------
 1633|    403|      return result;
 1634|  23.8k|    else {
 1635|  23.8k|      size_t buflen = Curl_bufq_len(&ctx->q.sendbuf);
 1636|  23.8k|      if((buflen >= send_quantum) ||
  ------------------
  |  Branch (1636:10): [True: 0, False: 23.8k]
  ------------------
 1637|  23.8k|         ((buflen + gsolen) >= ctx->q.sendbuf.chunk_size))
  ------------------
  |  Branch (1637:10): [True: 6, False: 23.8k]
  ------------------
 1638|      6|        break;
 1639|  23.8k|      DEBUGASSERT(nread > 0);
  ------------------
  |  | 1016|  23.8k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1639:7): [True: 0, False: 23.8k]
  |  Branch (1639:7): [True: 23.8k, False: 0]
  ------------------
 1640|  23.8k|      ++pktcnt;
 1641|  23.8k|      if(pktcnt == 1) {
  ------------------
  |  Branch (1641:10): [True: 13.4k, False: 10.4k]
  ------------------
 1642|       |        /* first packet in buffer. This is either of a known, "good"
 1643|       |         * payload size or it is a PMTUD. We shall see. */
 1644|  13.4k|        gsolen = nread;
 1645|  13.4k|      }
 1646|  10.4k|      else if(nread > gsolen ||
  ------------------
  |  Branch (1646:15): [True: 1.95k, False: 8.48k]
  ------------------
 1647|  8.48k|              (gsolen > path_max_payload_size && nread != gsolen)) {
  ------------------
  |  Branch (1647:16): [True: 1.91k, False: 6.57k]
  |  Branch (1647:50): [True: 1.91k, False: 0]
  ------------------
 1648|       |        /* The added packet is a PMTUD *or* the one(s) before the added were
 1649|       |         * PMTUD and the last one is smaller. Flush the buffer before the last
 1650|       |         * add. */
 1651|  3.86k|        result = Curl_vquic_send_tail_split(cf, data, &ctx->q,
 1652|  3.86k|                                            gsolen, nread, nread);
 1653|  3.86k|        if(result) {
  ------------------
  |  Branch (1653:12): [True: 0, False: 3.86k]
  ------------------
 1654|      0|          if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (1654:14): [True: 0, False: 0]
  ------------------
 1655|      0|            Curl_expire_set(data, EXPIRE_QUIC, 1, &pktx->now);
 1656|      0|            return CURLE_OK;
 1657|      0|          }
 1658|      0|          return result;
 1659|      0|        }
 1660|  3.86k|        pktcnt = 0;
 1661|  3.86k|      }
 1662|  6.57k|      else if(nread < gsolen) {
  ------------------
  |  Branch (1662:15): [True: 254, False: 6.32k]
  ------------------
 1663|       |        /* Reached capacity of our buffer *or*
 1664|       |         * last add was shorter than the previous ones, flush */
 1665|    254|        break;
 1666|    254|      }
 1667|  23.8k|    }
 1668|   152k|  }
 1669|       |
 1670|   128k|  if(!Curl_bufq_is_empty(&ctx->q.sendbuf)) {
  ------------------
  |  Branch (1670:6): [True: 9.56k, False: 118k]
  ------------------
 1671|       |    /* time to send */
 1672|  9.56k|    CURL_TRC_CF(data, cf, "egress, send collected %zu packets in %zu bytes",
  ------------------
  |  |  153|  9.56k|  do {                                          \
  |  |  154|  9.56k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.56k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  19.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.56k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 880, False: 8.68k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  19.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 880, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    880|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.56k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    880|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 880, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 83, False: 797]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.56k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.56k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.56k]
  |  |  ------------------
  ------------------
 1673|  9.56k|                pktcnt, Curl_bufq_len(&ctx->q.sendbuf));
 1674|  9.56k|    result = Curl_vquic_send(cf, data, &ctx->q, gsolen);
 1675|  9.56k|    if(result) {
  ------------------
  |  Branch (1675:8): [True: 4, False: 9.56k]
  ------------------
 1676|      4|      if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (1676:10): [True: 0, False: 4]
  ------------------
 1677|      0|        Curl_expire_set(data, EXPIRE_QUIC, 1, &pktx->now);
 1678|      0|        return CURLE_OK;
 1679|      0|      }
 1680|      4|      return result;
 1681|      4|    }
 1682|  9.56k|    Curl_cf_ngtcp2_io_ctx_update_time(data, pktx, cf);
 1683|  9.56k|    Curl_ngtcp2_conn_update_pkt_tx_time(&ctx->qconn, pktx->ts);
 1684|  9.56k|  }
 1685|   128k|  return CURLE_OK;
 1686|   128k|}
Curl_cf_ngtcp2_progress_ingress:
 1744|   124k|{
 1745|   124k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1746|   124k|  struct cf_ngtcp2_io_ctx local_pktx;
 1747|   124k|  struct cf_ngtcp2_recv_ctx rctx;
 1748|   124k|  CURLcode result = CURLE_OK;
 1749|       |
 1750|   124k|  if(!pktx) {
  ------------------
  |  Branch (1750:6): [True: 0, False: 124k]
  ------------------
 1751|      0|    Curl_cf_ngtcp2_io_ctx_init(&local_pktx, cf, data);
 1752|      0|    pktx = &local_pktx;
 1753|      0|  }
 1754|       |
 1755|   124k|  result = Curl_vquic_tls_before_recv(&ctx->tls, cf, data);
 1756|   124k|  if(result)
  ------------------
  |  Branch (1756:6): [True: 0, False: 124k]
  ------------------
 1757|      0|    return result;
 1758|       |
 1759|   124k|  rctx.pktx = pktx;
 1760|   124k|  rctx.pkt_count = 0;
 1761|       |
 1762|   124k|  if(ctx->q.sockfd != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|   124k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1762:6): [True: 16.0k, False: 108k]
  ------------------
 1763|       |    /* Direct UDP socket (via happy eyeballs) */
 1764|  16.0k|    CURL_TRC_CF(data, cf, "progress_ingress(socket)");
  ------------------
  |  |  153|  16.0k|  do {                                          \
  |  |  154|  16.0k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  16.0k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  32.0k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 16.0k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 1.87k, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  32.0k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 1.87k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  1.87k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  16.0k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  1.87k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 1.87k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 49, False: 1.82k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  16.0k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  16.0k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 1765|  16.0k|    return Curl_vquic_recv_packets(cf, data, &ctx->q, 1000,
 1766|  16.0k|                                   cf_ngtcp2_recv_pkts, &rctx);
 1767|  16.0k|  }
 1768|   108k|  else {
 1769|       |    /* Tunneled QUIC (CONNECT-UDP through proxy) */
 1770|   108k|    unsigned char *buf;
 1771|   108k|    size_t max_udp_payload = QUIC_TUNNEL_INBUF_SIZE;
  ------------------
  |  |   78|   108k|#define QUIC_TUNNEL_INBUF_SIZE (64 * 1024)
  ------------------
 1772|   108k|    size_t pkt_limit = QUIC_TUNNEL_INGRESS_PKT_LIMIT;
  ------------------
  |  |  103|   108k|#define QUIC_TUNNEL_INGRESS_PKT_LIMIT 1000
  ------------------
 1773|   108k|    size_t nread;
 1774|   108k|    struct sockaddr_storage remote_addr;
 1775|   108k|    socklen_t remote_addrlen;
 1776|       |
 1777|   108k|    CURL_TRC_CF(data, cf, "progress_ingress(sub-filters)");
  ------------------
  |  |  153|   108k|  do {                                          \
  |  |  154|   108k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|   108k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|   217k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 108k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 32.4k, False: 76.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|   217k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 32.4k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  32.4k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|   108k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  32.4k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 32.4k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 16.8k, False: 15.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|   108k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|   108k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 108k]
  |  |  ------------------
  ------------------
 1778|   108k|    if(Curl_ngtcp2_conn(&ctx->qconn)) {
  ------------------
  |  Branch (1778:8): [True: 108k, False: 0]
  ------------------
 1779|   108k|      size_t max_path_payload;
 1780|   108k|      max_path_payload =
 1781|   108k|        Curl_ngtcp2_conn_get_path_max_tx_udp_payload_size(&ctx->qconn);
 1782|   108k|      if(max_path_payload > max_udp_payload)
  ------------------
  |  Branch (1782:10): [True: 0, False: 108k]
  ------------------
 1783|      0|        max_udp_payload = max_path_payload;
 1784|   108k|    }
 1785|       |
 1786|   108k|    if(ctx->tunnel_inbuf_len < max_udp_payload) {
  ------------------
  |  Branch (1786:8): [True: 1.33k, False: 107k]
  ------------------
 1787|  1.33k|      unsigned char *newbuf = curlx_realloc(ctx->tunnel_inbuf,
  ------------------
  |  | 1502|  1.33k|  curl_dbg_realloc(ptr, size, __LINE__, __FILE__)
  ------------------
 1788|  1.33k|                                            max_udp_payload);
 1789|  1.33k|      if(!newbuf)
  ------------------
  |  Branch (1789:10): [True: 2, False: 1.33k]
  ------------------
 1790|      2|        return CURLE_OUT_OF_MEMORY;
 1791|  1.33k|      ctx->tunnel_inbuf = newbuf;
 1792|  1.33k|      ctx->tunnel_inbuf_len = max_udp_payload;
 1793|  1.33k|    }
 1794|   108k|    buf = ctx->tunnel_inbuf;
 1795|       |
 1796|   125k|    while(pkt_limit--) {
  ------------------
  |  Branch (1796:11): [True: 125k, False: 11]
  ------------------
 1797|   125k|      result = Curl_conn_cf_recv(cf->next, data, (char *)buf,
 1798|   125k|                                 ctx->tunnel_inbuf_len, &nread);
 1799|   125k|      if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (1799:10): [True: 107k, False: 18.2k]
  ------------------
 1800|       |        /* no more data available at the moment */
 1801|   107k|        return CURLE_OK;
 1802|   107k|      }
 1803|  18.2k|      if(result) {
  ------------------
  |  Branch (1803:10): [True: 470, False: 17.8k]
  ------------------
 1804|    470|        CURL_TRC_CF(data, cf, "ingress, recv from tunnel failed: %d",
  ------------------
  |  |  153|    470|  do {                                          \
  |  |  154|    470|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    470|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    940|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 470, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 71, False: 399]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    940|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 71, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     71|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    470|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     71|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 71, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 12, False: 59]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    470|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    470|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 470]
  |  |  ------------------
  ------------------
 1805|    470|                    (int)result);
 1806|    470|        return result;
 1807|    470|      }
 1808|  17.8k|      if(nread == 0) {
  ------------------
  |  Branch (1808:10): [True: 1.20k, False: 16.6k]
  ------------------
 1809|       |        /* tunnel closed */
 1810|  1.20k|        return CURLE_OK;
 1811|  1.20k|      }
 1812|       |
 1813|  16.6k|      memcpy(&remote_addr, ctx->connected_path.remote.addr,
 1814|  16.6k|             ctx->connected_path.remote.addrlen);
 1815|  16.6k|      remote_addrlen = (socklen_t)ctx->connected_path.remote.addrlen;
 1816|  16.6k|      result = cf_ngtcp2_recv_pkts(buf, nread, nread, &remote_addr,
 1817|  16.6k|                                   remote_addrlen, 0, &rctx);
 1818|  16.6k|      if(result)
  ------------------
  |  Branch (1818:10): [True: 7, False: 16.5k]
  ------------------
 1819|      7|        return result;
 1820|       |
 1821|  16.5k|      if(!ctx->q.got_first_byte) {
  ------------------
  |  Branch (1821:10): [True: 725, False: 15.8k]
  ------------------
 1822|    725|        ctx->q.got_first_byte = TRUE;
  ------------------
  |  |  986|    725|#define TRUE true
  ------------------
 1823|    725|        ctx->q.first_byte_at = ctx->q.last_op;
 1824|    725|      }
 1825|  16.5k|      ctx->q.last_io = ctx->q.last_op;
 1826|  16.5k|    }
 1827|     11|    return CURLE_OK;
 1828|   108k|  }
 1829|   124k|}
Curl_cf_ngtcp2_cmn_set_expiry:
 1841|   127k|{
 1842|   127k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1843|   127k|  struct cf_ngtcp2_io_ctx local_pktx;
 1844|   127k|  ngtcp2_tstamp expiry;
 1845|       |
 1846|   127k|  if(!pktx) {
  ------------------
  |  Branch (1846:6): [True: 0, False: 127k]
  ------------------
 1847|      0|    Curl_cf_ngtcp2_io_ctx_init(&local_pktx, cf, data);
 1848|      0|    pktx = &local_pktx;
 1849|      0|  }
 1850|   127k|  else {
 1851|   127k|    Curl_cf_ngtcp2_io_ctx_update_time(data, pktx, cf);
 1852|   127k|  }
 1853|       |
 1854|   127k|  expiry = Curl_ngtcp2_conn_get_expiry(&ctx->qconn);
 1855|   127k|  if(expiry != UINT64_MAX) {
  ------------------
  |  Branch (1855:6): [True: 126k, False: 378]
  ------------------
 1856|   126k|    if(expiry <= pktx->ts) {
  ------------------
  |  Branch (1856:8): [True: 294, False: 126k]
  ------------------
 1857|    294|      CURLcode result;
 1858|    294|      int rv = Curl_ngtcp2_conn_handle_expiry(&ctx->qconn, pktx->ts);
 1859|    294|      if(rv) {
  ------------------
  |  Branch (1859:10): [True: 0, False: 294]
  ------------------
 1860|      0|        failf(data, "ngtcp2_conn_handle_expiry returned error: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1861|      0|              ngtcp2_strerror(rv));
 1862|      0|        Curl_cf_ngtcp2_cmn_err_set(cf, data, rv);
 1863|      0|        return CURLE_SEND_ERROR;
 1864|      0|      }
 1865|    294|      result = Curl_cf_ngtcp2_progress_ingress(cf, data, pktx);
 1866|    294|      if(!result)
  ------------------
  |  Branch (1866:10): [True: 294, False: 0]
  ------------------
 1867|    294|        result = Curl_cf_ngtcp2_progress_egress(cf, data, pktx);
 1868|    294|      if(result) {
  ------------------
  |  Branch (1868:10): [True: 0, False: 294]
  ------------------
 1869|       |        /* a verify failure during ingress must win over generic errors */
 1870|      0|        if(ctx->tls_vrfy_result)
  ------------------
  |  Branch (1870:12): [True: 0, False: 0]
  ------------------
 1871|      0|          result = ctx->tls_vrfy_result;
 1872|      0|        return result;
 1873|      0|      }
 1874|       |      /* ask again, things might have changed */
 1875|    294|      expiry = Curl_ngtcp2_conn_get_expiry(&ctx->qconn);
 1876|    294|    }
 1877|       |
 1878|   126k|    if(expiry > pktx->ts) {
  ------------------
  |  Branch (1878:8): [True: 126k, False: 3]
  ------------------
 1879|   126k|      ngtcp2_duration timeout = expiry - pktx->ts;
 1880|   126k|      if(timeout % NGTCP2_MILLISECONDS) {
  ------------------
  |  Branch (1880:10): [True: 126k, False: 104]
  ------------------
 1881|   126k|        timeout += NGTCP2_MILLISECONDS;
 1882|   126k|      }
 1883|   126k|      Curl_expire_latest(data, EXPIRE_QUIC,
 1884|   126k|                         (timediff_t)(timeout / NGTCP2_MILLISECONDS),
 1885|   126k|                         &pktx->now);
 1886|   126k|    }
 1887|   126k|  }
 1888|   127k|  return CURLE_OK;
 1889|   127k|}
Curl_cf_ngtcp2_h3_stream_setup:
 1931|  1.94k|{
 1932|  1.94k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1933|  1.94k|  struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
  ------------------
  |  |   82|  1.94k|  ((data) ? Curl_u32_ptrset_get(&(ctx)->streams, (data)->mid) : NULL)
  |  |  ------------------
  |  |  |  Branch (82:4): [True: 1.94k, False: 0]
  |  |  ------------------
  ------------------
 1934|       |
 1935|  1.94k|  *pstream = NULL;
 1936|  1.94k|  if(!data)
  ------------------
  |  Branch (1936:6): [True: 0, False: 1.94k]
  ------------------
 1937|      0|    return CURLE_FAILED_INIT;
 1938|       |
 1939|  1.94k|  if(stream) {
  ------------------
  |  Branch (1939:6): [True: 1, False: 1.94k]
  ------------------
 1940|      1|    *pstream = stream;
 1941|      1|    return CURLE_OK;
 1942|      1|  }
 1943|       |
 1944|  1.94k|  stream = curlx_calloc(1, sizeof(*stream));
  ------------------
  |  | 1500|  1.94k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1945|  1.94k|  if(!stream)
  ------------------
  |  Branch (1945:6): [True: 0, False: 1.94k]
  ------------------
 1946|      0|    return CURLE_OUT_OF_MEMORY;
 1947|       |
 1948|  1.94k|  stream->id = -1;
 1949|  1.94k|  stream->xfer_id = data->id;
 1950|  1.94k|  stream->mid = data->mid;
 1951|  1.94k|  stream->rx_offset = 0;
 1952|  1.94k|  stream->rx_offset_max = H3_STREAM_WINDOW_SIZE_INITIAL;
  ------------------
  |  |   83|  1.94k|#define H3_STREAM_WINDOW_SIZE_INITIAL (32 * 1024)
  ------------------
 1953|  1.94k|  stream->tx_in_flight_ideal = H3_STREAM_SEND_BUF_INITIAL;
  ------------------
  |  |  101|  1.94k|#define H3_STREAM_SEND_BUF_INITIAL     (32 * 1024)
  ------------------
 1954|       |
 1955|       |  /* on send, we control how much we put into the buffer */
 1956|  1.94k|  Curl_bufq_initp(&stream->sendbuf, &ctx->stream_bufcp,
 1957|  1.94k|                  H3_STREAM_SEND_CHUNKS, BUFQ_OPT_NONE);
  ------------------
  |  |   99|  1.94k|  (H3_STREAM_SEND_BUFFER_MAX / H3_STREAM_CHUNK_SIZE)
  |  |  ------------------
  |  |  |  |   97|  1.94k|#define H3_STREAM_SEND_BUFFER_MAX      (10 * H3_STREAM_CHUNK_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|  1.94k|#define H3_STREAM_CHUNK_SIZE  (64 * 1024)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 (H3_STREAM_SEND_BUFFER_MAX / H3_STREAM_CHUNK_SIZE)
  |  |  ------------------
  |  |  |  |   87|  1.94k|#define H3_STREAM_CHUNK_SIZE  (64 * 1024)
  |  |  ------------------
  ------------------
                                H3_STREAM_SEND_CHUNKS, BUFQ_OPT_NONE);
  ------------------
  |  |  106|  1.94k|#define BUFQ_OPT_NONE        0
  ------------------
 1958|  1.94k|  stream->tx_in_flight_size = 0;
 1959|  1.94k|  Curl_h1_req_parse_init(&stream->h1, H1_PARSE_DEFAULT_MAX_LINE_LEN);
  ------------------
  |  |   35|  1.94k|#define H1_PARSE_DEFAULT_MAX_LINE_LEN   DYN_HTTP_REQUEST
  |  |  ------------------
  |  |  |  |   69|  1.94k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  |  |  ------------------
  ------------------
 1960|       |
 1961|  1.94k|  if(Curl_u32_ptrset_set(&ctx->streams, data->mid, stream)) {
  ------------------
  |  Branch (1961:6): [True: 0, False: 1.94k]
  ------------------
 1962|      0|    Curl_cf_ngtcp2_h3_stream_ctx_free(stream);
 1963|      0|    return CURLE_OUT_OF_MEMORY;
 1964|      0|  }
 1965|       |
 1966|  1.94k|  if(Curl_u32_ptrset_count(&ctx->streams) == 1)
  ------------------
  |  Branch (1966:6): [True: 1.94k, False: 0]
  ------------------
 1967|  1.94k|    cf_ngtcp2_setup_keep_alive(cf, data);
 1968|       |
 1969|  1.94k|  *pstream = stream;
 1970|  1.94k|  return CURLE_OK;
 1971|  1.94k|}
Curl_cf_ngtcp2_h3_stream_close:
 1976|  1.95k|{
 1977|  1.95k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1978|  1.95k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1978:3): [True: 0, False: 1.95k]
  |  Branch (1978:3): [True: 1.95k, False: 0]
  ------------------
 1979|  1.95k|  DEBUGASSERT(stream);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1979:3): [True: 0, False: 1.95k]
  |  Branch (1979:3): [True: 1.95k, False: 0]
  ------------------
 1980|  1.95k|  if(!stream->closed && Curl_ngtcp2_conn(&ctx->qconn) && ctx->h3conn) {
  ------------------
  |  Branch (1980:6): [True: 1.22k, False: 724]
  |  Branch (1980:25): [True: 1.22k, False: 0]
  |  Branch (1980:58): [True: 1.22k, False: 0]
  ------------------
 1981|  1.22k|    CURLcode result;
 1982|       |
 1983|  1.22k|    nghttp3_conn_set_stream_user_data(ctx->h3conn, stream->id, NULL);
 1984|  1.22k|    Curl_ngtcp2_conn_set_stream_user_data(&ctx->qconn, stream->id, NULL);
 1985|  1.22k|    stream->closed = TRUE;
  ------------------
  |  |  986|  1.22k|#define TRUE true
  ------------------
 1986|  1.22k|    (void)Curl_ngtcp2_conn_shutdown_stream(
 1987|  1.22k|      &ctx->qconn, 0, stream->id, NGHTTP3_H3_REQUEST_CANCELLED);
 1988|  1.22k|    result = Curl_ngtcp2_restricted(&ctx->qconn) ? CURLE_OK :
  ------------------
  |  Branch (1988:14): [True: 378, False: 850]
  ------------------
 1989|  1.22k|      Curl_cf_ngtcp2_progress_egress(cf, data, NULL);
 1990|  1.22k|    if(result)
  ------------------
  |  Branch (1990:8): [True: 0, False: 1.22k]
  ------------------
 1991|      0|      CURL_TRC_CF(data, cf, "[%" PRId64 "] cancel stream -> %d",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1992|  1.22k|                  stream->id, (int)result);
 1993|  1.22k|  }
 1994|  1.95k|}
Curl_cf_ngtcp2_h3_stream_done:
 1998|  2.81k|{
 1999|  2.81k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 2000|  2.81k|  struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
  ------------------
  |  |   82|  2.81k|  ((data) ? Curl_u32_ptrset_get(&(ctx)->streams, (data)->mid) : NULL)
  |  |  ------------------
  |  |  |  Branch (82:4): [True: 2.81k, False: 0]
  |  |  ------------------
  ------------------
 2001|  2.81k|  if(stream) {
  ------------------
  |  Branch (2001:6): [True: 1.94k, False: 870]
  ------------------
 2002|  1.94k|    CURL_TRC_CF(data, cf, "[%" PRId64 "] easy handle is done", stream->id);
  ------------------
  |  |  153|  1.94k|  do {                                          \
  |  |  154|  1.94k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.94k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.89k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.94k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 145, False: 1.80k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.89k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 145, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    145|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.94k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    145|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 145, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 5, False: 140]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.94k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.94k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.94k]
  |  |  ------------------
  ------------------
 2003|  1.94k|    Curl_cf_ngtcp2_h3_stream_close(cf, data, stream);
 2004|  1.94k|    Curl_u32_ptrset_unset(&ctx->streams, data->mid);
 2005|  1.94k|    if(!Curl_u32_ptrset_count(&ctx->streams))
  ------------------
  |  Branch (2005:8): [True: 1.94k, False: 0]
  ------------------
 2006|  1.94k|      cf_ngtcp2_setup_keep_alive(cf, data);
 2007|  1.94k|  }
 2008|  2.81k|}
Curl_cf_ngtcp2_h3_init_ctrls:
 2060|  1.96k|{
 2061|  1.96k|  int64_t ctrl_stream_id, qpack_enc_stream_id, qpack_dec_stream_id;
 2062|  1.96k|  int rc;
 2063|       |
 2064|  1.96k|  rc = Curl_ngtcp2_conn_open_uni_stream(&ctx->qconn, &ctrl_stream_id, NULL);
 2065|  1.96k|  if(rc) {
  ------------------
  |  Branch (2065:6): [True: 2, False: 1.96k]
  ------------------
 2066|      2|    failf(data, "error creating HTTP/3 control stream: %s",
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
 2067|      2|          ngtcp2_strerror(rc));
 2068|      2|    return CURLE_QUIC_CONNECT_ERROR;
 2069|      2|  }
 2070|  1.96k|  rc = nghttp3_conn_bind_control_stream(ctx->h3conn, ctrl_stream_id);
 2071|  1.96k|  if(rc) {
  ------------------
  |  Branch (2071:6): [True: 2, False: 1.95k]
  ------------------
 2072|      2|    failf(data, "error binding HTTP/3 control stream: %s",
  ------------------
  |  |   62|      2|#define failf Curl_failf
  ------------------
 2073|      2|          ngtcp2_strerror(rc));
 2074|      2|    return CURLE_QUIC_CONNECT_ERROR;
 2075|      2|  }
 2076|  1.95k|  rc = Curl_ngtcp2_conn_open_uni_stream(&ctx->qconn, &qpack_enc_stream_id,
 2077|  1.95k|                                        NULL);
 2078|  1.95k|  if(rc) {
  ------------------
  |  Branch (2078:6): [True: 0, False: 1.95k]
  ------------------
 2079|      0|    failf(data, "error creating HTTP/3 qpack encoding stream: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2080|      0|          ngtcp2_strerror(rc));
 2081|      0|    return CURLE_QUIC_CONNECT_ERROR;
 2082|      0|  }
 2083|  1.95k|  rc = Curl_ngtcp2_conn_open_uni_stream(&ctx->qconn, &qpack_dec_stream_id,
 2084|  1.95k|                                        NULL);
 2085|  1.95k|  if(rc) {
  ------------------
  |  Branch (2085:6): [True: 0, False: 1.95k]
  ------------------
 2086|      0|    failf(data, "error creating HTTP/3 qpack decoding stream: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2087|      0|          ngtcp2_strerror(rc));
 2088|      0|    return CURLE_QUIC_CONNECT_ERROR;
 2089|      0|  }
 2090|  1.95k|  rc = nghttp3_conn_bind_qpack_streams(ctx->h3conn, qpack_enc_stream_id,
 2091|  1.95k|                                       qpack_dec_stream_id);
 2092|  1.95k|  if(rc) {
  ------------------
  |  Branch (2092:6): [True: 0, False: 1.95k]
  ------------------
 2093|      0|    failf(data, "error binding HTTP/3 qpack streams: %s", ngtcp2_strerror(rc));
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2094|      0|    return CURLE_QUIC_CONNECT_ERROR;
 2095|      0|  }
 2096|  1.95k|  return CURLE_OK;
 2097|  1.95k|}
Curl_cf_ngtcp2_cmn_query:
 2102|   127k|{
 2103|   127k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 2104|       |
 2105|   127k|  switch(query) {
 2106|      0|  case CF_QUERY_CONNECT_REPLY_MS:
  ------------------
  |  |  168|      0|#define CF_QUERY_CONNECT_REPLY_MS   2  /* number     -        */
  ------------------
  |  Branch (2106:3): [True: 0, False: 127k]
  ------------------
 2107|      0|    if((ctx->q.sockfd != CURL_SOCKET_BAD) && ctx->q.got_first_byte) {
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (2107:8): [True: 0, False: 0]
  |  Branch (2107:46): [True: 0, False: 0]
  ------------------
 2108|      0|      timediff_t ms = curlx_ptimediff_ms(&ctx->q.first_byte_at,
 2109|      0|                                         &ctx->started_at);
 2110|      0|      *pres1 = (ms < INT_MAX) ? (int)ms : INT_MAX;
  ------------------
  |  Branch (2110:16): [True: 0, False: 0]
  ------------------
 2111|      0|      return CURLE_OK;
 2112|      0|    }
 2113|      0|    break;
 2114|  1.03k|  case CF_QUERY_REALLY_CONNECTED:
  ------------------
  |  |  182|  1.03k|#define CF_QUERY_REALLY_CONNECTED  16  /* TRUE/FALSE - */
  ------------------
  |  Branch (2114:3): [True: 1.03k, False: 126k]
  ------------------
 2115|  1.03k|    if(ctx->q.sockfd != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  1.03k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (2115:8): [True: 0, False: 1.03k]
  ------------------
 2116|      0|      *pres1 = ctx->q.got_first_byte;
 2117|      0|      return CURLE_OK;
 2118|      0|    }
 2119|  1.03k|    break;
 2120|   126k|  default:
  ------------------
  |  Branch (2120:3): [True: 126k, False: 1.03k]
  ------------------
 2121|   126k|    break;
 2122|   127k|  }
 2123|   127k|  return cf->next ?
  ------------------
  |  Branch (2123:10): [True: 127k, False: 0]
  ------------------
 2124|   127k|    cf->next->cft->query(cf->next, data, query, pres1, pres2) :
 2125|   127k|    CURLE_UNKNOWN_OPTION;
 2126|   127k|}
Curl_cf_ngtcp2_cmn_cntrl:
 2154|  8.23k|{
 2155|  8.23k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 2156|  8.23k|  CURLcode result = CURLE_OK;
 2157|       |
 2158|  8.23k|  (void)arg1;
 2159|  8.23k|  (void)arg2;
 2160|  8.23k|  switch(event) {
 2161|  2.47k|  case CF_CTRL_REPORT_STATS:
  ------------------
  |  |  124|  2.47k|#define CF_CTRL_REPORT_STATS     (256 + 3) /* 0          NULL     ignored */
  ------------------
  |  Branch (2161:3): [True: 2.47k, False: 5.75k]
  ------------------
 2162|  2.47k|    if(cf->connected && !ctx->stats_reported) {
  ------------------
  |  Branch (2162:8): [True: 1.95k, False: 516]
  |  Branch (2162:25): [True: 1.95k, False: 0]
  ------------------
 2163|  1.95k|      if((cf->cft->flags & CF_TYPE_PROXY) &&
  ------------------
  |  |  213|  1.95k|#define CF_TYPE_PROXY       (1 << 3)
  ------------------
  |  Branch (2163:10): [True: 0, False: 1.95k]
  ------------------
 2164|      0|         (ctx->q.sockfd != CURL_SOCKET_BAD) && ctx->q.got_first_byte) {
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (2164:10): [True: 0, False: 0]
  |  Branch (2164:48): [True: 0, False: 0]
  ------------------
 2165|      0|        Curl_pgrsTimeWas(data, TIMER_CONNECT, ctx->q.first_byte_at);
 2166|      0|        ctx->stats_reported = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2167|      0|      }
 2168|  1.95k|      else if(ctx->handshake_at.tv_sec || ctx->handshake_at.tv_usec) {
  ------------------
  |  Branch (2168:15): [True: 1.95k, False: 0]
  |  Branch (2168:43): [True: 0, False: 0]
  ------------------
 2169|  1.95k|        if(ctx->q.sockfd != CURL_SOCKET_BAD)
  ------------------
  |  |  147|  1.95k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (2169:12): [True: 1.95k, False: 0]
  ------------------
 2170|  1.95k|          Curl_pgrsTimeWas(data, TIMER_CONNECT, ctx->q.first_byte_at);
 2171|  1.95k|        Curl_pgrsTimeWas(data, TIMER_APPCONNECT, ctx->handshake_at);
 2172|  1.95k|        ctx->stats_reported = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
 2173|  1.95k|      }
 2174|  1.95k|    }
 2175|  2.47k|    break;
 2176|      0|  case CF_CTRL_MAINTENANCE:
  ------------------
  |  |  125|      0|#define CF_CTRL_MAINTENANCE      (256 + 4) /* 0          NULL     ignored */
  ------------------
  |  Branch (2176:3): [True: 0, False: 8.23k]
  ------------------
 2177|      0|    result = cf_ngtcp2_cmn_maintenance(cf, data);
 2178|      0|    break;
 2179|  5.75k|  default:
  ------------------
  |  Branch (2179:3): [True: 5.75k, False: 2.47k]
  ------------------
 2180|  5.75k|    break;
 2181|  8.23k|  }
 2182|  8.23k|  return result;
 2183|  8.23k|}
cf-ngtcp2-cmn.c:cf_ngtcp2_h3_err_is_fatal:
  101|      3|{
  102|      3|  return (NGHTTP3_ERR_FATAL >= code) ||
  ------------------
  |  Branch (102:10): [True: 0, False: 3]
  ------------------
  103|      3|         (NGHTTP3_ERR_H3_CLOSED_CRITICAL_STREAM == code);
  ------------------
  |  Branch (103:10): [True: 3, False: 0]
  ------------------
  104|      3|}
cf-ngtcp2-cmn.c:h3_stream_set_free:
   94|  1.94k|{
   95|  1.94k|  (void)id;
   96|  1.94k|  DEBUGASSERT(stream);
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (96:3): [True: 0, False: 1.94k]
  |  Branch (96:3): [True: 1.94k, False: 0]
  ------------------
   97|  1.94k|  Curl_cf_ngtcp2_h3_stream_ctx_free((struct h3_stream_ctx *)stream);
   98|  1.94k|}
cf-ngtcp2-cmn.c:cf_connect_start:
 1020|  3.34k|{
 1021|  3.34k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1022|  3.34k|  int rc;
 1023|  3.34k|  int rv;
 1024|  3.34k|  CURLcode result;
 1025|  3.34k|  const struct Curl_sockaddr_ex *sockaddr = NULL;
 1026|  3.34k|  int qfd;
 1027|  3.34k|  static const struct alpn_spec ALPN_SPEC_H3 = { { "h3", "h3-29" }, 2 };
 1028|       |
 1029|  3.34k|  DEBUGASSERT(ctx->initialized);
  ------------------
  |  | 1016|  3.34k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1029:3): [True: 0, False: 3.34k]
  |  Branch (1029:3): [True: 3.34k, False: 0]
  ------------------
 1030|  3.34k|  ctx->dcid.datalen = NGTCP2_MAX_CIDLEN;
 1031|  3.34k|  result = Curl_rand(data, ctx->dcid.data, NGTCP2_MAX_CIDLEN);
  ------------------
  |  |   35|  3.34k|#define Curl_rand(a, b, c) Curl_rand_bytes(a, TRUE, b, c)
  |  |  ------------------
  |  |  |  |  986|  3.34k|#define TRUE true
  |  |  ------------------
  ------------------
 1032|  3.34k|  if(result)
  ------------------
  |  Branch (1032:6): [True: 0, False: 3.34k]
  ------------------
 1033|      0|    return result;
 1034|       |
 1035|  3.34k|  ctx->scid.datalen = NGTCP2_MAX_CIDLEN;
 1036|  3.34k|  result = Curl_rand(data, ctx->scid.data, NGTCP2_MAX_CIDLEN);
  ------------------
  |  |   35|  3.34k|#define Curl_rand(a, b, c) Curl_rand_bytes(a, TRUE, b, c)
  |  |  ------------------
  |  |  |  |  986|  3.34k|#define TRUE true
  |  |  ------------------
  ------------------
 1037|  3.34k|  if(result)
  ------------------
  |  Branch (1037:6): [True: 0, False: 3.34k]
  ------------------
 1038|      0|    return result;
 1039|       |
 1040|  3.34k|  (void)Curl_qlogdir(data, ctx->scid.data, NGTCP2_MAX_CIDLEN, &qfd);
 1041|  3.34k|  ctx->qlogfd = qfd; /* -1 if failure above */
 1042|  3.34k|  quic_settings(ctx, data, pktx);
 1043|       |
 1044|  3.34k|  result = Curl_vquic_ctx_init(data, &ctx->q);
 1045|  3.34k|  if(result)
  ------------------
  |  Branch (1045:6): [True: 0, False: 3.34k]
  ------------------
 1046|      0|    return result;
 1047|       |
 1048|       |  /* Query socket and remote address from sub-chain */
 1049|  3.34k|  if(Curl_cf_socket_peek(cf->next, data, &ctx->q.sockfd, &sockaddr, NULL)) {
  ------------------
  |  Branch (1049:6): [True: 1.37k, False: 1.97k]
  ------------------
 1050|       |    /* No direct socket - must be tunneled QUIC (CONNECT-UDP through proxy) */
 1051|  1.37k|    ctx->q.sockfd = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  1.37k|#define CURL_SOCKET_BAD (-1)
  ------------------
 1052|  1.37k|  }
 1053|       |
 1054|  3.34k|  if(ctx->q.sockfd != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  3.34k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1054:6): [True: 1.97k, False: 1.37k]
  ------------------
 1055|       |    /* Direct UDP socket - get local address for ngtcp2 */
 1056|  1.97k|    ctx->q.local_addrlen = sizeof(ctx->q.local_addr);
 1057|  1.97k|    rv = getsockname(ctx->q.sockfd, (struct sockaddr *)&ctx->q.local_addr,
 1058|  1.97k|                     &ctx->q.local_addrlen);
 1059|  1.97k|    if(rv == -1)
  ------------------
  |  Branch (1059:8): [True: 0, False: 1.97k]
  ------------------
 1060|      0|      return CURLE_QUIC_CONNECT_ERROR;
 1061|       |
 1062|  1.97k|    ngtcp2_addr_init(&ctx->connected_path.local,
 1063|  1.97k|                     (struct sockaddr *)&ctx->q.local_addr,
 1064|  1.97k|                     ctx->q.local_addrlen);
 1065|  1.97k|    ngtcp2_addr_init(&ctx->connected_path.remote,
 1066|  1.97k|                     &sockaddr->curl_sa_addr, (socklen_t)sockaddr->addrlen);
  ------------------
  |  |   36|  1.97k|#define curl_sa_addr    addr.sa
  ------------------
 1067|  1.97k|  }
 1068|  1.37k|  else {
 1069|       |    /* Tunneled QUIC (e.g. CONNECT-UDP): get remote address
 1070|       |       from the connected filter below */
 1071|  1.37k|    const struct Curl_sockaddr_ex *remote = NULL;
 1072|  1.37k|    if(cf->next->cft->query(cf->next, data, CF_QUERY_REMOTE_ADDR, NULL,
  ------------------
  |  |  176|  1.37k|#define CF_QUERY_REMOTE_ADDR       10  /* -          `Curl_sockaddr_ex *` */
  ------------------
  |  Branch (1072:8): [True: 0, False: 1.37k]
  ------------------
 1073|  1.37k|                            CURL_UNCONST(&remote)))
  ------------------
  |  |  793|  1.37k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
 1074|      0|      return CURLE_QUIC_CONNECT_ERROR;
 1075|  1.37k|    if(!remote)
  ------------------
  |  Branch (1075:8): [True: 0, False: 1.37k]
  ------------------
 1076|      0|      return CURLE_QUIC_CONNECT_ERROR;
 1077|       |
 1078|  1.37k|    memset(&ctx->q.local_addr, 0, sizeof(ctx->q.local_addr));
 1079|  1.37k|    switch(remote->family) {
 1080|  1.37k|    case AF_INET:
  ------------------
  |  Branch (1080:5): [True: 1.37k, False: 0]
  ------------------
 1081|  1.37k|      ((struct sockaddr_in *)&ctx->q.local_addr)->sin_family = AF_INET;
 1082|  1.37k|      ctx->q.local_addrlen = sizeof(struct sockaddr_in);
 1083|  1.37k|      break;
 1084|      0|#ifdef USE_IPV6
 1085|      0|    case AF_INET6:
  ------------------
  |  Branch (1085:5): [True: 0, False: 1.37k]
  ------------------
 1086|      0|      ((struct sockaddr_in6 *)&ctx->q.local_addr)->sin6_family = AF_INET6;
 1087|      0|      ctx->q.local_addrlen = sizeof(struct sockaddr_in6);
 1088|      0|      break;
 1089|      0|#endif
 1090|      0|    default:
  ------------------
  |  Branch (1090:5): [True: 0, False: 1.37k]
  ------------------
 1091|      0|      return CURLE_QUIC_CONNECT_ERROR;
 1092|  1.37k|    }
 1093|       |
 1094|  1.37k|    ngtcp2_addr_init(&ctx->connected_path.local,
 1095|  1.37k|                     (struct sockaddr *)&ctx->q.local_addr,
 1096|  1.37k|                     ctx->q.local_addrlen);
 1097|  1.37k|    ngtcp2_addr_init(&ctx->connected_path.remote,
 1098|  1.37k|                     &remote->curl_sa_addr,
  ------------------
  |  |   36|  1.37k|#define curl_sa_addr    addr.sa
  ------------------
 1099|  1.37k|                     (socklen_t)remote->addrlen);
 1100|  1.37k|  }
 1101|       |
 1102|  3.34k|  rc = Curl_ngtcp2_conn_client_new(&ctx->qconn, &ctx->dcid, &ctx->scid,
 1103|  3.34k|                                    &ctx->connected_path,
 1104|  3.34k|                                    NGTCP2_PROTO_VER_V1, &ng_callbacks,
 1105|  3.34k|                                    &ctx->settings, &ctx->transport_params,
 1106|  3.34k|                                    Curl_ngtcp2_mem(), cf);
 1107|  3.34k|  if(rc)
  ------------------
  |  Branch (1107:6): [True: 13, False: 3.33k]
  ------------------
 1108|     13|    return CURLE_QUIC_CONNECT_ERROR;
 1109|       |
 1110|  3.33k|  ctx->conn_ref.get_conn = get_conn;
 1111|  3.33k|  ctx->conn_ref.user_data = cf;
 1112|       |
 1113|  3.33k|  result = Curl_vquic_tls_init(&ctx->tls, cf, data,
 1114|  3.33k|                               &ctx->ssl_peer, &ALPN_SPEC_H3,
 1115|  3.33k|                               cf_ngtcp2_tls_ctx_setup, &ctx->tls,
 1116|  3.33k|                               &ctx->conn_ref,
 1117|  3.33k|                               cf_ngtcp2_on_session_reuse);
 1118|  3.33k|  if(result)
  ------------------
  |  Branch (1118:6): [True: 0, False: 3.33k]
  ------------------
 1119|      0|    return result;
 1120|       |
 1121|  3.33k|#if defined(USE_OPENSSL) && defined(OPENSSL_QUIC_API2)
 1122|  3.33k|  if(ngtcp2_crypto_ossl_ctx_new(&ctx->ossl_ctx, ctx->tls.ossl.ssl) != 0) {
  ------------------
  |  Branch (1122:6): [True: 0, False: 3.33k]
  ------------------
 1123|      0|    failf(data, "ngtcp2_crypto_ossl_ctx_new failed");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1124|      0|    return CURLE_FAILED_INIT;
 1125|      0|  }
 1126|  3.33k|  Curl_ngtcp2_conn_set_tls_native_handle(&ctx->qconn, ctx->ossl_ctx);
 1127|  3.33k|  if(ngtcp2_crypto_ossl_configure_client_session(ctx->tls.ossl.ssl) != 0) {
  ------------------
  |  Branch (1127:6): [True: 0, False: 3.33k]
  ------------------
 1128|      0|    failf(data, "ngtcp2_crypto_ossl_configure_client_session failed");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1129|      0|    return CURLE_FAILED_INIT;
 1130|      0|  }
 1131|       |#elif defined(USE_OPENSSL)
 1132|       |  SSL_set_quic_use_legacy_codepoint(ctx->tls.ossl.ssl, 0);
 1133|       |  Curl_ngtcp2_conn_set_tls_native_handle(&ctx->qconn, ctx->tls.ossl.ssl);
 1134|       |#elif defined(USE_GNUTLS)
 1135|       |  Curl_ngtcp2_conn_set_tls_native_handle(&ctx->qconn, ctx->tls.gtls.session);
 1136|       |#elif defined(USE_WOLFSSL)
 1137|       |  Curl_ngtcp2_conn_set_tls_native_handle(&ctx->qconn, ctx->tls.wssl.ssl);
 1138|       |#else
 1139|       |#error "ngtcp2 TLS backend not defined"
 1140|       |#endif
 1141|       |
 1142|  3.33k|#if defined(USE_OPENSSL) && defined(HAVE_OPENSSL_EARLYDATA) && \
 1143|  3.33k|  defined(OPENSSL_QUIC_API2)
 1144|       |  /* We need to tell OpenSSL to *really* use Early Data for QUIC and
 1145|       |   * this only works *after* ngtcp2 has tweaked all SSL parameters,
 1146|       |   * otherwise OpenSSL does not accept it. */
 1147|  3.33k|  if(ctx->use_earlydata &&
  ------------------
  |  Branch (1147:6): [True: 0, False: 3.33k]
  ------------------
 1148|      0|     !SSL_set_quic_tls_early_data_enabled(ctx->tls.ossl.ssl, 1)) {
  ------------------
  |  Branch (1148:6): [True: 0, False: 0]
  ------------------
 1149|      0|    CURL_TRC_CF(data, cf, "OpenSSL refused to use early data");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1150|      0|    ctx->use_earlydata = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1151|      0|    cf->connected = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1152|      0|  }
 1153|  3.33k|#endif
 1154|  3.33k|  ngtcp2_ccerr_default(&ctx->last_error);
 1155|       |
 1156|  3.33k|  return CURLE_OK;
 1157|  3.33k|}
cf-ngtcp2-cmn.c:quic_settings:
  245|  3.34k|{
  246|  3.34k|  ngtcp2_settings *s = &ctx->settings;
  247|  3.34k|  ngtcp2_transport_params *t = &ctx->transport_params;
  248|       |
  249|  3.34k|  ngtcp2_settings_default(s);
  250|  3.34k|  ngtcp2_transport_params_default(t);
  251|       |#ifdef DEBUG_NGTCP2
  252|       |  s->log_printf = quic_printf;
  253|       |#else
  254|  3.34k|  s->log_printf = NULL;
  255|  3.34k|#endif
  256|       |
  257|  3.34k|  s->initial_ts = pktx->ts;
  258|  3.34k|  s->handshake_timeout = (data->set.connecttimeout > 0) ?
  ------------------
  |  Branch (258:26): [True: 3.34k, False: 0]
  ------------------
  259|  3.34k|    data->set.connecttimeout * NGTCP2_MILLISECONDS : QUIC_HANDSHAKE_TIMEOUT;
  ------------------
  |  |   77|  3.34k|#define QUIC_HANDSHAKE_TIMEOUT (10 * NGTCP2_SECONDS)
  ------------------
  260|  3.34k|  s->max_window = H3_CONN_WINDOW_SIZE_MAX;
  ------------------
  |  |   85|  3.34k|#define H3_CONN_WINDOW_SIZE_MAX       (100 * H3_STREAM_WINDOW_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   84|  3.34k|#define H3_STREAM_WINDOW_SIZE_MAX     (10 * 1024 * 1024)
  |  |  ------------------
  ------------------
  261|  3.34k|  s->max_stream_window = 0; /* disable ngtcp2 auto-tuning of window */
  262|  3.34k|  s->no_pmtud = FALSE;
  ------------------
  |  |  989|  3.34k|#define FALSE false
  ------------------
  263|  3.34k|#ifdef NGTCP2_SETTINGS_V3
  264|       |  /* try ten times the ngtcp2 defaults here for problems with Caddy */
  265|  3.34k|  s->glitch_ratelim_burst = 1000 * 10;
  266|  3.34k|  s->glitch_ratelim_rate = 33 * 10;
  267|  3.34k|#endif
  268|       |  /* We do not allow the server to open bidi streams to us */
  269|  3.34k|  t->initial_max_streams_bidi = 0;
  270|  3.34k|  t->initial_max_stream_data_bidi_remote = 0;
  271|       |  /* remote uni streams have a limit which is 3 for HTTP/3 */
  272|  3.34k|  t->initial_max_streams_uni = QUIC_UNI_STREAM_MAX;
  ------------------
  |  |   74|  3.34k|#define QUIC_UNI_STREAM_MAX      3
  ------------------
  273|  3.34k|  t->initial_max_stream_data_uni = QUIC_UNI_STREAM_WIN_SIZE;
  ------------------
  |  |   75|  3.34k|#define QUIC_UNI_STREAM_WIN_SIZE (64 * 1024)
  ------------------
  274|       |  /* Initial windows sizes for stream we open */
  275|  3.34k|  t->initial_max_data = s->max_window;
  276|  3.34k|  t->initial_max_stream_data_bidi_local = H3_STREAM_WINDOW_SIZE_INITIAL;
  ------------------
  |  |   83|  3.34k|#define H3_STREAM_WINDOW_SIZE_INITIAL (32 * 1024)
  ------------------
  277|  3.34k|  t->max_idle_timeout = 0; /* no idle timeout from our side */
  278|  3.34k|  if(ctx->qlogfd != -1) {
  ------------------
  |  Branch (278:6): [True: 0, False: 3.34k]
  ------------------
  279|      0|    s->qlog_write = qlog_callback;
  280|      0|  }
  281|  3.34k|}
cf-ngtcp2-cmn.c:cb_ngtcp2_handshake_completed:
  289|  1.95k|{
  290|  1.95k|  struct Curl_cfilter *cf = user_data;
  291|  1.95k|  struct cf_ngtcp2_ctx *ctx = cf ? cf->ctx : NULL;
  ------------------
  |  Branch (291:31): [True: 1.95k, False: 0]
  ------------------
  292|  1.95k|  struct Curl_easy *data;
  293|       |
  294|  1.95k|  (void)tconn;
  295|  1.95k|  DEBUGASSERT(ctx);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (295:3): [True: 0, False: 1.95k]
  |  Branch (295:3): [True: 1.95k, False: 0]
  ------------------
  296|  1.95k|  data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  685|  1.95k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  157|  1.95k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (685:30): [True: 1.95k, False: 0]
  |  |  ------------------
  ------------------
  297|  1.95k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (297:3): [True: 0, False: 1.95k]
  |  Branch (297:3): [True: 1.95k, False: 0]
  ------------------
  298|  1.95k|  if(!ctx || !data)
  ------------------
  |  Branch (298:6): [True: 0, False: 1.95k]
  |  Branch (298:14): [True: 0, False: 1.95k]
  ------------------
  299|      0|    return NGTCP2_ERR_CALLBACK_FAILURE;
  300|       |
  301|  1.95k|  ctx->handshake_at = *Curl_pgrs_now(data);
  302|  1.95k|  ctx->tls_handshake_complete = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
  303|  1.95k|  Curl_vquic_report_handshake(&ctx->tls, cf, data);
  304|       |
  305|  1.95k|  ctx->tls_vrfy_result = Curl_vquic_tls_verify_peer(&ctx->tls, cf,
  306|  1.95k|                                                    data, &ctx->ssl_peer);
  307|  1.95k|  if(ctx->tls_vrfy_result)
  ------------------
  |  Branch (307:6): [True: 0, False: 1.95k]
  ------------------
  308|      0|    return NGTCP2_ERR_CALLBACK_FAILURE;
  309|       |
  310|  1.95k|#ifdef CURLVERBOSE
  311|  1.95k|  if(Curl_trc_is_verbose(data)) {
  ------------------
  |  |  322|  1.95k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  ------------------
  |  |  323|  1.95k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  ------------------
  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  312|    147|    const ngtcp2_transport_params *rp;
  313|    147|    rp = Curl_ngtcp2_conn_get_remote_transport_params(&ctx->qconn);
  314|    147|    CURL_TRC_CF(data, cf, "handshake complete after %" FMT_TIMEDIFF_T
  ------------------
  |  |  153|    147|  do {                                          \
  |  |  154|    147|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    147|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    294|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 147, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    294|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    147|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 5, False: 142]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    147|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    147|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 147]
  |  |  ------------------
  ------------------
  315|    147|                "ms, remote transport[max_udp_payload=%" PRIu64
  316|    147|                ", initial_max_data=%" PRIu64 "]",
  317|    147|                curlx_ptimediff_ms(&ctx->handshake_at, &ctx->started_at),
  318|    147|                rp->max_udp_payload_size, rp->initial_max_data);
  319|    147|  }
  320|  1.95k|#endif
  321|       |
  322|       |  /* In case of earlydata, where we simulate being connected, update
  323|       |   * the handshake time when we really did connect */
  324|  1.95k|  if(ctx->use_earlydata && !ctx->stats_reported &&
  ------------------
  |  Branch (324:6): [True: 0, False: 1.95k]
  |  Branch (324:28): [True: 0, False: 0]
  ------------------
  325|      0|     !(cf->cft->flags & CF_TYPE_PROXY)) {
  ------------------
  |  |  213|      0|#define CF_TYPE_PROXY       (1 << 3)
  ------------------
  |  Branch (325:6): [True: 0, False: 0]
  ------------------
  326|      0|    Curl_pgrsTimeWas(data, TIMER_APPCONNECT, ctx->handshake_at);
  327|      0|    ctx->stats_reported = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  328|      0|  }
  329|  1.95k|  if(ctx->use_earlydata) {
  ------------------
  |  Branch (329:6): [True: 0, False: 1.95k]
  ------------------
  330|      0|#if defined(USE_OPENSSL) && defined(HAVE_OPENSSL_EARLYDATA)
  331|       |    /* Check for bug that OpenSSL did not even send the early data. */
  332|      0|    if(SSL_get_early_data_status(ctx->tls.ossl.ssl) == SSL_EARLY_DATA_NOT_SENT)
  ------------------
  |  Branch (332:8): [True: 0, False: 0]
  ------------------
  333|      0|      CURL_TRC_CF(data, cf, "OpenSSL did not send early data");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  334|      0|#endif
  335|       |
  336|      0|#if NGTCP2_VERSION_NUM >= 0x011700
  337|      0|    ctx->earlydata_accepted =
  338|      0|      !Curl_ngtcp2_conn_get_tls_early_data_rejected2(&ctx->qconn);
  339|       |#else /* older NGTCP2 */
  340|       |    {
  341|       |#if defined(USE_OPENSSL) && defined(HAVE_OPENSSL_EARLYDATA)
  342|       |      int ossl_early_status = SSL_get_early_data_status(ctx->tls.ossl.ssl);
  343|       |      if(ossl_early_status == SSL_EARLY_DATA_NOT_SENT)
  344|       |        CURL_TRC_CF(data, cf, "OpenSSL did not send early data");
  345|       |      ctx->earlydata_accepted = (ossl_early_status == SSL_EARLY_DATA_ACCEPTED);
  346|       |#elif defined(USE_GNUTLS)
  347|       |      int flags = gnutls_session_get_flags(ctx->tls.gtls.session);
  348|       |      ctx->earlydata_accepted = !!(flags & GNUTLS_SFLAGS_EARLY_DATA);
  349|       |#elif defined(USE_WOLFSSL)
  350|       |#ifdef WOLFSSL_EARLY_DATA
  351|       |      ctx->earlydata_accepted =
  352|       |        (wolfSSL_get_early_data_status(ctx->tls.wssl.ssl) !=
  353|       |         WOLFSSL_EARLY_DATA_REJECTED);
  354|       |#else
  355|       |      DEBUGASSERT(0); /* should not come here if ED is disabled. */
  356|       |      ctx->earlydata_accepted = FALSE;
  357|       |#endif /* WOLFSSL_EARLY_DATA */
  358|       |#endif /* OPENSSL or GNUTLS or WOLFSSL */
  359|       |    }
  360|       |#endif /* older NGTCP2 */
  361|      0|    CURL_TRC_CF(data, cf, "server did%s accept %zu bytes of early data",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  362|      0|                ctx->earlydata_accepted ? "" : " not", ctx->earlydata_skip);
  363|      0|    Curl_pgrsEarlyData(data, ctx->earlydata_accepted ?
  ------------------
  |  Branch (363:30): [True: 0, False: 0]
  ------------------
  364|      0|                              (curl_off_t)ctx->earlydata_skip :
  365|      0|                             -(curl_off_t)ctx->earlydata_skip);
  366|      0|  }
  367|  1.95k|  return 0;
  368|  1.95k|}
cf-ngtcp2-cmn.c:cb_recv_stream_data:
  374|  7.59k|{
  375|  7.59k|  struct Curl_cfilter *cf = user_data;
  376|  7.59k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  377|  7.59k|  nghttp3_ssize rc;
  378|  7.59k|  uint64_t nconsumed;
  379|  7.59k|  int fin = (flags & NGTCP2_STREAM_DATA_FLAG_FIN) ? 1 : 0;
  ------------------
  |  Branch (379:13): [True: 563, False: 7.03k]
  ------------------
  380|  7.59k|  struct h3_stream_ctx *stream;
  381|  7.59k|  struct Curl_easy *data =
  382|  7.59k|    Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
  383|       |
  384|  7.59k|  (void)tconn;
  385|  7.59k|  (void)offset;
  386|  7.59k|  rc = nghttp3_conn_read_stream(ctx->h3conn, stream_id, buf, buflen, fin);
  387|  7.59k|  if(rc < 0) {
  ------------------
  |  Branch (387:6): [True: 53, False: 7.54k]
  ------------------
  388|     53|    if(data && stream) {
  ------------------
  |  Branch (388:8): [True: 51, False: 2]
  |  Branch (388:16): [True: 51, False: 0]
  ------------------
  389|     51|      CURL_TRC_CF(data, cf, "[%" PRId64 "] error on known stream, "
  ------------------
  |  |  153|     51|  do {                                          \
  |  |  154|     51|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|     51|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    102|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 51, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3, False: 48]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    102|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      3|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     51|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      3|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 1, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     51|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     51|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 51]
  |  |  ------------------
  ------------------
  390|     51|                  "reset=%d, closed=%d",
  391|     51|                  stream_id, stream->reset, stream->closed);
  392|     51|    }
  393|     53|    return NGTCP2_ERR_CALLBACK_FAILURE;
  394|     53|  }
  395|  7.54k|  nconsumed = (uint64_t)rc;
  396|  7.54k|  if(nconsumed) {
  ------------------
  |  Branch (396:6): [True: 7.54k, False: 0]
  ------------------
  397|       |    /* number of bytes inside buflen which consists of framing overhead
  398|       |     * including QPACK HEADERS. In other words, it does not consume payload of
  399|       |     * DATA frame. */
  400|  7.54k|    Curl_ngtcp2_conn_extend_max_stream_offset(&ctx->qconn, stream_id,
  401|  7.54k|                                              nconsumed);
  402|  7.54k|    Curl_ngtcp2_conn_extend_max_offset(&ctx->qconn, nconsumed);
  403|  7.54k|    if(stream) {
  ------------------
  |  Branch (403:8): [True: 1.56k, False: 5.97k]
  ------------------
  404|  1.56k|      stream->rx_offset += nconsumed;
  405|  1.56k|      stream->rx_offset_max += nconsumed;
  406|  1.56k|    }
  407|  7.54k|  }
  408|  7.54k|  return 0;
  409|  7.59k|}
cf-ngtcp2-cmn.c:cb_acked_stream_data_offset:
  414|  10.1k|{
  415|  10.1k|  struct Curl_cfilter *cf = user_data;
  416|  10.1k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  417|  10.1k|  int rv;
  418|  10.1k|  (void)stream_id;
  419|  10.1k|  (void)tconn;
  420|  10.1k|  (void)offset;
  421|  10.1k|  (void)datalen;
  422|  10.1k|  (void)stream_user_data;
  423|       |
  424|  10.1k|  rv = nghttp3_conn_add_ack_offset(ctx->h3conn, stream_id, datalen);
  425|  10.1k|  if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) {
  ------------------
  |  Branch (425:6): [True: 0, False: 10.1k]
  |  Branch (425:12): [True: 0, False: 0]
  ------------------
  426|      0|    return NGTCP2_ERR_CALLBACK_FAILURE;
  427|      0|  }
  428|       |
  429|  10.1k|  return 0;
  430|  10.1k|}
cf-ngtcp2-cmn.c:cb_extend_max_local_streams_bidi:
  555|  1.95k|{
  556|  1.95k|  struct Curl_cfilter *cf = user_data;
  557|  1.95k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  558|  1.95k|  struct Curl_easy *data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  685|  1.95k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  157|  1.95k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (685:30): [True: 1.95k, False: 0]
  |  |  ------------------
  ------------------
  559|       |
  560|  1.95k|  (void)tconn;
  561|  1.95k|  ctx->max_bidi_streams = max_streams;
  562|  1.95k|  if(data)
  ------------------
  |  Branch (562:6): [True: 1.95k, False: 0]
  ------------------
  563|  1.95k|    CURL_TRC_CF(data, cf, "max bidi streams now %" PRIu64 ", used %" PRIu64,
  ------------------
  |  |  153|  1.95k|  do {                                          \
  |  |  154|  1.95k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.95k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.91k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.91k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.95k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    147|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 5, False: 142]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.95k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.95k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
  564|  1.95k|                ctx->max_bidi_streams, ctx->used_bidi_streams);
  565|  1.95k|  return 0;
  566|  1.95k|}
cf-ngtcp2-cmn.c:cb_rand:
  596|  13.4k|{
  597|  13.4k|  CURLcode result;
  598|  13.4k|  (void)rand_ctx;
  599|       |
  600|  13.4k|  result = Curl_rand(NULL, dest, destlen);
  ------------------
  |  |   35|  13.4k|#define Curl_rand(a, b, c) Curl_rand_bytes(a, TRUE, b, c)
  |  |  ------------------
  |  |  |  |  986|  13.4k|#define TRUE true
  |  |  ------------------
  ------------------
  601|  13.4k|  if(result) {
  ------------------
  |  Branch (601:6): [True: 0, False: 13.4k]
  ------------------
  602|       |    /* cb_rand is only used for non-cryptographic context. If Curl_rand
  603|       |       failed, fill 0 and call it *random*. */
  604|      0|    memset(dest, 0, destlen);
  605|      0|  }
  606|  13.4k|}
cf-ngtcp2-cmn.c:cb_stream_reset:
  514|    188|{
  515|    188|  struct Curl_cfilter *cf = user_data;
  516|    188|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  517|    188|  struct Curl_easy *data = Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, NULL);
  518|    188|  int rv;
  519|    188|  (void)tconn;
  520|    188|  (void)final_size;
  521|    188|  (void)app_error_code;
  522|       |
  523|    188|  rv = nghttp3_conn_shutdown_stream_read(ctx->h3conn, stream_id);
  524|    188|  if(data)
  ------------------
  |  Branch (524:6): [True: 185, False: 3]
  ------------------
  525|    185|    CURL_TRC_CF(data, cf, "[%" PRId64 "] reset -> %d", stream_id, rv);
  ------------------
  |  |  153|    185|  do {                                          \
  |  |  154|    185|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    185|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    370|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 185, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 22, False: 163]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    370|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 22, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     22|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    185|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     22|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 22, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    185|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    185|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 185]
  |  |  ------------------
  ------------------
  526|    188|  if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) {
  ------------------
  |  Branch (526:6): [True: 0, False: 188]
  |  Branch (526:12): [True: 0, False: 0]
  ------------------
  527|      0|    return NGTCP2_ERR_CALLBACK_FAILURE;
  528|      0|  }
  529|       |
  530|    188|  return 0;
  531|    188|}
cf-ngtcp2-cmn.c:cb_extend_max_stream_data:
  571|     37|{
  572|     37|  struct Curl_cfilter *cf = user_data;
  573|     37|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  574|     37|  struct h3_stream_ctx *stream;
  575|     37|  struct Curl_easy *data =
  576|     37|    Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
  577|     37|  int rv;
  578|     37|  (void)tconn;
  579|     37|  (void)max_data;
  580|       |
  581|     37|  rv = nghttp3_conn_unblock_stream(ctx->h3conn, stream_id);
  582|     37|  if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) {
  ------------------
  |  Branch (582:6): [True: 0, False: 37]
  |  Branch (582:12): [True: 0, False: 0]
  ------------------
  583|      0|    return NGTCP2_ERR_CALLBACK_FAILURE;
  584|      0|  }
  585|     37|  if(stream && stream->quic_flow_blocked) {
  ------------------
  |  Branch (585:6): [True: 37, False: 0]
  |  Branch (585:16): [True: 0, False: 37]
  ------------------
  586|      0|    CURL_TRC_CF(data, cf, "[%" PRId64 "] unblock quic flow", stream_id);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  587|      0|    stream->quic_flow_blocked = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  588|      0|    if(data)
  ------------------
  |  Branch (588:8): [True: 0, False: 0]
  ------------------
  589|      0|      Curl_multi_mark_dirty(data);
  590|      0|  }
  591|     37|  return 0;
  592|     37|}
cf-ngtcp2-cmn.c:cb_stream_stop_sending:
  536|    809|{
  537|    809|  struct Curl_cfilter *cf = user_data;
  538|    809|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  539|    809|  int rv;
  540|    809|  (void)tconn;
  541|    809|  (void)app_error_code;
  542|    809|  (void)stream_user_data;
  543|       |
  544|    809|  rv = nghttp3_conn_shutdown_stream_read(ctx->h3conn, stream_id);
  545|    809|  if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) {
  ------------------
  |  Branch (545:6): [True: 0, False: 809]
  |  Branch (545:12): [True: 0, False: 0]
  ------------------
  546|      0|    return NGTCP2_ERR_CALLBACK_FAILURE;
  547|      0|  }
  548|       |
  549|    809|  return 0;
  550|    809|}
cf-ngtcp2-cmn.c:cb_recv_rx_key:
  653|  3.93k|{
  654|  3.93k|  struct Curl_cfilter *cf = user_data;
  655|  3.93k|  struct cf_ngtcp2_ctx *ctx = cf ? cf->ctx : NULL;
  ------------------
  |  Branch (655:31): [True: 3.93k, False: 0]
  ------------------
  656|  3.93k|  struct Curl_easy *data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  685|  3.93k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  157|  3.93k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (685:30): [True: 3.93k, False: 0]
  |  |  ------------------
  ------------------
  657|  3.93k|  (void)tconn;
  658|       |
  659|  3.93k|  if(level != NGTCP2_ENCRYPTION_LEVEL_1RTT)
  ------------------
  |  Branch (659:6): [True: 1.96k, False: 1.96k]
  ------------------
  660|  1.96k|    return 0;
  661|       |
  662|  1.96k|  DEBUGASSERT(ctx);
  ------------------
  |  | 1016|  1.96k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (662:3): [True: 0, False: 1.96k]
  |  Branch (662:3): [True: 1.96k, False: 0]
  ------------------
  663|  1.96k|  DEBUGASSERT(data);
  ------------------
  |  | 1016|  1.96k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (663:3): [True: 0, False: 1.96k]
  |  Branch (663:3): [True: 1.96k, False: 0]
  ------------------
  664|  1.96k|  if(ctx && data && !ctx->h3conn && ctx->init_h3_conn_cb) {
  ------------------
  |  Branch (664:6): [True: 1.96k, False: 0]
  |  Branch (664:13): [True: 1.96k, False: 0]
  |  Branch (664:21): [True: 1.96k, False: 0]
  |  Branch (664:37): [True: 1.96k, False: 0]
  ------------------
  665|  1.96k|    if(ctx->init_h3_conn_cb(cf, data, ctx))
  ------------------
  |  Branch (665:8): [True: 4, False: 1.95k]
  ------------------
  666|      4|      return NGTCP2_ERR_CALLBACK_FAILURE;
  667|  1.96k|  }
  668|  1.95k|  return 0;
  669|  1.96k|}
cf-ngtcp2-cmn.c:cb_get_new_connection_id2:
  633|  1.95k|{
  634|  1.95k|  CURLcode result;
  635|  1.95k|  (void)tconn;
  636|  1.95k|  (void)user_data;
  637|       |
  638|  1.95k|  result = Curl_rand(NULL, cid->data, cidlen);
  ------------------
  |  |   35|  1.95k|#define Curl_rand(a, b, c) Curl_rand_bytes(a, TRUE, b, c)
  |  |  ------------------
  |  |  |  |  986|  1.95k|#define TRUE true
  |  |  ------------------
  ------------------
  639|  1.95k|  if(result)
  ------------------
  |  Branch (639:6): [True: 0, False: 1.95k]
  ------------------
  640|      0|    return NGTCP2_ERR_CALLBACK_FAILURE;
  641|  1.95k|  cid->datalen = cidlen;
  642|       |
  643|  1.95k|  result = Curl_rand(NULL, token->data, sizeof(token->data));
  ------------------
  |  |   35|  1.95k|#define Curl_rand(a, b, c) Curl_rand_bytes(a, TRUE, b, c)
  |  |  ------------------
  |  |  |  |  986|  1.95k|#define TRUE true
  |  |  ------------------
  ------------------
  644|  1.95k|  if(result)
  ------------------
  |  Branch (644:6): [True: 0, False: 1.95k]
  ------------------
  645|      0|    return NGTCP2_ERR_CALLBACK_FAILURE;
  646|       |
  647|  1.95k|  return 0;
  648|  1.95k|}
cf-ngtcp2-cmn.c:cb_stream_close2:
  475|    721|{
  476|    721|  struct Curl_cfilter *cf = user_data;
  477|    721|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  478|    721|  struct Curl_easy *data = Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, NULL);
  479|    721|  uint64_t h3_app_error_code = NGHTTP3_H3_NO_ERROR;
  480|    721|  int rv;
  481|       |
  482|    721|  (void)tconn;
  483|    721|  (void)tx_app_error_code;
  484|       |  /* stream is closed... */
  485|    721|  if(!data)
  ------------------
  |  Branch (485:6): [True: 3, False: 718]
  ------------------
  486|      3|    data = CF_DATA_CURRENT(cf);
  ------------------
  |  |  685|      3|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  157|      3|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (685:30): [True: 3, False: 0]
  |  |  ------------------
  ------------------
  487|    721|  if(!data)
  ------------------
  |  Branch (487:6): [True: 0, False: 721]
  ------------------
  488|      0|    return NGTCP2_ERR_CALLBACK_FAILURE;
  489|       |
  490|    721|  if(flags & NGTCP2_STREAM_CLOSE2_FLAG_RX_APP_ERROR_CODE_SET)
  ------------------
  |  Branch (490:6): [True: 187, False: 534]
  ------------------
  491|    187|    h3_app_error_code = rx_app_error_code;
  492|       |
  493|    721|  rv = nghttp3_conn_close_stream(ctx->h3conn, stream_id, h3_app_error_code);
  494|    721|  CURL_TRC_CF(data, cf, "[%" PRId64 "] quic close(app_error=%"
  ------------------
  |  |  153|    721|  do {                                          \
  |  |  154|    721|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    721|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.44k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 721, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 63, False: 658]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.44k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 63, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     63|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    721|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     63|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 63, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 3, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    721|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    721|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 721]
  |  |  ------------------
  ------------------
  495|    721|              PRIu64 ") -> %d", stream_id, h3_app_error_code, rv);
  496|    721|  if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) {
  ------------------
  |  Branch (496:6): [True: 3, False: 718]
  |  Branch (496:12): [True: 3, False: 0]
  ------------------
  497|      3|    Curl_cf_ngtcp2_h3_err_set(cf, data, rv);
  498|      3|    return NGTCP2_ERR_CALLBACK_FAILURE;
  499|      3|  }
  500|       |
  501|       |  /* We start with 3 uni streams the server might open to us. If
  502|       |   * it closes one, we give it credit for a new one. */
  503|    718|  if(!ngtcp2_is_bidi_stream(stream_id) &&
  ------------------
  |  Branch (503:6): [True: 0, False: 718]
  ------------------
  504|      0|     !ngtcp2_conn_is_local_stream(tconn, stream_id))
  ------------------
  |  Branch (504:6): [True: 0, False: 0]
  ------------------
  505|      0|    ngtcp2_conn_extend_max_streams_uni(tconn, 1);
  506|       |
  507|    718|  return 0;
  508|    721|}
cf-ngtcp2-cmn.c:get_conn:
  192|  40.6k|{
  193|  40.6k|  struct Curl_cfilter *cf = conn_ref->user_data;
  194|  40.6k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  195|  40.6k|  return Curl_ngtcp2_conn(&ctx->qconn);
  196|  40.6k|}
cf-ngtcp2-cmn.c:cf_ngtcp2_tls_ctx_setup:
  894|  3.33k|{
  895|  3.33k|  struct curl_tls_ctx *ctx = user_data;
  896|       |
  897|  3.33k|#ifdef USE_OPENSSL
  898|       |#if defined(OPENSSL_IS_AWSLC) || defined(OPENSSL_IS_BORINGSSL)
  899|       |  if(ngtcp2_crypto_boringssl_configure_client_context(ctx->ossl.ssl_ctx)
  900|       |     != 0) {
  901|       |    failf(data, "ngtcp2_crypto_boringssl_configure_client_context failed");
  902|       |    return CURLE_FAILED_INIT;
  903|       |  }
  904|       |#elif defined(OPENSSL_QUIC_API2)
  905|       |  /* nothing to do */
  906|       |#else
  907|       |  if(ngtcp2_crypto_quictls_configure_client_context(ctx->ossl.ssl_ctx) != 0) {
  908|       |    failf(data, "ngtcp2_crypto_quictls_configure_client_context failed");
  909|       |    return CURLE_FAILED_INIT;
  910|       |  }
  911|       |#endif /* !OPENSSL_IS_AWSLC && !OPENSSL_IS_BORINGSSL */
  912|  3.33k|  if(Curl_ssl_scache_use(cf, data)) {
  ------------------
  |  Branch (912:6): [True: 3.33k, False: 0]
  ------------------
  913|       |    /* Enable the session cache because it is a prerequisite for the
  914|       |     * "new session" callback. Use the "external storage" mode to prevent
  915|       |     * OpenSSL from creating an internal session cache.
  916|       |     */
  917|  3.33k|    SSL_CTX_set_session_cache_mode(ctx->ossl.ssl_ctx,
  918|  3.33k|                                   SSL_SESS_CACHE_CLIENT |
  919|  3.33k|                                   SSL_SESS_CACHE_NO_INTERNAL);
  920|  3.33k|    SSL_CTX_sess_set_new_cb(ctx->ossl.ssl_ctx, quic_ossl_new_session_cb);
  921|  3.33k|  }
  922|       |
  923|       |#elif defined(USE_GNUTLS)
  924|       |  if(ngtcp2_crypto_gnutls_configure_client_session(ctx->gtls.session) != 0) {
  925|       |    failf(data, "ngtcp2_crypto_gnutls_configure_client_session failed");
  926|       |    return CURLE_FAILED_INIT;
  927|       |  }
  928|       |  if(Curl_ssl_scache_use(cf, data)) {
  929|       |    gnutls_handshake_set_hook_function(ctx->gtls.session,
  930|       |                                       GNUTLS_HANDSHAKE_ANY, GNUTLS_HOOK_POST,
  931|       |                                       quic_gtls_handshake_cb);
  932|       |  }
  933|       |
  934|       |#elif defined(USE_WOLFSSL)
  935|       |  if(ngtcp2_crypto_wolfssl_configure_client_context(ctx->wssl.ssl_ctx) != 0) {
  936|       |    failf(data, "ngtcp2_crypto_wolfssl_configure_client_context failed");
  937|       |    return CURLE_FAILED_INIT;
  938|       |  }
  939|       |  if(Curl_ssl_scache_use(cf, data)) {
  940|       |    /* Register to get notified when a new session is received */
  941|       |    wolfSSL_CTX_sess_set_new_cb(ctx->wssl.ssl_ctx, wssl_quic_new_session_cb);
  942|       |  }
  943|       |#endif
  944|  3.33k|  return CURLE_OK;
  945|  3.33k|}
cf-ngtcp2-cmn.c:quic_ossl_new_session_cb:
  745|  1.90k|{
  746|  1.90k|  struct Curl_cfilter *cf;
  747|  1.90k|  struct cf_ngtcp2_ctx *ctx;
  748|  1.90k|  struct Curl_easy *data;
  749|  1.90k|  ngtcp2_crypto_conn_ref *cref;
  750|       |
  751|  1.90k|  cref = (ngtcp2_crypto_conn_ref *)SSL_get_app_data(ssl);
  752|  1.90k|  cf = cref ? cref->user_data : NULL;
  ------------------
  |  Branch (752:8): [True: 1.90k, False: 0]
  ------------------
  753|  1.90k|  ctx = cf ? cf->ctx : NULL;
  ------------------
  |  Branch (753:9): [True: 1.90k, False: 0]
  ------------------
  754|  1.90k|  data = cf ? CF_DATA_CURRENT(cf) : NULL;
  ------------------
  |  |  685|  1.90k|#define CF_DATA_CURRENT(cf) ((cf) ? (CF_CTX_CALL_DATA(cf).data) : NULL)
  |  |  ------------------
  |  |  |  |  157|  1.90k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  |  Branch (685:30): [True: 1.90k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (754:10): [True: 1.90k, False: 0]
  ------------------
  755|  1.90k|  if(cf && data && ctx) {
  ------------------
  |  Branch (755:6): [True: 1.90k, False: 0]
  |  Branch (755:12): [True: 1.90k, False: 0]
  |  Branch (755:20): [True: 1.90k, False: 0]
  ------------------
  756|  1.90k|    unsigned char *quic_tp = NULL;
  757|  1.90k|    size_t quic_tp_len = 0;
  758|  1.90k|#ifdef HAVE_OPENSSL_EARLYDATA
  759|  1.90k|    ngtcp2_ssize tplen;
  760|  1.90k|    uint8_t tpbuf[256];
  761|       |
  762|  1.90k|    tplen = Curl_ngtcp2_conn_encode_0rtt_transport_params(
  763|  1.90k|      &ctx->qconn, tpbuf, sizeof(tpbuf));
  764|  1.90k|    if(tplen < 0)
  ------------------
  |  Branch (764:8): [True: 0, False: 1.90k]
  ------------------
  765|      0|      CURL_TRC_CF(data, cf, "error encoding 0RTT transport data: %s",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  766|  1.90k|                  ngtcp2_strerror((int)tplen));
  767|  1.90k|    else {
  768|  1.90k|      quic_tp = (unsigned char *)tpbuf;
  769|  1.90k|      quic_tp_len = (size_t)tplen;
  770|  1.90k|    }
  771|  1.90k|#endif
  772|  1.90k|    Curl_ossl_add_session(cf, data, &ctx->tls.ossl, ctx->ssl_peer.scache_key,
  773|       |                          ssl_sessionid, "h3", quic_tp, quic_tp_len, NULL);
  774|  1.90k|  }
  775|  1.90k|  return 0;
  776|  1.90k|}
cf-ngtcp2-cmn.c:cf_ngtcp2_err_is_fatal:
 1388|    795|{
 1389|    795|  return (NGTCP2_ERR_FATAL >= code) ||
  ------------------
  |  Branch (1389:10): [True: 138, False: 657]
  ------------------
 1390|    657|         (NGTCP2_ERR_DROP_CONN == code) ||
  ------------------
  |  Branch (1390:10): [True: 0, False: 657]
  ------------------
 1391|    657|         (NGTCP2_ERR_IDLE_CLOSE == code);
  ------------------
  |  Branch (1391:10): [True: 0, False: 657]
  ------------------
 1392|    795|}
cf-ngtcp2-cmn.c:read_pkt_to_send:
 1475|   152k|{
 1476|   152k|  struct cf_ngtcp2_io_ctx *x = userp;
 1477|   152k|  struct cf_ngtcp2_ctx *ctx = x->cf->ctx;
 1478|   152k|  nghttp3_vec vec[16];
 1479|   152k|  nghttp3_ssize veccnt;
 1480|   152k|  ngtcp2_ssize ndatalen;
 1481|   152k|  uint32_t flags;
 1482|   152k|  int64_t stream_id;
 1483|   152k|  int fin;
 1484|   152k|  ssize_t n;
 1485|   152k|  bool can_write_stream_data;
 1486|       |
 1487|   152k|  can_write_stream_data = ctx->h3conn &&
  ------------------
  |  Branch (1487:27): [True: 30.0k, False: 122k]
  ------------------
 1488|  30.0k|    Curl_ngtcp2_conn_get_max_data_left(&ctx->qconn);
  ------------------
  |  Branch (1488:5): [True: 29.6k, False: 378]
  ------------------
 1489|       |
 1490|       |  /* ngtcp2 may want to put several frames from different streams into
 1491|       |   * this packet. `NGTCP2_WRITE_STREAM_FLAG_MORE` tells it to do so.
 1492|       |   * When `NGTCP2_ERR_WRITE_MORE` is returned, we *need* to make
 1493|       |   * another iteration.
 1494|       |   * When ngtcp2 is happy (because it has no other frame that would fit
 1495|       |   * or it has nothing more to send), it returns the total length
 1496|       |   * of the assembled packet. This may be 0 if there was nothing to send. */
 1497|   152k|  *pnread = 0;
 1498|   161k|  for(;;) {
 1499|   161k|    veccnt = 0;
 1500|   161k|    stream_id = -1;
 1501|   161k|    fin = 0;
 1502|       |
 1503|       |    /* Once MORE starts coalescing a packet, no other ngtcp2 API may be
 1504|       |     * called until a write completes it. Cache the flow-control state before
 1505|       |     * entering the loop; ngtcp2 will reject individual streams as needed. */
 1506|   161k|    if(can_write_stream_data) {
  ------------------
  |  Branch (1506:8): [True: 38.6k, False: 122k]
  ------------------
 1507|  38.6k|      veccnt = nghttp3_conn_writev_stream(ctx->h3conn, &stream_id, &fin, vec,
 1508|  38.6k|                                          CURL_ARRAYSIZE(vec));
  ------------------
  |  | 1326|  38.6k|#define CURL_ARRAYSIZE(A) (sizeof(A) / sizeof((A)[0]))
  ------------------
 1509|  38.6k|      if(veccnt < 0) {
  ------------------
  |  Branch (1509:10): [True: 0, False: 38.6k]
  ------------------
 1510|      0|        failf(x->data, "nghttp3_conn_writev_stream returned error: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1511|      0|              nghttp3_strerror((int)veccnt));
 1512|      0|        Curl_cf_ngtcp2_h3_err_set(x->cf, x->data, (int)veccnt);
 1513|      0|        return CURLE_SEND_ERROR;
 1514|      0|      }
 1515|  38.6k|    }
 1516|       |
 1517|   161k|    flags = NGTCP2_WRITE_STREAM_FLAG_MORE |
 1518|   161k|            (fin ? NGTCP2_WRITE_STREAM_FLAG_FIN : 0);
  ------------------
  |  Branch (1518:14): [True: 3.05k, False: 157k]
  ------------------
 1519|   161k|    n = Curl_ngtcp2_conn_writev_stream(
 1520|   161k|      &ctx->qconn, &x->ps.path, NULL, buf, buflen, &ndatalen, flags,
 1521|   161k|      stream_id, (const ngtcp2_vec *)vec, veccnt, x->ts);
 1522|   161k|    if(n == 0) {
  ------------------
  |  Branch (1522:8): [True: 127k, False: 33.2k]
  ------------------
 1523|       |      /* nothing to send */
 1524|   127k|      return CURLE_AGAIN;
 1525|   127k|    }
 1526|  33.2k|    else if(n < 0) {
  ------------------
  |  Branch (1526:13): [True: 9.37k, False: 23.8k]
  ------------------
 1527|  9.37k|      switch(n) {
 1528|      0|      case NGTCP2_ERR_STREAM_DATA_BLOCKED: {
  ------------------
  |  Branch (1528:7): [True: 0, False: 9.37k]
  ------------------
 1529|      0|        struct h3_stream_ctx *stream;
 1530|      0|        DEBUGASSERT(ndatalen == -1);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1530:9): [True: 0, False: 0]
  |  Branch (1530:9): [True: 0, False: 0]
  ------------------
 1531|      0|        nghttp3_conn_block_stream(ctx->h3conn, stream_id);
 1532|      0|        CURL_TRC_CF(x->data, x->cf, "[%" PRId64 "] block quic flow",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1533|      0|                    stream_id);
 1534|      0|        stream = cf_ngtcp2_get_stream(ctx, stream_id);
 1535|      0|        if(stream) /* it might be not one of our h3 streams? */
  ------------------
  |  Branch (1535:12): [True: 0, False: 0]
  ------------------
 1536|      0|          stream->quic_flow_blocked = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1537|      0|        n = 0;
 1538|      0|        break;
 1539|      0|      }
 1540|      0|      case NGTCP2_ERR_STREAM_NOT_FOUND:
  ------------------
  |  Branch (1540:7): [True: 0, False: 9.37k]
  ------------------
 1541|      3|      case NGTCP2_ERR_STREAM_SHUT_WR:
  ------------------
  |  Branch (1541:7): [True: 3, False: 9.36k]
  ------------------
 1542|      3|        DEBUGASSERT(ndatalen == -1);
  ------------------
  |  | 1016|      3|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1542:9): [True: 0, False: 3]
  |  Branch (1542:9): [True: 3, False: 0]
  ------------------
 1543|      3|        nghttp3_conn_shutdown_stream_write(ctx->h3conn, stream_id);
 1544|      3|        n = 0;
 1545|      3|        break;
 1546|  8.96k|      case NGTCP2_ERR_WRITE_MORE:
  ------------------
  |  Branch (1546:7): [True: 8.96k, False: 404]
  ------------------
 1547|       |        /* ngtcp2 wants to send more. update the flow of the stream whose data
 1548|       |         * is in the buffer and continue */
 1549|  8.96k|        DEBUGASSERT(ndatalen >= 0);
  ------------------
  |  | 1016|  8.96k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1549:9): [True: 0, False: 8.96k]
  |  Branch (1549:9): [True: 8.96k, False: 0]
  ------------------
 1550|  8.96k|        n = 0;
 1551|  8.96k|        break;
 1552|    401|      default:
  ------------------
  |  Branch (1552:7): [True: 401, False: 8.96k]
  ------------------
 1553|    401|        failf(x->data, "ngtcp2_conn_writev_stream returned error: %s",
  ------------------
  |  |   62|    401|#define failf Curl_failf
  ------------------
 1554|    401|              ngtcp2_strerror((int)n));
 1555|    401|        Curl_cf_ngtcp2_cmn_err_set(x->cf, x->data, (int)n);
 1556|    401|        return CURLE_SEND_ERROR;
 1557|  9.37k|      }
 1558|  9.37k|    }
 1559|       |
 1560|  32.8k|    if(ndatalen >= 0) {
  ------------------
  |  Branch (1560:8): [True: 11.5k, False: 21.3k]
  ------------------
 1561|       |      /* we add the amount of data bytes to the flow windows */
 1562|  11.5k|      int rv = nghttp3_conn_add_write_offset(ctx->h3conn, stream_id, ndatalen);
 1563|  11.5k|      if(rv) {
  ------------------
  |  Branch (1563:10): [True: 0, False: 11.5k]
  ------------------
 1564|      0|        failf(x->data, "nghttp3_conn_add_write_offset returned error: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1565|      0|              nghttp3_strerror(rv));
 1566|      0|        return CURLE_SEND_ERROR;
 1567|      0|      }
 1568|  11.5k|    }
 1569|       |
 1570|  32.8k|    if(n > 0) {
  ------------------
  |  Branch (1570:8): [True: 23.8k, False: 8.96k]
  ------------------
 1571|       |      /* packet assembled, leave */
 1572|  23.8k|      *pnread = (size_t)n;
 1573|  23.8k|      return CURLE_OK;
 1574|  23.8k|    }
 1575|  32.8k|  }
 1576|   152k|}
cf-ngtcp2-cmn.c:cf_ngtcp2_recv_pkts:
 1698|  30.1k|{
 1699|  30.1k|  struct cf_ngtcp2_recv_ctx *rctx = userp;
 1700|  30.1k|  struct cf_ngtcp2_io_ctx *pktx = rctx->pktx;
 1701|  30.1k|  struct cf_ngtcp2_ctx *ctx = pktx->cf->ctx;
 1702|  30.1k|  ngtcp2_pkt_info pi;
 1703|  30.1k|  ngtcp2_path path;
 1704|  30.1k|  size_t offset, pktlen;
 1705|  30.1k|  int rv;
 1706|       |
 1707|  30.1k|  if(!rctx->pkt_count) {
  ------------------
  |  Branch (1707:6): [True: 11.4k, False: 18.7k]
  ------------------
 1708|  11.4k|    Curl_cf_ngtcp2_io_ctx_update_time(pktx->data, pktx, pktx->cf);
 1709|  11.4k|    ngtcp2_path_storage_zero(&pktx->ps);
 1710|  11.4k|  }
 1711|       |
 1712|  30.1k|  if(ecn)
  ------------------
  |  Branch (1712:6): [True: 0, False: 30.1k]
  ------------------
 1713|      0|    CURL_TRC_CF(pktx->data, pktx->cf, "vquic_recv(len=%zu, gso=%zu, ecn=%x)",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1714|  30.1k|                buflen, gso_size, (unsigned)ecn);
 1715|  30.1k|  ngtcp2_addr_init(&path.local, (struct sockaddr *)&ctx->q.local_addr,
 1716|  30.1k|                   ctx->q.local_addrlen);
 1717|  30.1k|  ngtcp2_addr_init(&path.remote, (struct sockaddr *)remote_addr,
 1718|  30.1k|                   remote_addrlen);
 1719|  30.1k|  pi.ecn = (uint8_t)ecn;
 1720|       |
 1721|  59.9k|  for(offset = 0; offset < buflen; offset += gso_size) {
  ------------------
  |  Branch (1721:19): [True: 30.1k, False: 29.7k]
  ------------------
 1722|  30.1k|    rctx->pkt_count++;
 1723|  30.1k|    pktlen = ((offset + gso_size) <= buflen) ? gso_size : (buflen - offset);
  ------------------
  |  Branch (1723:14): [True: 30.1k, False: 0]
  ------------------
 1724|  30.1k|    rv = Curl_ngtcp2_conn_read_pkt(&ctx->qconn, &path, &pi,
 1725|  30.1k|                                   buf + offset, pktlen, pktx->ts);
 1726|  30.1k|    if(rv) {
  ------------------
  |  Branch (1726:8): [True: 394, False: 29.7k]
  ------------------
 1727|    394|      CURL_TRC_CF(pktx->data, pktx->cf, "ingress, read_pkt -> %s (%d)",
  ------------------
  |  |  153|    394|  do {                                          \
  |  |  154|    394|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    394|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    788|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 394, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 26, False: 368]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    788|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 26, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     26|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    394|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     26|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 26, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 3, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    394|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    394|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 394]
  |  |  ------------------
  ------------------
 1728|    394|                  ngtcp2_strerror(rv), rv);
 1729|    394|      Curl_cf_ngtcp2_cmn_err_set(pktx->cf, pktx->data, rv);
 1730|       |
 1731|    394|      if(rv == NGTCP2_ERR_CRYPTO)
  ------------------
  |  Branch (1731:10): [True: 7, False: 387]
  ------------------
 1732|       |        /* this is a "TLS problem", but a failed certificate verification
 1733|       |           is a common reason for this */
 1734|      7|        return CURLE_PEER_FAILED_VERIFICATION;
 1735|    387|      return CURLE_RECV_ERROR;
 1736|    394|    }
 1737|  30.1k|  }
 1738|  29.7k|  return CURLE_OK;
 1739|  30.1k|}
cf-ngtcp2-cmn.c:cf_ngtcp2_setup_keep_alive:
 1893|  3.89k|{
 1894|  3.89k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1895|  3.89k|  const ngtcp2_transport_params *rp;
 1896|       |  /* Peer should have sent us its transport parameters. If it
 1897|       |   * announces a positive `max_idle_timeout` it closes the
 1898|       |   * connection when it does not hear from us for that time.
 1899|       |   *
 1900|       |   * Some servers use this as a keep-alive timer at a rather low
 1901|       |   * value. We are doing HTTP/3 here and waiting for the response
 1902|       |   * to a request may take a considerable amount of time. We need
 1903|       |   * to prevent the peer's QUIC stack from closing in this case.
 1904|       |   */
 1905|  3.89k|  if(!Curl_ngtcp2_conn(&ctx->qconn))
  ------------------
  |  Branch (1905:6): [True: 0, False: 3.89k]
  ------------------
 1906|      0|    return;
 1907|       |
 1908|  3.89k|  rp = Curl_ngtcp2_conn_get_remote_transport_params(&ctx->qconn);
 1909|  3.89k|  if(!rp || !rp->max_idle_timeout) {
  ------------------
  |  Branch (1909:6): [True: 378, False: 3.51k]
  |  Branch (1909:13): [True: 0, False: 3.51k]
  ------------------
 1910|    378|    Curl_ngtcp2_conn_set_keep_alive_timeout(&ctx->qconn, UINT64_MAX);
 1911|    378|    CURL_TRC_CF(data, cf, "no peer idle timeout, unset keep-alive");
  ------------------
  |  |  153|    378|  do {                                          \
  |  |  154|    378|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    378|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    756|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 378, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 24, False: 354]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    756|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 24, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     24|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    378|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     24|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 24, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 2, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    378|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    378|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 378]
  |  |  ------------------
  ------------------
 1912|    378|  }
 1913|  3.51k|  else if(!Curl_u32_ptrset_count(&ctx->streams)) {
  ------------------
  |  Branch (1913:11): [True: 1.56k, False: 1.94k]
  ------------------
 1914|  1.56k|    Curl_ngtcp2_conn_set_keep_alive_timeout(&ctx->qconn, UINT64_MAX);
 1915|  1.56k|    CURL_TRC_CF(data, cf, "no active streams, unset keep-alive");
  ------------------
  |  |  153|  1.56k|  do {                                          \
  |  |  154|  1.56k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.56k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.13k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.56k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 121, False: 1.44k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.13k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 121, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    121|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.56k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    121|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 121, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 3, False: 118]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.56k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.56k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.56k]
  |  |  ------------------
  ------------------
 1916|  1.56k|  }
 1917|  1.94k|  else {
 1918|  1.94k|    ngtcp2_duration keep_ns;
 1919|  1.94k|    keep_ns = (rp->max_idle_timeout > 1) ? (rp->max_idle_timeout / 2) : 1;
  ------------------
  |  Branch (1919:15): [True: 1.94k, False: 0]
  ------------------
 1920|  1.94k|    Curl_ngtcp2_conn_set_keep_alive_timeout(&ctx->qconn, keep_ns);
 1921|  1.94k|    CURL_TRC_CF(data, cf, "peer idle timeout is %" PRIu64 "ms, "
  ------------------
  |  |  153|  1.94k|  do {                                          \
  |  |  154|  1.94k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.94k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.89k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.94k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 145, False: 1.80k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.89k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 145, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    145|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.94k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    145|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 145, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 5, False: 140]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.94k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.94k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.94k]
  |  |  ------------------
  ------------------
 1922|  1.94k|                "set keep-alive to %" PRIu64 " ms.",
 1923|  1.94k|                (rp->max_idle_timeout / NGTCP2_MILLISECONDS),
 1924|  1.94k|                (keep_ns / NGTCP2_MILLISECONDS));
 1925|  1.94k|  }
 1926|  3.89k|}

Curl_cf_ngtcp2_create:
 1124|  1.99k|{
 1125|  1.99k|  struct cf_ngtcp2_ctx *ctx = NULL;
 1126|  1.99k|  struct Curl_cfilter *cf = NULL;
 1127|  1.99k|  CURLcode result;
 1128|       |
 1129|  1.99k|  result = Curl_cf_udp_create(chain, data, origin, peer,
 1130|  1.99k|                              TRNSPRT_QUIC, addr, NULL, TRNSPRT_QUIC);
  ------------------
  |  |  227|  1.99k|#define TRNSPRT_QUIC 5
  ------------------
                                            TRNSPRT_QUIC, addr, NULL, TRNSPRT_QUIC);
  ------------------
  |  |  227|  1.99k|#define TRNSPRT_QUIC 5
  ------------------
 1131|  1.99k|  if(result)
  ------------------
  |  Branch (1131:6): [True: 0, False: 1.99k]
  ------------------
 1132|      0|    goto out;
 1133|       |
 1134|  1.99k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|  1.99k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1135|  1.99k|  if(!ctx) {
  ------------------
  |  Branch (1135:6): [True: 3, False: 1.98k]
  ------------------
 1136|      3|    result = CURLE_OUT_OF_MEMORY;
 1137|      3|    goto out;
 1138|      3|  }
 1139|  1.98k|  result = Curl_cf_ngtcp2_ctx_init(ctx, origin, peer,
 1140|  1.98k|                                   &chain->conn->ssl_config, init_ngh3_conn);
 1141|  1.98k|  if(!result)
  ------------------
  |  Branch (1141:6): [True: 1.98k, False: 5]
  ------------------
 1142|  1.98k|    result = Curl_cf_create(&cf, &Curl_cft_http3, ctx);
 1143|  1.98k|  if(result)
  ------------------
  |  Branch (1143:6): [True: 7, False: 1.98k]
  ------------------
 1144|      7|    goto out;
 1145|  1.98k|  Curl_cfchain_add(chain, cf);
 1146|  1.98k|  cf = NULL;
 1147|  1.98k|  ctx = NULL;
 1148|       |
 1149|  1.99k|out:
 1150|  1.99k|  if(cf)
  ------------------
  |  Branch (1150:6): [True: 0, False: 1.99k]
  ------------------
 1151|      0|    Curl_conn_cf_discard_chain(&chain->cf, data);
 1152|  1.99k|  if(ctx) {
  ------------------
  |  Branch (1152:6): [True: 7, False: 1.98k]
  ------------------
 1153|      7|    Curl_cf_ngtcp2_ctx_cleanup(ctx);
 1154|      7|    curlx_free(ctx);
  ------------------
  |  | 1503|      7|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1155|      7|  }
 1156|  1.99k|  return result;
 1157|  1.98k|}
Curl_cf_ngtcp2_insert_after:
 1163|  1.38k|{
 1164|  1.38k|  struct cf_ngtcp2_ctx *ctx = NULL;
 1165|  1.38k|  struct Curl_cfilter *cf = NULL;
 1166|  1.38k|  CURLcode result;
 1167|       |
 1168|  1.38k|  ctx = curlx_calloc(1, sizeof(*ctx));
  ------------------
  |  | 1500|  1.38k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 1169|  1.38k|  if(!ctx) {
  ------------------
  |  Branch (1169:6): [True: 2, False: 1.38k]
  ------------------
 1170|      2|    result = CURLE_OUT_OF_MEMORY;
 1171|      2|    goto out;
 1172|      2|  }
 1173|  1.38k|  result = Curl_cf_ngtcp2_ctx_init(ctx, origin, peer,
 1174|  1.38k|                                   &CF_CONN(cf_at)->ssl_config,
  ------------------
  |  |  260|  1.38k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
 1175|  1.38k|                                   init_ngh3_conn);
 1176|  1.38k|  if(!result)
  ------------------
  |  Branch (1176:6): [True: 1.37k, False: 6]
  ------------------
 1177|  1.37k|    result = Curl_cf_create(&cf, &Curl_cft_http3, ctx);
 1178|  1.38k|  if(result)
  ------------------
  |  Branch (1178:6): [True: 6, False: 1.37k]
  ------------------
 1179|      6|    goto out;
 1180|  1.37k|  Curl_conn_cf_insert_after(cf_at, cf);
 1181|  1.38k|out:
 1182|  1.38k|  if(result) {
  ------------------
  |  Branch (1182:6): [True: 8, False: 1.37k]
  ------------------
 1183|      8|    curlx_safefree(cf);
  ------------------
  |  | 1359|      8|  do {                      \
  |  | 1360|      8|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      8|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      8|    (ptr) = NULL;           \
  |  | 1362|      8|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 8]
  |  |  ------------------
  ------------------
 1184|      8|    if(ctx) {
  ------------------
  |  Branch (1184:8): [True: 6, False: 2]
  ------------------
 1185|      6|      Curl_cf_ngtcp2_ctx_cleanup(ctx);
 1186|      6|      curlx_free(ctx);
  ------------------
  |  | 1503|      6|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1187|      6|    }
 1188|      8|  }
 1189|  1.38k|  *pcf = cf;
 1190|  1.38k|  return result;
 1191|  1.37k|}
cf-ngtcp2.c:cf_ngtcp2_destroy:
 1017|  3.35k|{
 1018|  3.35k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1019|       |
 1020|  3.35k|  CURL_TRC_CF(data, cf, "destroy");
  ------------------
  |  |  153|  3.35k|  do {                                          \
  |  |  154|  3.35k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.35k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.70k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.35k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 2, False: 3.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.70k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  3.35k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      2|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 2, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.35k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.35k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
 1021|  3.35k|  if(ctx) {
  ------------------
  |  Branch (1021:6): [True: 3.35k, False: 0]
  ------------------
 1022|  3.35k|    if(Curl_ngtcp2_conn(&ctx->qconn)) {
  ------------------
  |  Branch (1022:8): [True: 3.33k, False: 19]
  ------------------
 1023|  3.33k|      struct cf_call_data save;
 1024|  3.33k|      CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  656|  3.33k|  do { \
  |  |  657|  3.33k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  157|  3.33k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  658|  3.33k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  3.33k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  659|  3.33k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  157|  3.33k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  660|  3.33k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  157|  3.33k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  793|  3.33k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  661|  3.33k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (661:11): [Folded, False: 3.33k]
  |  |  ------------------
  ------------------
  |  Branch (1024:7): [True: 3.33k, False: 0]
  |  Branch (1024:7): [True: 0, False: 0]
  |  Branch (1024:7): [True: 3.33k, False: 0]
  |  Branch (1024:7): [True: 0, False: 0]
  ------------------
 1025|  3.33k|      Curl_cf_ngtcp2_cmn_conn_close(cf, data);
 1026|  3.33k|      CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  664|  3.33k|  do { \
  |  |  665|  3.33k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1016|  3.33k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  666|  3.33k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  3.33k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  667|  3.33k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  157|  3.33k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  668|  3.33k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (668:11): [Folded, False: 3.33k]
  |  |  ------------------
  ------------------
  |  Branch (1026:7): [True: 0, False: 3.33k]
  |  Branch (1026:7): [True: 3.33k, False: 0]
  |  Branch (1026:7): [True: 3.33k, False: 0]
  |  Branch (1026:7): [True: 0, False: 0]
  |  Branch (1026:7): [True: 3.33k, False: 0]
  |  Branch (1026:7): [True: 0, False: 0]
  ------------------
 1027|  3.33k|    }
 1028|  3.35k|    Curl_cf_ngtcp2_ctx_cleanup(ctx);
 1029|  3.35k|    curlx_free(ctx);
  ------------------
  |  | 1503|  3.35k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1030|       |    cf->ctx = NULL;
 1031|  3.35k|  }
 1032|  3.35k|}
cf-ngtcp2.c:cf_ngtcp2_connect:
 1037|   116k|{
 1038|   116k|  return Curl_cf_ngtcp2_cmn_connect(cf, data, done);
 1039|   116k|}
cf-ngtcp2.c:cf_ngtcp2_adjust_pollset:
   60|  67.4k|{
   61|  67.4k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
   62|  67.4k|  bool want_recv, want_send;
   63|  67.4k|  CURLcode result = CURLE_OK;
   64|  67.4k|  curl_socket_t sock = (ctx->q.sockfd != CURL_SOCKET_BAD) ?
  ------------------
  |  |  147|  67.4k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (64:24): [True: 12.3k, False: 55.0k]
  ------------------
   65|  55.0k|   ctx->q.sockfd : cf->chain->sock;
   66|       |
   67|  67.4k|  if(!Curl_ngtcp2_conn(&ctx->qconn) || (sock == CURL_SOCKET_BAD))
  ------------------
  |  |  147|  67.4k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (67:6): [True: 0, False: 67.4k]
  |  Branch (67:40): [True: 0, False: 67.4k]
  ------------------
   68|      0|    return CURLE_OK;
   69|       |
   70|  67.4k|  Curl_pollset_check(data, ps, sock, &want_recv, &want_send);
   71|  67.4k|  if(!want_send && !Curl_bufq_is_empty(&ctx->q.sendbuf))
  ------------------
  |  Branch (71:6): [True: 66.6k, False: 740]
  |  Branch (71:20): [True: 0, False: 66.6k]
  ------------------
   72|      0|    want_send = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
   73|       |
   74|  67.4k|  if(want_recv || want_send) {
  ------------------
  |  Branch (74:6): [True: 8.50k, False: 58.9k]
  |  Branch (74:19): [True: 0, False: 58.9k]
  ------------------
   75|  8.50k|    struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
  ------------------
  |  |   82|  8.50k|  ((data) ? Curl_u32_ptrset_get(&(ctx)->streams, (data)->mid) : NULL)
  |  |  ------------------
  |  |  |  Branch (82:4): [True: 8.50k, False: 0]
  |  |  ------------------
  ------------------
   76|  8.50k|    struct cf_call_data save;
   77|  8.50k|    bool c_exhaust, s_exhaust;
   78|       |
   79|  8.50k|    CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  656|  8.50k|  do { \
  |  |  657|  8.50k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  157|  8.50k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  658|  8.50k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  8.50k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  659|  8.50k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  157|  8.50k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  660|  8.50k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  157|  8.50k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  793|  8.50k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  661|  8.50k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (661:11): [Folded, False: 8.50k]
  |  |  ------------------
  ------------------
  |  Branch (79:5): [True: 8.50k, False: 0]
  |  Branch (79:5): [True: 0, False: 0]
  |  Branch (79:5): [True: 8.50k, False: 0]
  |  Branch (79:5): [True: 0, False: 0]
  ------------------
   80|  8.50k|    c_exhaust = want_send && !Curl_ngtcp2_restricted(&ctx->qconn) &&
  ------------------
  |  Branch (80:17): [True: 740, False: 7.76k]
  |  Branch (80:30): [True: 740, False: 0]
  ------------------
   81|    740|      (!Curl_ngtcp2_conn_get_cwnd_left(&ctx->qconn) ||
  ------------------
  |  Branch (81:8): [True: 55, False: 685]
  ------------------
   82|    685|       !Curl_ngtcp2_conn_get_max_data_left(&ctx->qconn));
  ------------------
  |  Branch (82:8): [True: 0, False: 685]
  ------------------
   83|  8.50k|    s_exhaust = want_send && stream && stream->id >= 0 &&
  ------------------
  |  Branch (83:17): [True: 740, False: 7.76k]
  |  Branch (83:30): [True: 740, False: 0]
  |  Branch (83:40): [True: 740, False: 0]
  ------------------
   84|    740|                (stream->quic_flow_blocked ||
  ------------------
  |  Branch (84:18): [True: 0, False: 740]
  ------------------
   85|    740|                 stream->tx_in_flight_size >= stream->tx_in_flight_ideal);
  ------------------
  |  Branch (85:18): [True: 64, False: 676]
  ------------------
   86|  8.50k|    want_recv = (want_recv || c_exhaust || s_exhaust);
  ------------------
  |  Branch (86:18): [True: 8.50k, False: 0]
  |  Branch (86:31): [True: 0, False: 0]
  |  Branch (86:44): [True: 0, False: 0]
  ------------------
   87|  8.50k|    want_send = (!s_exhaust && want_send) ||
  ------------------
  |  Branch (87:18): [True: 8.44k, False: 64]
  |  Branch (87:32): [True: 676, False: 7.76k]
  ------------------
   88|  7.83k|                 !Curl_bufq_is_empty(&ctx->q.sendbuf);
  ------------------
  |  Branch (88:18): [True: 0, False: 7.83k]
  ------------------
   89|       |
   90|  8.50k|    result = Curl_pollset_set(data, ps, sock, want_recv, want_send);
   91|  8.50k|    CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  664|  8.50k|  do { \
  |  |  665|  8.50k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1016|  8.50k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  666|  8.50k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  8.50k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  667|  8.50k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  157|  8.50k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  668|  8.50k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (668:11): [Folded, False: 8.50k]
  |  |  ------------------
  ------------------
  |  Branch (91:5): [True: 0, False: 8.50k]
  |  Branch (91:5): [True: 8.50k, False: 0]
  |  Branch (91:5): [True: 8.50k, False: 0]
  |  Branch (91:5): [True: 0, False: 0]
  |  Branch (91:5): [True: 8.50k, False: 0]
  |  Branch (91:5): [True: 0, False: 0]
  ------------------
   92|  8.50k|  }
   93|  58.9k|  else {
   94|       |    /* We always want to process server packets */
   95|  58.9k|    result = Curl_pollset_add_in(data, ps, sock);
  ------------------
  |  |  152|  58.9k|  Curl_pollset_change(data, ps, sock, CURL_POLL_IN, 0)
  |  |  ------------------
  |  |  |  |  283|  58.9k|#define CURL_POLL_IN     1
  |  |  ------------------
  ------------------
   96|  58.9k|  }
   97|  67.4k|  return result;
   98|  67.4k|}
cf-ngtcp2.c:cf_ngtcp2_send:
  848|  2.23k|{
  849|  2.23k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  850|  2.23k|  struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
  ------------------
  |  |   82|  2.23k|  ((data) ? Curl_u32_ptrset_get(&(ctx)->streams, (data)->mid) : NULL)
  |  |  ------------------
  |  |  |  Branch (82:4): [True: 2.23k, False: 0]
  |  |  ------------------
  ------------------
  851|  2.23k|  struct cf_call_data save;
  852|  2.23k|  struct cf_ngtcp2_io_ctx pktx;
  853|  2.23k|  CURLcode result = CURLE_OK;
  854|       |
  855|  2.23k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  656|  2.23k|  do { \
  |  |  657|  2.23k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  157|  2.23k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  658|  2.23k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  659|  2.23k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  157|  2.23k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  660|  2.23k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  157|  2.23k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  793|  2.23k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  661|  2.23k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (661:11): [Folded, False: 2.23k]
  |  |  ------------------
  ------------------
  |  Branch (855:3): [True: 2.23k, False: 0]
  |  Branch (855:3): [True: 0, False: 0]
  |  Branch (855:3): [True: 2.23k, False: 0]
  |  Branch (855:3): [True: 0, False: 0]
  ------------------
  856|  2.23k|  DEBUGASSERT(cf->connected);
  ------------------
  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (856:3): [True: 0, False: 2.23k]
  |  Branch (856:3): [True: 2.23k, False: 0]
  ------------------
  857|  2.23k|  DEBUGASSERT(Curl_ngtcp2_conn(&ctx->qconn));
  ------------------
  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (857:3): [True: 0, False: 2.23k]
  |  Branch (857:3): [True: 2.23k, False: 0]
  ------------------
  858|  2.23k|  DEBUGASSERT(ctx->h3conn);
  ------------------
  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (858:3): [True: 0, False: 2.23k]
  |  Branch (858:3): [True: 2.23k, False: 0]
  ------------------
  859|  2.23k|  Curl_cf_ngtcp2_io_ctx_init(&pktx, cf, data);
  860|  2.23k|  *pnwritten = 0;
  861|       |
  862|       |  /* handshake verification failed in callback, do not send anything */
  863|  2.23k|  if(ctx->tls_vrfy_result) {
  ------------------
  |  Branch (863:6): [True: 0, False: 2.23k]
  ------------------
  864|      0|    result = ctx->tls_vrfy_result;
  865|      0|    goto denied;
  866|      0|  }
  867|       |
  868|  2.23k|  result = Curl_cf_ngtcp2_progress_ingress(cf, data, &pktx);
  869|  2.23k|  if(result)
  ------------------
  |  Branch (869:6): [True: 0, False: 2.23k]
  ------------------
  870|      0|    goto out;
  871|       |
  872|  2.23k|  if(!stream || stream->id < 0) {
  ------------------
  |  Branch (872:6): [True: 1.94k, False: 290]
  |  Branch (872:17): [True: 1, False: 289]
  ------------------
  873|  1.94k|    if(ctx->shutdown_started) {
  ------------------
  |  Branch (873:8): [True: 0, False: 1.94k]
  ------------------
  874|      0|      CURL_TRC_CF(data, cf, "cannot open stream on closed connection");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  875|      0|      result = CURLE_SEND_ERROR;
  876|      0|      goto out;
  877|      0|    }
  878|  1.94k|    result = h3_stream_open(cf, data, buf, len, eos, pnwritten);
  879|  1.94k|    if(result) {
  ------------------
  |  Branch (879:8): [True: 18, False: 1.92k]
  ------------------
  880|     18|      CURL_TRC_CF(data, cf, "failed to open stream -> %d", (int)result);
  ------------------
  |  |  153|     18|  do {                                          \
  |  |  154|     18|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|     18|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     36|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 18, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 4, False: 14]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     36|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 4, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      4|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     18|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      4|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 4, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     18|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     18|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 18]
  |  |  ------------------
  ------------------
  881|     18|      goto out;
  882|     18|    }
  883|  1.92k|    stream = H3_STREAM_CTX(ctx, data);
  ------------------
  |  |   82|  1.92k|  ((data) ? Curl_u32_ptrset_get(&(ctx)->streams, (data)->mid) : NULL)
  |  |  ------------------
  |  |  |  Branch (82:4): [True: 1.92k, False: 0]
  |  |  ------------------
  ------------------
  884|  1.92k|  }
  885|    289|  else if(stream->xfer_result) {
  ------------------
  |  Branch (885:11): [True: 0, False: 289]
  ------------------
  886|      0|    CURL_TRC_CF(data, cf, "[%" PRId64 "] xfer write failed", stream->id);
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  887|      0|    Curl_cf_ngtcp2_h3_stream_close(cf, data, stream);
  888|      0|    result = stream->xfer_result;
  889|      0|    goto out;
  890|      0|  }
  891|    289|  else if(stream->closed) {
  ------------------
  |  Branch (891:11): [True: 0, False: 289]
  ------------------
  892|      0|    if(stream->resp_hds_complete) {
  ------------------
  |  Branch (892:8): [True: 0, False: 0]
  ------------------
  893|       |      /* Server decided to close the stream after having sent us a final
  894|       |       * response. This is valid if it is not interested in the request
  895|       |       * body. This happens on 30x or 40x responses.
  896|       |       * We silently discard the data sent, since this is not a transport
  897|       |       * error situation. */
  898|      0|      CURL_TRC_CF(data, cf, "[%" PRId64 "] discarding data"
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  899|      0|                  "on closed stream with response", stream->id);
  900|      0|      result = CURLE_OK;
  901|      0|      *pnwritten = len;
  902|      0|      goto out;
  903|      0|    }
  904|      0|    CURL_TRC_CF(data, cf, "[%" PRId64 "] send_body(len=%zu) "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  905|      0|                "-> stream closed", stream->id, len);
  906|      0|    result = CURLE_HTTP3;
  907|      0|    goto out;
  908|      0|  }
  909|    289|  else if(ctx->shutdown_started) {
  ------------------
  |  Branch (909:11): [True: 0, False: 289]
  ------------------
  910|      0|    CURL_TRC_CF(data, cf, "cannot send on closed connection");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  911|      0|    result = CURLE_SEND_ERROR;
  912|      0|    goto out;
  913|      0|  }
  914|    289|  else if(stream->tx_in_flight_size >= stream->tx_in_flight_ideal) {
  ------------------
  |  Branch (914:11): [True: 56, False: 233]
  ------------------
  915|     56|    result = CURLE_AGAIN;
  916|     56|    goto out;
  917|     56|  }
  918|    233|  else {
  919|    233|    if(len && stream->sendbuf_eos) {
  ------------------
  |  Branch (919:8): [True: 183, False: 50]
  |  Branch (919:15): [True: 0, False: 183]
  ------------------
  920|      0|      failf(data, "adding upload data after EOS");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  921|      0|      result = CURLE_SEND_ERROR;
  922|      0|      goto out;
  923|      0|    }
  924|    233|    result = Curl_bufq_write(&stream->sendbuf, buf, len, pnwritten);
  925|    233|    CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send, add to "
  ------------------
  |  |  153|    233|  do {                                          \
  |  |  154|    233|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    233|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    466|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 233, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 36, False: 197]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    466|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 36, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     36|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    233|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     36|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 36, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 36]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    233|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    233|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 233]
  |  |  ------------------
  ------------------
  926|    233|                "sendbuf(len=%zu, eos=%d) -> %d, %zu",
  927|    233|                stream->id, len, eos, (int)result, *pnwritten);
  928|    233|    if(result)
  ------------------
  |  Branch (928:8): [True: 0, False: 233]
  ------------------
  929|      0|      goto out;
  930|    233|    if(eos && (len == *pnwritten))
  ------------------
  |  Branch (930:8): [True: 60, False: 173]
  |  Branch (930:15): [True: 60, False: 0]
  ------------------
  931|     60|      stream->sendbuf_eos = TRUE;
  ------------------
  |  |  986|     60|#define TRUE true
  ------------------
  932|    233|    (void)nghttp3_conn_resume_stream(ctx->h3conn, stream->id);
  933|    233|  }
  934|       |
  935|  2.16k|  if(*pnwritten > 0 && !ctx->tls_handshake_complete && ctx->use_earlydata)
  ------------------
  |  Branch (935:6): [True: 2.11k, False: 50]
  |  Branch (935:24): [True: 0, False: 2.11k]
  |  Branch (935:56): [True: 0, False: 0]
  ------------------
  936|      0|    ctx->earlydata_skip += *pnwritten;
  937|       |
  938|  2.16k|  DEBUGASSERT(!result);
  ------------------
  |  | 1016|  2.16k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (938:3): [True: 0, False: 2.16k]
  |  Branch (938:3): [True: 2.16k, False: 0]
  ------------------
  939|  2.16k|  result = Curl_cf_ngtcp2_progress_egress(cf, data, &pktx);
  940|       |
  941|  2.16k|  if(*pnwritten > 0) {
  ------------------
  |  Branch (941:6): [True: 2.11k, False: 50]
  ------------------
  942|  2.11k|    const size_t delta = (2 * 1024);
  943|  2.11k|    if(stream->tx_in_flight_size > (stream->tx_in_flight_ideal + delta)) {
  ------------------
  |  Branch (943:8): [True: 32, False: 2.08k]
  ------------------
  944|       |      /* ngtcp2 keeps more in flight than we try to provide for,
  945|       |       * increase our "ideal" tx buffer length */
  946|     32|      stream->tx_in_flight_ideal += delta;
  947|     32|      CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(%zu), added %zu, "
  ------------------
  |  |  153|     32|  do {                                          \
  |  |  154|     32|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|     32|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     64|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 32, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 9, False: 23]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     64|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 9, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      9|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|     32|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      9|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 9, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|     32|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|     32|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 32]
  |  |  ------------------
  ------------------
  948|     32|                  "inflight=%zu, increase tx_win=%zu",
  949|     32|                  stream->id, len, *pnwritten,
  950|     32|                  stream->tx_in_flight_size, stream->tx_in_flight_ideal);
  951|     32|    }
  952|  2.08k|    else if((stream->tx_in_flight_size + delta) < stream->tx_in_flight_ideal) {
  ------------------
  |  Branch (952:13): [True: 2.01k, False: 65]
  ------------------
  953|       |      /* ngtcp2 keeps less in flight than we try to provide for,
  954|       |       * decrease our "ideal" tx buffer length */
  955|  2.01k|      stream->tx_in_flight_ideal -= delta;
  956|  2.01k|      CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(%zu), added %zu, "
  ------------------
  |  |  153|  2.01k|  do {                                          \
  |  |  154|  2.01k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  2.01k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  4.03k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 2.01k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 155, False: 1.86k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  4.03k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 155, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    155|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  2.01k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    155|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 155, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 5, False: 150]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.01k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.01k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.01k]
  |  |  ------------------
  ------------------
  957|  2.01k|                  "inflight=%zu, reduce tx_win=%zu",
  958|  2.01k|                  stream->id, len, *pnwritten,
  959|  2.01k|                  stream->tx_in_flight_size, stream->tx_in_flight_ideal);
  960|  2.01k|    }
  961|  2.11k|  }
  962|       |
  963|  2.23k|out:
  964|  2.23k|  result = Curl_1st_fatal(result,
  965|  2.23k|                          Curl_cf_ngtcp2_cmn_set_expiry(cf, data, &pktx));
  966|  2.23k|  if(ctx->tls_vrfy_result)
  ------------------
  |  Branch (966:6): [True: 0, False: 2.23k]
  ------------------
  967|      0|    result = ctx->tls_vrfy_result;
  968|  2.23k|denied:
  969|  2.23k|  CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_send(len=%zu, eos=%d) -> %d, %zu",
  ------------------
  |  |  153|  2.23k|  do {                                          \
  |  |  154|  2.23k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  2.23k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  4.47k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 2.23k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 192, False: 2.04k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  4.47k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 192, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    192|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  2.23k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    192|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 192, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 5, False: 187]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.23k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 5, False: 0]
  |  |  ------------------
  |  |  156|  2.23k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.23k]
  |  |  ------------------
  ------------------
  970|  2.23k|              stream ? stream->id : -1, len, eos, (int)result, *pnwritten);
  971|  2.23k|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  664|  2.23k|  do { \
  |  |  665|  2.23k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  666|  2.23k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  2.23k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  667|  2.23k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  157|  2.23k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  668|  2.23k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (668:11): [Folded, False: 2.23k]
  |  |  ------------------
  ------------------
  |  Branch (971:3): [True: 0, False: 2.23k]
  |  Branch (971:3): [True: 2.23k, False: 0]
  |  Branch (971:3): [True: 2.23k, False: 0]
  |  Branch (971:3): [True: 0, False: 0]
  |  Branch (971:3): [True: 2.23k, False: 0]
  |  Branch (971:3): [True: 0, False: 0]
  ------------------
  972|  2.23k|  return result;
  973|  2.23k|}
cf-ngtcp2.c:h3_stream_open:
  723|  1.94k|{
  724|  1.94k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  725|  1.94k|  struct h3_stream_ctx *stream = NULL;
  726|  1.94k|  int64_t sid;
  727|  1.94k|  struct dynhds h2_headers;
  728|  1.94k|  nghttp3_nv *nva = NULL;
  729|  1.94k|  int rc = 0;
  730|  1.94k|  uint32_t i, nheader;
  731|  1.94k|  nghttp3_data_reader reader;
  732|  1.94k|  nghttp3_data_reader *preader = NULL;
  733|  1.94k|  CURLcode result;
  734|       |
  735|  1.94k|  *pnwritten = 0;
  736|  1.94k|  Curl_dynhds_init(&h2_headers, 0, DYN_HTTP_REQUEST);
  ------------------
  |  |   69|  1.94k|#define DYN_HTTP_REQUEST    (1024 * 1024)
  ------------------
  737|       |
  738|  1.94k|  result = Curl_cf_ngtcp2_h3_stream_setup(cf, data, &stream);
  739|  1.94k|  if(result)
  ------------------
  |  Branch (739:6): [True: 0, False: 1.94k]
  ------------------
  740|      0|    goto out;
  741|       |
  742|  1.94k|  result = Curl_h1_req_parse_read(&stream->h1, buf, len, NULL,
  743|  1.94k|    !data->state.http_ignorecustom ?
  ------------------
  |  Branch (743:5): [True: 1.94k, False: 0]
  ------------------
  744|  1.94k|    CURL_EASY_STR(data, STRING_CUSTOMREQUEST) : NULL,
  ------------------
  |  | 1206|  1.94k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
  745|  1.94k|    0, pnwritten);
  746|  1.94k|  if(result)
  ------------------
  |  Branch (746:6): [True: 17, False: 1.93k]
  ------------------
  747|     17|    goto out;
  748|  1.93k|  if(!stream->h1.done) {
  ------------------
  |  Branch (748:6): [True: 1, False: 1.92k]
  ------------------
  749|       |    /* need more data */
  750|      1|    goto out;
  751|      1|  }
  752|  1.92k|  DEBUGASSERT(stream->h1.req);
  ------------------
  |  | 1016|  1.92k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (752:3): [True: 0, False: 1.92k]
  |  Branch (752:3): [True: 1.92k, False: 0]
  ------------------
  753|       |
  754|  1.92k|  result = Curl_http_req_to_h2(&h2_headers, stream->h1.req, data);
  755|  1.92k|  if(result)
  ------------------
  |  Branch (755:6): [True: 0, False: 1.92k]
  ------------------
  756|      0|    goto out;
  757|       |
  758|       |  /* no longer needed */
  759|  1.92k|  Curl_h1_req_parse_free(&stream->h1);
  760|       |
  761|  1.92k|  nheader = Curl_dynhds_count(&h2_headers);
  762|  1.92k|  nva = curlx_malloc(sizeof(nghttp3_nv) * nheader);
  ------------------
  |  | 1498|  1.92k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
  763|  1.92k|  if(!nva) {
  ------------------
  |  Branch (763:6): [True: 0, False: 1.92k]
  ------------------
  764|      0|    result = CURLE_OUT_OF_MEMORY;
  765|      0|    goto out;
  766|      0|  }
  767|       |
  768|  12.4k|  for(i = 0; i < nheader; ++i) {
  ------------------
  |  Branch (768:14): [True: 10.5k, False: 1.92k]
  ------------------
  769|  10.5k|    struct dynhds_entry *e = Curl_dynhds_getn(&h2_headers, i);
  770|  10.5k|    if(!e)
  ------------------
  |  Branch (770:8): [True: 0, False: 10.5k]
  ------------------
  771|      0|      break;
  772|  10.5k|    nva[i].name = (unsigned char *)e->name;
  773|  10.5k|    nva[i].namelen = e->namelen;
  774|  10.5k|    nva[i].value = (unsigned char *)e->value;
  775|  10.5k|    nva[i].valuelen = e->valuelen;
  776|  10.5k|    nva[i].flags = NGHTTP3_NV_FLAG_NONE;
  777|  10.5k|  }
  778|       |
  779|  1.92k|  rc = Curl_ngtcp2_conn_open_bidi_stream(&ctx->qconn, &sid, stream);
  780|  1.92k|  if(rc) {
  ------------------
  |  Branch (780:6): [True: 0, False: 1.92k]
  ------------------
  781|      0|    failf(data, "cannot open bidi streams");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  782|      0|    result = CURLE_SEND_ERROR;
  783|      0|    goto out;
  784|      0|  }
  785|  1.92k|  stream->id = sid;
  786|  1.92k|  ++ctx->used_bidi_streams;
  787|       |
  788|  1.92k|  stream->sendbuf_eos = stream->send_closed = (eos && *pnwritten == len);
  ------------------
  |  Branch (788:48): [True: 1.83k, False: 94]
  |  Branch (788:55): [True: 1.50k, False: 334]
  ------------------
  789|  1.92k|  if(!stream->send_closed) {
  ------------------
  |  Branch (789:6): [True: 428, False: 1.50k]
  ------------------
  790|    428|    reader.read_data = cb_h3_read_req_body;
  791|    428|    preader = &reader;
  792|    428|  }
  793|       |
  794|  1.92k|  if(*pnwritten < len) {
  ------------------
  |  Branch (794:6): [True: 427, False: 1.50k]
  ------------------
  795|       |    /* There is also upload data in buf, add it */
  796|    427|    size_t body_written = 0;
  797|    427|    result = Curl_bufq_write(
  798|    427|      &stream->sendbuf, buf + *pnwritten, len - *pnwritten, &body_written);
  799|    427|    CURL_TRC_CF(data, cf, "[%" PRId64 "] stream open, adding to "
  ------------------
  |  |  153|    427|  do {                                          \
  |  |  154|    427|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    427|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    854|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 427, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 27, False: 400]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    854|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 27, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     27|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    427|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     27|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 27, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    427|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    427|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 427]
  |  |  ------------------
  ------------------
  800|    427|                "sendbuf(len=%zu, eos=%d) -> %d, %zu",
  801|    427|                stream->id, len - *pnwritten, eos, (int)result,
  802|    427|                body_written);
  803|    427|    if(result)
  ------------------
  |  Branch (803:8): [True: 0, False: 427]
  ------------------
  804|      0|      goto out;
  805|    427|    *pnwritten += body_written;
  806|    427|    stream->sendbuf_eos = (eos && *pnwritten == len);
  ------------------
  |  Branch (806:28): [True: 334, False: 93]
  |  Branch (806:35): [True: 334, False: 0]
  ------------------
  807|    427|  }
  808|       |
  809|  1.92k|  rc = nghttp3_conn_submit_request(ctx->h3conn, stream->id,
  810|  1.92k|                                   nva, nheader, preader, stream);
  811|  1.92k|  if(rc) {
  ------------------
  |  Branch (811:6): [True: 1, False: 1.92k]
  ------------------
  812|      1|    switch(rc) {
  813|      0|    case NGHTTP3_ERR_CONN_CLOSING:
  ------------------
  |  Branch (813:5): [True: 0, False: 1]
  ------------------
  814|      0|      CURL_TRC_CF(data, cf, "h3sid[%" PRId64 "] failed to send, "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  815|      0|                  "connection is closing", stream->id);
  816|      0|      break;
  817|      1|    default:
  ------------------
  |  Branch (817:5): [True: 1, False: 0]
  ------------------
  818|      1|      CURL_TRC_CF(data, cf, "h3sid[%" PRId64 "] failed to send -> "
  ------------------
  |  |  153|      1|  do {                                          \
  |  |  154|      1|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      1|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      2|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      2|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      1|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      1|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      1|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1]
  |  |  ------------------
  ------------------
  819|      1|                  "%d (%s)", stream->id, rc, nghttp3_strerror(rc));
  820|      1|      break;
  821|      1|    }
  822|      1|    Curl_cf_ngtcp2_h3_stream_close(cf, data, stream);
  823|      1|    result = CURLE_SEND_ERROR;
  824|      1|    goto out;
  825|      1|  }
  826|       |
  827|  1.92k|  cf_ngtcp2_upd_rx_win(cf, data, stream);
  828|       |
  829|  1.92k|  if(Curl_trc_is_verbose(data)) {
  ------------------
  |  |  322|  1.92k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 1.92k, False: 0]
  |  |  |  Branch (322:14): [True: 141, False: 1.78k]
  |  |  ------------------
  |  |  323|  1.92k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 141, False: 0]
  |  |  ------------------
  |  |  324|    141|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  830|    141|    infof(data, "[HTTP/3] [%" PRId64 "] OPENED stream for %s",
  ------------------
  |  |  143|    141|  do {                               \
  |  |  144|    141|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    141|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 141, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 141, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    141|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 141, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    141|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    141|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    141|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 141]
  |  |  ------------------
  ------------------
  831|    141|          stream->id, Curl_bufref_ptr(&data->state.url));
  832|    887|    for(i = 0; i < nheader; ++i) {
  ------------------
  |  Branch (832:16): [True: 746, False: 141]
  ------------------
  833|    746|      infof(data, "[HTTP/3] [%" PRId64 "] [%.*s: %.*s]", stream->id,
  ------------------
  |  |  143|    746|  do {                               \
  |  |  144|    746|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    746|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 746, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 746, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    746|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 746, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    746|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    746|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    746|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 746]
  |  |  ------------------
  ------------------
  834|    746|            (int)nva[i].namelen, nva[i].name,
  835|    746|            (int)nva[i].valuelen, nva[i].value);
  836|    746|    }
  837|    141|  }
  838|       |
  839|  1.94k|out:
  840|  1.94k|  curlx_free(nva);
  ------------------
  |  | 1503|  1.94k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  841|  1.94k|  Curl_dynhds_cleanup(&h2_headers);
  842|  1.94k|  return result;
  843|  1.92k|}
cf-ngtcp2.c:cb_h3_read_req_body:
  661|    884|{
  662|    884|  struct Curl_cfilter *cf = user_data;
  663|    884|  struct h3_stream_ctx *stream;
  664|    884|  struct Curl_easy *data =
  665|    884|    Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
  666|    884|  size_t nwritten = 0;
  667|    884|  size_t nvecs = 0;
  668|    884|  (void)conn;
  669|    884|  (void)stream_id;
  670|    884|  (void)user_data;
  671|    884|  (void)veccnt;
  672|       |
  673|    884|  if(!stream || !data)
  ------------------
  |  Branch (673:6): [True: 0, False: 884]
  |  Branch (673:17): [True: 0, False: 884]
  ------------------
  674|      0|    return NGHTTP3_ERR_CALLBACK_FAILURE;
  675|       |  /* nghttp3 keeps references to the sendbuf data until it is ACKed
  676|       |   * by the server (see `cb_h3_acked_req_body()` for updates).
  677|       |   * `tx_in_flight_size` is the amount of bytes in `sendbuf`
  678|       |   * that we have already passed to nghttp3, but which have not been
  679|       |   * ACKed yet.
  680|       |   * Any amount beyond `tx_in_flight_size` we need still to pass
  681|       |   * to nghttp3. Do that now, if we can. */
  682|    884|  if(stream->tx_in_flight_size < Curl_bufq_len(&stream->sendbuf)) {
  ------------------
  |  Branch (682:6): [True: 600, False: 284]
  ------------------
  683|    600|    nvecs = 0;
  684|  1.21k|    while(nvecs < veccnt &&
  ------------------
  |  Branch (684:11): [True: 1.21k, False: 0]
  ------------------
  685|  1.21k|          Curl_bufq_peek_at(&stream->sendbuf,
  ------------------
  |  Branch (685:11): [True: 615, False: 600]
  ------------------
  686|  1.21k|                            stream->tx_in_flight_size,
  687|  1.21k|                            CURL_UNCONST(&vec[nvecs].base),
  ------------------
  |  |  793|  1.21k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  688|  1.21k|                            &vec[nvecs].len)) {
  689|    615|      stream->tx_in_flight_size += vec[nvecs].len;
  690|    615|      nwritten += vec[nvecs].len;
  691|    615|      ++nvecs;
  692|    615|    }
  693|    600|    DEBUGASSERT(nvecs > 0); /* we SHOULD have been be able to peek */
  ------------------
  |  | 1016|    600|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (693:5): [True: 0, False: 600]
  |  Branch (693:5): [True: 600, False: 0]
  ------------------
  694|    600|  }
  695|       |
  696|       |  /* When we stopped sending and everything in `sendbuf` is "in flight",
  697|       |   * we are at the end of the request body. */
  698|    884|  if(stream->sendbuf_eos &&
  ------------------
  |  Branch (698:6): [True: 390, False: 494]
  ------------------
  699|    390|     (stream->tx_in_flight_size == Curl_bufq_len(&stream->sendbuf))) {
  ------------------
  |  Branch (699:6): [True: 390, False: 0]
  ------------------
  700|    390|    *pflags = NGHTTP3_DATA_FLAG_EOF;
  701|    390|    stream->send_closed = TRUE;
  ------------------
  |  |  986|    390|#define TRUE true
  ------------------
  702|    390|  }
  703|    494|  else if(!nwritten) {
  ------------------
  |  Branch (703:11): [True: 235, False: 259]
  ------------------
  704|       |    /* Not EOF, and nothing to give, we signal WOULDBLOCK. */
  705|    235|    CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> AGAIN", stream->id);
  ------------------
  |  |  153|    235|  do {                                          \
  |  |  154|    235|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    235|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    470|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 235, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 34, False: 201]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    470|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 34, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     34|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    235|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     34|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 34, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    235|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    235|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 235]
  |  |  ------------------
  ------------------
  706|    235|    return NGHTTP3_ERR_WOULDBLOCK;
  707|    235|  }
  708|       |
  709|    649|  CURL_TRC_CF(data, cf, "[%" PRId64 "] read req body -> "
  ------------------
  |  |  153|    649|  do {                                          \
  |  |  154|    649|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    649|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.29k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 649, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 59, False: 590]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.29k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 59, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     59|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    649|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     59|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 59, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 59]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    649|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|    649|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 649]
  |  |  ------------------
  ------------------
  710|    649|              "%zu vecs%s with %zu (buffered=%zu, buf-eos%d)",
  711|    649|              stream->id, nvecs,
  712|    649|              *pflags == NGHTTP3_DATA_FLAG_EOF ? " EOF" : "",
  713|    649|              nwritten, Curl_bufq_len(&stream->sendbuf),
  714|    649|              stream->sendbuf_eos);
  715|    649|  return (nghttp3_ssize)nvecs;
  716|    884|}
cf-ngtcp2.c:cf_ngtcp2_upd_rx_win:
  174|  11.6k|{
  175|  11.6k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  176|  11.6k|  uint64_t cur_win, wanted_win = H3_STREAM_WINDOW_SIZE_MAX;
  ------------------
  |  |   84|  11.6k|#define H3_STREAM_WINDOW_SIZE_MAX     (10 * 1024 * 1024)
  ------------------
  177|       |
  178|       |  /* how much does rate limiting allow us to acknowledge? */
  179|  11.6k|  if(Curl_rlimit_active(&data->progress.dl.rlimit)) {
  ------------------
  |  Branch (179:6): [True: 62, False: 11.6k]
  ------------------
  180|     62|    int64_t avail;
  181|       |
  182|       |    /* start rate limit updates only after first bytes arrived */
  183|     62|    if(!stream->rx_offset)
  ------------------
  |  Branch (183:8): [True: 62, False: 0]
  ------------------
  184|     62|      return;
  185|       |
  186|      0|    avail = Curl_rlimit_avail(&data->progress.dl.rlimit, NULL);
  187|      0|    if(avail <= 0) {
  ------------------
  |  Branch (187:8): [True: 0, False: 0]
  ------------------
  188|       |      /* nothing available, do not extend the rx offset */
  189|      0|      CURL_TRC_CF(data, cf, "[%" PRId64 "] dl rate limit exhausted (%" PRId64
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  190|      0|                  " tokens)", stream->id, avail);
  191|      0|      return;
  192|      0|    }
  193|      0|    wanted_win = CURLMIN((uint64_t)avail, H3_STREAM_WINDOW_SIZE_MAX);
  ------------------
  |  | 1315|      0|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  194|      0|  }
  195|       |
  196|  11.6k|  if(stream->rx_offset_max < stream->rx_offset) {
  ------------------
  |  Branch (196:6): [True: 0, False: 11.6k]
  ------------------
  197|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (197:5): [Folded, False: 0]
  |  Branch (197:5): [Folded, False: 0]
  ------------------
  198|      0|    return;
  199|      0|  }
  200|  11.6k|  cur_win = stream->rx_offset_max - stream->rx_offset;
  201|       |
  202|  11.6k|  if(wanted_win > cur_win) {
  ------------------
  |  Branch (202:6): [True: 2.03k, False: 9.58k]
  ------------------
  203|  2.03k|    uint64_t delta = wanted_win - cur_win;
  204|       |
  205|  2.03k|    if(UINT64_MAX - delta < stream->rx_offset_max)
  ------------------
  |  Branch (205:8): [True: 0, False: 2.03k]
  ------------------
  206|      0|      delta = UINT64_MAX - stream->rx_offset_max;
  207|  2.03k|    if(delta) {
  ------------------
  |  Branch (207:8): [True: 2.03k, False: 0]
  ------------------
  208|  2.03k|      CURL_TRC_CF(data, cf, "[%" PRId64 "] rx window, extend by %" PRIu64
  ------------------
  |  |  153|  2.03k|  do {                                          \
  |  |  154|  2.03k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  2.03k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  4.06k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 2.03k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 140, False: 1.89k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  4.06k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 140, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    140|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  2.03k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    140|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 140, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 5, False: 135]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  2.03k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  2.03k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 2.03k]
  |  |  ------------------
  ------------------
  209|  2.03k|                  " bytes", stream->id, delta);
  210|  2.03k|      stream->rx_offset_max += delta;
  211|  2.03k|      Curl_ngtcp2_conn_extend_max_stream_offset(&ctx->qconn, stream->id,
  212|  2.03k|                                                 delta);
  213|  2.03k|    }
  214|  2.03k|  }
  215|  11.6k|}
cf-ngtcp2.c:cf_ngtcp2_recv:
  554|  9.62k|{
  555|  9.62k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  556|  9.62k|  struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
  ------------------
  |  |   82|  9.62k|  ((data) ? Curl_u32_ptrset_get(&(ctx)->streams, (data)->mid) : NULL)
  |  |  ------------------
  |  |  |  Branch (82:4): [True: 9.62k, False: 0]
  |  |  ------------------
  ------------------
  557|  9.62k|  struct cf_call_data save;
  558|  9.62k|  struct cf_ngtcp2_io_ctx pktx;
  559|  9.62k|  CURLcode result = CURLE_OK;
  560|  9.62k|  int i;
  561|       |
  562|  9.62k|  (void)ctx;
  563|  9.62k|  (void)buf;
  564|  9.62k|  NOVERBOSE((void)buflen);
  ------------------
  |  | 1638|  9.62k|#define NOVERBOSE(x) Curl_nop_stmt
  |  |  ------------------
  |  |  |  | 1199|  9.62k|#define Curl_nop_stmt do {} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1199:35): [Folded, False: 9.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  565|       |
  566|  9.62k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  656|  9.62k|  do { \
  |  |  657|  9.62k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  157|  9.62k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  658|  9.62k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  659|  9.62k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  157|  9.62k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  660|  9.62k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  157|  9.62k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  793|  9.62k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  661|  9.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (661:11): [Folded, False: 9.62k]
  |  |  ------------------
  ------------------
  |  Branch (566:3): [True: 9.62k, False: 0]
  |  Branch (566:3): [True: 0, False: 0]
  |  Branch (566:3): [True: 9.62k, False: 0]
  |  Branch (566:3): [True: 0, False: 0]
  ------------------
  567|  9.62k|  DEBUGASSERT(cf->connected);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (567:3): [True: 0, False: 9.62k]
  |  Branch (567:3): [True: 9.62k, False: 0]
  ------------------
  568|  9.62k|  DEBUGASSERT(ctx);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (568:3): [True: 0, False: 9.62k]
  |  Branch (568:3): [True: 9.62k, False: 0]
  ------------------
  569|  9.62k|  DEBUGASSERT(Curl_ngtcp2_conn(&ctx->qconn));
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (569:3): [True: 0, False: 9.62k]
  |  Branch (569:3): [True: 9.62k, False: 0]
  ------------------
  570|  9.62k|  DEBUGASSERT(ctx->h3conn);
  ------------------
  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (570:3): [True: 0, False: 9.62k]
  |  Branch (570:3): [True: 9.62k, False: 0]
  ------------------
  571|  9.62k|  *pnread = 0;
  572|       |
  573|       |  /* handshake verification failed in callback, do not recv anything */
  574|  9.62k|  if(ctx->tls_vrfy_result) {
  ------------------
  |  Branch (574:6): [True: 0, False: 9.62k]
  ------------------
  575|      0|    result = ctx->tls_vrfy_result;
  576|      0|    goto denied;
  577|      0|  }
  578|       |
  579|  9.62k|  Curl_cf_ngtcp2_io_ctx_init(&pktx, cf, data);
  580|       |
  581|  9.62k|  if(!stream || ctx->shutdown_started) {
  ------------------
  |  Branch (581:6): [True: 0, False: 9.62k]
  |  Branch (581:17): [True: 0, False: 9.62k]
  ------------------
  582|      0|    result = CURLE_RECV_ERROR;
  583|      0|    goto out;
  584|      0|  }
  585|       |
  586|  9.62k|  cf_ngtcp2_upd_rx_win(cf, data, stream);
  587|       |
  588|       |  /* first check for results/closed already known without touching
  589|       |   * the connection. For an already failed/closed stream, errors on
  590|       |   * the connection do not count.
  591|       |   * Then handle incoming data and check for failed/closed again.
  592|       |   */
  593|  27.4k|  for(i = 0; i < 2; ++i) {
  ------------------
  |  Branch (593:14): [True: 18.8k, False: 8.53k]
  ------------------
  594|  18.8k|    if(stream->xfer_result) {
  ------------------
  |  Branch (594:8): [True: 5, False: 18.8k]
  ------------------
  595|      5|      CURL_TRC_CF(data, cf, "[%" PRId64 "] xfer write failed", stream->id);
  ------------------
  |  |  153|      5|  do {                                          \
  |  |  154|      5|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      5|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     10|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 5, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     10|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      5|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      5|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      5|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 5]
  |  |  ------------------
  ------------------
  596|      5|      Curl_cf_ngtcp2_h3_stream_close(cf, data, stream);
  597|      5|      result = stream->xfer_result;
  598|      5|      goto out;
  599|      5|    }
  600|  18.8k|    else if(stream->closed) {
  ------------------
  |  Branch (600:13): [True: 716, False: 18.1k]
  ------------------
  601|    716|      result = recv_closed_stream(cf, data, stream, pnread);
  602|    716|      goto out;
  603|    716|    }
  604|       |
  605|  18.1k|    if(!i && Curl_cf_ngtcp2_progress_ingress(cf, data, &pktx)) {
  ------------------
  |  Branch (605:8): [True: 9.62k, False: 8.53k]
  |  Branch (605:14): [True: 378, False: 9.25k]
  ------------------
  606|    378|      result = CURLE_RECV_ERROR;
  607|    378|      goto out;
  608|    378|    }
  609|  18.1k|  }
  610|       |
  611|  8.53k|  result = CURLE_AGAIN;
  612|       |
  613|  9.62k|out:
  614|  9.62k|  result = Curl_1st_fatal(result,
  615|  9.62k|                          Curl_cf_ngtcp2_progress_egress(cf, data, &pktx));
  616|  9.62k|  result = Curl_1st_fatal(result,
  617|  9.62k|                          Curl_cf_ngtcp2_cmn_set_expiry(cf, data, &pktx));
  618|  9.62k|  if(ctx->tls_vrfy_result)
  ------------------
  |  Branch (618:6): [True: 0, False: 9.62k]
  ------------------
  619|      0|    result = ctx->tls_vrfy_result;
  620|  9.62k|denied:
  621|  9.62k|  CURL_TRC_CF(data, cf, "[%" PRId64 "] cf_recv(buflen=%zu) -> %d, %zu",
  ------------------
  |  |  153|  9.62k|  do {                                          \
  |  |  154|  9.62k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.62k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  19.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.62k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 1.35k, False: 8.27k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  19.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 1.35k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  1.35k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.62k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  1.35k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 1.35k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 34, False: 1.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.62k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 34, False: 0]
  |  |  ------------------
  |  |  156|  9.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.62k]
  |  |  ------------------
  ------------------
  622|  9.62k|              stream ? stream->id : -1, buflen, (int)result, *pnread);
  623|  9.62k|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  664|  9.62k|  do { \
  |  |  665|  9.62k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  666|  9.62k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  9.62k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  667|  9.62k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  157|  9.62k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  668|  9.62k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (668:11): [Folded, False: 9.62k]
  |  |  ------------------
  ------------------
  |  Branch (623:3): [True: 0, False: 9.62k]
  |  Branch (623:3): [True: 9.62k, False: 0]
  |  Branch (623:3): [True: 9.62k, False: 0]
  |  Branch (623:3): [True: 0, False: 0]
  |  Branch (623:3): [True: 9.62k, False: 0]
  |  Branch (623:3): [True: 0, False: 0]
  ------------------
  624|  9.62k|  return result;
  625|  9.62k|}
cf-ngtcp2.c:recv_closed_stream:
  519|    716|{
  520|    716|  *pnread = 0;
  521|    716|  if(stream->reset) {
  ------------------
  |  Branch (521:6): [True: 184, False: 532]
  ------------------
  522|    184|    if(stream->error3 == CURL_H3_ERR_REQUEST_REJECTED) {
  ------------------
  |  Branch (522:8): [True: 0, False: 184]
  ------------------
  523|      0|      infof(data, "HTTP/3 stream %" PRId64 " refused by server, try again "
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  524|      0|            "on a new connection", stream->id);
  525|      0|      connclose(CF_CONN(cf)); /* do not use this anymore */
  ------------------
  |  |   72|      0|#define connclose(x)   Curl_conncontrol((x), CONNCTRL_CONN_CLOSE)
  |  |  ------------------
  |  |  |  |   66|      0|#define CONNCTRL_CONN_CLOSE      1
  |  |  ------------------
  ------------------
  526|      0|      data->req.refused_stream = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  527|      0|      return CURLE_RECV_ERROR; /* trigger Curl_retry_request() later */
  528|      0|    }
  529|    184|    else if(stream->resp_hds_complete && data->req.no_body) {
  ------------------
  |  Branch (529:13): [True: 3, False: 181]
  |  Branch (529:42): [True: 0, False: 3]
  ------------------
  530|      0|        CURL_TRC_CF(data, cf, "[%" PRId64 "] error after response headers, "
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  531|      0|                    "but we did not want a body anyway, ignore error 0x%"
  532|      0|                    PRIx64 " %s", stream->id, stream->error3,
  533|      0|                    Curl_vquic_h3_err_str(stream->error3));
  534|      0|        return CURLE_OK;
  535|      0|    }
  536|    184|    failf(data, "HTTP/3 stream %" PRId64 " reset by server (error 0x%" PRIx64
  ------------------
  |  |   62|    184|#define failf Curl_failf
  ------------------
  537|    184|          " %s)", stream->id, stream->error3,
  538|    184|          Curl_vquic_h3_err_str(stream->error3));
  539|    184|    return data->req.bytecount ? CURLE_PARTIAL_FILE : CURLE_HTTP3;
  ------------------
  |  Branch (539:12): [True: 3, False: 181]
  ------------------
  540|    184|  }
  541|    532|  else if(!stream->resp_hds_complete) {
  ------------------
  |  Branch (541:11): [True: 0, False: 532]
  ------------------
  542|      0|    failf(data,
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  543|      0|          "HTTP/3 stream %" PRId64 " was closed cleanly, but before "
  544|      0|          "getting all response header fields, treated as error",
  545|      0|          stream->id);
  546|      0|    return CURLE_HTTP3;
  547|      0|  }
  548|    532|  return CURLE_OK;
  549|    716|}
cf-ngtcp2.c:cf_ngtcp2_cntrl:
  990|  13.5k|{
  991|  13.5k|  CURLcode result = CURLE_OK;
  992|  13.5k|  struct cf_call_data save;
  993|       |
  994|  13.5k|  CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  656|  13.5k|  do { \
  |  |  657|  13.5k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  157|  13.5k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  658|  13.5k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  13.5k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  659|  13.5k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  157|  13.5k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  660|  13.5k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  157|  13.5k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  793|  13.5k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  661|  13.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (661:11): [Folded, False: 13.5k]
  |  |  ------------------
  ------------------
  |  Branch (994:3): [True: 13.5k, False: 0]
  |  Branch (994:3): [True: 0, False: 0]
  |  Branch (994:3): [True: 13.5k, False: 0]
  |  Branch (994:3): [True: 0, False: 0]
  ------------------
  995|  13.5k|  switch(event) {
  996|      0|  case CF_CTRL_DATA_SETUP:
  ------------------
  |  |  115|      0|#define CF_CTRL_DATA_SETUP              4  /* 0          NULL     first fail */
  ------------------
  |  Branch (996:3): [True: 0, False: 13.5k]
  ------------------
  997|      0|    break;
  998|      0|  case CF_CTRL_DATA_PAUSE:
  ------------------
  |  |  117|      0|#define CF_CTRL_DATA_PAUSE              6  /* on/off     NULL     first fail */
  ------------------
  |  Branch (998:3): [True: 0, False: 13.5k]
  ------------------
  999|      0|    result = h3_data_pause(cf, data, (arg1 != 0));
 1000|      0|    break;
 1001|  2.81k|  case CF_CTRL_DATA_DONE:
  ------------------
  |  |  118|  2.81k|#define CF_CTRL_DATA_DONE               7  /* premature  NULL     ignored */
  ------------------
  |  Branch (1001:3): [True: 2.81k, False: 10.7k]
  ------------------
 1002|  2.81k|    Curl_cf_ngtcp2_h3_stream_done(cf, data);
 1003|  2.81k|    break;
 1004|  2.47k|  case CF_CTRL_CONN_INFO_UPDATE:
  ------------------
  |  |  121|  2.47k|#define CF_CTRL_CONN_INFO_UPDATE (256 + 0) /* 0          NULL     ignored */
  ------------------
  |  Branch (1004:3): [True: 2.47k, False: 11.0k]
  ------------------
 1005|  2.47k|    if(cf->connected)
  ------------------
  |  Branch (1005:8): [True: 1.95k, False: 516]
  ------------------
 1006|  1.95k|      Curl_conn_set_multiplex(cf->chain, 30);
 1007|  2.47k|    break;
 1008|  8.23k|  default:
  ------------------
  |  Branch (1008:3): [True: 8.23k, False: 5.29k]
  ------------------
 1009|  8.23k|    result = Curl_cf_ngtcp2_cmn_cntrl(cf, data, event, arg1, arg2);
 1010|  8.23k|    break;
 1011|  13.5k|  }
 1012|  13.5k|  CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  664|  13.5k|  do { \
  |  |  665|  13.5k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1016|  13.5k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  666|  13.5k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  13.5k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  667|  13.5k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  157|  13.5k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  668|  13.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (668:11): [Folded, False: 13.5k]
  |  |  ------------------
  ------------------
  |  Branch (1012:3): [True: 0, False: 13.5k]
  |  Branch (1012:3): [True: 13.5k, False: 0]
  |  Branch (1012:3): [True: 13.5k, False: 0]
  |  Branch (1012:3): [True: 0, False: 0]
  |  Branch (1012:3): [True: 13.5k, False: 0]
  |  Branch (1012:3): [True: 0, False: 0]
  ------------------
 1013|  13.5k|  return result;
 1014|  13.5k|}
cf-ngtcp2.c:cf_ngtcp2_query:
 1044|   132k|{
 1045|   132k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
 1046|   132k|  struct cf_call_data save;
 1047|       |
 1048|   132k|  switch(query) {
 1049|  1.94k|  case CF_QUERY_MAX_CONCURRENT: {
  ------------------
  |  |  167|  1.94k|#define CF_QUERY_MAX_CONCURRENT     1  /* number     -        */
  ------------------
  |  Branch (1049:3): [True: 1.94k, False: 130k]
  ------------------
 1050|  1.94k|    DEBUGASSERT(pres1);
  ------------------
  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1050:5): [True: 0, False: 1.94k]
  |  Branch (1050:5): [True: 1.94k, False: 0]
  ------------------
 1051|  1.94k|    CF_DATA_SAVE(save, cf, data);
  ------------------
  |  |  656|  1.94k|  do { \
  |  |  657|  1.94k|    (save) = CF_CTX_CALL_DATA(cf); \
  |  |  ------------------
  |  |  |  |  157|  1.94k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  658|  1.94k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  659|  1.94k|    CF_CTX_CALL_DATA(cf).depth++;  \
  |  |  ------------------
  |  |  |  |  157|  1.94k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  660|  1.94k|    CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  157|  1.94k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |                   CF_CTX_CALL_DATA(cf).data = (struct Curl_easy *)CURL_UNCONST(data); \
  |  |  ------------------
  |  |  |  |  793|  1.94k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  |  |  ------------------
  |  |  661|  1.94k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (661:11): [Folded, False: 1.94k]
  |  |  ------------------
  ------------------
  |  Branch (1051:5): [True: 1.94k, False: 0]
  |  Branch (1051:5): [True: 0, False: 0]
  |  Branch (1051:5): [True: 1.94k, False: 0]
  |  Branch (1051:5): [True: 0, False: 0]
  ------------------
 1052|       |    /* Set after transport params arrived and continually updated
 1053|       |     * by callback. QUIC counts the number over the lifetime of the
 1054|       |     * connection, ever increasing.
 1055|       |     * We count the *open* transfers plus the budget for new ones. */
 1056|  1.94k|    if(!Curl_ngtcp2_valid(&ctx->qconn) || ctx->shutdown_started) {
  ------------------
  |  Branch (1056:8): [True: 376, False: 1.57k]
  |  Branch (1056:43): [True: 0, False: 1.57k]
  ------------------
 1057|    376|      *pres1 = 0;
 1058|    376|    }
 1059|  1.57k|    else if(ctx->max_bidi_streams) {
  ------------------
  |  Branch (1059:13): [True: 1.57k, False: 0]
  ------------------
 1060|  1.57k|      uint64_t avail_bidi_streams = 0;
 1061|  1.57k|      uint64_t max_streams = CF_CONN(cf)->attached_xfers;
  ------------------
  |  |  260|  1.57k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
 1062|  1.57k|      if(ctx->max_bidi_streams > ctx->used_bidi_streams)
  ------------------
  |  Branch (1062:10): [True: 1.57k, False: 0]
  ------------------
 1063|  1.57k|        avail_bidi_streams = ctx->max_bidi_streams - ctx->used_bidi_streams;
 1064|  1.57k|      max_streams += avail_bidi_streams;
 1065|  1.57k|      *pres1 = (max_streams > INT_MAX) ? INT_MAX : (int)max_streams;
  ------------------
  |  Branch (1065:16): [True: 0, False: 1.57k]
  ------------------
 1066|  1.57k|    }
 1067|      0|    else {  /* transport params not arrived yet? take our default. */
 1068|      0|      uint32_t n = Curl_multi_max_concurrent_streams(data->multi);
 1069|      0|      *pres1 = (n < INT_MAX) ? (int)n : INT_MAX;
  ------------------
  |  Branch (1069:16): [True: 0, False: 0]
  ------------------
 1070|      0|    }
 1071|  1.94k|    CURL_TRC_CF(data, cf, "query conn[%" FMT_OFF_T "]: "
  ------------------
  |  |  153|  1.94k|  do {                                          \
  |  |  154|  1.94k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.94k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.89k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.94k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 145, False: 1.80k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.89k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 145, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    145|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.94k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    145|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 145, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 5, False: 140]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.94k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.94k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.94k]
  |  |  ------------------
  ------------------
 1072|  1.94k|                "MAX_CONCURRENT -> %d (%u in use)",
 1073|  1.94k|                CF_CONN(cf)->connection_id, *pres1,
 1074|  1.94k|                CF_CONN(cf)->attached_xfers);
 1075|  1.94k|    CF_DATA_RESTORE(cf, save);
  ------------------
  |  |  664|  1.94k|  do { \
  |  |  665|  1.94k|    DEBUGASSERT(CF_CTX_CALL_DATA(cf).depth == (save).depth + 1); \
  |  |  ------------------
  |  |  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  666|  1.94k|    DEBUGASSERT(!(save).data || (save).depth > 0); \
  |  |  ------------------
  |  |  |  | 1016|  1.94k|#define DEBUGASSERT(x) assert(x)
  |  |  ------------------
  |  |  667|  1.94k|    CF_CTX_CALL_DATA(cf) = (save); \
  |  |  ------------------
  |  |  |  |  157|  1.94k|#define CF_CTX_CALL_DATA(cf) ((struct cf_ngtcp2_ctx *)(cf)->ctx)->call_data
  |  |  ------------------
  |  |  668|  1.94k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (668:11): [Folded, False: 1.94k]
  |  |  ------------------
  ------------------
  |  Branch (1075:5): [True: 0, False: 1.94k]
  |  Branch (1075:5): [True: 1.94k, False: 0]
  |  Branch (1075:5): [True: 1.94k, False: 0]
  |  Branch (1075:5): [True: 0, False: 0]
  |  Branch (1075:5): [True: 1.94k, False: 0]
  |  Branch (1075:5): [True: 0, False: 0]
  ------------------
 1076|  1.94k|    return CURLE_OK;
 1077|  1.94k|  }
 1078|  1.94k|  case CF_QUERY_HTTP_VERSION:
  ------------------
  |  |  173|  1.94k|#define CF_QUERY_HTTP_VERSION       9  /* number (10/11/20/30)   - */
  ------------------
  |  Branch (1078:3): [True: 1.94k, False: 130k]
  ------------------
 1079|  1.94k|    *pres1 = 30;
 1080|  1.94k|    return CURLE_OK;
 1081|      0|  case CF_QUERY_SSL_INFO:
  ------------------
  |  |  178|      0|#define CF_QUERY_SSL_INFO          12  /* -    struct curl_tlssessioninfo * */
  ------------------
  |  Branch (1081:3): [True: 0, False: 132k]
  ------------------
 1082|      0|  case CF_QUERY_SSL_CTX_INFO: {
  ------------------
  |  |  179|      0|#define CF_QUERY_SSL_CTX_INFO      13  /* -    struct curl_tlssessioninfo * */
  ------------------
  |  Branch (1082:3): [True: 0, False: 132k]
  ------------------
 1083|      0|    struct curl_tlssessioninfo *info = pres2;
 1084|      0|    if(Curl_vquic_tls_get_ssl_info(&ctx->tls,
  ------------------
  |  Branch (1084:8): [True: 0, False: 0]
  ------------------
 1085|      0|                                   (query == CF_QUERY_SSL_CTX_INFO), info))
  ------------------
  |  |  179|      0|#define CF_QUERY_SSL_CTX_INFO      13  /* -    struct curl_tlssessioninfo * */
  ------------------
 1086|      0|      return CURLE_OK;
 1087|      0|    break;
 1088|      0|  }
 1089|  1.95k|  case CF_QUERY_ALPN_NEGOTIATED: {
  ------------------
  |  |  181|  1.95k|#define CF_QUERY_ALPN_NEGOTIATED   15  /* -          const char * */
  ------------------
  |  Branch (1089:3): [True: 1.95k, False: 130k]
  ------------------
 1090|  1.95k|    const char **palpn = pres2;
 1091|  1.95k|    DEBUGASSERT(palpn);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1091:5): [True: 0, False: 1.95k]
  |  Branch (1091:5): [True: 1.95k, False: 0]
  ------------------
 1092|  1.95k|    *palpn = cf->connected ? "h3" : NULL;
  ------------------
  |  Branch (1092:14): [True: 1.95k, False: 0]
  ------------------
 1093|  1.95k|    return CURLE_OK;
 1094|  1.95k|  }
 1095|   127k|  default:
  ------------------
  |  Branch (1095:3): [True: 127k, False: 5.85k]
  ------------------
 1096|   127k|    break;
 1097|   132k|  }
 1098|   127k|  return Curl_cf_ngtcp2_cmn_query(cf, data, query, pres1, pres2);
 1099|   132k|}
cf-ngtcp2.c:init_ngh3_conn:
  492|  1.96k|{
  493|  1.96k|  int rc;
  494|       |
  495|  1.96k|  if(Curl_ngtcp2_conn_get_streams_uni_left(&ctx->qconn) < 3) {
  ------------------
  |  Branch (495:6): [True: 0, False: 1.96k]
  ------------------
  496|      0|    failf(data, "QUIC connection lacks 3 uni streams to run HTTP/3");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  497|      0|    return CURLE_QUIC_CONNECT_ERROR;
  498|      0|  }
  499|       |
  500|  1.96k|  nghttp3_settings_default(&ctx->h3settings);
  501|       |
  502|  1.96k|  rc = nghttp3_conn_client_new(&ctx->h3conn,
  503|  1.96k|                               &ngh3_callbacks,
  504|  1.96k|                               &ctx->h3settings,
  505|  1.96k|                               Curl_nghttp3_mem(),
  506|  1.96k|                               cf);
  507|  1.96k|  if(rc) {
  ------------------
  |  Branch (507:6): [True: 0, False: 1.96k]
  ------------------
  508|      0|    failf(data, "error creating nghttp3 connection instance");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  509|      0|    return CURLE_OUT_OF_MEMORY;
  510|      0|  }
  511|       |
  512|  1.96k|  return Curl_cf_ngtcp2_h3_init_ctrls(ctx, data);
  513|  1.96k|}
cf-ngtcp2.c:cb_h3_acked_req_body:
  630|  2.72k|{
  631|  2.72k|  struct h3_stream_ctx *stream = stream_user_data;
  632|  2.72k|  size_t skiplen;
  633|       |
  634|  2.72k|  (void)user_data;
  635|  2.72k|  if(!stream)
  ------------------
  |  Branch (635:6): [True: 0, False: 2.72k]
  ------------------
  636|      0|    return 0;
  637|       |  /* The server acknowledged `datalen` of bytes from our request body.
  638|       |   * This is a delta. We have kept this data in `sendbuf` for
  639|       |   * re-transmissions and can free it now. */
  640|  2.72k|  if(datalen >= (uint64_t)stream->tx_in_flight_size)
  ------------------
  |  Branch (640:6): [True: 454, False: 2.26k]
  ------------------
  641|    454|    skiplen = stream->tx_in_flight_size;
  642|  2.26k|  else
  643|  2.26k|    skiplen = (size_t)datalen;
  644|  2.72k|  Curl_bufq_skip(&stream->sendbuf, skiplen);
  645|  2.72k|  stream->tx_in_flight_size -= skiplen;
  646|       |
  647|       |  /* Resume upload processing if we have more data to send */
  648|  2.72k|  if(stream->tx_in_flight_size < Curl_bufq_len(&stream->sendbuf)) {
  ------------------
  |  Branch (648:6): [True: 9, False: 2.71k]
  ------------------
  649|      9|    int rv = nghttp3_conn_resume_stream(conn, stream_id);
  650|      9|    if(rv && rv != NGHTTP3_ERR_STREAM_NOT_FOUND) {
  ------------------
  |  Branch (650:8): [True: 0, False: 9]
  |  Branch (650:14): [True: 0, False: 0]
  ------------------
  651|      0|      return NGHTTP3_ERR_CALLBACK_FAILURE;
  652|      0|    }
  653|      9|  }
  654|  2.72k|  return 0;
  655|  2.72k|}
cf-ngtcp2.c:cb_h3_stream_close:
  103|    718|{
  104|    718|  struct Curl_cfilter *cf = user_data;
  105|    718|  struct h3_stream_ctx *stream;
  106|    718|  struct Curl_easy *data =
  107|    718|    Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
  108|    718|  (void)conn;
  109|    718|  (void)stream_id;
  110|       |
  111|       |  /* we might be called by nghttp3 after we already cleaned up */
  112|    718|  if(!data || !stream)
  ------------------
  |  Branch (112:6): [True: 0, False: 718]
  |  Branch (112:15): [True: 0, False: 718]
  ------------------
  113|      0|    return 0;
  114|       |
  115|    718|  stream->closed = TRUE;
  ------------------
  |  |  986|    718|#define TRUE true
  ------------------
  116|    718|  stream->error3 = app_error_code;
  117|    718|  if(stream->error3 != NGHTTP3_H3_NO_ERROR) {
  ------------------
  |  Branch (117:6): [True: 184, False: 534]
  ------------------
  118|    184|    stream->reset = TRUE;
  ------------------
  |  |  986|    184|#define TRUE true
  ------------------
  119|    184|    stream->send_closed = TRUE;
  ------------------
  |  |  986|    184|#define TRUE true
  ------------------
  120|    184|    CURL_TRC_CF(data, cf, "[%" PRId64 "] RESET: error %" PRIu64,
  ------------------
  |  |  153|    184|  do {                                          \
  |  |  154|    184|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    184|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    368|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 184, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 22, False: 162]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    368|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 22, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     22|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    184|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     22|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 22, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    184|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    184|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 184]
  |  |  ------------------
  ------------------
  121|    184|                stream->id, stream->error3);
  122|    184|  }
  123|    534|  else {
  124|    534|    CURL_TRC_CF(data, cf, "[%" PRId64 "] CLOSED", stream->id);
  ------------------
  |  |  153|    534|  do {                                          \
  |  |  154|    534|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    534|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  1.06k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 534, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 41, False: 493]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  1.06k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 41, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|     41|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    534|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|     41|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 41, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 3, False: 38]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    534|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    534|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 534]
  |  |  ------------------
  ------------------
  125|    534|  }
  126|    718|  Curl_multi_mark_dirty(data);
  127|    718|  return 0;
  128|    718|}
cf-ngtcp2.c:cb_h3_recv_data:
  220|    117|{
  221|    117|  struct Curl_cfilter *cf = user_data;
  222|    117|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  223|    117|  struct h3_stream_ctx *stream;
  224|    117|  struct Curl_easy *data =
  225|    117|    Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
  226|       |
  227|    117|  (void)conn;
  228|    117|  (void)stream3_id;
  229|       |
  230|    117|  if(!stream || !data)
  ------------------
  |  Branch (230:6): [True: 0, False: 117]
  |  Branch (230:17): [True: 0, False: 117]
  ------------------
  231|      0|    return NGHTTP3_ERR_CALLBACK_FAILURE;
  232|       |
  233|    117|  h3_xfer_write_resp(cf, data, stream, (const char *)buf, buflen, FALSE);
  ------------------
  |  |  989|    117|#define FALSE false
  ------------------
  234|       |
  235|    117|  Curl_ngtcp2_conn_extend_max_offset(&ctx->qconn, buflen);
  236|    117|  stream->rx_offset += buflen;
  237|    117|  if(stream->rx_offset_max < stream->rx_offset)
  ------------------
  |  Branch (237:6): [True: 0, False: 117]
  ------------------
  238|      0|    stream->rx_offset_max = stream->rx_offset;
  239|       |
  240|    117|  CURL_TRC_CF(data, cf, "[%" PRId64 "] DATA len=%zu, rx win=%" PRIu64,
  ------------------
  |  |  153|    117|  do {                                          \
  |  |  154|    117|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|    117|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|    234|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 117, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 3, False: 114]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|    234|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      3|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|    117|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      3|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 3, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|    117|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|    117|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 117]
  |  |  ------------------
  ------------------
  241|    117|              stream->id, buflen, stream->rx_offset_max - stream->rx_offset);
  242|    117|  cf_ngtcp2_upd_rx_win(cf, data, stream);
  243|    117|  return 0;
  244|    117|}
cf-ngtcp2.c:h3_xfer_write_resp:
  154|    117|{
  155|       |  /* This function returns no error intentionally, but records
  156|       |   * the result at the stream, skipping further writes once the
  157|       |   * `result` of the transfer is known.
  158|       |   * The stream is subsequently cancelled "higher up" in the filter's
  159|       |   * send/recv callbacks. Closing the stream here leads to SEND/RECV
  160|       |   * errors in other places that then overwrite the transfer's result. */
  161|    117|  if(!stream->xfer_result) {
  ------------------
  |  Branch (161:6): [True: 117, False: 0]
  ------------------
  162|    117|    stream->xfer_result = Curl_xfer_write_resp(data, buf, buflen, eos);
  163|       |    /* If the transfer write is errored, we do not want any more data */
  164|    117|    if(stream->xfer_result) {
  ------------------
  |  Branch (164:8): [True: 0, False: 117]
  ------------------
  165|      0|      CURL_TRC_CF(data, cf, "[%" PRId64 "] error %d writing %zu bytes of data",
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  166|      0|                  stream->id, (int)stream->xfer_result, buflen);
  167|      0|    }
  168|    117|  }
  169|    117|}
cf-ngtcp2.c:cb_h3_recv_header:
  342|  2.14k|{
  343|  2.14k|  struct Curl_cfilter *cf = user_data;
  344|  2.14k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  345|  2.14k|  nghttp3_vec h3name = nghttp3_rcbuf_get_buf(name);
  346|  2.14k|  nghttp3_vec h3val = nghttp3_rcbuf_get_buf(value);
  347|  2.14k|  struct h3_stream_ctx *stream;
  348|  2.14k|  struct Curl_easy *data =
  349|  2.14k|    Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
  350|  2.14k|  CURLcode result = CURLE_OK;
  351|  2.14k|  (void)conn;
  352|  2.14k|  (void)stream_id;
  353|  2.14k|  (void)token;
  354|  2.14k|  (void)flags;
  355|       |
  356|       |  /* we might have cleaned up this transfer already */
  357|  2.14k|  if(!stream || !data)
  ------------------
  |  Branch (357:6): [True: 0, False: 2.14k]
  |  Branch (357:17): [True: 0, False: 2.14k]
  ------------------
  358|      0|    return 0;
  359|       |
  360|  2.14k|  if(token == NGHTTP3_QPACK_TOKEN__STATUS) {
  ------------------
  |  Branch (360:6): [True: 1.14k, False: 997]
  ------------------
  361|       |
  362|  1.14k|    result = Curl_http_decode_status(&stream->status_code,
  363|  1.14k|                                     (const char *)h3val.base, h3val.len);
  364|  1.14k|    if(result)
  ------------------
  |  Branch (364:8): [True: 0, False: 1.14k]
  ------------------
  365|      0|      return NGHTTP3_ERR_CALLBACK_FAILURE;
  366|  1.14k|    curlx_dyn_reset(&ctx->scratch);
  367|  1.14k|    result = curlx_dyn_addn(&ctx->scratch, STRCONST("HTTP/3 "));
  ------------------
  |  | 1324|  1.14k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.14k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  368|  1.14k|    if(!result)
  ------------------
  |  Branch (368:8): [True: 1.14k, False: 0]
  ------------------
  369|  1.14k|      result = curlx_dyn_addn(&ctx->scratch,
  370|  1.14k|                              (const char *)h3val.base, h3val.len);
  371|  1.14k|    if(!result)
  ------------------
  |  Branch (371:8): [True: 1.14k, False: 0]
  ------------------
  372|  1.14k|      result = curlx_dyn_addn(&ctx->scratch, STRCONST(" \r\n"));
  ------------------
  |  | 1324|  1.14k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.14k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  373|  1.14k|    if(!result)
  ------------------
  |  Branch (373:8): [True: 1.14k, False: 0]
  ------------------
  374|  1.14k|      h3_xfer_write_resp_hd(cf, data, stream, curlx_dyn_ptr(&ctx->scratch),
  375|  1.14k|                            curlx_dyn_len(&ctx->scratch), FALSE);
  ------------------
  |  |  989|  1.14k|#define FALSE false
  ------------------
  376|  1.14k|    CURL_TRC_CF(data, cf, "[%" PRId64 "] status: %s",
  ------------------
  |  |  153|  1.14k|  do {                                          \
  |  |  154|  1.14k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.14k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  2.29k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.14k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 146, False: 1.00k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.29k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 146, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    146|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.14k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    146|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 146, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 12, False: 134]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.14k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.14k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.14k]
  |  |  ------------------
  ------------------
  377|  1.14k|                stream_id, curlx_dyn_ptr(&ctx->scratch));
  378|  1.14k|    if(result) {
  ------------------
  |  Branch (378:8): [True: 0, False: 1.14k]
  ------------------
  379|      0|      return NGHTTP3_ERR_CALLBACK_FAILURE;
  380|      0|    }
  381|  1.14k|  }
  382|    997|  else {
  383|       |    /* store as an HTTP1-style header */
  384|    997|    cf_h3_write_field(cf, data, stream, &h3name, &h3val, FALSE);
  ------------------
  |  |  989|    997|#define FALSE false
  ------------------
  385|    997|  }
  386|  2.14k|  return 0;
  387|  2.14k|}
cf-ngtcp2.c:h3_xfer_write_resp_hd:
  134|  3.28k|{
  135|       |  /* This function returns no error intentionally, but records
  136|       |   * the result at the stream, skipping further writes once the
  137|       |   * `result` of the transfer is known.
  138|       |   * The stream is subsequently cancelled "higher up" in the filter's
  139|       |   * send/recv callbacks. Closing the stream here leads to SEND/RECV
  140|       |   * errors in other places that then overwrite the transfer's result. */
  141|  3.28k|  if(!stream->xfer_result) {
  ------------------
  |  Branch (141:6): [True: 3.28k, False: 0]
  ------------------
  142|  3.28k|    stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, buflen, eos);
  143|  3.28k|    if(stream->xfer_result)
  ------------------
  |  Branch (143:8): [True: 5, False: 3.28k]
  ------------------
  144|      5|      CURL_TRC_CF(data, cf, "[%" PRId64 "] error %d writing %zu "
  ------------------
  |  |  153|      5|  do {                                          \
  |  |  154|      5|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      5|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|     10|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 5, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|     10|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      5|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      5|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      5|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 5]
  |  |  ------------------
  ------------------
  145|  3.28k|                  "bytes of headers", stream->id, (int)stream->xfer_result,
  146|  3.28k|                  buflen);
  147|  3.28k|  }
  148|  3.28k|}
cf-ngtcp2.c:cf_h3_write_field:
  300|  1.15k|{
  301|  1.15k|  struct cf_ngtcp2_ctx *ctx = cf->ctx;
  302|       |
  303|  1.15k|  if(stream->xfer_result)
  ------------------
  |  Branch (303:6): [True: 0, False: 1.15k]
  ------------------
  304|      0|    return;
  305|  1.15k|  curlx_dyn_reset(&ctx->scratch);
  306|  1.15k|  stream->xfer_result = curlx_dyn_addn(&ctx->scratch,
  307|  1.15k|                                       (const char *)name->base, name->len);
  308|  1.15k|  if(!stream->xfer_result)
  ------------------
  |  Branch (308:6): [True: 1.15k, False: 0]
  ------------------
  309|  1.15k|    stream->xfer_result = curlx_dyn_addn(&ctx->scratch, STRCONST(": "));
  ------------------
  |  | 1324|  1.15k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.15k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  310|  1.15k|  if(!stream->xfer_result)
  ------------------
  |  Branch (310:6): [True: 1.15k, False: 0]
  ------------------
  311|  1.15k|    stream->xfer_result = curlx_dyn_addn(
  312|  1.15k|      &ctx->scratch, (const char *)value->base, value->len);
  313|  1.15k|  if(!stream->xfer_result)
  ------------------
  |  Branch (313:6): [True: 1.15k, False: 0]
  ------------------
  314|  1.15k|    stream->xfer_result = curlx_dyn_addn(&ctx->scratch, STRCONST("\r\n"));
  ------------------
  |  | 1324|  1.15k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.15k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  315|  1.15k|  if(stream->xfer_result)
  ------------------
  |  Branch (315:6): [True: 0, False: 1.15k]
  ------------------
  316|      0|    return;
  317|       |
  318|  1.15k|  CURL_TRC_CF(data, cf, "[%" PRId64 "] %s: %.*s: %.*s",
  ------------------
  |  |  153|  1.15k|  do {                                          \
  |  |  154|  1.15k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.15k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  2.30k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.15k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 484, False: 666]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.30k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 484, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    484|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.15k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    484|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 484, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 484]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.15k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (155:35): [True: 0, False: 0]
  |  |  ------------------
  |  |  156|  1.15k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.15k]
  |  |  ------------------
  ------------------
  319|  1.15k|              stream->id, is_trailer ? "trailer" : "header",
  320|  1.15k|              (int)name->len, name->base,
  321|  1.15k|              (int)value->len, value->base);
  322|  1.15k|  if(is_trailer) {
  ------------------
  |  Branch (322:6): [True: 153, False: 997]
  ------------------
  323|    153|    Curl_debug(data, CURLINFO_HEADER_IN, curlx_dyn_ptr(&ctx->scratch),
  324|    153|               curlx_dyn_len(&ctx->scratch));
  325|    153|    stream->xfer_result =
  326|    153|      Curl_client_write(data, CLIENTWRITE_HEADER | CLIENTWRITE_TRAILER,
  ------------------
  |  |   45|    153|#define CLIENTWRITE_HEADER  (1 << 2) /* meta information, HEADER */
  ------------------
                    Curl_client_write(data, CLIENTWRITE_HEADER | CLIENTWRITE_TRAILER,
  ------------------
  |  |   49|    153|#define CLIENTWRITE_TRAILER (1 << 6) /* a trailer HEADER */
  ------------------
  327|    153|                        curlx_dyn_ptr(&ctx->scratch),
  328|    153|                        curlx_dyn_len(&ctx->scratch));
  329|    153|    if(!stream->xfer_result)
  ------------------
  |  Branch (329:8): [True: 153, False: 0]
  ------------------
  330|    153|      stream->xfer_result =
  331|    153|        Curl_bump_headersize(data, curlx_dyn_len(&ctx->scratch), FALSE);
  ------------------
  |  |  989|    153|#define FALSE false
  ------------------
  332|    153|  }
  333|    997|  else
  334|    997|    h3_xfer_write_resp_hd(cf, data, stream, curlx_dyn_ptr(&ctx->scratch),
  335|       |                          curlx_dyn_len(&ctx->scratch), FALSE);
  ------------------
  |  |  989|    997|#define FALSE false
  ------------------
  336|  1.15k|}
cf-ngtcp2.c:cb_h3_end_headers:
  270|  1.14k|{
  271|  1.14k|  struct Curl_cfilter *cf = user_data;
  272|  1.14k|  struct h3_stream_ctx *stream;
  273|  1.14k|  struct Curl_easy *data =
  274|  1.14k|    Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
  275|  1.14k|  (void)conn;
  276|  1.14k|  (void)stream_id;
  277|  1.14k|  (void)fin;
  278|       |
  279|  1.14k|  if(!stream || !data)
  ------------------
  |  Branch (279:6): [True: 0, False: 1.14k]
  |  Branch (279:17): [True: 0, False: 1.14k]
  ------------------
  280|      0|    return 0;
  281|       |  /* add a CRLF only if we have received some headers */
  282|  1.14k|  h3_xfer_write_resp_hd(cf, data, stream, STRCONST("\r\n"),
  ------------------
  |  | 1324|  1.14k|#define STRCONST(x) x, CURL_CSTRLEN(x)
  |  |  ------------------
  |  |  |  | 1319|  1.14k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  |  |  ------------------
  ------------------
  283|  1.14k|                        (bool)stream->closed);
  284|       |
  285|  1.14k|  CURL_TRC_CF(data, cf, "[%" PRId64 "] end_headers, status=%d",
  ------------------
  |  |  153|  1.14k|  do {                                          \
  |  |  154|  1.14k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.14k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  2.28k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.14k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 146, False: 995]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.28k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 146, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    146|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.14k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    146|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 146, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 12, False: 134]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.14k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.14k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.14k]
  |  |  ------------------
  ------------------
  286|  1.14k|              stream_id, stream->status_code);
  287|  1.14k|  if(stream->status_code / 100 != 1) {
  ------------------
  |  Branch (287:6): [True: 634, False: 507]
  ------------------
  288|       |    stream->resp_hds_complete = TRUE;
  ------------------
  |  |  986|    634|#define TRUE true
  ------------------
  289|    634|  }
  290|  1.14k|  Curl_multi_mark_dirty(data);
  291|  1.14k|  return 0;
  292|  1.14k|}
cf-ngtcp2.c:cb_h3_recv_trailer:
  393|    153|{
  394|    153|  struct Curl_cfilter *cf = user_data;
  395|    153|  nghttp3_vec h3name = nghttp3_rcbuf_get_buf(name);
  396|    153|  nghttp3_vec h3val = nghttp3_rcbuf_get_buf(value);
  397|    153|  struct h3_stream_ctx *stream;
  398|    153|  struct Curl_easy *data =
  399|    153|    Curl_cf_ngtcp2_get_xfer(cf, stream_user_data, &stream);
  400|       |
  401|    153|  (void)conn;
  402|    153|  (void)stream_id;
  403|    153|  (void)token;
  404|    153|  (void)flags;
  405|       |  /* we might have cleaned up this transfer already */
  406|    153|  if(!stream || !data || stream->xfer_result)
  ------------------
  |  Branch (406:6): [True: 0, False: 153]
  |  Branch (406:17): [True: 0, False: 153]
  |  Branch (406:26): [True: 0, False: 153]
  ------------------
  407|      0|    return 0;
  408|       |
  409|    153|  cf_h3_write_field(cf, data, stream, &h3name, &h3val, TRUE);
  ------------------
  |  |  986|    153|#define TRUE true
  ------------------
  410|    153|  return 0;
  411|    153|}

Curl_ngtcp2_valid:
  117|  1.94k|{
  118|  1.94k|  return ntp2->conn && (ntp2->state != CURL_NGTCP2_CLOSE_ONLY);
  ------------------
  |  Branch (118:10): [True: 1.94k, False: 0]
  |  Branch (118:24): [True: 1.57k, False: 376]
  ------------------
  119|  1.94k|}
Curl_ngtcp2_restricted:
  122|  1.96k|{
  123|  1.96k|  return ntp2->conn && (ntp2->state != CURL_NGTCP2_NORMAL);
  ------------------
  |  Branch (123:10): [True: 1.96k, False: 0]
  |  Branch (123:24): [True: 378, False: 1.59k]
  ------------------
  124|  1.96k|}
Curl_ngtcp2_conn:
  127|   588k|{
  128|   588k|  return ntp2->conn;
  129|   588k|}
Curl_ngtcp2_conn_client_new:
  139|  3.34k|{
  140|  3.34k|  ngtcp2_conn *conn = NULL;
  141|  3.34k|  int rv;
  142|       |
  143|  3.34k|  if(ntp2->conn)
  ------------------
  |  Branch (143:6): [True: 0, False: 3.34k]
  ------------------
  144|      0|    return NGTCP2_ERR_INVALID_STATE;
  145|  3.34k|  ntp2_set_normal(ntp2);
  146|  3.34k|  rv = ngtcp2_conn_client_new(&conn, dcid, scid, path,
  147|  3.34k|                              client_chosen_version, callbacks, settings,
  148|  3.34k|                              params, mem, user_data);
  149|  3.34k|  if(!rv)
  ------------------
  |  Branch (149:6): [True: 3.33k, False: 13]
  ------------------
  150|  3.33k|    ntp2->conn = conn;
  151|  3.34k|  return rv;
  152|  3.34k|}
Curl_ngtcp2_conn_del:
  155|  3.36k|{
  156|  3.36k|  if(ntp2->conn)
  ------------------
  |  Branch (156:6): [True: 3.33k, False: 32]
  ------------------
  157|  3.33k|    ngtcp2_conn_del(ntp2->conn);
  158|  3.36k|  memset(ntp2, 0, sizeof(*ntp2));
  159|  3.36k|}
Curl_ngtcp2_conn_encode_0rtt_transport_params:
  173|  1.90k|{
  174|  1.90k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (174:6): [True: 0, False: 1.90k]
  ------------------
  175|      0|    return ntp2_error(ntp2);
  176|  1.90k|  return ntp2_check_ssize(ntp2,
  177|  1.90k|    ngtcp2_conn_encode_0rtt_transport_params(ntp2->conn, dest, destlen));
  178|  1.90k|}
Curl_ngtcp2_conn_extend_max_offset:
  182|  7.66k|{
  183|  7.66k|  if(ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (183:6): [True: 7.66k, False: 0]
  ------------------
  184|  7.66k|    ngtcp2_conn_extend_max_offset(ntp2->conn, datalen);
  185|  7.66k|}
Curl_ngtcp2_conn_extend_max_stream_offset:
  190|  9.57k|{
  191|  9.57k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (191:6): [True: 0, False: 9.57k]
  ------------------
  192|      0|    return (int)ntp2_error(ntp2);
  193|  9.57k|  return ntp2_check_int(ntp2,
  194|  9.57k|    ngtcp2_conn_extend_max_stream_offset(ntp2->conn, stream_id, datalen));
  195|  9.57k|}
Curl_ngtcp2_conn_get_cwnd_left:
  205|    740|{
  206|    740|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (206:6): [True: 0, False: 740]
  ------------------
  207|      0|    return 0;
  208|    740|  return ngtcp2_conn_get_cwnd_left(ntp2->conn);
  209|    740|}
Curl_ngtcp2_conn_get_expiry:
  212|   127k|{
  213|   127k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (213:6): [True: 378, False: 127k]
  ------------------
  214|    378|    return UINT64_MAX;
  215|   127k|  return ngtcp2_conn_get_expiry(ntp2->conn);
  216|   127k|}
Curl_ngtcp2_conn_get_handshake_completed:
  219|   112k|{
  220|   112k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (220:6): [True: 0, False: 112k]
  ------------------
  221|      0|    return 0;
  222|   112k|  return ngtcp2_conn_get_handshake_completed(ntp2->conn);
  223|   112k|}
Curl_ngtcp2_conn_get_max_data_left:
  226|  30.6k|{
  227|  30.6k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (227:6): [True: 378, False: 30.3k]
  ------------------
  228|    378|    return 0;
  229|  30.3k|  return ngtcp2_conn_get_max_data_left(ntp2->conn);
  230|  30.6k|}
Curl_ngtcp2_conn_get_max_tx_udp_payload_size:
  233|   128k|{
  234|   128k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (234:6): [True: 378, False: 128k]
  ------------------
  235|    378|    return 0;
  236|   128k|  return ngtcp2_conn_get_max_tx_udp_payload_size(ntp2->conn);
  237|   128k|}
Curl_ngtcp2_conn_get_path_max_tx_udp_payload_size:
  241|   237k|{
  242|   237k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (242:6): [True: 378, False: 236k]
  ------------------
  243|    378|    return 0;
  244|   236k|  return ngtcp2_conn_get_path_max_tx_udp_payload_size(ntp2->conn);
  245|   237k|}
Curl_ngtcp2_conn_get_remote_transport_params:
  249|  4.03k|{
  250|  4.03k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (250:6): [True: 378, False: 3.66k]
  ------------------
  251|    378|    return NULL;
  252|  3.66k|  return ngtcp2_conn_get_remote_transport_params(ntp2->conn);
  253|  4.03k|}
Curl_ngtcp2_conn_get_send_quantum:
  256|   128k|{
  257|   128k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (257:6): [True: 378, False: 128k]
  ------------------
  258|    378|    return 0;
  259|   128k|  return ngtcp2_conn_get_send_quantum(ntp2->conn);
  260|   128k|}
Curl_ngtcp2_conn_get_streams_uni_left:
  263|  1.96k|{
  264|  1.96k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (264:6): [True: 0, False: 1.96k]
  ------------------
  265|      0|    return 0;
  266|  1.96k|  return ngtcp2_conn_get_streams_uni_left(ntp2->conn);
  267|  1.96k|}
Curl_ngtcp2_conn_get_tls_alert:
  270|      7|{
  271|      7|  if(!ntp2_allow_terminal(ntp2))
  ------------------
  |  Branch (271:6): [True: 0, False: 7]
  ------------------
  272|      0|    return 0;
  273|      7|  return ngtcp2_conn_get_tls_alert(ntp2->conn);
  274|      7|}
Curl_ngtcp2_conn_handle_expiry:
  287|    294|{
  288|    294|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (288:6): [True: 0, False: 294]
  ------------------
  289|      0|    return (int)ntp2_error(ntp2);
  290|    294|  return ntp2_check_terminal_int(ntp2,
  291|    294|                                 ngtcp2_conn_handle_expiry(ntp2->conn, ts));
  292|    294|}
Curl_ngtcp2_conn_in_draining_period:
  295|    501|{
  296|    501|  if(!ntp2_allow_terminal(ntp2))
  ------------------
  |  Branch (296:6): [True: 0, False: 501]
  ------------------
  297|      0|    return 0;
  298|    501|  return ngtcp2_conn_in_draining_period(ntp2->conn);
  299|    501|}
Curl_ngtcp2_conn_open_bidi_stream:
  304|  1.92k|{
  305|  1.92k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (305:6): [True: 0, False: 1.92k]
  ------------------
  306|      0|    return (int)ntp2_error(ntp2);
  307|  1.92k|  return ntp2_check_int(ntp2,
  308|  1.92k|    ngtcp2_conn_open_bidi_stream(ntp2->conn, pstream_id, stream_user_data));
  309|  1.92k|}
Curl_ngtcp2_conn_open_uni_stream:
  314|  5.88k|{
  315|  5.88k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (315:6): [True: 0, False: 5.88k]
  ------------------
  316|      0|    return (int)ntp2_error(ntp2);
  317|  5.88k|  return ntp2_check_int(ntp2,
  318|  5.88k|    ngtcp2_conn_open_uni_stream(ntp2->conn, pstream_id, stream_user_data));
  319|  5.88k|}
Curl_ngtcp2_conn_read_pkt:
  325|  30.1k|{
  326|  30.1k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (326:6): [True: 0, False: 30.1k]
  ------------------
  327|      0|    return (int)ntp2_error(ntp2);
  328|  30.1k|  return ntp2_check_terminal_int(ntp2,
  329|       |    ngtcp2_conn_read_pkt(ntp2->conn, path, pi, pkt, pktlen, ts));
  330|  30.1k|}
Curl_ngtcp2_conn_set_keep_alive_timeout:
  334|  3.89k|{
  335|  3.89k|  if(ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (335:6): [True: 3.51k, False: 378]
  ------------------
  336|  3.51k|    ngtcp2_conn_set_keep_alive_timeout(ntp2->conn, timeout);
  337|  3.89k|}
Curl_ngtcp2_conn_set_stream_user_data:
  342|  1.22k|{
  343|  1.22k|  if(!ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (343:6): [True: 378, False: 850]
  ------------------
  344|    378|    return (int)ntp2_error(ntp2);
  345|    850|  return ntp2_check_int(ntp2,
  346|    850|    ngtcp2_conn_set_stream_user_data(ntp2->conn, stream_id,
  347|    850|                                     stream_user_data));
  348|  1.22k|}
Curl_ngtcp2_conn_set_tls_native_handle:
  352|  3.33k|{
  353|  3.33k|  if(ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (353:6): [True: 3.33k, False: 0]
  ------------------
  354|  3.33k|    ngtcp2_conn_set_tls_native_handle(ntp2->conn, tls_native_handle);
  355|  3.33k|}
Curl_ngtcp2_conn_shutdown_stream:
  360|  1.22k|{
  361|  1.22k|  if(!ntp2_allow_shutdown(ntp2))
  ------------------
  |  Branch (361:6): [True: 378, False: 850]
  ------------------
  362|    378|    return (int)ntp2_error(ntp2);
  363|    850|  return ntp2_check_int(ntp2,
  364|    850|    ngtcp2_conn_shutdown_stream(ntp2->conn, flags, stream_id,
  365|    850|                                app_error_code));
  366|  1.22k|}
Curl_ngtcp2_conn_update_pkt_tx_time:
  392|  9.56k|{
  393|  9.56k|  if(ntp2_allow_normal(ntp2))
  ------------------
  |  Branch (393:6): [True: 9.56k, False: 0]
  ------------------
  394|  9.56k|    ngtcp2_conn_update_pkt_tx_time(ntp2->conn, ts);
  395|  9.56k|}
Curl_ngtcp2_conn_write_connection_close:
  401|  1.66k|{
  402|  1.66k|  ngtcp2_ssize rv;
  403|       |
  404|  1.66k|  if(!ntp2->conn)
  ------------------
  |  Branch (404:6): [True: 0, False: 1.66k]
  ------------------
  405|      0|    return ntp2_error(ntp2);
  406|  1.66k|  rv = ngtcp2_conn_write_connection_close(ntp2->conn, path, pi, dest,
  407|  1.66k|                                           destlen, ccerr, ts);
  408|  1.66k|  if(rv < 0)
  ------------------
  |  Branch (408:6): [True: 22, False: 1.64k]
  ------------------
  409|     22|    ntp2_set_close_only(ntp2, rv);
  410|  1.64k|  else
  411|  1.64k|    ntp2_set_close_only(ntp2, ntp2->error_rv);
  412|  1.66k|  return rv;
  413|  1.66k|}
Curl_ngtcp2_conn_writev_stream:
  420|   161k|{
  421|   161k|  bool was_coalescing;
  422|   161k|  bool may_coalesce;
  423|   161k|  ngtcp2_ssize rv;
  424|       |
  425|   161k|  if(!ntp2->conn || (ntp2->state == CURL_NGTCP2_CLOSE_ONLY))
  ------------------
  |  Branch (425:6): [True: 0, False: 161k]
  |  Branch (425:21): [True: 378, False: 160k]
  ------------------
  426|    378|    return ntp2_error(ntp2);
  427|       |
  428|   160k|  was_coalescing = ntp2->state == CURL_NGTCP2_COALESCING;
  429|   160k|  if(was_coalescing && ((ntp2->path != path) || (ntp2->pi != pi) ||
  ------------------
  |  Branch (429:6): [True: 8.96k, False: 151k]
  |  Branch (429:25): [True: 0, False: 8.96k]
  |  Branch (429:49): [True: 0, False: 8.96k]
  ------------------
  430|  8.96k|                        (ntp2->dest != dest) ||
  ------------------
  |  Branch (430:25): [True: 0, False: 8.96k]
  ------------------
  431|  8.96k|                        (ntp2->destlen != destlen) || (ntp2->ts != ts))) {
  ------------------
  |  Branch (431:25): [True: 0, False: 8.96k]
  |  Branch (431:55): [True: 0, False: 8.96k]
  ------------------
  432|      0|    ntp2_set_close_only(ntp2, NGTCP2_ERR_INVALID_ARGUMENT);
  433|      0|    return ntp2_error(ntp2);
  434|      0|  }
  435|       |
  436|   160k|  rv = ngtcp2_conn_writev_stream(ntp2->conn, path, pi, dest, destlen,
  437|   160k|                                  pdatalen, flags, stream_id, datav,
  438|   160k|                                  datavcnt, ts);
  439|   160k|  if(rv < NGTCP2_ERR_FATAL)
  ------------------
  |  Branch (439:6): [True: 23, False: 160k]
  ------------------
  440|     23|    ntp2_set_close_only(ntp2, rv);
  441|   160k|  if(ntp2->state == CURL_NGTCP2_CLOSE_ONLY)
  ------------------
  |  Branch (441:6): [True: 23, False: 160k]
  ------------------
  442|     23|    return ntp2_error(ntp2);
  443|       |
  444|   160k|  may_coalesce = was_coalescing || !!(flags & NGTCP2_WRITE_STREAM_FLAG_MORE);
  ------------------
  |  Branch (444:18): [True: 8.96k, False: 151k]
  |  Branch (444:36): [True: 151k, False: 0]
  ------------------
  445|   160k|  if((rv < 0) && may_coalesce && !ntp2_is_continuation(rv)) {
  ------------------
  |  Branch (445:6): [True: 8.96k, False: 151k]
  |  Branch (445:18): [True: 8.96k, False: 0]
  |  Branch (445:34): [True: 0, False: 8.96k]
  ------------------
  446|      0|    ntp2_set_close_only(ntp2, rv);
  447|      0|    return rv;
  448|      0|  }
  449|       |
  450|   160k|  if(may_coalesce && ntp2_is_continuation(rv)) {
  ------------------
  |  Branch (450:6): [True: 160k, False: 0]
  |  Branch (450:22): [True: 8.96k, False: 151k]
  ------------------
  451|  8.96k|    ntp2->path = path;
  452|  8.96k|    ntp2->pi = pi;
  453|  8.96k|    ntp2->dest = dest;
  454|  8.96k|    ntp2->destlen = destlen;
  455|  8.96k|    ntp2->ts = ts;
  456|  8.96k|    ntp2->error_rv = 0;
  457|  8.96k|    ntp2->state = CURL_NGTCP2_COALESCING;
  458|  8.96k|  }
  459|   151k|  else
  460|   151k|    ntp2_set_normal(ntp2);
  461|   160k|  return rv;
  462|   160k|}
ngtcp2_shim.c:ntp2_set_normal:
   42|   155k|{
   43|   155k|  ntp2_clear_tuple(ntp2);
   44|   155k|  ntp2->error_rv = 0;
   45|   155k|  ntp2->state = CURL_NGTCP2_NORMAL;
   46|   155k|}
ngtcp2_shim.c:ntp2_clear_tuple:
   33|   157k|{
   34|   157k|  ntp2->path = NULL;
   35|   157k|  ntp2->pi = NULL;
   36|       |  ntp2->dest = NULL;
   37|   157k|  ntp2->destlen = 0;
   38|   157k|  ntp2->ts = 0;
   39|   157k|}
ngtcp2_shim.c:ntp2_allow_normal:
   63|   846k|{
   64|   846k|  if(ntp2->conn && (ntp2->state == CURL_NGTCP2_NORMAL))
  ------------------
  |  Branch (64:6): [True: 846k, False: 0]
  |  Branch (64:20): [True: 843k, False: 3.02k]
  ------------------
   65|   843k|    return TRUE;
  ------------------
  |  |  986|   843k|#define TRUE true
  ------------------
   66|  3.02k|  if(ntp2->conn && (ntp2->state == CURL_NGTCP2_COALESCING))
  ------------------
  |  Branch (66:6): [True: 3.02k, False: 0]
  |  Branch (66:20): [True: 0, False: 3.02k]
  ------------------
   67|      0|    ntp2_set_close_only(ntp2, NGTCP2_ERR_INVALID_STATE);
   68|       |  return FALSE;
  ------------------
  |  |  989|  3.02k|#define FALSE false
  ------------------
   69|   846k|}
ngtcp2_shim.c:ntp2_error:
   58|  1.55k|{
   59|  1.55k|  return (ntp2->error_rv < 0) ? ntp2->error_rv : NGTCP2_ERR_INVALID_STATE;
  ------------------
  |  Branch (59:10): [True: 1.55k, False: 0]
  ------------------
   60|  1.55k|}
ngtcp2_shim.c:ntp2_check_int:
   88|  49.5k|{
   89|  49.5k|  if(rv < NGTCP2_ERR_FATAL)
  ------------------
  |  Branch (89:6): [True: 65, False: 49.4k]
  ------------------
   90|     65|    ntp2_set_close_only(ntp2, rv);
   91|  49.5k|  return (ntp2->state == CURL_NGTCP2_CLOSE_ONLY) ? (int)ntp2_error(ntp2) : rv;
  ------------------
  |  Branch (91:10): [True: 396, False: 49.1k]
  ------------------
   92|  49.5k|}
ngtcp2_shim.c:ntp2_check_ssize:
  102|  1.90k|{
  103|  1.90k|  if(rv < NGTCP2_ERR_FATAL)
  ------------------
  |  Branch (103:6): [True: 0, False: 1.90k]
  ------------------
  104|      0|    ntp2_set_close_only(ntp2, rv);
  105|  1.90k|  return (ntp2->state == CURL_NGTCP2_CLOSE_ONLY) ? ntp2_error(ntp2) : rv;
  ------------------
  |  Branch (105:10): [True: 0, False: 1.90k]
  ------------------
  106|  1.90k|}
ngtcp2_shim.c:ntp2_allow_terminal:
   72|    508|{
   73|    508|  if(!ntp2->conn)
  ------------------
  |  Branch (73:6): [True: 0, False: 508]
  ------------------
   74|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
   75|    508|  if(ntp2->state == CURL_NGTCP2_COALESCING) {
  ------------------
  |  Branch (75:6): [True: 0, False: 508]
  ------------------
   76|      0|    ntp2_set_close_only(ntp2, NGTCP2_ERR_INVALID_STATE);
   77|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
   78|      0|  }
   79|    508|  return TRUE;
  ------------------
  |  |  986|    508|#define TRUE true
  ------------------
   80|    508|}
ngtcp2_shim.c:ntp2_check_terminal_int:
   95|  30.4k|{
   96|  30.4k|  if(rv < 0)
  ------------------
  |  Branch (96:6): [True: 394, False: 30.0k]
  ------------------
   97|    394|    ntp2_set_close_only(ntp2, rv);
   98|  30.4k|  return ntp2_check_int(ntp2, rv);
   99|  30.4k|}
ngtcp2_shim.c:ntp2_allow_shutdown:
   83|  1.22k|{
   84|  1.22k|  return ntp2->conn && (ntp2->state != CURL_NGTCP2_CLOSE_ONLY);
  ------------------
  |  Branch (84:10): [True: 1.22k, False: 0]
  |  Branch (84:24): [True: 850, False: 378]
  ------------------
   85|  1.22k|}
ngtcp2_shim.c:ntp2_set_close_only:
   49|  2.14k|{
   50|  2.14k|  ntp2_clear_tuple(ntp2);
   51|  2.14k|  if((ntp2->state != CURL_NGTCP2_CLOSE_ONLY) ||
  ------------------
  |  Branch (51:6): [True: 1.99k, False: 153]
  ------------------
   52|    153|     (ntp2->error_rv >= 0))
  ------------------
  |  Branch (52:6): [True: 0, False: 153]
  ------------------
   53|  1.99k|    ntp2->error_rv = (rv < 0) ? rv : NGTCP2_ERR_INVALID_STATE;
  ------------------
  |  Branch (53:22): [True: 414, False: 1.57k]
  ------------------
   54|  2.14k|  ntp2->state = CURL_NGTCP2_CLOSE_ONLY;
   55|  2.14k|}
ngtcp2_shim.c:ntp2_is_continuation:
  109|   169k|{
  110|   169k|  return (rv == NGTCP2_ERR_WRITE_MORE) ||
  ------------------
  |  Branch (110:10): [True: 17.9k, False: 151k]
  ------------------
  111|   151k|         (rv == NGTCP2_ERR_STREAM_DATA_BLOCKED) ||
  ------------------
  |  Branch (111:10): [True: 0, False: 151k]
  ------------------
  112|   151k|         (rv == NGTCP2_ERR_STREAM_NOT_FOUND) ||
  ------------------
  |  Branch (112:10): [True: 0, False: 151k]
  ------------------
  113|   151k|         (rv == NGTCP2_ERR_STREAM_SHUT_WR);
  ------------------
  |  Branch (113:10): [True: 6, False: 151k]
  ------------------
  114|   169k|}

Curl_vquic_tls_peer_init:
   56|  3.36k|{
   57|  3.36k|  char tls_id[80];
   58|       |
   59|  3.36k|#ifdef USE_OPENSSL
   60|  3.36k|  Curl_ossl_version(tls_id, sizeof(tls_id));
   61|       |#elif defined(USE_GNUTLS)
   62|       |  Curl_gtls_version(tls_id, sizeof(tls_id));
   63|       |#elif defined(USE_WOLFSSL)
   64|       |  Curl_wssl_version(tls_id, sizeof(tls_id));
   65|       |#else
   66|       |#error "no TLS lib in used, should not happen"
   67|       |  return CURLE_FAILED_INIT;
   68|       |#endif
   69|  3.36k|  if(ssl_peer->origin || ssl_peer->peer)
  ------------------
  |  Branch (69:6): [True: 0, False: 3.36k]
  |  Branch (69:26): [True: 0, False: 3.36k]
  ------------------
   70|      0|    Curl_ssl_peer_cleanup(ssl_peer);
   71|  3.36k|  return Curl_ssl_peer_init(ssl_peer, origin, peer, sslc,
   72|  3.36k|                            tls_id, TRNSPRT_QUIC);
  ------------------
  |  |  227|  3.36k|#define TRNSPRT_QUIC 5
  ------------------
   73|  3.36k|}
Curl_vquic_tls_init:
   83|  3.33k|{
   84|  3.33k|#ifdef USE_OPENSSL
   85|  3.33k|  return Curl_ossl_ctx_init(&ctx->ossl, cf, data, ssl_peer, alpns,
   86|  3.33k|                            cb_setup, cb_user_data, NULL, ssl_user_data,
   87|  3.33k|                            session_reuse_cb);
   88|       |#elif defined(USE_GNUTLS)
   89|       |  return Curl_gtls_ctx_init(&ctx->gtls, cf, data, ssl_peer, alpns,
   90|       |                            cb_setup, cb_user_data, ssl_user_data,
   91|       |                            session_reuse_cb);
   92|       |#elif defined(USE_WOLFSSL)
   93|       |  return Curl_wssl_ctx_init(&ctx->wssl, cf, data, ssl_peer, alpns,
   94|       |                            cb_setup, cb_user_data,
   95|       |                            ssl_user_data, session_reuse_cb);
   96|       |#else
   97|       |#error "no TLS lib in used, should not happen"
   98|       |  return CURLE_FAILED_INIT;
   99|       |#endif
  100|  3.33k|}
Curl_vquic_tls_cleanup:
  103|  3.36k|{
  104|  3.36k|#ifdef USE_OPENSSL
  105|  3.36k|  Curl_osslctx_cleanup(&ctx->ossl);
  106|       |#elif defined(USE_GNUTLS)
  107|       |  if(ctx->gtls.session)
  108|       |    gnutls_deinit(ctx->gtls.session);
  109|       |  Curl_gtls_shared_creds_free(&ctx->gtls.shared_creds);
  110|       |#elif defined(USE_WOLFSSL)
  111|       |  if(ctx->wssl.ssl)
  112|       |    wolfSSL_free(ctx->wssl.ssl);
  113|       |  if(ctx->wssl.ssl_ctx)
  114|       |    wolfSSL_CTX_free(ctx->wssl.ssl_ctx);
  115|       |#endif
  116|  3.36k|  memset(ctx, 0, sizeof(*ctx));
  117|  3.36k|}
Curl_vquic_tls_before_recv:
  122|   124k|{
  123|   124k|#ifdef USE_OPENSSL
  124|   124k|  if(!ctx->ossl.x509_store_setup) {
  ------------------
  |  Branch (124:6): [True: 3.30k, False: 121k]
  ------------------
  125|  3.30k|    CURLcode result = Curl_ssl_setup_x509_store(cf, data, &ctx->ossl);
  126|  3.30k|    if(result)
  ------------------
  |  Branch (126:8): [True: 0, False: 3.30k]
  ------------------
  127|      0|      return result;
  128|  3.30k|    ctx->ossl.x509_store_setup = TRUE;
  ------------------
  |  |  986|  3.30k|#define TRUE true
  ------------------
  129|  3.30k|  }
  130|       |#elif defined(USE_WOLFSSL)
  131|       |  if(!ctx->wssl.x509_store_setup) {
  132|       |    CURLcode result = Curl_wssl_setup_x509_store(cf, data, &ctx->wssl);
  133|       |    if(result)
  134|       |      return result;
  135|       |  }
  136|       |#elif defined(USE_GNUTLS)
  137|       |  if(!ctx->gtls.shared_creds->trust_setup) {
  138|       |    CURLcode result = Curl_gtls_client_trust_setup(cf, data, &ctx->gtls);
  139|       |    if(result)
  140|       |      return result;
  141|       |  }
  142|       |#else
  143|       |  (void)ctx;
  144|       |  (void)cf;
  145|       |  (void)data;
  146|       |#endif
  147|   124k|  return CURLE_OK;
  148|   124k|}
Curl_vquic_tls_verify_peer:
  154|  1.95k|{
  155|  1.95k|  struct ssl_filter_config *conn_config;
  156|  1.95k|  CURLcode result = CURLE_OK;
  157|       |
  158|  1.95k|  conn_config = Curl_ssl_cf_get_filter_config(cf);
  159|  1.95k|  if(!conn_config)
  ------------------
  |  Branch (159:6): [True: 0, False: 1.95k]
  ------------------
  160|      0|    return CURLE_FAILED_INIT;
  161|       |
  162|  1.95k|#ifdef USE_OPENSSL
  163|  1.95k|  (void)conn_config;
  164|  1.95k|  result = Curl_ossl_check_peer_cert(cf, data, &ctx->ossl, peer);
  165|       |#elif defined(USE_GNUTLS)
  166|       |  result = Curl_gtls_verifyserver(
  167|       |    cf, data, ctx->gtls.session, conn_config, &data->set.ssl, peer);
  168|       |#elif defined(USE_WOLFSSL)
  169|       |  (void)data;
  170|       |  if(conn_config->verifyhost) {
  171|       |    WOLFSSL_X509 *cert = wolfSSL_get_peer_certificate(ctx->wssl.ssl);
  172|       |    if(!cert)
  173|       |      result = CURLE_OUT_OF_MEMORY;
  174|       |    else if(peer->sni &&
  175|       |            (wolfSSL_X509_check_host(cert, peer->sni, strlen(peer->sni), 0,
  176|       |                                     NULL) == WOLFSSL_FAILURE))
  177|       |      result = CURLE_PEER_FAILED_VERIFICATION;
  178|       |    else if(!peer->sni &&
  179|       |            (wolfSSL_X509_check_ip_asc(cert, peer->origin->hostname,
  180|       |                                       0) == WOLFSSL_FAILURE))
  181|       |      result = CURLE_PEER_FAILED_VERIFICATION;
  182|       |    wolfSSL_X509_free(cert);
  183|       |  }
  184|       |  if(!result)
  185|       |    result = Curl_wssl_verify_pinned(cf, data, &ctx->wssl);
  186|       |#endif
  187|       |  /* on error, remove any session we might have in the pool */
  188|  1.95k|  if(result)
  ------------------
  |  Branch (188:6): [True: 0, False: 1.95k]
  ------------------
  189|      0|    Curl_ssl_scache_remove_all(cf, data, peer->scache_key);
  190|  1.95k|  return result;
  191|  1.95k|}
Curl_vquic_report_handshake:
  220|  1.95k|{
  221|  1.95k|  (void)cf;
  222|  1.95k|#ifdef USE_OPENSSL
  223|  1.95k|  Curl_ossl_report_handshake(data, &ctx->ossl);
  224|       |#elif defined(USE_GNUTLS)
  225|       |  Curl_gtls_report_handshake(data, &ctx->gtls);
  226|       |#elif defined(USE_WOLFSSL)
  227|       |  Curl_wssl_report_handshake(data, &ctx->wssl);
  228|       |#else
  229|       |  (void)data;
  230|       |  (void)ctx;
  231|       |#endif
  232|  1.95k|}

Curl_vquic_init:
   98|      2|{
   99|      2|#if defined(USE_NGTCP2) && defined(OPENSSL_QUIC_API2)
  100|      2|  if(ngtcp2_crypto_ossl_init())
  ------------------
  |  Branch (100:6): [True: 0, False: 2]
  ------------------
  101|      0|    return 0;
  102|      2|#endif
  103|       |
  104|      2|  return 1;
  105|      2|}
Curl_vquic_ctx_init:
  126|  3.34k|{
  127|  3.34k|  Curl_bufq_init2(&qctx->sendbuf, NW_CHUNK_SIZE, NW_SEND_CHUNKS,
  ------------------
  |  |   69|  3.34k|#define NW_CHUNK_SIZE     (64 * 1024)
  ------------------
                Curl_bufq_init2(&qctx->sendbuf, NW_CHUNK_SIZE, NW_SEND_CHUNKS,
  ------------------
  |  |   70|  3.34k|#define NW_SEND_CHUNKS    1
  ------------------
  128|  3.34k|                  BUFQ_OPT_SOFT_LIMIT);
  ------------------
  |  |  111|  3.34k|#define BUFQ_OPT_SOFT_LIMIT  (1 << 0)
  ------------------
  129|  3.34k|#if defined(__linux__) && defined(UDP_SEGMENT) && defined(HAVE_SENDMSG)
  130|  3.34k|  qctx->no_gso = FALSE;
  ------------------
  |  |  989|  3.34k|#define FALSE false
  ------------------
  131|       |#elif defined(HAVE_APPLE_MSG_X)
  132|       |  qctx->no_gso = FALSE;
  133|       |#else
  134|       |  qctx->no_gso = TRUE;
  135|       |#endif
  136|  3.34k|#ifdef DEBUGBUILD
  137|  3.34k|  {
  138|  3.34k|    const char *p = getenv("CURL_DBG_QUIC_WBLOCK");
  139|  3.34k|    if(p) {
  ------------------
  |  Branch (139:8): [True: 0, False: 3.34k]
  ------------------
  140|      0|      curl_off_t l;
  141|      0|      if(!curlx_str_number(&p, &l, 100))
  ------------------
  |  Branch (141:10): [True: 0, False: 0]
  ------------------
  142|      0|        qctx->wblock_percent = (int)l;
  143|      0|    }
  144|  3.34k|  }
  145|  3.34k|#endif
  146|  3.34k|  Curl_vquic_ctx_set_time(qctx, Curl_pgrs_now(data));
  147|       |
  148|  3.34k|  return CURLE_OK;
  149|  3.34k|}
Curl_vquic_ctx_free:
  152|  3.36k|{
  153|  3.36k|  Curl_bufq_free(&qctx->sendbuf);
  154|  3.36k|}
Curl_vquic_ctx_set_time:
  158|   133k|{
  159|   133k|  qctx->last_op = *pnow;
  160|   133k|}
Curl_vquic_ctx_update_time:
  164|   275k|{
  165|   275k|  qctx->last_op = *pnow;
  166|   275k|}
Curl_vquic_flush:
  472|   143k|{
  473|   143k|  const unsigned char *buf;
  474|   143k|  size_t blen, sent;
  475|   143k|  CURLcode result;
  476|   143k|  size_t gsolen;
  477|       |
  478|   162k|  while(Curl_bufq_peek(&qctx->sendbuf, &buf, &blen)) {
  ------------------
  |  Branch (478:9): [True: 18.9k, False: 143k]
  ------------------
  479|  18.9k|    gsolen = qctx->gsolen;
  480|  18.9k|    if(qctx->split_len) {
  ------------------
  |  Branch (480:8): [True: 3.86k, False: 15.0k]
  ------------------
  481|  3.86k|      gsolen = qctx->split_gsolen;
  482|  3.86k|      if(blen > qctx->split_len)
  ------------------
  |  Branch (482:10): [True: 3.86k, False: 0]
  ------------------
  483|  3.86k|        blen = qctx->split_len;
  484|  3.86k|    }
  485|       |
  486|  18.9k|    if(qctx->sockfd != CURL_SOCKET_BAD) {
  ------------------
  |  |  147|  18.9k|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (486:8): [True: 17.5k, False: 1.34k]
  ------------------
  487|       |      /* Direct UDP socket (via happy eyeballs) */
  488|  17.5k|      result = vquic_send_packets(cf, data, qctx, buf, blen, gsolen, &sent);
  489|  17.5k|    }
  490|  1.34k|    else {
  491|       |      /* Tunneled QUIC (CONNECT-UDP through proxy) */
  492|  1.34k|      if(gsolen && (blen > gsolen)) {
  ------------------
  |  Branch (492:10): [True: 1.34k, False: 0]
  |  Branch (492:20): [True: 1.34k, False: 7]
  ------------------
  493|       |        /* Send one datagram at a time to preserve packet boundaries. */
  494|  1.34k|        result = send_packet_no_gso_cf(cf, data, buf, blen, gsolen, &sent);
  495|  1.34k|      }
  496|      7|      else {
  497|       |        /* No GSO aggregate to split, regular lower-filter send is enough. */
  498|      7|        result = Curl_conn_cf_send(cf->next, data, buf, blen, FALSE, &sent);
  ------------------
  |  |  989|      7|#define FALSE false
  ------------------
  499|      7|      }
  500|  1.34k|    }
  501|       |
  502|  18.9k|    if(result) {
  ------------------
  |  Branch (502:8): [True: 4, False: 18.9k]
  ------------------
  503|      4|      if(result == CURLE_AGAIN) {
  ------------------
  |  Branch (503:10): [True: 0, False: 4]
  ------------------
  504|      0|        Curl_bufq_skip(&qctx->sendbuf, sent);
  505|      0|        if(qctx->split_len)
  ------------------
  |  Branch (505:12): [True: 0, False: 0]
  ------------------
  506|      0|          qctx->split_len -= sent;
  507|      0|      }
  508|      4|      return result;
  509|      4|    }
  510|  18.9k|    Curl_bufq_skip(&qctx->sendbuf, sent);
  511|  18.9k|    if(qctx->split_len)
  ------------------
  |  Branch (511:8): [True: 3.86k, False: 15.0k]
  ------------------
  512|  3.86k|      qctx->split_len -= sent;
  513|  18.9k|  }
  514|   143k|  return CURLE_OK;
  515|   143k|}
Curl_vquic_send:
  519|  9.56k|{
  520|  9.56k|  qctx->gsolen = gsolen;
  521|  9.56k|  return Curl_vquic_flush(cf, data, qctx);
  522|  9.56k|}
Curl_vquic_send_tail_split:
  528|  3.86k|{
  529|  3.86k|  DEBUGASSERT(Curl_bufq_len(&qctx->sendbuf) > tail_len);
  ------------------
  |  | 1016|  3.86k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (529:3): [True: 0, False: 3.86k]
  |  Branch (529:3): [True: 3.86k, False: 0]
  ------------------
  530|  3.86k|  qctx->split_len = Curl_bufq_len(&qctx->sendbuf) - tail_len;
  531|  3.86k|  qctx->split_gsolen = gsolen;
  532|  3.86k|  qctx->gsolen = tail_gsolen;
  533|  3.86k|  CURL_TRC_CF(data, cf, "vquic_send_tail_split: [%zu gso=%zu][%zu gso=%zu]",
  ------------------
  |  |  153|  3.86k|  do {                                          \
  |  |  154|  3.86k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.86k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  7.73k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.86k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 284, False: 3.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  7.73k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 284, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    284|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  3.86k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    284|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 284, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 10, False: 274]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.86k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.86k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.86k]
  |  |  ------------------
  ------------------
  534|  3.86k|              qctx->split_len, qctx->split_gsolen, tail_len, qctx->gsolen);
  535|  3.86k|  return Curl_vquic_flush(cf, data, qctx);
  536|  3.86k|}
Curl_vquic_recv_packets:
 1042|  16.0k|{
 1043|  16.0k|  CURLcode result;
 1044|  16.0k|  size_t nread = 0;
 1045|  16.0k|#ifdef HAVE_SENDMMSG
 1046|  16.0k|  result = recvmmsg_packets(cf, data, qctx, max_pkts, recv_cb, userp, &nread);
 1047|       |#elif defined(HAVE_APPLE_MSG_X)
 1048|       |  result = recvmsg_x_packets(cf, data, qctx, max_pkts, recv_cb, userp,
 1049|       |                             &nread);
 1050|       |#elif defined(HAVE_SENDMSG)
 1051|       |  result = recvmsg_packets(cf, data, qctx, max_pkts, recv_cb, userp, &nread);
 1052|       |#else
 1053|       |  result = recvfrom_packets(cf, data, qctx, max_pkts, recv_cb, userp, &nread);
 1054|       |#endif
 1055|  16.0k|  if(!result) {
  ------------------
  |  Branch (1055:6): [True: 15.6k, False: 387]
  ------------------
 1056|       |    /* EAGAIN is no error, only count actual packets as a reply */
 1057|  15.6k|    if(!qctx->got_first_byte && nread) {
  ------------------
  |  Branch (1057:8): [True: 1.96k, False: 13.6k]
  |  Branch (1057:33): [True: 1.96k, False: 0]
  ------------------
 1058|       |      qctx->got_first_byte = TRUE;
  ------------------
  |  |  986|  1.96k|#define TRUE true
  ------------------
 1059|  1.96k|      qctx->first_byte_at = qctx->last_op;
 1060|  1.96k|    }
 1061|  15.6k|    qctx->last_io = qctx->last_op;
 1062|  15.6k|  }
 1063|  16.0k|  return result;
 1064|  16.0k|}
Curl_qlogdir:
 1078|  3.34k|{
 1079|  3.34k|  char *qlog_dir = curl_getenv("QLOGDIR");
 1080|  3.34k|  *qlogfdp = -1;
 1081|  3.34k|  if(qlog_dir) {
  ------------------
  |  Branch (1081:6): [True: 0, False: 3.34k]
  ------------------
 1082|      0|    struct dynbuf fname;
 1083|      0|    CURLcode result;
 1084|      0|    unsigned int i;
 1085|      0|    curlx_dyn_init(&fname, DYN_QLOG_NAME);
  ------------------
  |  |   74|      0|#define DYN_QLOG_NAME       1024
  ------------------
 1086|      0|    result = curlx_dyn_add(&fname, qlog_dir);
 1087|      0|    if(!result)
  ------------------
  |  Branch (1087:8): [True: 0, False: 0]
  ------------------
 1088|      0|      result = curlx_dyn_add(&fname, "/");
 1089|      0|    for(i = 0; (i < scidlen) && !result; i++) {
  ------------------
  |  Branch (1089:16): [True: 0, False: 0]
  |  Branch (1089:33): [True: 0, False: 0]
  ------------------
 1090|      0|      char hex[3];
 1091|      0|      curl_msnprintf(hex, 3, "%02x", scid[i]);
 1092|      0|      result = curlx_dyn_add(&fname, hex);
 1093|      0|    }
 1094|      0|    if(!result)
  ------------------
  |  Branch (1094:8): [True: 0, False: 0]
  ------------------
 1095|      0|      result = curlx_dyn_add(&fname, ".sqlog");
 1096|       |
 1097|      0|    if(!result) {
  ------------------
  |  Branch (1097:8): [True: 0, False: 0]
  ------------------
 1098|      0|      int qlogfd = curlx_open(curlx_dyn_ptr(&fname),
  ------------------
  |  |   72|      0|#define curlx_open              open
  ------------------
 1099|      0|                              O_WRONLY | O_CREAT | O_TRUNC | CURL_O_BINARY,
  ------------------
  |  | 1254|      0|#define CURL_O_BINARY 0
  ------------------
 1100|       |#ifdef _WIN32
 1101|       |                              data->set.new_file_perms & (_S_IREAD | _S_IWRITE)
 1102|       |#else
 1103|      0|                              (mode_t)data->set.new_file_perms
 1104|      0|#endif
 1105|      0|                              );
 1106|      0|      if(qlogfd != -1)
  ------------------
  |  Branch (1106:10): [True: 0, False: 0]
  ------------------
 1107|      0|        *qlogfdp = qlogfd;
 1108|      0|    }
 1109|      0|    curlx_dyn_free(&fname);
 1110|      0|    curlx_free(qlog_dir);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 1111|      0|    if(result)
  ------------------
  |  Branch (1111:8): [True: 0, False: 0]
  ------------------
 1112|      0|      return result;
 1113|      0|  }
 1114|       |
 1115|  3.34k|  return CURLE_OK;
 1116|  3.34k|}
Curl_cf_quic_insert_after:
 1122|  1.38k|{
 1123|  1.38k|  struct Curl_cfilter *cf = NULL;
 1124|  1.38k|  CURLcode result;
 1125|       |
 1126|  1.38k|  (void)data; /* not used in all cases and compilers are stupid */
 1127|  1.38k|#if defined(USE_NGTCP2) && defined(USE_NGHTTP3)
 1128|  1.38k|  result = Curl_cf_ngtcp2_insert_after(cf_at, origin, peer, &cf);
 1129|       |#elif defined(USE_QUICHE)
 1130|       |  result = Curl_cf_quiche_insert_after(cf_at, origin, peer, &cf);
 1131|       |#else
 1132|       |  (void)cf;
 1133|       |  (void)cf_at;
 1134|       |  (void)origin;
 1135|       |  (void)peer;
 1136|       |  result = CURLE_NOT_BUILT_IN;
 1137|       |#endif
 1138|       |
 1139|  1.38k|#if defined(USE_HTTPSRR) && defined(USE_ECH)
 1140|       |  /* When using ECH, kick off the HTTPS-RR resolve */
 1141|  1.38k|  if(!result && (origin->scheme->family == CURLPROTO_HTTP) &&
  ------------------
  |  | 1088|  1.37k|#define CURLPROTO_HTTP    (1L << 0)
  ------------------
  |  Branch (1141:6): [True: 1.37k, False: 8]
  |  Branch (1141:17): [True: 1.37k, False: 0]
  ------------------
 1142|  1.37k|     Curl_ssl_need_httpsrr(cf)) {
  ------------------
  |  Branch (1142:6): [True: 0, False: 1.37k]
  ------------------
 1143|      0|    result = Curl_dns_cf_add_https_resolve(data, cf, origin);
 1144|      0|  }
 1145|  1.38k|#endif /* USE_HTTPSRR && USE_ECH */
 1146|  1.38k|  return result;
 1147|  1.38k|}
Curl_cf_quic_create:
 1157|  1.99k|{
 1158|  1.99k|  (void)transport_peer;
 1159|  1.99k|  (void)tunnel_transport;
 1160|  1.99k|  (void)tunnel_peer;
 1161|  1.99k|  DEBUGASSERT(transport_peer == TRNSPRT_QUIC);
  ------------------
  |  | 1016|  1.99k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1161:3): [True: 0, False: 1.99k]
  |  Branch (1161:3): [True: 1.99k, False: 0]
  ------------------
 1162|  1.99k|#if defined(USE_NGTCP2) && defined(USE_NGHTTP3)
 1163|  1.99k|  return Curl_cf_ngtcp2_create(chain, data, origin, peer, addr);
 1164|       |#elif defined(USE_QUICHE)
 1165|       |  return Curl_cf_quiche_create(chain, data, origin, peer, addr);
 1166|       |#else
 1167|       |  (void)data;
 1168|       |  (void)origin;
 1169|       |  (void)peer;
 1170|       |  (void)addr;
 1171|       |  (void)tunnel_peer;
 1172|       |  (void)tunnel_transport;
 1173|       |  return CURLE_NOT_BUILT_IN;
 1174|       |#endif
 1175|  1.99k|}
Curl_conn_may_http3:
 1230|  18.7k|{
 1231|  18.7k|  if(Curl_conn_get_first_peer(conn)->unix_socket) {
  ------------------
  |  Branch (1231:6): [True: 0, False: 18.7k]
  ------------------
 1232|      0|    failf(data, "HTTP/3 cannot be used over UNIX domain sockets");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1233|      0|    return CURLE_QUIC_CONNECT_ERROR;
 1234|      0|  }
 1235|  18.7k|  if(!(data->state.origin->scheme->flags & PROTOPT_SSL)) {
  ------------------
  |  |  214|  18.7k|#define PROTOPT_SSL (1 << 0)       /* uses SSL */
  ------------------
  |  Branch (1235:6): [True: 0, False: 18.7k]
  ------------------
 1236|      0|    failf(data, "HTTP/3 requested for non-HTTPS URL");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1237|      0|    return CURLE_URL_MALFORMAT;
 1238|      0|  }
 1239|  18.7k|#ifndef CURL_DISABLE_PROXY
 1240|  18.7k|  if(conn->socks_proxy.peer) {
  ------------------
  |  Branch (1240:6): [True: 0, False: 18.7k]
  ------------------
 1241|      0|    failf(data, "HTTP/3 is not supported over a SOCKS proxy");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 1242|      0|    return CURLE_URL_MALFORMAT;
 1243|      0|  }
 1244|       |#else
 1245|       |  (void)conn;
 1246|       |#endif
 1247|       |
 1248|  18.7k|  return CURLE_OK;
 1249|  18.7k|}
Curl_vquic_h3_err_str:
 1253|    184|{
 1254|    184|  if(error_code <= UINT_MAX) {
  ------------------
  |  Branch (1254:6): [True: 181, False: 3]
  ------------------
 1255|    181|    switch((unsigned int)error_code) {
 1256|      0|    case CURL_H3_ERR_NO_ERROR:
  ------------------
  |  Branch (1256:5): [True: 0, False: 181]
  ------------------
 1257|      0|      return "NO_ERROR";
 1258|      0|    case CURL_H3_ERR_GENERAL_PROTOCOL_ERROR:
  ------------------
  |  Branch (1258:5): [True: 0, False: 181]
  ------------------
 1259|      0|      return "GENERAL_PROTOCOL_ERROR";
 1260|      0|    case CURL_H3_ERR_INTERNAL_ERROR:
  ------------------
  |  Branch (1260:5): [True: 0, False: 181]
  ------------------
 1261|      0|      return "INTERNAL_ERROR";
 1262|      0|    case CURL_H3_ERR_STREAM_CREATION_ERROR:
  ------------------
  |  Branch (1262:5): [True: 0, False: 181]
  ------------------
 1263|      0|      return "STREAM_CREATION_ERROR";
 1264|      0|    case CURL_H3_ERR_CLOSED_CRITICAL_STREAM:
  ------------------
  |  Branch (1264:5): [True: 0, False: 181]
  ------------------
 1265|      0|      return "CLOSED_CRITICAL_STREAM";
 1266|      0|    case CURL_H3_ERR_FRAME_UNEXPECTED:
  ------------------
  |  Branch (1266:5): [True: 0, False: 181]
  ------------------
 1267|      0|      return "FRAME_UNEXPECTED";
 1268|      0|    case CURL_H3_ERR_FRAME_ERROR:
  ------------------
  |  Branch (1268:5): [True: 0, False: 181]
  ------------------
 1269|      0|      return "FRAME_ERROR";
 1270|      0|    case CURL_H3_ERR_EXCESSIVE_LOAD:
  ------------------
  |  Branch (1270:5): [True: 0, False: 181]
  ------------------
 1271|      0|      return "EXCESSIVE_LOAD";
 1272|      0|    case CURL_H3_ERR_ID_ERROR:
  ------------------
  |  Branch (1272:5): [True: 0, False: 181]
  ------------------
 1273|      0|      return "ID_ERROR";
 1274|      0|    case CURL_H3_ERR_SETTINGS_ERROR:
  ------------------
  |  Branch (1274:5): [True: 0, False: 181]
  ------------------
 1275|      0|      return "SETTINGS_ERROR";
 1276|      0|    case CURL_H3_ERR_MISSING_SETTINGS:
  ------------------
  |  Branch (1276:5): [True: 0, False: 181]
  ------------------
 1277|      0|      return "MISSING_SETTINGS";
 1278|      0|    case CURL_H3_ERR_REQUEST_REJECTED:
  ------------------
  |  Branch (1278:5): [True: 0, False: 181]
  ------------------
 1279|      0|      return "REQUEST_REJECTED";
 1280|      3|    case CURL_H3_ERR_REQUEST_CANCELLED:
  ------------------
  |  Branch (1280:5): [True: 3, False: 178]
  ------------------
 1281|      3|      return "REQUEST_CANCELLED";
 1282|      0|    case CURL_H3_ERR_REQUEST_INCOMPLETE:
  ------------------
  |  Branch (1282:5): [True: 0, False: 181]
  ------------------
 1283|      0|      return "REQUEST_INCOMPLETE";
 1284|      0|    case CURL_H3_ERR_MESSAGE_ERROR:
  ------------------
  |  Branch (1284:5): [True: 0, False: 181]
  ------------------
 1285|      0|      return "MESSAGE_ERROR";
 1286|      0|    case CURL_H3_ERR_CONNECT_ERROR:
  ------------------
  |  Branch (1286:5): [True: 0, False: 181]
  ------------------
 1287|      0|      return "CONNECT_ERROR";
 1288|      0|    case CURL_H3_ERR_VERSION_FALLBACK:
  ------------------
  |  Branch (1288:5): [True: 0, False: 181]
  ------------------
 1289|      0|      return "VERSION_FALLBACK";
 1290|    178|    default:
  ------------------
  |  Branch (1290:5): [True: 178, False: 3]
  ------------------
 1291|    178|      break;
 1292|    181|    }
 1293|    181|  }
 1294|       |  /* RFC 9114 ch. 8.1 + 9, reserved future error codes that are NO_ERROR */
 1295|    181|  if((error_code >= 0x21) && !((error_code - 0x21) % 0x1f))
  ------------------
  |  Branch (1295:6): [True: 5, False: 176]
  |  Branch (1295:30): [True: 2, False: 3]
  ------------------
 1296|      2|    return "NO_ERROR";
 1297|    179|  return "unknown";
 1298|    181|}
Curl_ngtcp2_mem:
 1336|  3.34k|{
 1337|  3.34k|  return &vquic_ngtcp2_mem;
 1338|  3.34k|}
Curl_nghttp3_mem:
 1350|  1.96k|{
 1351|  1.96k|  return &vquic_nghttp3_mem;
 1352|  1.96k|}
vquic.c:vquic_send_packets:
  445|  17.5k|{
  446|  17.5k|  CURLcode result;
  447|  17.5k|#ifdef DEBUGBUILD
  448|       |  /* simulate network blocking/partial writes */
  449|  17.5k|  if(qctx->wblock_percent > 0) {
  ------------------
  |  Branch (449:6): [True: 0, False: 17.5k]
  ------------------
  450|      0|    unsigned char c;
  451|      0|    *psent = 0;
  452|      0|    Curl_rand(data, &c, 1);
  ------------------
  |  |   35|      0|#define Curl_rand(a, b, c) Curl_rand_bytes(a, TRUE, b, c)
  |  |  ------------------
  |  |  |  |  986|      0|#define TRUE true
  |  |  ------------------
  ------------------
  453|      0|    if(c >= ((100 - qctx->wblock_percent) * 256 / 100)) {
  ------------------
  |  Branch (453:8): [True: 0, False: 0]
  ------------------
  454|      0|      CURL_TRC_CF(data, cf, "vquic_flush() simulate EWOULDBLOCK");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  455|      0|      return CURLE_AGAIN;
  456|      0|    }
  457|      0|  }
  458|  17.5k|#endif
  459|  17.5k|  if(qctx->no_gso && pktlen > gsolen) {
  ------------------
  |  Branch (459:6): [True: 1.63k, False: 15.9k]
  |  Branch (459:22): [True: 0, False: 1.63k]
  ------------------
  460|      0|    result = send_packet_no_gso(cf, data, qctx, pkt, pktlen, gsolen, psent);
  461|      0|  }
  462|  17.5k|  else {
  463|  17.5k|    result = do_sendmsg(cf, data, qctx, pkt, pktlen, gsolen, psent);
  464|  17.5k|  }
  465|  17.5k|  if(!result)
  ------------------
  |  Branch (465:6): [True: 17.5k, False: 0]
  ------------------
  466|  17.5k|    qctx->last_io = qctx->last_op;
  467|  17.5k|  return result;
  468|  17.5k|}
vquic.c:do_sendmsg:
  270|  17.5k|{
  271|  17.5k|  CURLcode result = CURLE_OK;
  272|  17.5k|#ifdef HAVE_SENDMSG
  273|  17.5k|  struct iovec msg_iov;
  274|  17.5k|  struct msghdr msg = { 0 };
  275|  17.5k|  ssize_t rv;
  276|  17.5k|#if defined(__linux__) && defined(UDP_SEGMENT)
  277|  17.5k|  uint8_t msg_ctrl[32];
  278|  17.5k|  struct cmsghdr *cm;
  279|  17.5k|#endif
  280|       |
  281|  17.5k|  *psent = 0;
  282|  17.5k|  msg_iov.iov_base = (uint8_t *)CURL_UNCONST(pkt);
  ------------------
  |  |  793|  17.5k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  283|  17.5k|  msg_iov.iov_len = pktlen;
  284|  17.5k|  msg.msg_iov = &msg_iov;
  285|  17.5k|  msg.msg_iovlen = 1;
  286|       |
  287|  17.5k|#if defined(__linux__) && defined(UDP_SEGMENT)
  288|  17.5k|  if(pktlen > gsolen) {
  ------------------
  |  Branch (288:6): [True: 3.16k, False: 14.4k]
  ------------------
  289|       |    /* Only set this, when we need it. macOS, for example,
  290|       |     * does not seem to like a msg_control of length 0. */
  291|  3.16k|    memset(msg_ctrl, 0, sizeof(msg_ctrl));
  292|  3.16k|    msg.msg_control = msg_ctrl;
  293|  3.16k|    DEBUGASSERT(sizeof(msg_ctrl) >= CMSG_SPACE(sizeof(int)));
  ------------------
  |  | 1016|  3.16k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (293:5): [True: 0, Folded]
  |  Branch (293:5): [True: 3.16k, Folded]
  ------------------
  294|  3.16k|    msg.msg_controllen = CMSG_SPACE(sizeof(int));
  295|  3.16k|    cm = CMSG_FIRSTHDR(&msg);
  ------------------
  |  Branch (295:10): [True: 3.16k, False: 0]
  ------------------
  296|  3.16k|    cm->cmsg_level = SOL_UDP;
  297|  3.16k|    cm->cmsg_type = UDP_SEGMENT;
  298|  3.16k|    cm->cmsg_len = CMSG_LEN(sizeof(uint16_t));
  299|  3.16k|    *(uint16_t *)(void *)CMSG_DATA(cm) = gsolen & 0xffff;
  300|  3.16k|  }
  301|  17.5k|#endif
  302|       |
  303|  17.5k|  while((rv = sendmsg(qctx->sockfd, &msg, 0)) == -1 && SOCKERRNO == SOCKEINTR)
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
                while((rv = sendmsg(qctx->sockfd, &msg, 0)) == -1 && SOCKERRNO == SOCKEINTR)
  ------------------
  |  | 1139|      0|#define SOCKEINTR         EINTR
  ------------------
  |  Branch (303:9): [True: 0, False: 17.5k]
  |  Branch (303:56): [True: 0, False: 0]
  ------------------
  304|      0|    ;
  305|       |
  306|  17.5k|  if(!curlx_sztouz(rv, psent)) {
  ------------------
  |  Branch (306:6): [True: 0, False: 17.5k]
  ------------------
  307|      0|    int sockerr = SOCKERRNO;
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
  308|      0|    if(SOCK_EAGAIN(sockerr))
  ------------------
  |  | 1156|      0|#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
  |  |  ------------------
  |  |  |  | 1147|      0|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  |  |  ------------------
  |  |  |  Branch (1156:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  309|      0|      return CURLE_AGAIN;
  310|      0|    switch(sockerr) {
  311|      0|    case SOCKEMSGSIZE:
  ------------------
  |  | 1142|      0|#define SOCKEMSGSIZE      EMSGSIZE
  ------------------
  |  Branch (311:5): [True: 0, False: 0]
  ------------------
  312|       |      /* UDP datagram is too large; caused by PMTUD. Let it be lost. */
  313|      0|      *psent = pktlen;
  314|      0|      break;
  315|      0|    case EIO:
  ------------------
  |  Branch (315:5): [True: 0, False: 0]
  ------------------
  316|      0|      if(pktlen > gsolen) {
  ------------------
  |  Branch (316:10): [True: 0, False: 0]
  ------------------
  317|       |        /* GSO failure */
  318|      0|        infof(data, "sendmsg() returned %zd (errno %d); disable GSO", rv,
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  319|      0|              sockerr);
  320|      0|        qctx->no_gso = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  321|      0|        return send_packet_no_gso(cf, data, qctx, pkt, pktlen, gsolen, psent);
  322|      0|      }
  323|      0|      FALLTHROUGH();
  ------------------
  |  |  752|      0|#  define FALLTHROUGH()  __attribute__((fallthrough))
  ------------------
  324|      0|    default:
  ------------------
  |  Branch (324:5): [True: 0, False: 0]
  ------------------
  325|      0|      failf(data, "sendmsg() returned %zd (errno %d)", rv, sockerr);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  326|      0|      result = CURLE_SEND_ERROR;
  327|      0|      goto out;
  328|      0|    }
  329|      0|  }
  330|  17.5k|  else if(pktlen != *psent) {
  ------------------
  |  Branch (330:11): [True: 0, False: 17.5k]
  ------------------
  331|      0|    failf(data, "sendmsg() sent only %zu/%zu bytes", *psent, pktlen);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  332|      0|    result = CURLE_SEND_ERROR;
  333|      0|    goto out;
  334|      0|  }
  335|       |#else
  336|       |  ssize_t rv;
  337|       |  (void)gsolen;
  338|       |
  339|       |  *psent = 0;
  340|       |
  341|       |  while((rv = swrite(qctx->sockfd, pkt, pktlen)) == -1 &&
  342|       |        SOCKERRNO == SOCKEINTR)
  343|       |    ;
  344|       |
  345|       |  if(!curlx_sztouz(rv, psent)) {
  346|       |    if(SOCK_EAGAIN(SOCKERRNO)) {
  347|       |      result = CURLE_AGAIN;
  348|       |      goto out;
  349|       |    }
  350|       |    else {
  351|       |      if(SOCKERRNO != SOCKEMSGSIZE) {
  352|       |        failf(data, "send() returned %zd (errno %d)", rv, SOCKERRNO);
  353|       |        result = CURLE_SEND_ERROR;
  354|       |        goto out;
  355|       |      }
  356|       |      /* UDP datagram is too large; caused by PMTUD. Let it be lost. */
  357|       |      *psent = pktlen;
  358|       |    }
  359|       |  }
  360|       |#endif
  361|       |
  362|  17.5k|out:
  363|  17.5k|  CURL_TRC_CF(data, cf,
  ------------------
  |  |  153|  17.5k|  do {                                          \
  |  |  154|  17.5k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  17.5k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  35.1k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 17.5k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 1.25k, False: 16.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  35.1k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 1.25k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  1.25k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  17.5k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  1.25k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 1.25k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 40, False: 1.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  17.5k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  17.5k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 17.5k]
  |  |  ------------------
  ------------------
  364|  17.5k|              "vquic_%s(len=%zu, gso=%zu, calls=1) -> %d, sent=%zu",
  365|  17.5k|              VQUIC_SEND_METHOD, pktlen, gsolen, (int)result, *psent);
  366|  17.5k|  return result;
  367|  17.5k|}
vquic.c:send_packet_no_gso_cf:
  407|  1.34k|{
  408|  1.34k|  const uint8_t *p, *end = pkt + pktlen;
  409|  1.34k|  size_t sent, len;
  410|  1.34k|  CURLcode result = CURLE_OK;
  411|  1.34k|  VERBOSE(size_t calls = 0);
  ------------------
  |  | 1637|  1.34k|#define VERBOSE(x) x
  ------------------
  412|       |
  413|  1.34k|  *psent = 0;
  414|       |
  415|       |  /* Send one datagram-sized chunk per call into the lower filter. */
  416|  4.01k|  for(p = pkt; p < end; p += len) {
  ------------------
  |  Branch (416:16): [True: 2.67k, False: 1.33k]
  ------------------
  417|  2.67k|    len = CURLMIN(gsolen, (size_t)(end - p));
  ------------------
  |  | 1315|  2.67k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 1.34k, False: 1.33k]
  |  |  ------------------
  ------------------
  418|  2.67k|    result = Curl_conn_cf_send(cf->next, data, p, len, FALSE, &sent);
  ------------------
  |  |  989|  2.67k|#define FALSE false
  ------------------
  419|       |    /* Report forward progress even if we return CURLE_AGAIN later. */
  420|  2.67k|    VERBOSE(++calls);
  ------------------
  |  | 1637|  2.67k|#define VERBOSE(x) x
  ------------------
  421|       |    /* Preserve lower-filter errors (including CURLE_AGAIN). */
  422|  2.67k|    if(result)
  ------------------
  |  Branch (422:8): [True: 4, False: 2.67k]
  ------------------
  423|      4|      goto out;
  424|       |
  425|  2.67k|    if(sent != len) {
  ------------------
  |  Branch (425:8): [True: 0, False: 2.67k]
  ------------------
  426|       |      /* We can only send the complete datagram, not parts. */
  427|      0|      result = CURLE_SEND_ERROR;
  428|      0|      goto out;
  429|      0|    }
  430|  2.67k|    *psent += sent;
  431|  2.67k|  }
  432|       |
  433|  1.34k|out:
  434|  1.34k|  CURL_TRC_CF(data, cf,
  ------------------
  |  |  153|  1.34k|  do {                                          \
  |  |  154|  1.34k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  1.34k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  2.68k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.34k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 193, False: 1.14k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  2.68k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 193, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    193|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  1.34k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    193|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 193, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 64, False: 129]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  1.34k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  1.34k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 1.34k]
  |  |  ------------------
  ------------------
  435|  1.34k|              "vquic_cf_send(len=%zu, gso=%zu, calls=%zu) -> %d, sent=%zu",
  436|  1.34k|              pktlen, gsolen, calls, (int)result, *psent);
  437|  1.34k|  return result;
  438|  1.34k|}
vquic.c:recvmmsg_packets:
  662|  16.0k|{
  663|  16.0k|#if defined(__linux__) && defined(UDP_GRO)
  664|  16.0k|#define MMSG_NUM  16
  665|  16.0k|#define UDP_GRO_CNT_MAX  64
  666|       |#else
  667|       |#define MMSG_NUM  64
  668|       |#define UDP_GRO_CNT_MAX  1
  669|       |#endif
  670|  16.0k|#define MSG_BUF_SIZE  (UDP_GRO_CNT_MAX * 1500)
  671|  16.0k|  struct iovec msg_iov[MMSG_NUM];
  672|  16.0k|  struct mmsghdr mmsg[MMSG_NUM];
  673|  16.0k|  union {
  674|  16.0k|    struct cmsghdr align;
  675|  16.0k|    uint8_t bytes[MMSG_NUM * CMSG_PER_MSG_SIZE];
  676|  16.0k|  } msg_ctrl;
  677|  16.0k|  struct sockaddr_storage remote_addr[MMSG_NUM];
  678|  16.0k|  size_t total_nread = 0, pkts = 0;
  679|  16.0k|#ifdef CURLVERBOSE
  680|  16.0k|  size_t calls = 0;
  681|  16.0k|#endif
  682|  16.0k|  int mcount, i, n;
  683|  16.0k|  char errstr[STRERROR_LEN];
  684|  16.0k|  CURLcode result = CURLE_OK;
  685|  16.0k|  size_t gso_size;
  686|  16.0k|  char *sockbuf = NULL;
  687|  16.0k|  uint8_t (*bufs)[MSG_BUF_SIZE] = NULL;
  688|  16.0k|  uint8_t ecn = 0;
  689|       |
  690|  16.0k|  DEBUGASSERT(max_pkts > 0);
  ------------------
  |  | 1016|  16.0k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (690:3): [True: 0, False: 16.0k]
  |  Branch (690:3): [True: 16.0k, False: 0]
  ------------------
  691|  16.0k|  result = Curl_multi_xfer_sockbuf_borrow(data, MMSG_NUM * MSG_BUF_SIZE,
  ------------------
  |  |  664|  16.0k|#define MMSG_NUM  16
  ------------------
                result = Curl_multi_xfer_sockbuf_borrow(data, MMSG_NUM * MSG_BUF_SIZE,
  ------------------
  |  |  670|  16.0k|#define MSG_BUF_SIZE  (UDP_GRO_CNT_MAX * 1500)
  |  |  ------------------
  |  |  |  |  665|  16.0k|#define UDP_GRO_CNT_MAX  64
  |  |  ------------------
  ------------------
  692|  16.0k|                                          &sockbuf);
  693|  16.0k|  if(result)
  ------------------
  |  Branch (693:6): [True: 0, False: 16.0k]
  ------------------
  694|      0|    goto out;
  695|  16.0k|  bufs = (uint8_t (*)[MSG_BUF_SIZE])sockbuf;
  696|       |
  697|  16.0k|  total_nread = 0;
  698|  24.9k|  while(pkts < max_pkts) {
  ------------------
  |  Branch (698:9): [True: 24.9k, False: 0]
  ------------------
  699|  24.9k|    n = (int)CURLMIN(CURLMIN(MMSG_NUM, IOV_MAX), max_pkts);
  ------------------
  |  | 1315|  49.8k|#define CURLMIN(x, y) ((x) < (y) ? (x) : (y))
  |  |  ------------------
  |  |  |  Branch (1315:24): [True: 24.9k, False: 0]
  |  |  |  Branch (1315:25): [True: 24.9k, Folded]
  |  |  |  Branch (1315:37): [True: 24.9k, Folded]
  |  |  ------------------
  ------------------
  700|  24.9k|    memset(&mmsg, 0, sizeof(mmsg));
  701|   423k|    for(i = 0; i < n; ++i) {
  ------------------
  |  Branch (701:16): [True: 398k, False: 24.9k]
  ------------------
  702|   398k|      msg_iov[i].iov_base = bufs[i];
  703|   398k|      msg_iov[i].iov_len = sizeof(bufs[i]);
  704|   398k|      mmsg[i].msg_hdr.msg_iov = &msg_iov[i];
  705|   398k|      mmsg[i].msg_hdr.msg_iovlen = 1;
  706|   398k|      mmsg[i].msg_hdr.msg_name = &remote_addr[i];
  707|   398k|      mmsg[i].msg_hdr.msg_namelen = sizeof(remote_addr[i]);
  708|   398k|      mmsg[i].msg_hdr.msg_control = &msg_ctrl.bytes[i * CMSG_PER_MSG_SIZE];
  ------------------
  |  |  644|   398k|  (CMSG_SPACE(2 * sizeof(int64_t)) + \
  |  |  645|   398k|   CMSG_SPACE(6 * sizeof(int64_t)) + \
  |  |  646|   398k|   CMSG_SPACE(4 * sizeof(uint32_t)) + \
  |  |  647|   398k|   CMSG_SPACE(sizeof(int)) + \
  |  |  648|   398k|   VQUIC_CMSG_GRO_SPACE)
  |  |  ------------------
  |  |  |  |  634|   398k|#define VQUIC_CMSG_GRO_SPACE CMSG_SPACE(sizeof(int))
  |  |  ------------------
  ------------------
  709|   398k|      mmsg[i].msg_hdr.msg_controllen = CMSG_PER_MSG_SIZE;
  ------------------
  |  |  644|   398k|  (CMSG_SPACE(2 * sizeof(int64_t)) + \
  |  |  645|   398k|   CMSG_SPACE(6 * sizeof(int64_t)) + \
  |  |  646|   398k|   CMSG_SPACE(4 * sizeof(uint32_t)) + \
  |  |  647|   398k|   CMSG_SPACE(sizeof(int)) + \
  |  |  648|   398k|   VQUIC_CMSG_GRO_SPACE)
  |  |  ------------------
  |  |  |  |  634|   398k|#define VQUIC_CMSG_GRO_SPACE CMSG_SPACE(sizeof(int))
  |  |  ------------------
  ------------------
  710|   398k|    }
  711|       |
  712|  24.9k|    while((mcount = recvmmsg(qctx->sockfd, mmsg, n, 0, NULL)) == -1 &&
  ------------------
  |  Branch (712:11): [True: 15.6k, False: 9.26k]
  ------------------
  713|  15.6k|          (SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE))
  ------------------
  |  | 1105|  15.6k|#define SOCKERRNO         errno
  ------------------
                        (SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE))
  ------------------
  |  | 1139|  31.2k|#define SOCKEINTR         EINTR
  ------------------
                        (SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE))
  ------------------
  |  | 1105|  15.6k|#define SOCKERRNO         errno
  ------------------
                        (SOCKERRNO == SOCKEINTR || SOCKERRNO == SOCKEMSGSIZE))
  ------------------
  |  | 1142|  15.6k|#define SOCKEMSGSIZE      EMSGSIZE
  ------------------
  |  Branch (713:12): [True: 0, False: 15.6k]
  |  Branch (713:38): [True: 0, False: 15.6k]
  ------------------
  714|      0|      ;
  715|  24.9k|    if(mcount == -1) {
  ------------------
  |  Branch (715:8): [True: 15.6k, False: 9.26k]
  ------------------
  716|  15.6k|      if(SOCK_EAGAIN(SOCKERRNO)) {
  ------------------
  |  | 1156|  15.6k|#define SOCK_EAGAIN(e) ((e) == SOCKEWOULDBLOCK)
  |  |  ------------------
  |  |  |  | 1147|  15.6k|#define SOCKEWOULDBLOCK   EWOULDBLOCK
  |  |  ------------------
  |  |  |  Branch (1156:24): [True: 15.6k, False: 0]
  |  |  ------------------
  ------------------
  717|  15.6k|        CURL_TRC_CF(data, cf, "ingress, recvmmsg -> EAGAIN");
  ------------------
  |  |  153|  15.6k|  do {                                          \
  |  |  154|  15.6k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  15.6k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  31.2k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 15.6k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 1.84k, False: 13.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  31.2k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 1.84k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|  1.84k|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  15.6k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|  1.84k|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 1.84k, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 47, False: 1.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  15.6k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  15.6k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 15.6k]
  |  |  ------------------
  ------------------
  718|  15.6k|        goto out;
  719|  15.6k|      }
  720|      0|      if(!cf->connected && SOCKERRNO == SOCKECONNREFUSED) {
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
                    if(!cf->connected && SOCKERRNO == SOCKECONNREFUSED) {
  ------------------
  |  | 1136|      0|#define SOCKECONNREFUSED  ECONNREFUSED
  ------------------
  |  Branch (720:10): [True: 0, False: 0]
  |  Branch (720:28): [True: 0, False: 0]
  ------------------
  721|      0|        struct ip_quadruple ip;
  722|      0|        if(!Curl_cf_socket_peek(cf->next, data, NULL, NULL, &ip))
  ------------------
  |  Branch (722:12): [True: 0, False: 0]
  ------------------
  723|      0|          failf(data, "QUIC: connection to %s port %u refused",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  724|      0|                ip.remote_ip, ip.remote_port);
  725|      0|        result = CURLE_COULDNT_CONNECT;
  726|      0|        goto out;
  727|      0|      }
  728|      0|      curlx_strerror(SOCKERRNO, errstr, sizeof(errstr));
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
  729|      0|      failf(data, "QUIC: recvmmsg() unexpectedly returned %d (errno=%d; %s)",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  730|      0|            mcount, SOCKERRNO, errstr);
  ------------------
  |  | 1105|      0|#define SOCKERRNO         errno
  ------------------
  731|      0|      result = CURLE_RECV_ERROR;
  732|      0|      goto out;
  733|      0|    }
  734|       |
  735|  9.26k|    VERBOSE(++calls);
  ------------------
  |  | 1637|  9.26k|#define VERBOSE(x) x
  ------------------
  736|  22.4k|    for(i = 0; i < mcount; ++i) {
  ------------------
  |  Branch (736:16): [True: 13.5k, False: 8.88k]
  ------------------
  737|       |      /* A zero-length UDP packet is no QUIC packet. Ignore. */
  738|  13.5k|      if(!mmsg[i].msg_len) {
  ------------------
  |  Branch (738:10): [True: 0, False: 13.5k]
  ------------------
  739|      0|        ++pkts;
  740|      0|        continue;
  741|      0|      }
  742|  13.5k|      total_nread += mmsg[i].msg_len;
  743|       |
  744|  13.5k|      ecn = vquic_msghdr_get_ecn(&mmsg[i].msg_hdr, remote_addr[i].ss_family);
  745|  13.5k|      gso_size = vquic_msghdr_get_udp_gro(&mmsg[i].msg_hdr);
  746|  13.5k|      if(gso_size == 0)
  ------------------
  |  Branch (746:10): [True: 13.5k, False: 0]
  ------------------
  747|  13.5k|        gso_size = mmsg[i].msg_len;
  748|       |
  749|  13.5k|      result = recv_cb(bufs[i], mmsg[i].msg_len, gso_size,
  750|  13.5k|                       mmsg[i].msg_hdr.msg_name,
  751|  13.5k|                       mmsg[i].msg_hdr.msg_namelen, ecn, userp);
  752|  13.5k|      if(result)
  ------------------
  |  Branch (752:10): [True: 387, False: 13.1k]
  ------------------
  753|    387|        goto out;
  754|  13.1k|      pkts += (mmsg[i].msg_len + gso_size - 1) / gso_size;
  755|  13.1k|    }
  756|  9.26k|  }
  757|       |
  758|  16.0k|out:
  759|  16.0k|  if(total_nread || result)
  ------------------
  |  Branch (759:6): [True: 9.26k, False: 6.76k]
  |  Branch (759:21): [True: 0, False: 6.76k]
  ------------------
  760|  9.26k|    CURL_TRC_CF(data, cf,
  ------------------
  |  |  153|  9.26k|  do {                                          \
  |  |  154|  9.26k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  9.26k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  18.5k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 9.26k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 803, False: 8.46k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  18.5k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 803, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    803|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  9.26k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    803|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 803, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 30, False: 773]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  9.26k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  9.26k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 9.26k]
  |  |  ------------------
  ------------------
  761|  16.0k|                "vquic_recvmmsg(len=%zu, packets=%zu, calls=%zu) -> %d",
  762|  16.0k|                total_nread, pkts, calls, (int)result);
  763|  16.0k|  Curl_multi_xfer_sockbuf_release(data, sockbuf);
  764|  16.0k|  *pnread = total_nread;
  765|  16.0k|  return result;
  766|  16.0k|}
vquic.c:vquic_msghdr_get_ecn:
  577|  13.5k|{
  578|  13.5k|  struct cmsghdr *cmsg;
  579|  13.5k|  switch(family) {
  ------------------
  |  Branch (579:10): [True: 13.5k, False: 0]
  ------------------
  580|  13.5k|  case AF_INET:
  ------------------
  |  Branch (580:3): [True: 13.5k, False: 0]
  ------------------
  581|       |  /* Workaround musl CMSG_NXTHDR issue */
  582|       |#if defined(__clang__) && !defined(__GLIBC__)
  583|       |#pragma clang diagnostic push
  584|       |#pragma clang diagnostic ignored "-Wsign-compare"
  585|       |#pragma clang diagnostic ignored "-Wcast-align"
  586|       |#endif
  587|  13.5k|    for(cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
  ------------------
  |  Branch (587:16): [True: 13.5k, False: 0]
  |  Branch (587:36): [True: 13.5k, False: 0]
  ------------------
  588|       |#if defined(__clang__) && !defined(__GLIBC__)
  589|       |#pragma clang diagnostic pop
  590|       |#endif
  591|  13.5k|      if(cmsg->cmsg_level == IPPROTO_IP &&
  ------------------
  |  Branch (591:10): [True: 13.5k, False: 0]
  ------------------
  592|       |#ifdef __APPLE__
  593|       |          cmsg->cmsg_type == IP_RECVTOS
  594|       |#else
  595|  13.5k|          cmsg->cmsg_type == IP_TOS
  ------------------
  |  Branch (595:11): [True: 13.5k, False: 0]
  ------------------
  596|  13.5k|#endif
  597|  13.5k|          && cmsg->cmsg_len >= CMSG_LEN(sizeof(uint8_t))) {
  ------------------
  |  Branch (597:14): [True: 13.5k, False: 0]
  ------------------
  598|  13.5k|        return *(uint8_t *)(CMSG_DATA(cmsg)) & IPTOS_ECN_MASK;
  599|  13.5k|      }
  600|  13.5k|    }
  601|      0|    break;
  602|      0|  case AF_INET6:
  ------------------
  |  Branch (602:3): [True: 0, False: 13.5k]
  ------------------
  603|       |  /* Workaround musl CMSG_NXTHDR issue */
  604|       |#if defined(__clang__) && !defined(__GLIBC__)
  605|       |#pragma clang diagnostic push
  606|       |#pragma clang diagnostic ignored "-Wsign-compare"
  607|       |#pragma clang diagnostic ignored "-Wcast-align"
  608|       |#endif
  609|      0|    for(cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
  ------------------
  |  Branch (609:16): [True: 0, False: 0]
  |  Branch (609:36): [True: 0, False: 0]
  ------------------
  610|       |#if defined(__clang__) && !defined(__GLIBC__)
  611|       |#pragma clang diagnostic pop
  612|       |#endif
  613|      0|      if(cmsg->cmsg_level == IPPROTO_IPV6 && cmsg->cmsg_type == IPV6_TCLASS &&
  ------------------
  |  Branch (613:10): [True: 0, False: 0]
  |  Branch (613:46): [True: 0, False: 0]
  ------------------
  614|      0|         cmsg->cmsg_len >= CMSG_LEN(sizeof(int))) {
  ------------------
  |  Branch (614:10): [True: 0, False: 0]
  ------------------
  615|      0|        unsigned int tos;
  616|       |
  617|      0|        memcpy(&tos, CMSG_DATA(cmsg), sizeof(int));
  618|       |
  619|      0|        return (uint8_t)(tos & IPTOS_ECN_MASK);
  620|      0|      }
  621|      0|    }
  622|      0|    break;
  623|  13.5k|  }
  624|      0|  return 0;
  625|  13.5k|}
vquic.c:vquic_msghdr_get_udp_gro:
  541|  13.5k|{
  542|  13.5k|  int gso_size = 0;
  543|  13.5k|#if defined(__linux__) && defined(UDP_GRO)
  544|  13.5k|  struct cmsghdr *cmsg;
  545|       |
  546|       |  /* Workaround musl CMSG_NXTHDR issue */
  547|       |#if defined(__clang__) && !defined(__GLIBC__)
  548|       |#pragma clang diagnostic push
  549|       |#pragma clang diagnostic ignored "-Wsign-compare"
  550|       |#pragma clang diagnostic ignored "-Wcast-align"
  551|       |#endif
  552|  27.1k|  for(cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
  ------------------
  |  Branch (552:14): [True: 13.5k, False: 0]
  |  Branch (552:34): [True: 13.5k, False: 13.5k]
  ------------------
  553|       |#if defined(__clang__) && !defined(__GLIBC__)
  554|       |#pragma clang diagnostic pop
  555|       |#endif
  556|  13.5k|    if(cmsg->cmsg_level == SOL_UDP && cmsg->cmsg_type == UDP_GRO &&
  ------------------
  |  Branch (556:8): [True: 0, False: 13.5k]
  |  Branch (556:39): [True: 0, False: 0]
  ------------------
  557|      0|       cmsg->cmsg_len >= CMSG_LEN(sizeof(gso_size))) {
  ------------------
  |  Branch (557:8): [True: 0, False: 0]
  ------------------
  558|      0|      memcpy(&gso_size, CMSG_DATA(cmsg), sizeof(gso_size));
  559|       |
  560|      0|      break;
  561|      0|    }
  562|  13.5k|  }
  563|  13.5k|#endif /* linux && UDP_GRO */
  564|  13.5k|  (void)msg;
  565|       |
  566|  13.5k|  return (size_t)gso_size;
  567|  13.5k|}
vquic.c:vquic_ngtcp2_malloc:
 1304|   108k|{
 1305|   108k|  (void)user_data;
 1306|   108k|  return Curl_cmalloc(size);
 1307|   108k|}
vquic.c:vquic_ngtcp2_free:
 1310|   217k|{
 1311|   217k|  (void)user_data;
 1312|   217k|  Curl_cfree(ptr);
 1313|   217k|}
vquic.c:vquic_ngtcp2_calloc:
 1316|  15.9k|{
 1317|  15.9k|  (void)user_data;
 1318|  15.9k|  return Curl_ccalloc(nmemb, size);
 1319|  15.9k|}
vquic.c:vquic_ngtcp2_realloc:
 1322|  13.5k|{
 1323|  13.5k|  (void)user_data;
 1324|  13.5k|  return Curl_crealloc(ptr, size);
 1325|  13.5k|}

Curl_cert_hostcheck:
  126|  1.95k|{
  127|  1.95k|  if(matchlen > 0 && hostlen > 0)
  ------------------
  |  Branch (127:6): [True: 1.95k, False: 0]
  |  Branch (127:22): [True: 1.95k, False: 0]
  ------------------
  128|  1.95k|    return hostmatch(hostname, hostlen, match, matchlen);
  129|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  130|  1.95k|}
hostcheck.c:hostmatch:
   81|  1.95k|{
   82|  1.95k|  const char *pattern_label_end;
   83|       |
   84|  1.95k|  DEBUGASSERT(pattern);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (84:3): [True: 0, False: 1.95k]
  |  Branch (84:3): [True: 1.95k, False: 0]
  ------------------
   85|  1.95k|  DEBUGASSERT(patternlen);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (85:3): [True: 0, False: 1.95k]
  |  Branch (85:3): [True: 1.95k, False: 0]
  ------------------
   86|  1.95k|  DEBUGASSERT(hostname);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (86:3): [True: 0, False: 1.95k]
  |  Branch (86:3): [True: 1.95k, False: 0]
  ------------------
   87|  1.95k|  DEBUGASSERT(hostlen);
  ------------------
  |  | 1016|  1.95k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (87:3): [True: 0, False: 1.95k]
  |  Branch (87:3): [True: 1.95k, False: 0]
  ------------------
   88|       |
   89|       |  /* normalize the hostname by stripping off a trailing dot. The pattern is
   90|       |     the name from the certificate and is used as is: a trailing dot there
   91|       |     would escape the issuers' name constraints (which the TLS library checked
   92|       |     against the encoded name) while still matching the normalized host */
   93|  1.95k|  if(hostlen > 0 && hostname[hostlen - 1] == '.')
  ------------------
  |  Branch (93:6): [True: 1.95k, False: 0]
  |  Branch (93:21): [True: 0, False: 1.95k]
  ------------------
   94|      0|    hostlen--;
   95|       |
   96|  1.95k|  if(patternlen > 2 && strncmp(pattern, "*.", 2))
  ------------------
  |  Branch (96:6): [True: 1.95k, False: 0]
  |  Branch (96:24): [True: 1.95k, False: 0]
  ------------------
   97|  1.95k|    return pmatch(hostname, hostlen, pattern, patternlen);
   98|       |
   99|       |  /* detect host as IP address or starting with a dot and fail if so */
  100|      0|  else if(Curl_host_is_ipnum(hostname) || (hostlen > 0 && hostname[0] == '.'))
  ------------------
  |  Branch (100:11): [True: 0, False: 0]
  |  Branch (100:44): [True: 0, False: 0]
  |  Branch (100:59): [True: 0, False: 0]
  ------------------
  101|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  102|       |
  103|       |  /* We require at least 2 dots in the pattern to avoid too wide wildcard
  104|       |     match. */
  105|      0|  pattern_label_end = memchr(pattern, '.', patternlen);
  106|      0|  if(!pattern_label_end ||
  ------------------
  |  Branch (106:6): [True: 0, False: 0]
  ------------------
  107|      0|     (memrchr(pattern, '.', patternlen) == pattern_label_end))
  ------------------
  |  Branch (107:6): [True: 0, False: 0]
  ------------------
  108|      0|    return pmatch(hostname, hostlen, pattern, patternlen);
  109|      0|  else {
  110|      0|    const char *hostname_label_end = memchr(hostname, '.', hostlen);
  111|      0|    if(hostname_label_end) {
  ------------------
  |  Branch (111:8): [True: 0, False: 0]
  ------------------
  112|      0|      size_t skiphost = hostname_label_end - hostname;
  113|      0|      size_t skiplen = pattern_label_end - pattern;
  114|      0|      return pmatch(hostname_label_end, hostlen - skiphost,
  115|      0|                    pattern_label_end, patternlen - skiplen);
  116|      0|    }
  117|      0|  }
  118|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  119|      0|}
hostcheck.c:pmatch:
   44|  1.95k|{
   45|  1.95k|  if(hostlen != patternlen)
  ------------------
  |  Branch (45:6): [True: 0, False: 1.95k]
  ------------------
   46|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
   47|  1.95k|  return curl_strnequal(hostname, pattern, hostlen);
   48|  1.95k|}

Curl_tls_keylog_open:
   39|      2|{
   40|      2|  if(!keylog_file_fp) {
  ------------------
  |  Branch (40:6): [True: 2, False: 0]
  ------------------
   41|      2|    keylog_file_name = getenv("SSLKEYLOGFILE");
   42|      2|    if(keylog_file_name) {
  ------------------
  |  Branch (42:8): [True: 2, False: 0]
  ------------------
   43|      2|      keylog_file_fp = curlx_fopen(keylog_file_name, FOPEN_APPENDTEXT);
  ------------------
  |  |   83|      2|#define curlx_fopen(file, mode) curl_dbg_fopen(file, mode, __LINE__, __FILE__)
  ------------------
   44|      2|      if(keylog_file_fp) {
  ------------------
  |  Branch (44:10): [True: 2, False: 0]
  ------------------
   45|       |#ifdef _WIN32
   46|       |        if(setvbuf(keylog_file_fp, NULL, _IONBF, 0))
   47|       |#else
   48|      2|        if(setvbuf(keylog_file_fp, NULL, _IOLBF, 4096))
  ------------------
  |  Branch (48:12): [True: 0, False: 2]
  ------------------
   49|      0|#endif
   50|      0|        {
   51|      0|          curlx_fclose(keylog_file_fp);
  ------------------
  |  |   88|      0|#define curlx_fclose(file)      curl_dbg_fclose(file, __LINE__, __FILE__)
  ------------------
   52|       |          keylog_file_fp = NULL;
   53|      0|        }
   54|      2|      }
   55|      2|    }
   56|      2|  }
   57|      2|}
Curl_tls_keylog_enabled:
   68|  3.33k|{
   69|  3.33k|  return !!keylog_file_fp;
   70|  3.33k|}
Curl_tls_keylog_write_line:
   78|  9.82k|{
   79|       |  /* The current maximum valid keylog line length LF and NUL is 195. */
   80|  9.82k|  size_t linelen;
   81|  9.82k|  char buf[256];
   82|       |
   83|  9.82k|  if(!keylog_file_fp || !line) {
  ------------------
  |  Branch (83:6): [True: 0, False: 9.82k]
  |  Branch (83:25): [True: 0, False: 9.82k]
  ------------------
   84|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
   85|      0|  }
   86|       |
   87|  9.82k|  linelen = strlen(line);
   88|  9.82k|  if(linelen == 0 || linelen > sizeof(buf) - 2) {
  ------------------
  |  Branch (88:6): [True: 0, False: 9.82k]
  |  Branch (88:22): [True: 0, False: 9.82k]
  ------------------
   89|       |    /* Empty line or too big to fit in an LF and NUL. */
   90|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
   91|      0|  }
   92|       |
   93|  9.82k|  memcpy(buf, line, linelen);
   94|  9.82k|  if(line[linelen - 1] != '\n') {
  ------------------
  |  Branch (94:6): [True: 9.82k, False: 0]
  ------------------
   95|  9.82k|    buf[linelen++] = '\n';
   96|  9.82k|  }
   97|  9.82k|  buf[linelen] = '\0';
   98|       |
   99|       |  /* Using fputs here instead of fprintf since libcurl's fprintf replacement
  100|       |     may not be thread-safe. */
  101|  9.82k|  fputs(buf, keylog_file_fp);
  102|       |  return TRUE;
  ------------------
  |  |  986|  9.82k|#define TRUE true
  ------------------
  103|  9.82k|}

Curl_osslctx_cleanup:
 2001|  3.36k|{
 2002|  3.36k|  DEBUGASSERT(octx);
  ------------------
  |  | 1016|  3.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2002:3): [True: 0, False: 3.36k]
  |  Branch (2002:3): [True: 3.36k, False: 0]
  ------------------
 2003|  3.36k|  if(octx->ssl) {
  ------------------
  |  Branch (2003:6): [True: 3.33k, False: 32]
  ------------------
 2004|  3.33k|    SSL_free(octx->ssl);
 2005|  3.33k|    octx->ssl = NULL;
 2006|  3.33k|  }
 2007|  3.36k|  if(octx->ssl_ctx) {
  ------------------
  |  Branch (2007:6): [True: 3.33k, False: 32]
  ------------------
 2008|  3.33k|    SSL_CTX_free(octx->ssl_ctx);
 2009|  3.33k|    octx->ssl_ctx = NULL;
 2010|  3.33k|    octx->x509_store_setup = FALSE;
  ------------------
  |  |  989|  3.33k|#define FALSE false
  ------------------
 2011|  3.33k|  }
 2012|  3.36k|  if(octx->bio_method) {
  ------------------
  |  Branch (2012:6): [True: 0, False: 3.36k]
  ------------------
 2013|      0|    ossl_bio_cf_method_free(octx->bio_method);
 2014|      0|    octx->bio_method = NULL;
 2015|      0|  }
 2016|       |#ifdef USE_OPENSSL_ENGINE
 2017|       |  if(octx->p.engine) {
 2018|       |    ENGINE_finish(octx->p.engine);
 2019|       |    ENGINE_free(octx->p.engine);
 2020|       |    octx->p.engine = NULL;
 2021|       |  }
 2022|       |#endif
 2023|  3.36k|  ossl_provider_cleanup(octx);
 2024|  3.36k|}
Curl_ossl_add_session:
 2585|  1.90k|{
 2586|  1.90k|  struct Curl_ssl_session *sc_session = NULL, *sc_dup = NULL;
 2587|  1.90k|  unsigned char *der_session_buf = NULL;
 2588|  1.90k|  unsigned char *qtp_clone = NULL;
 2589|  1.90k|  CURLcode result = CURLE_OK;
 2590|       |
 2591|  1.90k|  if(psession)
  ------------------
  |  Branch (2591:6): [True: 0, False: 1.90k]
  ------------------
 2592|      0|    *psession = NULL;
 2593|  1.90k|  if(!cf || !data)
  ------------------
  |  Branch (2593:6): [True: 0, False: 1.90k]
  |  Branch (2593:13): [True: 0, False: 1.90k]
  ------------------
 2594|      0|    goto out;
 2595|       |
 2596|  1.90k|  if(Curl_ssl_scache_use(cf, data)) {
  ------------------
  |  Branch (2596:6): [True: 1.90k, False: 0]
  ------------------
 2597|  1.90k|    size_t der_session_size;
 2598|  1.90k|    unsigned char *der_session_ptr;
 2599|  1.90k|    size_t earlydata_max = 0;
 2600|  1.90k|    int ietf_tls_id = SSL_version(octx->ssl);
 2601|       |
 2602|  1.90k|    der_session_size = i2d_SSL_SESSION(session, NULL);
 2603|  1.90k|    if(der_session_size == 0) {
  ------------------
  |  Branch (2603:8): [True: 0, False: 1.90k]
  ------------------
 2604|      0|      result = CURLE_OUT_OF_MEMORY;
 2605|      0|      goto out;
 2606|      0|    }
 2607|       |
 2608|  1.90k|    der_session_buf = der_session_ptr = curlx_malloc(der_session_size);
  ------------------
  |  | 1498|  1.90k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
 2609|  1.90k|    if(!der_session_buf) {
  ------------------
  |  Branch (2609:8): [True: 0, False: 1.90k]
  ------------------
 2610|      0|      result = CURLE_OUT_OF_MEMORY;
 2611|      0|      goto out;
 2612|      0|    }
 2613|       |
 2614|  1.90k|    der_session_size = i2d_SSL_SESSION(session, &der_session_ptr);
 2615|  1.90k|    if(der_session_size == 0) {
  ------------------
  |  Branch (2615:8): [True: 0, False: 1.90k]
  ------------------
 2616|      0|      result = CURLE_OUT_OF_MEMORY;
 2617|      0|      goto out;
 2618|      0|    }
 2619|       |
 2620|  1.90k|#ifdef HAVE_OPENSSL_EARLYDATA
 2621|  1.90k|    earlydata_max = SSL_SESSION_get_max_early_data(session);
 2622|  1.90k|#endif
 2623|  1.90k|    if(quic_tp && quic_tp_len) {
  ------------------
  |  Branch (2623:8): [True: 1.90k, False: 0]
  |  Branch (2623:19): [True: 1.90k, False: 0]
  ------------------
 2624|  1.90k|      qtp_clone = curlx_memdup0((const char *)quic_tp, quic_tp_len);
 2625|  1.90k|      if(!qtp_clone) {
  ------------------
  |  Branch (2625:10): [True: 0, False: 1.90k]
  ------------------
 2626|      0|        result = CURLE_OUT_OF_MEMORY;
 2627|      0|        goto out;
 2628|      0|      }
 2629|  1.90k|    }
 2630|       |
 2631|  1.90k|    result = Curl_ssl_session_create2(der_session_buf, der_session_size,
 2632|  1.90k|                                      ietf_tls_id, alpn,
 2633|  1.90k|                                      (curl_off_t)time(NULL) +
 2634|  1.90k|                                        SSL_SESSION_get_timeout(session),
 2635|  1.90k|                                      earlydata_max, qtp_clone, quic_tp_len,
 2636|  1.90k|                                      &sc_session);
 2637|  1.90k|    der_session_buf = NULL;  /* took ownership of sdata */
 2638|       |#ifdef USE_APPLE_SECTRUST
 2639|       |    if(!result)
 2640|       |      sc_session->sectrust_verified = octx->sectrust_verified;
 2641|       |#endif
 2642|  1.90k|    if(!result && psession &&  /* return a duplicate if asked for and FTP */
  ------------------
  |  Branch (2642:8): [True: 1.90k, False: 0]
  |  Branch (2642:19): [True: 0, False: 1.90k]
  ------------------
 2643|      0|       (CF_CONN(cf)->scheme->family == CURLPROTO_FTP)) {
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
                     (CF_CONN(cf)->scheme->family == CURLPROTO_FTP)) {
  ------------------
  |  | 1090|      0|#define CURLPROTO_FTP     (1L << 2)
  ------------------
  |  Branch (2643:8): [True: 0, False: 0]
  ------------------
 2644|      0|        result = Curl_ssl_session_dup(sc_session, &sc_dup);
 2645|      0|    }
 2646|  1.90k|    if(!result) {
  ------------------
  |  Branch (2646:8): [True: 1.90k, False: 0]
  ------------------
 2647|  1.90k|      result = Curl_ssl_scache_put(cf, data, ssl_peer_key, sc_session);
 2648|       |      /* took ownership of `sc_session` */
 2649|  1.90k|      sc_session = NULL;
 2650|  1.90k|    }
 2651|  1.90k|  }
 2652|       |
 2653|  1.90k|out:
 2654|  1.90k|  curlx_free(der_session_buf);
  ------------------
  |  | 1503|  1.90k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 2655|  1.90k|  if(!result && psession) {
  ------------------
  |  Branch (2655:6): [True: 1.90k, False: 0]
  |  Branch (2655:17): [True: 0, False: 1.90k]
  ------------------
 2656|      0|    *psession = sc_dup;
 2657|       |    sc_dup = NULL;
 2658|      0|  }
 2659|  1.90k|  Curl_ssl_session_destroy(sc_session);
 2660|  1.90k|  Curl_ssl_session_destroy(sc_dup);
 2661|  1.90k|  return result;
 2662|  1.90k|}
Curl_ssl_setup_x509_store:
 3328|  3.30k|{
 3329|  3.30k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 3330|  3.30k|  CURLcode result = CURLE_OK;
 3331|  3.30k|  X509_STORE *cached_store;
 3332|  3.30k|  bool cache_criteria_met, is_empty;
 3333|       |
 3334|       |  /* Consider the X509 store cacheable if it comes from CAfile/CApath,
 3335|       |     or no source is provided and we are falling back to OpenSSL's built-in
 3336|       |     default. */
 3337|  3.30k|  cache_criteria_met = (data->set.ssl_ca_cache_timeout != 0) &&
  ------------------
  |  Branch (3337:24): [True: 3.30k, False: 0]
  ------------------
 3338|  3.30k|    conn_config->verifypeer &&
  ------------------
  |  Branch (3338:5): [True: 3.30k, False: 0]
  ------------------
 3339|  3.30k|    !conn_config->ca_info_blob &&
  ------------------
  |  Branch (3339:5): [True: 15, False: 3.29k]
  ------------------
 3340|     15|    !conn_config->CRLfile &&
  ------------------
  |  Branch (3340:5): [True: 15, False: 0]
  ------------------
 3341|     15|    !conn_config->native_ca_store &&
  ------------------
  |  Branch (3341:5): [True: 15, False: 0]
  ------------------
 3342|     15|    !USING_PROVIDER(octx);
  ------------------
  |  | 3320|  3.32k|#define USING_PROVIDER(octx) (octx)->p.libctx
  ------------------
  |  Branch (3342:5): [True: 15, False: 0]
  ------------------
 3343|       |
 3344|  3.30k|  ERR_set_mark();
 3345|       |
 3346|  3.30k|  cached_store = ossl_get_cached_x509_store(cf, data, &is_empty);
 3347|  3.30k|  if(cached_store && cache_criteria_met && X509_STORE_up_ref(cached_store)) {
  ------------------
  |  Branch (3347:6): [True: 0, False: 3.30k]
  |  Branch (3347:22): [True: 0, False: 0]
  |  Branch (3347:44): [True: 0, False: 0]
  ------------------
 3348|      0|    SSL_CTX_set_cert_store(octx->ssl_ctx, cached_store);
 3349|      0|    octx->store_is_empty = is_empty;
 3350|      0|  }
 3351|  3.30k|  else {
 3352|  3.30k|    X509_STORE *store = SSL_CTX_get_cert_store(octx->ssl_ctx);
 3353|       |
 3354|  3.30k|    result = ossl_populate_x509_store(cf, data, octx, store);
 3355|  3.30k|    if(result == CURLE_OK && cache_criteria_met) {
  ------------------
  |  Branch (3355:8): [True: 3.30k, False: 0]
  |  Branch (3355:30): [True: 15, False: 3.29k]
  ------------------
 3356|     15|      ossl_set_cached_x509_store(cf, data, store, (bool)octx->store_is_empty);
 3357|     15|    }
 3358|  3.30k|  }
 3359|       |
 3360|  3.30k|  ERR_pop_to_mark();
 3361|       |
 3362|  3.30k|  return result;
 3363|  3.30k|}
Curl_ossl_ctx_init:
 3738|  3.33k|{
 3739|  3.33k|  CURLcode result = CURLE_OK;
 3740|  3.33k|  const char *ciphers;
 3741|  3.33k|  const SSL_METHOD *req_method = NULL;
 3742|  3.33k|  ctx_option_t ctx_options = 0;
 3743|  3.33k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 3744|  3.33k|  struct ssl_easy_config *ssl_config = Curl_ssl_cf_get_easy_config(cf, data);
 3745|  3.33k|  char * const ssl_cert = conn_config->clientcert;
 3746|  3.33k|  const struct curl_blob *ssl_cert_blob = conn_config->cert_blob;
 3747|  3.33k|  const char * const ssl_cert_type = conn_config->cert_type;
 3748|  3.33k|  unsigned int ssl_version_min = CURL_SSLVERSION_DEFAULT;
  ------------------
  |  | 2394|  3.33k|#define CURL_SSLVERSION_DEFAULT 0L
  ------------------
 3749|  3.33k|  char error_buffer[256];
 3750|       |
 3751|       |  /* Make funny stuff to get random input */
 3752|  3.33k|  result = ossl_seed(data);
 3753|  3.33k|  if(!result) {
  ------------------
  |  Branch (3753:6): [True: 3.33k, False: 0]
  ------------------
 3754|  3.33k|    if(CURL_EASY_STR(data, STRING_SSL_ENGINE))
  ------------------
  |  | 1206|  3.33k|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  |  |  ------------------
  |  |  |  Branch (1206:3): [True: 0, False: 3.33k]
  |  |  ------------------
  ------------------
 3755|      0|      result = ossl_set_engine(data, octx,
 3756|      0|                               CURL_EASY_STR(data, STRING_SSL_ENGINE));
  ------------------
  |  | 1206|      0|  Curl_u8_strset_get(&(d)->set.strings, (uint8_t)(id))
  ------------------
 3757|  3.33k|    if(!result && data->set.engine_default)
  ------------------
  |  Branch (3757:8): [True: 3.33k, False: 0]
  |  Branch (3757:19): [True: 0, False: 3.33k]
  ------------------
 3758|      0|      result = ossl_set_engine_default(data, octx);
 3759|  3.33k|  }
 3760|       |
 3761|  3.33k|  if(!result) {
  ------------------
  |  Branch (3761:6): [True: 3.33k, False: 0]
  ------------------
 3762|  3.33k|    ssl_config->certverifyresult = !X509_V_OK;
 3763|  3.33k|    result = ossl_init_method(cf, data, peer, &req_method, &ssl_version_min);
 3764|  3.33k|  }
 3765|  3.33k|  if(result)
  ------------------
  |  Branch (3765:6): [True: 0, False: 3.33k]
  ------------------
 3766|      0|    return result;
 3767|  3.33k|  DEBUGASSERT(req_method);
  ------------------
  |  | 1016|  3.33k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3767:3): [True: 0, False: 3.33k]
  |  Branch (3767:3): [True: 3.33k, False: 0]
  ------------------
 3768|       |
 3769|  3.33k|  DEBUGASSERT(!octx->ssl_ctx);
  ------------------
  |  | 1016|  3.33k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3769:3): [True: 0, False: 3.33k]
  |  Branch (3769:3): [True: 3.33k, False: 0]
  ------------------
 3770|  3.33k|  octx->ssl_ctx =
 3771|  3.33k|#ifdef OPENSSL_HAS_PROVIDERS
 3772|  3.33k|    octx->p.libctx ?
  ------------------
  |  Branch (3772:5): [True: 0, False: 3.33k]
  ------------------
 3773|      0|    SSL_CTX_new_ex(octx->p.libctx, octx->p.propq, req_method):
 3774|  3.33k|#endif
 3775|  3.33k|    SSL_CTX_new(req_method);
 3776|       |
 3777|  3.33k|  if(!octx->ssl_ctx) {
  ------------------
  |  Branch (3777:6): [True: 0, False: 3.33k]
  ------------------
 3778|      0|    failf(data, "SSL: could not create a context: %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3779|      0|          ossl_strerror(ERR_peek_error(), error_buffer, sizeof(error_buffer)));
 3780|      0|    return CURLE_OUT_OF_MEMORY;
 3781|      0|  }
 3782|       |
 3783|  3.33k|  if(cb_setup) {
  ------------------
  |  Branch (3783:6): [True: 3.33k, False: 0]
  ------------------
 3784|  3.33k|    result = cb_setup(cf, data, cb_user_data);
 3785|  3.33k|    if(result)
  ------------------
  |  Branch (3785:8): [True: 0, False: 3.33k]
  ------------------
 3786|      0|      return result;
 3787|  3.33k|  }
 3788|       |
 3789|  3.33k|  if(data->set.fdebug && data->set.verbose &&
  ------------------
  |  Branch (3789:6): [True: 343, False: 2.99k]
  |  Branch (3789:26): [True: 343, False: 0]
  ------------------
 3790|    343|     (peer->transport != TRNSPRT_QUIC)) {
  ------------------
  |  |  227|    343|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (3790:6): [True: 0, False: 343]
  ------------------
 3791|       |    /* the SSL trace callback is only used for verbose logging;
 3792|       |     * QUIC connections use a different TLS record format that
 3793|       |     * ossl_trace cannot handle */
 3794|      0|    SSL_CTX_set_msg_callback(octx->ssl_ctx, ossl_trace);
 3795|      0|    SSL_CTX_set_msg_callback_arg(octx->ssl_ctx, cf);
 3796|      0|  }
 3797|       |
 3798|       |  /* OpenSSL contains code to work around lots of bugs and flaws in various
 3799|       |     SSL-implementations. SSL_CTX_set_options() is used to enable those
 3800|       |     workarounds. The man page for this option states that SSL_OP_ALL enables
 3801|       |     all the workarounds and that "It is usually safe to use SSL_OP_ALL to
 3802|       |     enable the bug workaround options if compatibility with somewhat broken
 3803|       |     implementations is desired."
 3804|       |
 3805|       |     The "-no_ticket" option was introduced in OpenSSL 0.9.8j. it is a flag to
 3806|       |     disable "rfc4507bis session ticket support". rfc4507bis was later turned
 3807|       |     into the proper RFC5077: https://datatracker.ietf.org/doc/html/rfc5077
 3808|       |
 3809|       |     The enabled extension concerns the session management. I wonder how often
 3810|       |     libcurl stops a connection and then resumes a TLS session. Also, sending
 3811|       |     the session data is some overhead. I suggest that you use your proposed
 3812|       |     patch (which explicitly disables TICKET).
 3813|       |
 3814|       |     If someone writes an application with libcurl and OpenSSL who wants to
 3815|       |     enable the feature, one can do this in the SSL callback.
 3816|       |
 3817|       |     SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option enabling allowed proper
 3818|       |     interoperability with web server Netscape Enterprise Server 2.0.1 which
 3819|       |     was released back in 1996.
 3820|       |
 3821|       |     Due to CVE-2010-4180, option SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG has
 3822|       |     become ineffective as of OpenSSL 0.9.8q and 1.0.0c. In order to mitigate
 3823|       |     CVE-2010-4180 when using previous OpenSSL versions we no longer enable
 3824|       |     this option regardless of OpenSSL version and SSL_OP_ALL definition.
 3825|       |
 3826|       |     OpenSSL added a workaround for an SSL 3.0/TLS 1.0 CBC vulnerability:
 3827|       |     https://web.archive.org/web/20240114184648/openssl.org/~bodo/tls-cbc.txt.
 3828|       |     In 0.9.6e they added a bit to SSL_OP_ALL that _disables_ that workaround
 3829|       |     despite the fact that SSL_OP_ALL is documented to do "rather harmless"
 3830|       |     workarounds. In order to keep the secure workaround, the
 3831|       |     SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS bit must not be set. */
 3832|       |
 3833|  3.33k|  ctx_options = SSL_OP_ALL | SSL_OP_NO_TICKET | SSL_OP_NO_COMPRESSION;
 3834|       |
 3835|       |  /* mitigate CVE-2010-4180 */
 3836|  3.33k|  ctx_options &= ~(ctx_option_t)SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG;
 3837|       |
 3838|       |  /* unless the user explicitly asks to allow the protocol vulnerability we
 3839|       |     use the workaround */
 3840|  3.33k|  if(!conn_config->enable_beast)
  ------------------
  |  Branch (3840:6): [True: 3.33k, False: 0]
  ------------------
 3841|  3.33k|    ctx_options &= ~(ctx_option_t)SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
 3842|       |
 3843|  3.33k|  DEBUGASSERT(ssl_version_min != CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 1016|  3.33k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3843:3): [True: 0, False: 3.33k]
  |  Branch (3843:3): [True: 3.33k, False: 0]
  ------------------
 3844|  3.33k|  switch(ssl_version_min) {
 3845|      0|  case CURL_SSLVERSION_SSLv2:
  ------------------
  |  | 2396|      0|#define CURL_SSLVERSION_SSLv2   2L
  ------------------
  |  Branch (3845:3): [True: 0, False: 3.33k]
  ------------------
 3846|      0|  case CURL_SSLVERSION_SSLv3:
  ------------------
  |  | 2397|      0|#define CURL_SSLVERSION_SSLv3   3L
  ------------------
  |  Branch (3846:3): [True: 0, False: 3.33k]
  ------------------
 3847|      0|    return CURLE_NOT_BUILT_IN;
 3848|       |
 3849|       |    /* "--tlsv<x.y>" options mean TLS >= version <x.y> */
 3850|      0|  case CURL_SSLVERSION_TLSv1:   /* TLS >= version 1.0 */
  ------------------
  |  | 2395|      0|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  ------------------
  |  Branch (3850:3): [True: 0, False: 3.33k]
  ------------------
 3851|      0|  case CURL_SSLVERSION_TLSv1_0: /* TLS >= version 1.0 */
  ------------------
  |  | 2398|      0|#define CURL_SSLVERSION_TLSv1_0 4L
  ------------------
  |  Branch (3851:3): [True: 0, False: 3.33k]
  ------------------
 3852|      0|  case CURL_SSLVERSION_TLSv1_1: /* TLS >= version 1.1 */
  ------------------
  |  | 2399|      0|#define CURL_SSLVERSION_TLSv1_1 5L
  ------------------
  |  Branch (3852:3): [True: 0, False: 3.33k]
  ------------------
 3853|      0|  case CURL_SSLVERSION_TLSv1_2: /* TLS >= version 1.2 */
  ------------------
  |  | 2400|      0|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  |  Branch (3853:3): [True: 0, False: 3.33k]
  ------------------
 3854|  3.33k|  case CURL_SSLVERSION_TLSv1_3: /* TLS >= version 1.3 */
  ------------------
  |  | 2401|  3.33k|#define CURL_SSLVERSION_TLSv1_3 7L
  ------------------
  |  Branch (3854:3): [True: 3.33k, False: 0]
  ------------------
 3855|       |    /* asking for any TLS version as the minimum, means no SSL versions
 3856|       |       allowed */
 3857|  3.33k|    ctx_options |= SSL_OP_NO_SSLv2;
 3858|  3.33k|    ctx_options |= SSL_OP_NO_SSLv3;
 3859|       |
 3860|  3.33k|    result = ossl_set_ssl_version_min_max(cf, octx->ssl_ctx, ssl_version_min);
 3861|  3.33k|    if(result)
  ------------------
  |  Branch (3861:8): [True: 0, False: 3.33k]
  ------------------
 3862|      0|      return result;
 3863|  3.33k|    break;
 3864|       |
 3865|  3.33k|  default:
  ------------------
  |  Branch (3865:3): [True: 0, False: 3.33k]
  ------------------
 3866|      0|    failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3867|      0|    return CURLE_SSL_CONNECT_ERROR;
 3868|  3.33k|  }
 3869|       |
 3870|  3.33k|  SSL_CTX_set_options(octx->ssl_ctx, ctx_options);
 3871|  3.33k|  SSL_CTX_set_read_ahead(octx->ssl_ctx, 1);
 3872|       |
 3873|       |  /* Max TLS1.2 record size 0x4000 + 0x800.
 3874|       |     OpenSSL supports processing "jumbo TLS record" (8 TLS records) in one go
 3875|       |     for some algorithms, so match that here.
 3876|       |     Experimentation shows that a slightly larger buffer is needed
 3877|       |     to avoid short reads.
 3878|       |
 3879|       |     However using a large buffer (8 packets) actually decreases performance.
 3880|       |     4 packets is better.
 3881|       |   */
 3882|  3.33k|#ifdef HAVE_SSL_CTX_SET_DEFAULT_READ_BUFFER_LEN
 3883|  3.33k|  SSL_CTX_set_default_read_buffer_len(octx->ssl_ctx, 0x401e * 4);
 3884|  3.33k|#endif
 3885|       |
 3886|       |  /* We do retry writes sometimes from another buffer address */
 3887|  3.33k|  SSL_CTX_set_mode(octx->ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
 3888|       |  /* Prevent OpenSSL from receiving more records from the BIO when
 3889|       |   * TLS Meta records (like Session Tickets) are encountered. A server
 3890|       |   * can stall us with only sending tickets and no data, otherwise. */
 3891|  3.33k|  SSL_CTX_clear_mode(octx->ssl_ctx, SSL_MODE_AUTO_RETRY);
 3892|       |
 3893|  3.33k|  ciphers = conn_config->cipher_list;
 3894|  3.33k|  if(!ciphers && (peer->transport != TRNSPRT_QUIC))
  ------------------
  |  |  227|  3.33k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (3894:6): [True: 3.33k, False: 0]
  |  Branch (3894:18): [True: 0, False: 3.33k]
  ------------------
 3895|      0|    ciphers = NULL;
 3896|  3.33k|  if(ciphers && (ssl_version_min < CURL_SSLVERSION_TLSv1_3)) {
  ------------------
  |  | 2401|      0|#define CURL_SSLVERSION_TLSv1_3 7L
  ------------------
  |  Branch (3896:6): [True: 0, False: 3.33k]
  |  Branch (3896:17): [True: 0, False: 0]
  ------------------
 3897|      0|    if(!SSL_CTX_set_cipher_list(octx->ssl_ctx, ciphers)) {
  ------------------
  |  Branch (3897:8): [True: 0, False: 0]
  ------------------
 3898|      0|      failf(data, "failed setting cipher list: %s", ciphers);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3899|      0|      return CURLE_SSL_CIPHER;
 3900|      0|    }
 3901|      0|    infof(data, "Cipher selection: %s", ciphers);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3902|      0|  }
 3903|       |
 3904|  3.33k|#ifdef HAVE_SSL_CTX_SET_CIPHERSUITES
 3905|  3.33k|  {
 3906|  3.33k|    const char *ciphers13 = conn_config->cipher_list13;
 3907|  3.33k|    if(ciphers13 &&
  ------------------
  |  Branch (3907:8): [True: 0, False: 3.33k]
  ------------------
 3908|      0|       (!conn_config->version_max ||
  ------------------
  |  Branch (3908:9): [True: 0, False: 0]
  ------------------
 3909|      0|        (conn_config->version_max == CURL_SSLVERSION_MAX_DEFAULT) ||
  ------------------
  |  | 2406|      0|#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1   << 16)
  |  |  ------------------
  |  |  |  | 2395|      0|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  |  |  ------------------
  ------------------
  |  Branch (3909:9): [True: 0, False: 0]
  ------------------
 3910|      0|        (conn_config->version_max >= CURL_SSLVERSION_MAX_TLSv1_3))) {
  ------------------
  |  | 2410|      0|#define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)
  |  |  ------------------
  |  |  |  | 2401|      0|#define CURL_SSLVERSION_TLSv1_3 7L
  |  |  ------------------
  ------------------
  |  Branch (3910:9): [True: 0, False: 0]
  ------------------
 3911|      0|      if(!SSL_CTX_set_ciphersuites(octx->ssl_ctx, ciphers13)) {
  ------------------
  |  Branch (3911:10): [True: 0, False: 0]
  ------------------
 3912|      0|        failf(data, "failed setting TLS 1.3 cipher suite: %s", ciphers13);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3913|      0|        return CURLE_SSL_CIPHER;
 3914|      0|      }
 3915|      0|      infof(data, "TLS 1.3 cipher selection: %s", ciphers13);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3916|      0|    }
 3917|  3.33k|  }
 3918|  3.33k|#endif
 3919|       |
 3920|  3.33k|  if(ssl_cert || ssl_cert_blob || ssl_cert_type) {
  ------------------
  |  Branch (3920:6): [True: 0, False: 3.33k]
  |  Branch (3920:18): [True: 0, False: 3.33k]
  |  Branch (3920:35): [True: 0, False: 3.33k]
  ------------------
 3921|      0|    result = client_cert(data, octx,
 3922|      0|                         ssl_cert, ssl_cert_blob, ssl_cert_type,
 3923|      0|                         conn_config->key, conn_config->key_blob,
 3924|      0|                         conn_config->key_type,
 3925|      0|                         conn_config->key_passwd);
 3926|      0|    if(result)
  ------------------
  |  Branch (3926:8): [True: 0, False: 0]
  ------------------
 3927|       |      /* failf() is already done in client_cert() */
 3928|      0|      return result;
 3929|      0|  }
 3930|       |
 3931|  3.33k|#ifdef HAVE_SSL_CTX_SET_POST_HANDSHAKE_AUTH
 3932|       |  /* OpenSSL 1.1.1 requires clients to opt-in for PHA */
 3933|  3.33k|  SSL_CTX_set_post_handshake_auth(octx->ssl_ctx, 1);
 3934|  3.33k|#endif
 3935|       |
 3936|  3.33k|  {
 3937|  3.33k|    const char *curves = conn_config->curves;
 3938|  3.33k|    if(curves) {
  ------------------
  |  Branch (3938:8): [True: 0, False: 3.33k]
  ------------------
 3939|       |#ifdef HAVE_BORINGSSL_LIKE
 3940|       |#define OSSL_CURVE_CAST(x) (x)
 3941|       |#else
 3942|      0|#define OSSL_CURVE_CAST(x) (char *)CURL_UNCONST(x)
 3943|      0|#endif
 3944|      0|      if(!SSL_CTX_set1_curves_list(octx->ssl_ctx, OSSL_CURVE_CAST(curves))) {
  ------------------
  |  Branch (3944:10): [True: 0, False: 0]
  ------------------
 3945|      0|        failf(data, "failed setting curves list: '%s'", curves);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3946|      0|        return CURLE_SSL_CIPHER;
 3947|      0|      }
 3948|      0|    }
 3949|  3.33k|  }
 3950|       |
 3951|  3.33k|#ifdef HAVE_SSL_CTX_SET1_SIGALGS
 3952|  3.33k|#define OSSL_SIGALG_CAST(x) OSSL_CURVE_CAST(x)
 3953|  3.33k|  {
 3954|  3.33k|    const char *signature_algorithms = conn_config->signature_algorithms;
 3955|  3.33k|    if(signature_algorithms) {
  ------------------
  |  Branch (3955:8): [True: 0, False: 3.33k]
  ------------------
 3956|      0|      if(!SSL_CTX_set1_sigalgs_list(octx->ssl_ctx,
  ------------------
  |  Branch (3956:10): [True: 0, False: 0]
  ------------------
 3957|      0|                                    OSSL_SIGALG_CAST(signature_algorithms))) {
 3958|      0|        failf(data, "failed setting signature algorithms: '%s'",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3959|      0|              signature_algorithms);
 3960|      0|        return CURLE_SSL_CIPHER;
 3961|      0|      }
 3962|      0|    }
 3963|  3.33k|  }
 3964|  3.33k|#endif
 3965|       |
 3966|  3.33k|  {
 3967|  3.33k|    int (*verify_cb)(int, X509_STORE_CTX *) = NULL;
 3968|  3.33k|    int verify_mode = conn_config->verifypeer ?
  ------------------
  |  Branch (3968:23): [True: 3.33k, False: 0]
  ------------------
 3969|  3.33k|                      SSL_VERIFY_PEER : SSL_VERIFY_NONE;
 3970|       |#ifdef USE_APPLE_SECTRUST
 3971|       |    if(conn_config->native_ca_store) {
 3972|       |      /* We want to verify via SecTrust should OpenSSL's own verify fail.
 3973|       |       * For this, we want SSL_connect() to succeed in spite of a verify
 3974|       |       * fail. So we install a callback that is always happy. */
 3975|       |      verify_cb = ossl_verify_cb_continue;
 3976|       |    }
 3977|       |#endif
 3978|  3.33k|    SSL_CTX_set_verify(octx->ssl_ctx, verify_mode, verify_cb);
 3979|  3.33k|  }
 3980|       |
 3981|       |  /* Enable logging of secrets to the file specified in env SSLKEYLOGFILE. */
 3982|  3.33k|#if !defined(HAVE_KEYLOG_UPSTREAM) && defined(HAVE_KEYLOG_CALLBACK)
 3983|  3.33k|  if(Curl_tls_keylog_enabled()) {
  ------------------
  |  Branch (3983:6): [True: 3.33k, False: 0]
  ------------------
 3984|  3.33k|    SSL_CTX_set_keylog_callback(octx->ssl_ctx, ossl_keylog_callback);
 3985|  3.33k|  }
 3986|  3.33k|#endif
 3987|       |
 3988|  3.33k|  if(cb_new_session) {
  ------------------
  |  Branch (3988:6): [True: 0, False: 3.33k]
  ------------------
 3989|       |    /* Enable the session cache because it is a prerequisite for the
 3990|       |     * "new session" callback. Use the "external storage" mode to prevent
 3991|       |     * OpenSSL from creating an internal session cache.
 3992|       |     */
 3993|      0|    SSL_CTX_set_session_cache_mode(octx->ssl_ctx,
 3994|      0|                                   SSL_SESS_CACHE_CLIENT |
 3995|      0|                                   SSL_SESS_CACHE_NO_INTERNAL);
 3996|      0|    SSL_CTX_sess_set_new_cb(octx->ssl_ctx, cb_new_session);
 3997|      0|  }
 3998|       |
 3999|       |  /* give application a chance to interfere with SSL set up. */
 4000|  3.33k|  if(data->set.ssl_fsslctx) {
  ------------------
  |  Branch (4000:6): [True: 0, False: 3.33k]
  ------------------
 4001|      0|    struct Curl_mapi_guard guard;
 4002|       |    /* When a user callback is installed to modify the SSL_CTX,
 4003|       |     * we need to do the full initialization before calling it.
 4004|       |     * See: #11800 */
 4005|      0|    if(!octx->x509_store_setup) {
  ------------------
  |  Branch (4005:8): [True: 0, False: 0]
  ------------------
 4006|      0|      result = Curl_ssl_setup_x509_store(cf, data, octx);
 4007|      0|      if(result)
  ------------------
  |  Branch (4007:10): [True: 0, False: 0]
  ------------------
 4008|      0|        return result;
 4009|      0|      octx->x509_store_setup = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 4010|      0|    }
 4011|      0|    CURL_CBAPI_START(&guard, data, easy_fsslctx);
  ------------------
  |  |  201|      0|  Curl_cbapi_enter(g, d, NULL, CURL_CBAPI_FN_##fn)
  ------------------
 4012|      0|    result = (*data->set.ssl_fsslctx)(data, octx->ssl_ctx,
 4013|      0|                                      data->set.ssl_fsslctxp);
 4014|      0|    CURL_CBAPI_END(&guard);
  ------------------
  |  |  205|      0|  Curl_cbapi_leave(g)
  ------------------
 4015|      0|    if(result) {
  ------------------
  |  Branch (4015:8): [True: 0, False: 0]
  ------------------
 4016|      0|      failf(data, "error signaled by SSL ctx callback");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4017|      0|      return result;
 4018|      0|    }
 4019|      0|  }
 4020|       |
 4021|  3.33k|  return ossl_init_ssl(octx, cf, data, peer, alpns_requested,
 4022|  3.33k|                       ssl_user_data, sess_reuse_cb);
 4023|  3.33k|}
Curl_ossl_report_handshake:
 4040|  1.95k|{
 4041|  1.95k|#ifdef CURLVERBOSE
 4042|  1.95k|  if(Curl_trc_is_verbose(data)) {
  ------------------
  |  |  322|  1.95k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  ------------------
  |  |  323|  1.95k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  ------------------
  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4043|    147|    int psigtype_nid = NID_undef;
 4044|    147|    const char *negotiated_group_name = NULL;
 4045|       |
 4046|    147|#ifdef HAVE_OPENSSL3
 4047|    147|    SSL_get_peer_signature_type_nid(octx->ssl, &psigtype_nid);
 4048|    147|#if OPENSSL_VERSION_NUMBER >= 0x30200000L
 4049|    147|    negotiated_group_name = SSL_get0_group_name(octx->ssl);
 4050|       |#else
 4051|       |    negotiated_group_name =
 4052|       |      OBJ_nid2sn(SSL_get_negotiated_group(octx->ssl) & 0x0000FFFF);
 4053|       |#endif
 4054|    147|#endif
 4055|       |
 4056|       |    /* Informational message */
 4057|    147|    infof(data, "SSL connection using %s / %s / %s / %s",
  ------------------
  |  |  143|    147|  do {                               \
  |  |  144|    147|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    147|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    147|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    294|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 147, False: 0]
  |  |  ------------------
  |  |  146|    147|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 147]
  |  |  ------------------
  ------------------
 4058|    147|          SSL_get_version(octx->ssl),
 4059|    147|          SSL_get_cipher(octx->ssl),
 4060|    147|          negotiated_group_name ? negotiated_group_name : "[blank]",
 4061|    147|          OBJ_nid2sn(psigtype_nid));
 4062|    147|  }
 4063|       |#else
 4064|       |  (void)data;
 4065|       |  (void)octx;
 4066|       |#endif /* CURLVERBOSE */
 4067|  1.95k|}
Curl_ossl_check_peer_cert:
 4803|  1.95k|{
 4804|  1.95k|  struct connectdata *conn = CF_CONN(cf);
  ------------------
  |  |  260|  1.95k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
 4805|  1.95k|  struct ssl_easy_config *ssl_config = Curl_ssl_cf_get_easy_config(cf, data);
 4806|  1.95k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 4807|  1.95k|  CURLcode result = CURLE_OK;
 4808|  1.95k|  long ossl_verify;
 4809|  1.95k|  X509 *server_cert;
 4810|  1.95k|  bool verified = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 4811|       |
 4812|       |  /* we may have offered a session, but the server decides if it resumes */
 4813|  1.95k|  if(octx->reused_session && !SSL_session_reused(octx->ssl)) {
  ------------------
  |  Branch (4813:6): [True: 0, False: 1.95k]
  |  Branch (4813:30): [True: 0, False: 0]
  ------------------
 4814|      0|    infof(data, "SSL session not resumed by server, doing full checks");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4815|      0|    octx->reused_session = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 4816|      0|  }
 4817|       |
 4818|  1.95k|  if(data->set.ssl.certinfo && !octx->reused_session) {
  ------------------
  |  Branch (4818:6): [True: 0, False: 1.95k]
  |  Branch (4818:32): [True: 0, False: 0]
  ------------------
 4819|       |    /* asked to gather certificate info. Reused sessions do not have cert
 4820|       |       chains */
 4821|      0|    result = ossl_certchain(data, octx->ssl);
 4822|      0|    if(result)
  ------------------
  |  Branch (4822:8): [True: 0, False: 0]
  ------------------
 4823|      0|      return result;
 4824|      0|  }
 4825|       |
 4826|  1.95k|  server_cert = SSL_get1_peer_certificate(octx->ssl);
 4827|  1.95k|  if(!server_cert) {
  ------------------
  |  Branch (4827:6): [True: 0, False: 1.95k]
  ------------------
 4828|       |    /* no verification at all, this maybe acceptable */
 4829|      0|    if(!(conn_config->verifypeer || conn_config->verifyhost) &&
  ------------------
  |  Branch (4829:10): [True: 0, False: 0]
  |  Branch (4829:37): [True: 0, False: 0]
  ------------------
 4830|      0|       !conn_config->pinned_key)
  ------------------
  |  Branch (4830:8): [True: 0, False: 0]
  ------------------
 4831|      0|      goto out;
 4832|       |
 4833|      0|    failf(data, "SSL: could not get peer certificate");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4834|      0|    result = CURLE_PEER_FAILED_VERIFICATION;
 4835|      0|    goto out;
 4836|      0|  }
 4837|       |
 4838|  1.95k|#ifdef CURLVERBOSE
 4839|  1.95k|  result = ossl_infof_cert(cf, data, server_cert);
 4840|  1.95k|  if(result)
  ------------------
  |  Branch (4840:6): [True: 0, False: 1.95k]
  ------------------
 4841|      0|    goto out;
 4842|  1.95k|  infof_certstack(data, octx->ssl);
 4843|  1.95k|#endif
 4844|       |
 4845|  1.95k|  if(conn_config->verifyhost) {
  ------------------
  |  Branch (4845:6): [True: 1.95k, False: 0]
  ------------------
 4846|  1.95k|    result = ossl_verifyhost(data, conn, peer, server_cert);
 4847|  1.95k|    if(result)
  ------------------
  |  Branch (4847:8): [True: 0, False: 1.95k]
  ------------------
 4848|      0|      goto out;
 4849|  1.95k|  }
 4850|       |  /* `verifyhost` is either OK or not requested from here on */
 4851|       |
 4852|  1.95k|  ossl_verify = SSL_get_verify_result(octx->ssl);
 4853|  1.95k|  ssl_config->certverifyresult = ossl_verify;
 4854|  1.95k|  infof(data, "OpenSSL verify result: %lx", (unsigned long)ossl_verify);
  ------------------
  |  |  143|  1.95k|  do {                               \
  |  |  144|  1.95k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  1.95k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.95k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.95k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.95k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
 4855|       |
 4856|  1.95k|  verified = (ossl_verify == X509_V_OK);
 4857|  1.95k|  if(verified)
  ------------------
  |  Branch (4857:6): [True: 1.95k, False: 0]
  ------------------
 4858|  1.95k|    infof(data, "SSL certificate verified via OpenSSL.");
  ------------------
  |  |  143|  1.95k|  do {                               \
  |  |  144|  1.95k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  1.95k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.95k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.95k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.95k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
 4859|       |
 4860|       |#ifdef USE_APPLE_SECTRUST
 4861|       |  if(!verified && conn_config->verifypeer && conn_config->native_ca_store) {
 4862|       |    /* we verify using Apple SecTrust *unless* OpenSSL already verified.
 4863|       |     * This may happen if the application intercepted the OpenSSL callback
 4864|       |     * and installed its own. */
 4865|       |    result = ossl_apple_verify(cf, data, octx, peer);
 4866|       |    if(result && (result != CURLE_PEER_FAILED_VERIFICATION))
 4867|       |      goto out; /* unexpected error */
 4868|       |    if(octx->sectrust_verified) {
 4869|       |      infof(data, "SSL certificate verified via Apple SecTrust.");
 4870|       |      ssl_config->certverifyresult = X509_V_OK;
 4871|       |      verified = TRUE;
 4872|       |    }
 4873|       |  }
 4874|       |#endif
 4875|       |
 4876|  1.95k|  if(!verified) {
  ------------------
  |  Branch (4876:6): [True: 0, False: 1.95k]
  ------------------
 4877|       |    /* no trust established, report the OpenSSL status */
 4878|      0|    if(conn_config->verifypeer) {
  ------------------
  |  Branch (4878:8): [True: 0, False: 0]
  ------------------
 4879|      0|      failf(data, "SSL certificate OpenSSL verify result: %s (%ld)",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4880|      0|            X509_verify_cert_error_string(ossl_verify), ossl_verify);
 4881|      0|      result = CURLE_PEER_FAILED_VERIFICATION;
 4882|      0|      goto out;
 4883|      0|    }
 4884|      0|    infof(data, " SSL certificate verification failed, continuing anyway!");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4885|      0|  }
 4886|       |
 4887|  1.95k|#ifndef OPENSSL_NO_OCSP
 4888|  1.95k|  if(conn_config->verifystatus &&
  ------------------
  |  Branch (4888:6): [True: 0, False: 1.95k]
  ------------------
 4889|       |#ifdef USE_APPLE_SECTRUST
 4890|       |    /* When SecTrust did the verify and has the capability, no need. */
 4891|       |     !(octx->sectrust_verified && Curl_vtls_apple_verifies_ocsp(cf, data)) &&
 4892|       |#endif
 4893|      0|     !octx->reused_session) {
  ------------------
  |  Branch (4893:6): [True: 0, False: 0]
  ------------------
 4894|      0|    result = verifystatus(cf, data, octx);
 4895|      0|    if(result)
  ------------------
  |  Branch (4895:8): [True: 0, False: 0]
  ------------------
 4896|      0|      goto out;
 4897|      0|  }
 4898|  1.95k|#endif
 4899|       |
 4900|  1.95k|  result = ossl_check_issuer(cf, data, server_cert);
 4901|  1.95k|  if(result)
  ------------------
  |  Branch (4901:6): [True: 0, False: 1.95k]
  ------------------
 4902|      0|    goto out;
 4903|       |
 4904|  1.95k|  result = ossl_check_pinned_key(cf, data, server_cert);
 4905|       |
 4906|  1.95k|out:
 4907|  1.95k|  X509_free(server_cert);
 4908|  1.95k|  return result;
 4909|  1.95k|}
Curl_ossl_version:
 5474|  3.36k|{
 5475|       |#ifdef LIBRESSL_VERSION_NUMBER
 5476|       |  char *p;
 5477|       |  size_t count;
 5478|       |  const char *ver = OpenSSL_version(OPENSSL_VERSION);
 5479|       |  static const char expected[] = OSSL_PACKAGE " "; /* ie "LibreSSL " */
 5480|       |  if(curl_strnequal(ver, expected, CURL_CSTRLEN(expected))) {
 5481|       |    ver += CURL_CSTRLEN(expected);
 5482|       |  }
 5483|       |  count = curl_msnprintf(buffer, size, "%s/%s", OSSL_PACKAGE, ver);
 5484|       |  for(p = buffer; *p; ++p) {
 5485|       |    if(ISBLANK(*p))
 5486|       |      *p = '_';
 5487|       |  }
 5488|       |  return count;
 5489|       |#elif defined(OPENSSL_IS_AWSLC)
 5490|       |  return curl_msnprintf(buffer, size, "%s/%s",
 5491|       |                        OSSL_PACKAGE, AWSLC_VERSION_NUMBER_STRING);
 5492|       |#elif defined(OPENSSL_IS_BORINGSSL)
 5493|       |#ifdef CURL_BORINGSSL_VERSION
 5494|       |  return curl_msnprintf(buffer, size, "%s/%s",
 5495|       |                        OSSL_PACKAGE, CURL_BORINGSSL_VERSION);
 5496|       |#else
 5497|       |  return curl_msnprintf(buffer, size, OSSL_PACKAGE);
 5498|       |#endif
 5499|       |#else /* OpenSSL 3+ */
 5500|  3.36k|  return curl_msnprintf(buffer, size, "%s/%s",
 5501|  3.36k|                        OSSL_PACKAGE, OpenSSL_version(OPENSSL_VERSION_STRING));
  ------------------
  |  |  160|  3.36k|#define OSSL_PACKAGE "OpenSSL"
  ------------------
 5502|  3.36k|#endif
 5503|  3.36k|}
openssl.c:ossl_provider_cleanup:
 1748|  3.36k|{
 1749|  3.36k|  if(!octx)
  ------------------
  |  Branch (1749:6): [True: 0, False: 3.36k]
  ------------------
 1750|      0|    return;
 1751|  3.36k|  if(octx->p.baseprov) {
  ------------------
  |  Branch (1751:6): [True: 0, False: 3.36k]
  ------------------
 1752|      0|    OSSL_PROVIDER_unload(octx->p.baseprov);
 1753|      0|    octx->p.baseprov = NULL;
 1754|      0|  }
 1755|  3.36k|  if(octx->p.provider) {
  ------------------
  |  Branch (1755:6): [True: 0, False: 3.36k]
  ------------------
 1756|      0|    OSSL_PROVIDER_unload(octx->p.provider);
 1757|      0|    octx->p.provider = NULL;
 1758|      0|  }
 1759|  3.36k|  OSSL_LIB_CTX_free(octx->p.libctx);
 1760|  3.36k|  octx->p.libctx = NULL;
 1761|  3.36k|  curlx_safefree(octx->p.propq);
  ------------------
  |  | 1359|  3.36k|  do {                      \
  |  | 1360|  3.36k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  3.36k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  3.36k|    (ptr) = NULL;           \
  |  | 1362|  3.36k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 3.36k]
  |  |  ------------------
  ------------------
 1762|       |  octx->p.provider_loaded = FALSE;
  ------------------
  |  |  989|  3.36k|#define FALSE false
  ------------------
 1763|  3.36k|}
openssl.c:ossl_get_cached_x509_store:
 3232|  3.30k|{
 3233|  3.30k|  struct Curl_multi *multi = data->multi;
 3234|  3.30k|  struct ossl_x509_share *share;
 3235|  3.30k|  X509_STORE *store = NULL;
 3236|       |
 3237|  3.30k|  DEBUGASSERT(multi);
  ------------------
  |  | 1016|  3.30k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3237:3): [True: 0, False: 3.30k]
  |  Branch (3237:3): [True: 3.30k, False: 0]
  ------------------
 3238|  3.30k|  *pempty = TRUE;
  ------------------
  |  |  986|  3.30k|#define TRUE true
  ------------------
 3239|  3.30k|  share = multi ? Curl_hash_pick(&multi->proto_hash,
  ------------------
  |  Branch (3239:11): [True: 3.30k, False: 0]
  ------------------
 3240|  3.30k|                                 MPROTO_OSSL_X509_KEY,
  ------------------
  |  | 3165|  3.30k|#define MPROTO_OSSL_X509_KEY  "tls:ossl:x509:share"
  ------------------
 3241|  3.30k|                                 CURL_CSTRLEN(MPROTO_OSSL_X509_KEY)) : NULL;
  ------------------
  |  | 1319|  3.30k|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
 3242|  3.30k|  if(share && share->store &&
  ------------------
  |  Branch (3242:6): [True: 0, False: 3.30k]
  |  Branch (3242:15): [True: 0, False: 0]
  ------------------
 3243|      0|     !ossl_cached_x509_store_expired(data, share) &&
  ------------------
  |  Branch (3243:6): [True: 0, False: 0]
  ------------------
 3244|      0|     !ossl_cached_x509_store_different(cf, data, share)) {
  ------------------
  |  Branch (3244:6): [True: 0, False: 0]
  ------------------
 3245|      0|    store = share->store;
 3246|      0|    *pempty = (bool)share->store_is_empty;
 3247|      0|  }
 3248|       |
 3249|  3.30k|  return store;
 3250|  3.30k|}
openssl.c:ossl_populate_x509_store:
 3099|  3.30k|{
 3100|  3.30k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 3101|  3.30k|  CURLcode result = CURLE_OK;
 3102|  3.30k|  X509_LOOKUP *lookup = NULL;
 3103|  3.30k|  const char * const ssl_crlfile = conn_config->CRLfile;
 3104|  3.30k|  unsigned long x509flags = 0;
 3105|       |
 3106|  3.30k|  CURL_TRC_CF(data, cf, "configuring OpenSSL's x509 trust store");
  ------------------
  |  |  153|  3.30k|  do {                                          \
  |  |  154|  3.30k|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|  3.30k|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.61k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.30k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 339, False: 2.96k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.61k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 339, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    339|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|  3.30k|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    339|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 339, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 69, False: 270]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|  3.30k|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|  3.30k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
 3107|  3.30k|  if(!store)
  ------------------
  |  Branch (3107:6): [True: 0, False: 3.30k]
  ------------------
 3108|      0|    return CURLE_OUT_OF_MEMORY;
 3109|       |
 3110|  3.30k|  if(!conn_config->verifypeer) {
  ------------------
  |  Branch (3110:6): [True: 0, False: 3.30k]
  ------------------
 3111|      0|    infof(data, "SSL Trust: peer verification disabled");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3112|      0|    return CURLE_OK;
 3113|      0|  }
 3114|       |
 3115|  3.30k|  infof(data, "SSL Trust Anchors:");
  ------------------
  |  |  143|  3.30k|  do {                               \
  |  |  144|  3.30k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  3.30k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 3.30k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 339, False: 2.96k]
  |  |  |  |  ------------------
  |  |  |  |  323|  3.30k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 339, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    339|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  3.30k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  3.30k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 3.30k]
  |  |  ------------------
  ------------------
 3116|  3.30k|  result = ossl_load_trust_anchors(cf, data, octx, store);
 3117|  3.30k|  if(result)
  ------------------
  |  Branch (3117:6): [True: 0, False: 3.30k]
  ------------------
 3118|      0|    return result;
 3119|       |
 3120|       |  /* Does not make sense to load a CRL file without peer verification */
 3121|       |#ifdef USE_APPLE_SECTRUST
 3122|       |  if(ssl_crlfile && conn_config->native_ca_store) {
 3123|       |    failf(data, "openssl: CRL file not supported with native CA store; "
 3124|       |          "the platform verifier has no CRL attachment API");
 3125|       |    return CURLE_NOT_BUILT_IN;
 3126|       |  }
 3127|       |#endif
 3128|  3.30k|  if(ssl_crlfile) {
  ------------------
  |  Branch (3128:6): [True: 0, False: 3.30k]
  ------------------
 3129|       |    /* tell OpenSSL where to find CRL file that is used to check certificate
 3130|       |     * revocation */
 3131|      0|    lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
 3132|      0|    if(!lookup ||
  ------------------
  |  Branch (3132:8): [True: 0, False: 0]
  ------------------
 3133|      0|       (!X509_load_crl_file(lookup, ssl_crlfile, X509_FILETYPE_PEM))) {
  ------------------
  |  Branch (3133:8): [True: 0, False: 0]
  ------------------
 3134|      0|      failf(data, "error loading CRL file: %s", ssl_crlfile);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3135|      0|      return CURLE_SSL_CRL_BADFILE;
 3136|      0|    }
 3137|      0|    x509flags = X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL;
 3138|      0|    infof(data, " CRLfile: %s", ssl_crlfile);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3139|      0|  }
 3140|       |
 3141|       |  /* Try building a chain using issuers in the trusted store first to avoid
 3142|       |     problems with server-sent legacy intermediates. Newer versions of
 3143|       |     OpenSSL do alternate chain checking by default but we do not know how to
 3144|       |     determine that in a reliable manner.
 3145|       |     https://web.archive.org/web/20190422050538/rt.openssl.org/Ticket/Display.html?id=3621
 3146|       |   */
 3147|  3.30k|  x509flags |= X509_V_FLAG_TRUSTED_FIRST;
 3148|       |
 3149|  3.30k|  if(!conn_config->no_partialchain && !ssl_crlfile) {
  ------------------
  |  Branch (3149:6): [True: 3.30k, False: 0]
  |  Branch (3149:39): [True: 3.30k, False: 0]
  ------------------
 3150|       |    /* Have intermediate certificates in the trust store be treated as
 3151|       |       trust-anchors, in the same way as self-signed root CA certificates are.
 3152|       |       This allows users to verify servers using the intermediate cert only,
 3153|       |       instead of needing the whole chain.
 3154|       |
 3155|       |       Due to OpenSSL bug https://github.com/openssl/openssl/issues/5081 we
 3156|       |       cannot do partial chains with a CRL check. */
 3157|  3.30k|    x509flags |= X509_V_FLAG_PARTIAL_CHAIN;
 3158|  3.30k|  }
 3159|  3.30k|  (void)X509_STORE_set_flags(store, x509flags);
 3160|       |
 3161|  3.30k|  return result;
 3162|  3.30k|}
openssl.c:ossl_load_trust_anchors:
 2989|  3.30k|{
 2990|  3.30k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 2991|  3.30k|  CURLcode result = CURLE_OK;
 2992|  3.30k|  const char * const ssl_cafile =
 2993|       |    /* CURLOPT_CAINFO_BLOB overrides CURLOPT_CAINFO */
 2994|  3.30k|    (conn_config->ca_info_blob ? NULL : conn_config->CAfile);
  ------------------
  |  Branch (2994:6): [True: 3.29k, False: 15]
  ------------------
 2995|  3.30k|  const char * const ssl_capath = conn_config->CApath;
 2996|  3.30k|  bool have_native_check = FALSE;
  ------------------
  |  |  989|  3.30k|#define FALSE false
  ------------------
 2997|       |
 2998|  3.30k|  octx->store_is_empty = TRUE;
  ------------------
  |  |  986|  3.30k|#define TRUE true
  ------------------
 2999|  3.30k|  if(conn_config->native_ca_store) {
  ------------------
  |  Branch (2999:6): [True: 0, False: 3.30k]
  ------------------
 3000|       |#ifdef USE_WIN32_CRYPTO
 3001|       |    bool added = FALSE;
 3002|       |    result = ossl_windows_load_anchors(cf, data, store, &added);
 3003|       |    if(result)
 3004|       |      return result;
 3005|       |    if(added) {
 3006|       |      infof(data, "  Native: Windows System Stores ROOT+CA");
 3007|       |      octx->store_is_empty = FALSE;
 3008|       |    }
 3009|       |#elif defined(USE_APPLE_SECTRUST)
 3010|       |    infof(data, "  Native: Apple SecTrust");
 3011|       |    have_native_check = TRUE;
 3012|       |#endif
 3013|      0|  }
 3014|       |
 3015|  3.30k|  if(conn_config->ca_info_blob) {
  ------------------
  |  Branch (3015:6): [True: 3.29k, False: 15]
  ------------------
 3016|  3.29k|    result = load_cacert_from_memory(store, conn_config->ca_info_blob);
 3017|  3.29k|    if(result) {
  ------------------
  |  Branch (3017:8): [True: 0, False: 3.29k]
  ------------------
 3018|      0|      failf(data, "error adding trust anchors from certificate blob: %d",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3019|      0|            (int)result);
 3020|      0|      return result;
 3021|      0|    }
 3022|  3.29k|    infof(data, "  CA Blob from configuration");
  ------------------
  |  |  143|  3.29k|  do {                               \
  |  |  144|  3.29k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  3.29k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 3.29k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 337, False: 2.95k]
  |  |  |  |  ------------------
  |  |  |  |  323|  3.29k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 337, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    337|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  3.29k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  3.29k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 3.29k]
  |  |  ------------------
  ------------------
 3023|  3.29k|    octx->store_is_empty = FALSE;
  ------------------
  |  |  989|  3.29k|#define FALSE false
  ------------------
 3024|  3.29k|  }
 3025|       |
 3026|  3.30k|  if(ssl_cafile || ssl_capath) {
  ------------------
  |  Branch (3026:6): [True: 0, False: 3.30k]
  |  Branch (3026:20): [True: 0, False: 3.30k]
  ------------------
 3027|      0|#ifdef HAVE_OPENSSL3
 3028|       |    /* OpenSSL 3.0.0 has deprecated SSL_CTX_load_verify_locations */
 3029|      0|    if(ssl_cafile) {
  ------------------
  |  Branch (3029:8): [True: 0, False: 0]
  ------------------
 3030|      0|      if(!X509_STORE_load_file(store, ssl_cafile)) {
  ------------------
  |  Branch (3030:10): [True: 0, False: 0]
  ------------------
 3031|      0|        if(octx->store_is_empty && !have_native_check) {
  ------------------
  |  Branch (3031:12): [True: 0, False: 0]
  |  Branch (3031:36): [True: 0, False: 0]
  ------------------
 3032|       |          /* Fail if we insist on successfully verifying the server. */
 3033|      0|          failf(data, "error adding trust anchors from file: %s", ssl_cafile);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3034|      0|          return CURLE_SSL_CACERT_BADFILE;
 3035|      0|        }
 3036|      0|        else
 3037|      0|          infof(data, "error setting certificate file, continuing anyway");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3038|      0|      }
 3039|      0|      infof(data, "  CAfile: %s", ssl_cafile);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3040|      0|      octx->store_is_empty = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 3041|      0|    }
 3042|      0|    if(ssl_capath) {
  ------------------
  |  Branch (3042:8): [True: 0, False: 0]
  ------------------
 3043|      0|      if(!X509_STORE_load_path(store, ssl_capath)) {
  ------------------
  |  Branch (3043:10): [True: 0, False: 0]
  ------------------
 3044|      0|        if(octx->store_is_empty && !have_native_check) {
  ------------------
  |  Branch (3044:12): [True: 0, False: 0]
  |  Branch (3044:36): [True: 0, False: 0]
  ------------------
 3045|       |          /* Fail if we insist on successfully verifying the server. */
 3046|      0|          failf(data, "error adding trust anchors from path: %s", ssl_capath);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3047|      0|          return CURLE_SSL_CACERT_BADFILE;
 3048|      0|        }
 3049|      0|        else
 3050|      0|          infof(data, "error setting certificate path, continuing anyway");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3051|      0|      }
 3052|      0|      infof(data, "  CApath: %s", ssl_capath);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3053|      0|      octx->store_is_empty = FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 3054|      0|    }
 3055|       |#else
 3056|       |    /* tell OpenSSL where to find CA certificates that are used to verify the
 3057|       |       server's certificate. */
 3058|       |    if(!X509_STORE_load_locations(store, ssl_cafile, ssl_capath)) {
 3059|       |      if(octx->store_is_empty && !have_native_check) {
 3060|       |        /* Fail if we insist on successfully verifying the server. */
 3061|       |        failf(data, "error adding trust anchors from locations:"
 3062|       |              "  CAfile: %s CApath: %s",
 3063|       |              ssl_cafile ? ssl_cafile : "none",
 3064|       |              ssl_capath ? ssl_capath : "none");
 3065|       |        return CURLE_SSL_CACERT_BADFILE;
 3066|       |      }
 3067|       |      else {
 3068|       |        infof(data, "error setting certificate verify locations,"
 3069|       |              " continuing anyway");
 3070|       |      }
 3071|       |    }
 3072|       |    if(ssl_cafile)
 3073|       |      infof(data, "  CAfile: %s", ssl_cafile);
 3074|       |    if(ssl_capath)
 3075|       |      infof(data, "  CApath: %s", ssl_capath);
 3076|       |    octx->store_is_empty = FALSE;
 3077|       |#endif
 3078|      0|  }
 3079|       |
 3080|       |#ifdef CURL_CA_FALLBACK
 3081|       |  if(octx->store_is_empty) {
 3082|       |    /* verifying the peer without any CA certificates does not
 3083|       |       work so use OpenSSL's built-in default as fallback */
 3084|       |    X509_STORE_set_default_paths(store);
 3085|       |    infof(data, "  OpenSSL default paths (fallback)");
 3086|       |    octx->store_is_empty = FALSE;
 3087|       |  }
 3088|       |#endif
 3089|  3.30k|  if(octx->store_is_empty && !have_native_check)
  ------------------
  |  Branch (3089:6): [True: 15, False: 3.29k]
  |  Branch (3089:30): [True: 15, False: 0]
  ------------------
 3090|     15|    infof(data, "  no trust anchors configured");
  ------------------
  |  |  143|     15|  do {                               \
  |  |  144|     15|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|     15|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 15, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 2, False: 13]
  |  |  |  |  ------------------
  |  |  |  |  323|     15|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      2|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|     15|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|     15|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 15]
  |  |  ------------------
  ------------------
 3091|       |
 3092|  3.30k|  return result;
 3093|  3.30k|}
openssl.c:load_cacert_from_memory:
 2688|  3.29k|{
 2689|       |  /* these need to be freed at the end */
 2690|  3.29k|  BIO *cbio = NULL;
 2691|  3.29k|  STACK_OF(X509_INFO) *inf = NULL;
 2692|       |
 2693|       |  /* everything else is a reference */
 2694|  3.29k|  int i, count = 0;
 2695|  3.29k|  X509_INFO *itmp = NULL;
 2696|       |
 2697|  3.29k|  if(ca_info_blob->len > (size_t)INT_MAX)
  ------------------
  |  Branch (2697:6): [True: 0, False: 3.29k]
  ------------------
 2698|      0|    return CURLE_SSL_CACERT_BADFILE;
 2699|       |
 2700|  3.29k|  cbio = BIO_new_mem_buf(ca_info_blob->data, (int)ca_info_blob->len);
 2701|  3.29k|  if(!cbio)
  ------------------
  |  Branch (2701:6): [True: 0, False: 3.29k]
  ------------------
 2702|      0|    return CURLE_OUT_OF_MEMORY;
 2703|       |
 2704|  3.29k|  inf = PEM_X509_INFO_read_bio(cbio, NULL, NULL, NULL);
 2705|  3.29k|  if(!inf) {
  ------------------
  |  Branch (2705:6): [True: 0, False: 3.29k]
  ------------------
 2706|      0|    BIO_free(cbio);
 2707|      0|    return CURLE_SSL_CACERT_BADFILE;
 2708|      0|  }
 2709|       |
 2710|       |  /* add each entry from PEM file to x509_store */
 2711|  6.58k|  for(i = 0; i < (int)sk_X509_INFO_num(inf); ++i) {
  ------------------
  |  Branch (2711:14): [True: 3.29k, False: 3.29k]
  ------------------
 2712|  3.29k|    itmp = sk_X509_INFO_value(inf, (ossl_valsize_t)i);
 2713|  3.29k|    if(itmp->x509) {
  ------------------
  |  Branch (2713:8): [True: 3.29k, False: 0]
  ------------------
 2714|  3.29k|      if(X509_STORE_add_cert(store, itmp->x509)) {
  ------------------
  |  Branch (2714:10): [True: 3.29k, False: 0]
  ------------------
 2715|  3.29k|        ++count;
 2716|  3.29k|      }
 2717|      0|      else {
 2718|       |        /* set count to 0 to return an error */
 2719|      0|        count = 0;
 2720|      0|        break;
 2721|      0|      }
 2722|  3.29k|    }
 2723|  3.29k|    if(itmp->crl) {
  ------------------
  |  Branch (2723:8): [True: 0, False: 3.29k]
  ------------------
 2724|      0|      if(X509_STORE_add_crl(store, itmp->crl)) {
  ------------------
  |  Branch (2724:10): [True: 0, False: 0]
  ------------------
 2725|      0|        ++count;
 2726|      0|      }
 2727|      0|      else {
 2728|       |        /* set count to 0 to return an error */
 2729|      0|        count = 0;
 2730|      0|        break;
 2731|      0|      }
 2732|      0|    }
 2733|  3.29k|  }
 2734|       |
 2735|  3.29k|#if defined(__clang__) && __clang_major__ >= 16
 2736|  3.29k|#pragma clang diagnostic push
 2737|  3.29k|#pragma clang diagnostic ignored "-Wcast-function-type-strict"
 2738|  3.29k|#endif
 2739|  3.29k|  sk_X509_INFO_pop_free(inf, X509_INFO_free);
 2740|  3.29k|#if defined(__clang__) && __clang_major__ >= 16
 2741|  3.29k|#pragma clang diagnostic pop
 2742|  3.29k|#endif
 2743|  3.29k|  BIO_free(cbio);
 2744|       |
 2745|       |  /* if we did not end up importing anything, treat that as an error */
 2746|  3.29k|  return (count > 0) ? CURLE_OK : CURLE_SSL_CACERT_BADFILE;
  ------------------
  |  Branch (2746:10): [True: 3.29k, False: 0]
  ------------------
 2747|  3.29k|}
openssl.c:ossl_set_cached_x509_store:
 3256|     15|{
 3257|     15|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 3258|     15|  struct Curl_multi *multi = data->multi;
 3259|     15|  struct ossl_x509_share *share;
 3260|       |
 3261|     15|  DEBUGASSERT(multi);
  ------------------
  |  | 1016|     15|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3261:3): [True: 0, False: 15]
  |  Branch (3261:3): [True: 15, False: 0]
  ------------------
 3262|     15|  if(!multi)
  ------------------
  |  Branch (3262:6): [True: 0, False: 15]
  ------------------
 3263|      0|    return;
 3264|     15|  share = Curl_hash_pick(&multi->proto_hash,
 3265|     15|                         MPROTO_OSSL_X509_KEY,
  ------------------
  |  | 3165|     15|#define MPROTO_OSSL_X509_KEY  "tls:ossl:x509:share"
  ------------------
 3266|     15|                         CURL_CSTRLEN(MPROTO_OSSL_X509_KEY));
  ------------------
  |  | 1319|     15|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
 3267|       |
 3268|     15|  if(!share) {
  ------------------
  |  Branch (3268:6): [True: 15, False: 0]
  ------------------
 3269|     15|    share = curlx_calloc(1, sizeof(*share));
  ------------------
  |  | 1500|     15|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
 3270|     15|    if(!share)
  ------------------
  |  Branch (3270:8): [True: 0, False: 15]
  ------------------
 3271|      0|      return;
 3272|     15|    if(!Curl_hash_add2(&multi->proto_hash,
  ------------------
  |  Branch (3272:8): [True: 1, False: 14]
  ------------------
 3273|     15|                       MPROTO_OSSL_X509_KEY,
  ------------------
  |  | 3165|     15|#define MPROTO_OSSL_X509_KEY  "tls:ossl:x509:share"
  ------------------
 3274|     15|                       CURL_CSTRLEN(MPROTO_OSSL_X509_KEY),
  ------------------
  |  | 1319|     15|#define CURL_CSTRLEN(x) (sizeof(x) - 1)
  ------------------
 3275|     15|                       share, oss_x509_share_free)) {
 3276|      1|      curlx_free(share);
  ------------------
  |  | 1503|      1|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3277|      1|      return;
 3278|      1|    }
 3279|     15|  }
 3280|       |
 3281|     14|  if(X509_STORE_up_ref(store)) {
  ------------------
  |  Branch (3281:6): [True: 14, False: 0]
  ------------------
 3282|     14|    char *CAfile = NULL;
 3283|     14|    char *CApath = NULL;
 3284|       |
 3285|     14|    if(conn_config->CAfile) {
  ------------------
  |  Branch (3285:8): [True: 0, False: 14]
  ------------------
 3286|      0|      CAfile = curlx_strdup(conn_config->CAfile);
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 3287|      0|      if(!CAfile) {
  ------------------
  |  Branch (3287:10): [True: 0, False: 0]
  ------------------
 3288|      0|        X509_STORE_free(store);
 3289|      0|        return;
 3290|      0|      }
 3291|      0|    }
 3292|       |
 3293|     14|    if(conn_config->CApath) {
  ------------------
  |  Branch (3293:8): [True: 0, False: 14]
  ------------------
 3294|      0|      CApath = curlx_strdup(conn_config->CApath);
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
 3295|      0|      if(!CApath) {
  ------------------
  |  Branch (3295:10): [True: 0, False: 0]
  ------------------
 3296|      0|        curlx_free(CAfile);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3297|      0|        X509_STORE_free(store);
 3298|      0|        return;
 3299|      0|      }
 3300|      0|    }
 3301|       |
 3302|     14|    if(share->store) {
  ------------------
  |  Branch (3302:8): [True: 0, False: 14]
  ------------------
 3303|      0|      X509_STORE_free(share->store);
 3304|      0|      curlx_free(share->CAfile);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3305|      0|      curlx_free(share->CApath);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3306|      0|    }
 3307|       |
 3308|     14|    share->time = *Curl_pgrs_now(data);
 3309|     14|    share->store = store;
 3310|     14|    share->store_is_empty = is_empty;
 3311|     14|    share->CAfile = CAfile;
 3312|     14|    share->CApath = CApath;
 3313|     14|    share->no_partialchain = conn_config->no_partialchain;
 3314|     14|  }
 3315|     14|}
openssl.c:oss_x509_share_free:
 3177|     14|{
 3178|     14|  struct ossl_x509_share *share = p;
 3179|     14|  DEBUGASSERT(key_len == CURL_CSTRLEN(MPROTO_OSSL_X509_KEY));
  ------------------
  |  | 1016|     14|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3179:3): [True: 0, False: 14]
  |  Branch (3179:3): [True: 14, False: 0]
  ------------------
 3180|     14|  DEBUGASSERT(!memcmp(MPROTO_OSSL_X509_KEY, key, key_len));
  ------------------
  |  | 1016|     14|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3180:3): [True: 0, False: 14]
  |  Branch (3180:3): [True: 14, False: 0]
  ------------------
 3181|     14|  (void)key;
 3182|     14|  (void)key_len;
 3183|     14|  if(share->store) {
  ------------------
  |  Branch (3183:6): [True: 14, False: 0]
  ------------------
 3184|     14|    X509_STORE_free(share->store);
 3185|     14|  }
 3186|     14|  curlx_free(share->CAfile);
  ------------------
  |  | 1503|     14|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3187|     14|  curlx_free(share->CApath);
  ------------------
  |  | 1503|     14|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3188|     14|  curlx_free(share);
  ------------------
  |  | 1503|     14|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
 3189|     14|}
openssl.c:ossl_seed:
  809|  65.4k|{
  810|       |  /* This might get called before it has been added to a multi handle */
  811|  65.4k|  if(data->multi && data->multi->ssl_seeded)
  ------------------
  |  Branch (811:6): [True: 10.0k, False: 55.3k]
  |  Branch (811:21): [True: 6.68k, False: 3.34k]
  ------------------
  812|  6.68k|    return CURLE_OK;
  813|       |
  814|  58.7k|  if(rand_enough()) {
  ------------------
  |  Branch (814:6): [True: 58.7k, False: 0]
  ------------------
  815|       |    /* OpenSSL 1.1.0+ should return here */
  816|  58.7k|    if(data->multi)
  ------------------
  |  Branch (816:8): [True: 3.34k, False: 55.3k]
  ------------------
  817|  3.34k|      data->multi->ssl_seeded = TRUE;
  ------------------
  |  |  986|  3.34k|#define TRUE true
  ------------------
  818|  58.7k|    return CURLE_OK;
  819|  58.7k|  }
  820|      0|  failf(data, "Insufficient randomness");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  821|      0|  return CURLE_SSL_CONNECT_ERROR;
  822|  58.7k|}
openssl.c:rand_enough:
  804|  76.0k|{
  805|  76.0k|  return RAND_status() != 0;
  806|  76.0k|}
openssl.c:ossl_init_method:
 3668|  3.33k|{
 3669|  3.33k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 3670|       |
 3671|  3.33k|  *pmethod = NULL;
 3672|  3.33k|  *pssl_version_min = conn_config->version;
 3673|  3.33k|  DEBUGASSERT(conn_config->version != CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 1016|  3.33k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (3673:3): [True: 0, False: 3.33k]
  |  Branch (3673:3): [True: 3.33k, False: 0]
  ------------------
 3674|  3.33k|  switch(peer->transport) {
 3675|      0|  case TRNSPRT_TCP:
  ------------------
  |  |  225|      0|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (3675:3): [True: 0, False: 3.33k]
  ------------------
 3676|       |    /* check to see if we have been told to use an explicit SSL/TLS version */
 3677|      0|    switch(*pssl_version_min) {
 3678|      0|    case CURL_SSLVERSION_TLSv1:
  ------------------
  |  | 2395|      0|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  ------------------
  |  Branch (3678:5): [True: 0, False: 0]
  ------------------
 3679|      0|    case CURL_SSLVERSION_TLSv1_0:
  ------------------
  |  | 2398|      0|#define CURL_SSLVERSION_TLSv1_0 4L
  ------------------
  |  Branch (3679:5): [True: 0, False: 0]
  ------------------
 3680|      0|    case CURL_SSLVERSION_TLSv1_1:
  ------------------
  |  | 2399|      0|#define CURL_SSLVERSION_TLSv1_1 5L
  ------------------
  |  Branch (3680:5): [True: 0, False: 0]
  ------------------
 3681|      0|    case CURL_SSLVERSION_TLSv1_2:
  ------------------
  |  | 2400|      0|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  |  Branch (3681:5): [True: 0, False: 0]
  ------------------
 3682|      0|    case CURL_SSLVERSION_TLSv1_3:
  ------------------
  |  | 2401|      0|#define CURL_SSLVERSION_TLSv1_3 7L
  ------------------
  |  Branch (3682:5): [True: 0, False: 0]
  ------------------
 3683|       |      /* it is handled later with the context options */
 3684|      0|      *pmethod = TLS_client_method();
 3685|      0|      break;
 3686|      0|    case CURL_SSLVERSION_SSLv2:
  ------------------
  |  | 2396|      0|#define CURL_SSLVERSION_SSLv2   2L
  ------------------
  |  Branch (3686:5): [True: 0, False: 0]
  ------------------
 3687|      0|      failf(data, "No SSLv2 support");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3688|      0|      return CURLE_NOT_BUILT_IN;
 3689|      0|    case CURL_SSLVERSION_SSLv3:
  ------------------
  |  | 2397|      0|#define CURL_SSLVERSION_SSLv3   3L
  ------------------
  |  Branch (3689:5): [True: 0, False: 0]
  ------------------
 3690|      0|      failf(data, "No SSLv3 support");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3691|      0|      return CURLE_NOT_BUILT_IN;
 3692|      0|    default:
  ------------------
  |  Branch (3692:5): [True: 0, False: 0]
  ------------------
 3693|      0|      failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3694|      0|      return CURLE_SSL_CONNECT_ERROR;
 3695|      0|    }
 3696|      0|    break;
 3697|  3.33k|  case TRNSPRT_QUIC:
  ------------------
  |  |  227|  3.33k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (3697:3): [True: 3.33k, False: 0]
  ------------------
 3698|  3.33k|    *pssl_version_min = CURL_SSLVERSION_TLSv1_3;
  ------------------
  |  | 2401|  3.33k|#define CURL_SSLVERSION_TLSv1_3 7L
  ------------------
 3699|  3.33k|    if(conn_config->version_max &&
  ------------------
  |  Branch (3699:8): [True: 0, False: 3.33k]
  ------------------
 3700|      0|       (conn_config->version_max != CURL_SSLVERSION_MAX_DEFAULT) &&
  ------------------
  |  | 2406|      0|#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1   << 16)
  |  |  ------------------
  |  |  |  | 2395|      0|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  |  |  ------------------
  ------------------
  |  Branch (3700:8): [True: 0, False: 0]
  ------------------
 3701|      0|       (conn_config->version_max != CURL_SSLVERSION_MAX_TLSv1_3)) {
  ------------------
  |  | 2410|      0|#define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)
  |  |  ------------------
  |  |  |  | 2401|      0|#define CURL_SSLVERSION_TLSv1_3 7L
  |  |  ------------------
  ------------------
  |  Branch (3701:8): [True: 0, False: 0]
  ------------------
 3702|      0|      failf(data, "QUIC needs at least TLS version 1.3");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3703|      0|      return CURLE_SSL_CONNECT_ERROR;
 3704|      0|    }
 3705|       |
 3706|  3.33k|    *pmethod = TLS_method();
 3707|  3.33k|    break;
 3708|      0|  default:
  ------------------
  |  Branch (3708:3): [True: 0, False: 3.33k]
  ------------------
 3709|      0|    failf(data, "unsupported transport %d in SSL init", peer->transport);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3710|      0|    return CURLE_SSL_CONNECT_ERROR;
 3711|  3.33k|  }
 3712|       |
 3713|  3.33k|  return *pmethod ? CURLE_OK : CURLE_SSL_CONNECT_ERROR;
  ------------------
  |  Branch (3713:10): [True: 3.33k, False: 0]
  ------------------
 3714|  3.33k|}
openssl.c:ossl_set_ssl_version_min_max:
 2510|  3.33k|{
 2511|  3.33k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 2512|       |  /* first, TLS min version... */
 2513|  3.33k|  long curl_ssl_version_min = (long)ssl_version_min;
 2514|  3.33k|  long curl_ssl_version_max;
 2515|       |
 2516|       |  /* convert curl min SSL version option to OpenSSL constant */
 2517|       |#if defined(HAVE_BORINGSSL_LIKE) || defined(LIBRESSL_VERSION_NUMBER)
 2518|       |  uint16_t ossl_ssl_version_min = 0;
 2519|       |  uint16_t ossl_ssl_version_max = 0;
 2520|       |#else
 2521|  3.33k|  long ossl_ssl_version_min = 0;
 2522|  3.33k|  long ossl_ssl_version_max = 0;
 2523|  3.33k|#endif
 2524|       |  /* it cannot be default here */
 2525|  3.33k|  DEBUGASSERT(curl_ssl_version_min != CURL_SSLVERSION_DEFAULT);
  ------------------
  |  | 1016|  3.33k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2525:3): [True: 0, False: 3.33k]
  |  Branch (2525:3): [True: 3.33k, False: 0]
  ------------------
 2526|  3.33k|  switch(curl_ssl_version_min) {
  ------------------
  |  Branch (2526:10): [True: 3.33k, False: 0]
  ------------------
 2527|      0|  case CURL_SSLVERSION_TLSv1: /* TLS 1.x */
  ------------------
  |  | 2395|      0|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  ------------------
  |  Branch (2527:3): [True: 0, False: 3.33k]
  ------------------
 2528|      0|  case CURL_SSLVERSION_TLSv1_0:
  ------------------
  |  | 2398|      0|#define CURL_SSLVERSION_TLSv1_0 4L
  ------------------
  |  Branch (2528:3): [True: 0, False: 3.33k]
  ------------------
 2529|      0|    ossl_ssl_version_min = TLS1_VERSION;
 2530|      0|    break;
 2531|      0|  case CURL_SSLVERSION_TLSv1_1:
  ------------------
  |  | 2399|      0|#define CURL_SSLVERSION_TLSv1_1 5L
  ------------------
  |  Branch (2531:3): [True: 0, False: 3.33k]
  ------------------
 2532|      0|    ossl_ssl_version_min = TLS1_1_VERSION;
 2533|      0|    break;
 2534|      0|  case CURL_SSLVERSION_TLSv1_2:
  ------------------
  |  | 2400|      0|#define CURL_SSLVERSION_TLSv1_2 6L
  ------------------
  |  Branch (2534:3): [True: 0, False: 3.33k]
  ------------------
 2535|      0|    ossl_ssl_version_min = TLS1_2_VERSION;
 2536|      0|    break;
 2537|  3.33k|  case CURL_SSLVERSION_TLSv1_3:
  ------------------
  |  | 2401|  3.33k|#define CURL_SSLVERSION_TLSv1_3 7L
  ------------------
  |  Branch (2537:3): [True: 3.33k, False: 0]
  ------------------
 2538|  3.33k|    ossl_ssl_version_min = TLS1_3_VERSION;
 2539|  3.33k|    break;
 2540|  3.33k|  }
 2541|       |
 2542|       |  /* ... then, TLS max version */
 2543|  3.33k|  curl_ssl_version_max = (long)conn_config->version_max;
 2544|       |
 2545|       |  /* convert curl max SSL version option to OpenSSL constant */
 2546|  3.33k|  switch(curl_ssl_version_max) {
 2547|      0|  case CURL_SSLVERSION_MAX_TLSv1_0:
  ------------------
  |  | 2407|      0|#define CURL_SSLVERSION_MAX_TLSv1_0 (CURL_SSLVERSION_TLSv1_0 << 16)
  |  |  ------------------
  |  |  |  | 2398|      0|#define CURL_SSLVERSION_TLSv1_0 4L
  |  |  ------------------
  ------------------
  |  Branch (2547:3): [True: 0, False: 3.33k]
  ------------------
 2548|      0|    ossl_ssl_version_max = TLS1_VERSION;
 2549|      0|    break;
 2550|      0|  case CURL_SSLVERSION_MAX_TLSv1_1:
  ------------------
  |  | 2408|      0|#define CURL_SSLVERSION_MAX_TLSv1_1 (CURL_SSLVERSION_TLSv1_1 << 16)
  |  |  ------------------
  |  |  |  | 2399|      0|#define CURL_SSLVERSION_TLSv1_1 5L
  |  |  ------------------
  ------------------
  |  Branch (2550:3): [True: 0, False: 3.33k]
  ------------------
 2551|      0|    ossl_ssl_version_max = TLS1_1_VERSION;
 2552|      0|    break;
 2553|      0|  case CURL_SSLVERSION_MAX_TLSv1_2:
  ------------------
  |  | 2409|      0|#define CURL_SSLVERSION_MAX_TLSv1_2 (CURL_SSLVERSION_TLSv1_2 << 16)
  |  |  ------------------
  |  |  |  | 2400|      0|#define CURL_SSLVERSION_TLSv1_2 6L
  |  |  ------------------
  ------------------
  |  Branch (2553:3): [True: 0, False: 3.33k]
  ------------------
 2554|      0|    ossl_ssl_version_max = TLS1_2_VERSION;
 2555|      0|    break;
 2556|      0|  case CURL_SSLVERSION_MAX_TLSv1_3:
  ------------------
  |  | 2410|      0|#define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)
  |  |  ------------------
  |  |  |  | 2401|      0|#define CURL_SSLVERSION_TLSv1_3 7L
  |  |  ------------------
  ------------------
  |  Branch (2556:3): [True: 0, False: 3.33k]
  ------------------
 2557|      0|    ossl_ssl_version_max = TLS1_3_VERSION;
 2558|      0|    break;
 2559|  3.33k|  case CURL_SSLVERSION_MAX_NONE:  /* none selected */
  ------------------
  |  | 2405|  3.33k|#define CURL_SSLVERSION_MAX_NONE 0L
  ------------------
  |  Branch (2559:3): [True: 3.33k, False: 0]
  ------------------
 2560|  3.33k|  case CURL_SSLVERSION_MAX_DEFAULT:  /* max selected */
  ------------------
  |  | 2406|  3.33k|#define CURL_SSLVERSION_MAX_DEFAULT (CURL_SSLVERSION_TLSv1   << 16)
  |  |  ------------------
  |  |  |  | 2395|  3.33k|#define CURL_SSLVERSION_TLSv1   1L /* TLS 1.x */
  |  |  ------------------
  ------------------
  |  Branch (2560:3): [True: 0, False: 3.33k]
  ------------------
 2561|  3.33k|  default:
  ------------------
  |  Branch (2561:3): [True: 0, False: 3.33k]
  ------------------
 2562|       |    /* SSL_CTX_set_max_proto_version states that: setting the maximum to 0
 2563|       |       enables protocol versions up to the highest version supported by
 2564|       |       the library */
 2565|  3.33k|    ossl_ssl_version_max = 0;
 2566|  3.33k|    break;
 2567|  3.33k|  }
 2568|       |
 2569|  3.33k|  if(!SSL_CTX_set_min_proto_version(ctx, ossl_ssl_version_min) ||
  ------------------
  |  Branch (2569:6): [True: 0, False: 3.33k]
  ------------------
 2570|  3.33k|     !SSL_CTX_set_max_proto_version(ctx, ossl_ssl_version_max))
  ------------------
  |  Branch (2570:6): [True: 0, False: 3.33k]
  ------------------
 2571|      0|    return CURLE_SSL_CONNECT_ERROR;
 2572|       |
 2573|  3.33k|  return CURLE_OK;
 2574|  3.33k|}
openssl.c:ossl_keylog_callback:
  670|  9.82k|{
  671|  9.82k|  (void)ssl;
  672|       |
  673|  9.82k|  Curl_tls_keylog_write_line(line);
  674|  9.82k|}
openssl.c:ossl_init_ssl:
 3625|  3.33k|{
 3626|       |  /* Let's make an SSL structure */
 3627|  3.33k|  if(octx->ssl)
  ------------------
  |  Branch (3627:6): [True: 0, False: 3.33k]
  ------------------
 3628|      0|    SSL_free(octx->ssl);
 3629|  3.33k|  octx->ssl = SSL_new(octx->ssl_ctx);
 3630|  3.33k|  if(!octx->ssl) {
  ------------------
  |  Branch (3630:6): [True: 0, False: 3.33k]
  ------------------
 3631|      0|    failf(data, "SSL: could not create a context (handle)");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3632|      0|    return CURLE_OUT_OF_MEMORY;
 3633|      0|  }
 3634|       |
 3635|  3.33k|  SSL_set_app_data(octx->ssl, ssl_user_data);
 3636|       |
 3637|  3.33k|#ifndef OPENSSL_NO_OCSP
 3638|  3.33k|  if(Curl_ssl_cf_get_filter_config(cf)->verifystatus)
  ------------------
  |  Branch (3638:6): [True: 0, False: 3.33k]
  ------------------
 3639|  3.33k|    SSL_set_tlsext_status_type(octx->ssl, TLSEXT_STATUSTYPE_ocsp);
 3640|  3.33k|#endif
 3641|       |
 3642|  3.33k|  SSL_set_connect_state(octx->ssl);
 3643|       |
 3644|  3.33k|  if(peer->sni) {
  ------------------
  |  Branch (3644:6): [True: 2.27k, False: 1.06k]
  ------------------
 3645|  2.27k|    if(!SSL_set_tlsext_host_name(octx->ssl, peer->sni)) {
  ------------------
  |  Branch (3645:8): [True: 0, False: 2.27k]
  ------------------
 3646|      0|      failf(data, "Failed set SNI");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3647|      0|      return CURLE_SSL_CONNECT_ERROR;
 3648|      0|    }
 3649|  2.27k|  }
 3650|       |
 3651|  3.33k|#ifdef HAVE_SSL_SET1_ECH_CONFIG_LIST
 3652|  3.33k|  {
 3653|  3.33k|    CURLcode result = ossl_init_ech(octx, cf, data, peer);
 3654|  3.33k|    if(result)
  ------------------
  |  Branch (3654:8): [True: 0, False: 3.33k]
  ------------------
 3655|      0|      return result;
 3656|  3.33k|  }
 3657|  3.33k|#endif /* HAVE_SSL_SET1_ECH_CONFIG_LIST */
 3658|       |
 3659|  3.33k|  return ossl_init_session_and_alpns(octx, cf, data, peer,
 3660|  3.33k|                                     alpns_requested, sess_reuse_cb);
 3661|  3.33k|}
openssl.c:ossl_init_ech:
 3500|  3.33k|{
 3501|  3.33k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 3502|  3.33k|  int trying_ech_now = 0;
 3503|       |
 3504|  3.33k|  if(!Curl_ssl_ech_enabled(cf))
  ------------------
  |  Branch (3504:6): [True: 3.33k, False: 0]
  ------------------
 3505|  3.33k|    return CURLE_OK;
 3506|       |
 3507|      0|  if(conn_config->ech == CURLECH_GREASE) {
  ------------------
  |  |   55|      0|#define CURLECH_GREASE     1
  ------------------
  |  Branch (3507:6): [True: 0, False: 0]
  ------------------
 3508|      0|    infof(data, "ECH: will GREASE ClientHello");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3509|       |#ifdef HAVE_BORINGSSL_LIKE
 3510|       |    SSL_set_enable_ech_grease(octx->ssl, 1);
 3511|       |#else
 3512|      0|    SSL_set_options(octx->ssl, SSL_OP_ECH_GREASE);
 3513|      0|#endif
 3514|      0|  }
 3515|      0|  else if(conn_config->ech && conn_config->ech_config) {
  ------------------
  |  Branch (3515:11): [True: 0, False: 0]
  |  Branch (3515:31): [True: 0, False: 0]
  ------------------
 3516|       |#ifdef HAVE_BORINGSSL_LIKE
 3517|       |    uint8_t *ech_config;
 3518|       |    size_t ech_config_len = 0;
 3519|       |    CURLcode result;
 3520|       |
 3521|       |    if(!conn_config->ech_config[0]) {
 3522|       |      infof(data, "ECH: ECHConfig from command line empty");
 3523|       |      return CURLE_SSL_CONNECT_ERROR;
 3524|       |    }
 3525|       |    ech_config_len = 2 * strlen(conn_config->ech_config);
 3526|       |    result = curlx_base64_decode(conn_config->ech_config,
 3527|       |                                 &ech_config, &ech_config_len);
 3528|       |    if(result || !ech_config) {
 3529|       |      infof(data, "ECH: cannot base64 decode ECHConfig from command line");
 3530|       |      if(conn_config->ech == CURLECH_HARD)
 3531|       |        return result;
 3532|       |    }
 3533|       |    if(SSL_set1_ech_config_list(octx->ssl, ech_config, ech_config_len) != 1) {
 3534|       |      infof(data, "ECH: SSL_ECH_set1_ech_config_list failed");
 3535|       |      if(conn_config->ech == CURLECH_HARD) {
 3536|       |        curlx_free(ech_config);
 3537|       |        return CURLE_SSL_CONNECT_ERROR;
 3538|       |      }
 3539|       |    }
 3540|       |    curlx_free(ech_config);
 3541|       |    trying_ech_now = 1;
 3542|       |#else
 3543|      0|    size_t ech_config_len = 0;
 3544|      0|    if(!conn_config->ech_config[0]) {
  ------------------
  |  Branch (3544:8): [True: 0, False: 0]
  ------------------
 3545|      0|      infof(data, "ECH: ECHConfig from command line empty");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3546|      0|      return CURLE_SSL_CONNECT_ERROR;
 3547|      0|    }
 3548|      0|    ech_config_len = strlen(conn_config->ech_config);
 3549|      0|    if(SSL_set1_ech_config_list(octx->ssl,
  ------------------
  |  Branch (3549:8): [True: 0, False: 0]
  ------------------
 3550|      0|                                (const uint8_t *)conn_config->ech_config,
 3551|      0|                                ech_config_len) != 1) {
 3552|      0|      infof(data, "ECH: SSL_ECH_set1_ech_config_list failed");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3553|      0|      if(conn_config->ech == CURLECH_HARD)
  ------------------
  |  |   57|      0|#define CURLECH_HARD       3
  ------------------
  |  Branch (3553:10): [True: 0, False: 0]
  ------------------
 3554|      0|        return CURLE_SSL_CONNECT_ERROR;
 3555|      0|    }
 3556|      0|    else
 3557|      0|      trying_ech_now = 1;
 3558|      0|#endif /* HAVE_BORINGSSL_LIKE */
 3559|      0|    infof(data, "ECH: ECHConfig from command line");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3560|      0|  }
 3561|      0|  else {
 3562|      0|    const struct Curl_https_rrinfo *rinfo =
 3563|      0|      Curl_dns_cf_get_https(data, cf, peer->origin);
 3564|       |
 3565|      0|    if(Curl_httpsrr_is_for_peer(peer->origin, rinfo) && rinfo->echconfiglist) {
  ------------------
  |  Branch (3565:8): [True: 0, False: 0]
  |  Branch (3565:57): [True: 0, False: 0]
  ------------------
 3566|      0|      const unsigned char *ecl = rinfo->echconfiglist;
 3567|      0|      size_t elen = rinfo->echconfiglist_len;
 3568|       |
 3569|      0|      infof(data, "ECH: ECHConfig from HTTPS RR");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3570|      0|      if(SSL_set1_ech_config_list(octx->ssl, ecl, elen) != 1) {
  ------------------
  |  Branch (3570:10): [True: 0, False: 0]
  ------------------
 3571|      0|        infof(data, "ECH: SSL_set1_ech_config_list failed");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3572|      0|        if(conn_config->ech == CURLECH_HARD)
  ------------------
  |  |   57|      0|#define CURLECH_HARD       3
  ------------------
  |  Branch (3572:12): [True: 0, False: 0]
  ------------------
 3573|      0|          return CURLE_SSL_CONNECT_ERROR;
 3574|      0|      }
 3575|      0|      else {
 3576|      0|        trying_ech_now = 1;
 3577|      0|        infof(data, "ECH: imported ECHConfigList of length %zu", elen);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3578|      0|      }
 3579|      0|    }
 3580|      0|    else {
 3581|      0|      infof(data, "ECH: requested but no ECHConfig available");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3582|      0|      if(conn_config->ech == CURLECH_HARD)
  ------------------
  |  |   57|      0|#define CURLECH_HARD       3
  ------------------
  |  Branch (3582:10): [True: 0, False: 0]
  ------------------
 3583|      0|        return CURLE_SSL_CONNECT_ERROR;
 3584|      0|    }
 3585|      0|  }
 3586|       |#ifdef HAVE_BORINGSSL_LIKE
 3587|       |  (void)peer;
 3588|       |  if(trying_ech_now && conn_config->ech_public) {
 3589|       |    infof(data, "ECH: setting public_name not supported with BoringSSL");
 3590|       |    return CURLE_SSL_CONNECT_ERROR;
 3591|       |  }
 3592|       |#else
 3593|      0|  if(trying_ech_now && conn_config->ech_public) {
  ------------------
  |  Branch (3593:6): [True: 0, False: 0]
  |  Branch (3593:24): [True: 0, False: 0]
  ------------------
 3594|      0|    int ret;
 3595|      0|    infof(data, "ECH: inner: '%s', outer: '%s'",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 0]
  |  |  ------------------
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3596|      0|          peer->origin->hostname ? peer->origin->hostname : "NULL",
 3597|      0|          conn_config->ech_public);
 3598|      0|    ret = SSL_ech_set1_server_names(octx->ssl,
 3599|      0|                                    peer->origin->hostname,
 3600|      0|                                    conn_config->ech_public,
 3601|      0|                                    0 /* do send outer */);
 3602|      0|    if(ret != 1) {
  ------------------
  |  Branch (3602:8): [True: 0, False: 0]
  ------------------
 3603|      0|      infof(data, "ECH: rv failed to set server name(s) %d [ERROR]", ret);
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3604|      0|      return CURLE_SSL_CONNECT_ERROR;
 3605|      0|    }
 3606|      0|  }
 3607|      0|#endif /* HAVE_BORINGSSL_LIKE */
 3608|      0|  if(trying_ech_now &&
  ------------------
  |  Branch (3608:6): [True: 0, False: 0]
  ------------------
 3609|      0|     SSL_set_min_proto_version(octx->ssl, TLS1_3_VERSION) != 1) {
  ------------------
  |  Branch (3609:6): [True: 0, False: 0]
  ------------------
 3610|      0|    infof(data, "ECH: cannot force TLSv1.3 [ERROR]");
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3611|      0|    return CURLE_SSL_CONNECT_ERROR;
 3612|      0|  }
 3613|       |
 3614|      0|  return CURLE_OK;
 3615|      0|}
openssl.c:ossl_init_session_and_alpns:
 3447|  3.33k|{
 3448|  3.33k|  struct ssl_filter_config *conn_cfg = Curl_ssl_cf_get_filter_config(cf);
 3449|  3.33k|  struct alpn_spec alpns;
 3450|  3.33k|  CURLcode result;
 3451|       |
 3452|  3.33k|  Curl_alpn_copy(&alpns, alpns_requested);
 3453|       |
 3454|  3.33k|  octx->reused_session = FALSE;
  ------------------
  |  |  989|  3.33k|#define FALSE false
  ------------------
 3455|       |
 3456|  3.33k|  if(!CF_IS_PRIMARY(cf) && !(cf->cft->flags & CF_TYPE_PROXY)) {
  ------------------
  |  |  261|  6.67k|#define CF_IS_PRIMARY(cf)       (bool)(cf)->chain->primary
  ------------------
                if(!CF_IS_PRIMARY(cf) && !(cf->cft->flags & CF_TYPE_PROXY)) {
  ------------------
  |  |  213|      0|#define CF_TYPE_PROXY       (1 << 3)
  ------------------
  |  Branch (3456:6): [True: 0, False: 3.33k]
  |  Branch (3456:28): [True: 0, False: 0]
  ------------------
 3457|       |    /* FTP is a bitch. On TLS secured transfers, it is a common server
 3458|       |     * option to require the client to use the SAME TLS session as on
 3459|       |     * the control connection or it fails the request. See #22225. */
 3460|      0|    struct Curl_ssl_session *scs = Curl_ssl_get_primary_session(data, cf->cft);
 3461|      0|    if(scs) {
  ------------------
  |  Branch (3461:8): [True: 0, False: 0]
  ------------------
 3462|      0|      if(ossl_apply_session(octx, cf, data, &alpns, sess_reuse_cb, scs))
  ------------------
  |  Branch (3462:10): [True: 0, False: 0]
  ------------------
 3463|      0|        CURL_TRC_CF(data, cf, "applied SSL session from control connection");
  ------------------
  |  |  153|      0|  do {                                          \
  |  |  154|      0|    if(Curl_trc_cf_is_verbose(cf, data))        \
  |  |  ------------------
  |  |  |  |  326|      0|  (Curl_trc_is_verbose(data) &&                       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  327|      0|   (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (327:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (327:12): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  155|      0|      Curl_trc_cf_infof(data, cf, __VA_ARGS__); \
  |  |  156|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3464|      0|    }
 3465|      0|  }
 3466|       |
 3467|  3.33k|  if(!octx->reused_session &&
  ------------------
  |  Branch (3467:6): [True: 3.33k, False: 0]
  ------------------
 3468|  3.33k|     Curl_ssl_scache_use(cf, data) && !conn_cfg->verifystatus) {
  ------------------
  |  Branch (3468:6): [True: 3.33k, False: 0]
  |  Branch (3468:39): [True: 3.33k, False: 0]
  ------------------
 3469|  3.33k|    struct Curl_ssl_session *scs = NULL;
 3470|       |
 3471|  3.33k|    result = Curl_ssl_scache_take(cf, data, peer->scache_key, &scs);
 3472|  3.33k|    if(!result && scs && scs->sdata && scs->sdata_len) {
  ------------------
  |  Branch (3472:8): [True: 3.33k, False: 0]
  |  Branch (3472:19): [True: 0, False: 3.33k]
  |  Branch (3472:26): [True: 0, False: 0]
  |  Branch (3472:40): [True: 0, False: 0]
  ------------------
 3473|      0|      (void)ossl_apply_session(octx, cf, data, &alpns, sess_reuse_cb, scs);
 3474|      0|    }
 3475|  3.33k|    Curl_ssl_scache_return(cf, data, peer->scache_key, scs);
 3476|  3.33k|  }
 3477|       |
 3478|  3.33k|  if(alpns.count) {
  ------------------
  |  Branch (3478:6): [True: 3.33k, False: 0]
  ------------------
 3479|  3.33k|    struct alpn_proto_buf proto;
 3480|  3.33k|    memset(&proto, 0, sizeof(proto));
 3481|  3.33k|    result = Curl_alpn_to_proto_buf(&proto, &alpns);
 3482|  3.33k|    if(result) {
  ------------------
  |  Branch (3482:8): [True: 0, False: 3.33k]
  ------------------
 3483|      0|      failf(data, "Error determining ALPN");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3484|      0|      return CURLE_SSL_CONNECT_ERROR;
 3485|      0|    }
 3486|  3.33k|    if(SSL_set_alpn_protos(octx->ssl, proto.data, proto.len)) {
  ------------------
  |  Branch (3486:8): [True: 0, False: 3.33k]
  ------------------
 3487|      0|      failf(data, "Error setting ALPN");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 3488|      0|      return CURLE_SSL_CONNECT_ERROR;
 3489|      0|    }
 3490|  3.33k|  }
 3491|       |
 3492|  3.33k|  return CURLE_OK;
 3493|  3.33k|}
openssl.c:ossl_infof_cert:
 4653|  1.95k|{
 4654|  1.95k|  BIO *mem = NULL;
 4655|  1.95k|  struct dynbuf dname;
 4656|  1.95k|  char err_buf[256] = "";
 4657|  1.95k|  char *buf;
 4658|  1.95k|  long len;
 4659|  1.95k|  CURLcode result = CURLE_OK;
 4660|       |
 4661|  1.95k|  if(!Curl_trc_is_verbose(data))
  ------------------
  |  |  322|  1.95k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  ------------------
  |  |  323|  1.95k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  ------------------
  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4662|  1.81k|    return CURLE_OK;
 4663|       |
 4664|    147|  curlx_dyn_init(&dname, MAX_CERT_NAME_LENGTH);
  ------------------
  |  | 4649|    147|#define MAX_CERT_NAME_LENGTH 2048
  ------------------
 4665|    147|  mem = BIO_new(BIO_s_mem());
 4666|    147|  if(!mem) {
  ------------------
  |  Branch (4666:6): [True: 0, False: 147]
  ------------------
 4667|      0|    failf(data, "BIO_new return NULL, " OSSL_PACKAGE " error %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4668|      0|          ossl_strerror(ERR_get_error(), err_buf, sizeof(err_buf)));
 4669|      0|    result = CURLE_OUT_OF_MEMORY;
 4670|      0|    goto out;
 4671|      0|  }
 4672|       |
 4673|    147|  infof(data, "%s certificate:", Curl_ssl_cf_is_proxy(cf) ?
  ------------------
  |  |  143|    147|  do {                               \
  |  |  144|    147|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    147|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    147|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    294|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 147]
  |  |  ------------------
  |  |  146|    147|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 147]
  |  |  ------------------
  ------------------
 4674|    147|        "Proxy" : "Server");
 4675|       |
 4676|    147|  result = x509_name_oneline(X509_get_subject_name(server_cert), &dname);
 4677|    147|  infof(data, "  subject: %s", result ? "[NONE]" : curlx_dyn_ptr(&dname));
  ------------------
  |  |  143|    147|  do {                               \
  |  |  144|    147|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    147|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    147|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    294|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 0, False: 147]
  |  |  ------------------
  |  |  146|    147|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 147]
  |  |  ------------------
  ------------------
 4678|       |
 4679|    147|  ASN1_TIME_print(mem, X509_get0_notBefore(server_cert));
 4680|    147|  len = BIO_get_mem_data(mem, (char **)&buf);
 4681|    147|  infof(data, "  start date: %.*s", (int)len, buf);
  ------------------
  |  |  143|    147|  do {                               \
  |  |  144|    147|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    147|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    147|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    147|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    147|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 147]
  |  |  ------------------
  ------------------
 4682|    147|  (void)BIO_reset(mem);
 4683|       |
 4684|    147|  ASN1_TIME_print(mem, X509_get0_notAfter(server_cert));
 4685|    147|  len = BIO_get_mem_data(mem, (char **)&buf);
 4686|    147|  infof(data, "  expire date: %.*s", (int)len, buf);
  ------------------
  |  |  143|    147|  do {                               \
  |  |  144|    147|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    147|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    147|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    147|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    147|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 147]
  |  |  ------------------
  ------------------
 4687|    147|  (void)BIO_reset(mem);
 4688|       |
 4689|    147|  result = x509_name_oneline(X509_get_issuer_name(server_cert), &dname);
 4690|    147|  if(result) /* should be only fatal stuff like OOM */
  ------------------
  |  Branch (4690:6): [True: 0, False: 147]
  ------------------
 4691|      0|    goto out;
 4692|    147|  infof(data, "  issuer: %s", curlx_dyn_ptr(&dname));
  ------------------
  |  |  143|    147|  do {                               \
  |  |  144|    147|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    147|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    147|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    147|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|    147|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 147]
  |  |  ------------------
  ------------------
 4693|       |
 4694|    147|out:
 4695|    147|  BIO_free(mem);
 4696|    147|  curlx_dyn_free(&dname);
 4697|    147|  return result;
 4698|    147|}
openssl.c:x509_name_oneline:
 1600|    294|{
 1601|    294|  BIO *bio_out = BIO_new(BIO_s_mem());
 1602|    294|  BUF_MEM *biomem;
 1603|    294|  int rc;
 1604|    294|  CURLcode result = CURLE_OUT_OF_MEMORY;
 1605|       |
 1606|    294|  if(bio_out) {
  ------------------
  |  Branch (1606:6): [True: 294, False: 0]
  ------------------
 1607|    294|    unsigned long flags = XN_FLAG_SEP_SPLUS_SPC |
 1608|    294|      (XN_FLAG_ONELINE & ~ASN1_STRFLGS_ESC_MSB & ~XN_FLAG_SPC_EQ);
 1609|    294|    curlx_dyn_reset(d);
 1610|    294|    rc = X509_NAME_print_ex(bio_out, a, 0, flags);
 1611|    294|    if(rc != -1) {
  ------------------
  |  Branch (1611:8): [True: 294, False: 0]
  ------------------
 1612|       |      BIO_get_mem_ptr(bio_out, &biomem);
 1613|    294|      result = curlx_dyn_addn(d, biomem->data, biomem->length);
 1614|    294|    }
 1615|    294|    BIO_free(bio_out);
 1616|    294|  }
 1617|    294|  return result;
 1618|    294|}
openssl.c:infof_certstack:
 4489|  1.95k|{
 4490|  1.95k|  STACK_OF(X509) *certstack;
 4491|  1.95k|  long verify_result;
 4492|  1.95k|  int num_cert_levels;
 4493|  1.95k|  int cert_level;
 4494|       |
 4495|  1.95k|  if(!Curl_trc_is_verbose(data))
  ------------------
  |  |  322|  1.95k|  ((data) && (data)->set.verbose &&                        \
  |  |  ------------------
  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  ------------------
  |  |  323|  1.95k|   (!(data)->state.feat ||                                 \
  |  |  ------------------
  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  ------------------
  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  ------------------
  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  ------------------
  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4496|  1.81k|    return;
 4497|       |
 4498|    147|  verify_result = SSL_get_verify_result(ssl);
 4499|    147|  if(verify_result != X509_V_OK)
  ------------------
  |  Branch (4499:6): [True: 0, False: 147]
  ------------------
 4500|      0|    certstack = SSL_get_peer_cert_chain(ssl);
 4501|    147|  else
 4502|    147|    certstack = SSL_get0_verified_chain(ssl);
 4503|    147|  if(!certstack)
  ------------------
  |  Branch (4503:6): [True: 0, False: 147]
  ------------------
 4504|      0|    return;
 4505|    147|  num_cert_levels = sk_X509_num(certstack);
 4506|       |
 4507|    294|  for(cert_level = 0; cert_level < num_cert_levels; cert_level++) {
  ------------------
  |  Branch (4507:23): [True: 147, False: 147]
  ------------------
 4508|    147|    char cert_algorithm[80] = "";
 4509|    147|    char group_name_final[80] = "";
 4510|    147|    const X509_ALGOR *palg_cert = NULL;
 4511|    147|    const ASN1_OBJECT *paobj_cert = NULL;
 4512|    147|    X509 *current_cert;
 4513|    147|    EVP_PKEY *current_pkey;
 4514|    147|    int key_bits;
 4515|    147|    int key_sec_bits;
 4516|    147|    int get_group_name;
 4517|    147|    const char *type_name;
 4518|       |
 4519|    147|    current_cert = sk_X509_value(certstack, cert_level);
 4520|    147|    if(!current_cert)
  ------------------
  |  Branch (4520:8): [True: 0, False: 147]
  ------------------
 4521|      0|      continue;
 4522|       |
 4523|    147|    current_pkey = X509_get0_pubkey(current_cert);
 4524|    147|    if(!current_pkey)
  ------------------
  |  Branch (4524:8): [True: 0, False: 147]
  ------------------
 4525|      0|      continue;
 4526|       |
 4527|    147|    X509_get0_signature(NULL, &palg_cert, current_cert);
 4528|    147|    X509_ALGOR_get0(&paobj_cert, NULL, NULL, palg_cert);
 4529|    147|    OBJ_obj2txt(cert_algorithm, sizeof(cert_algorithm), paobj_cert, 0);
 4530|       |
 4531|    147|    key_bits = EVP_PKEY_bits(current_pkey);
 4532|       |#ifndef HAVE_OPENSSL3
 4533|       |#define EVP_PKEY_get_security_bits EVP_PKEY_security_bits
 4534|       |#endif
 4535|    147|    key_sec_bits = EVP_PKEY_get_security_bits(current_pkey);
 4536|    147|#ifdef HAVE_OPENSSL3
 4537|    147|    {
 4538|    147|      char group_name[80] = "";
 4539|    147|      get_group_name = EVP_PKEY_get_group_name(current_pkey, group_name,
 4540|    147|                                               sizeof(group_name), NULL);
 4541|    147|      curl_msnprintf(group_name_final, sizeof(group_name_final), "/%s",
 4542|    147|                     group_name);
 4543|    147|    }
 4544|    147|    type_name = EVP_PKEY_get0_type_name(current_pkey);
 4545|       |#else
 4546|       |    get_group_name = 0;
 4547|       |    type_name = NULL;
 4548|       |#endif
 4549|       |
 4550|    147|    infof(data, "  Certificate level %d: "
  ------------------
  |  |  143|    147|  do {                               \
  |  |  144|    147|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|    147|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 147, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|    147|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|    588|      Curl_infof(data, __VA_ARGS__); \
  |  |  ------------------
  |  |  |  Branch (145:24): [True: 147, False: 0]
  |  |  |  Branch (145:24): [True: 0, False: 147]
  |  |  ------------------
  |  |  146|    147|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 147]
  |  |  ------------------
  ------------------
 4551|    147|          "Public key type %s%s (%d/%d Bits/secBits), signed using %s",
 4552|    147|          cert_level, type_name ? type_name : "?",
 4553|    147|          get_group_name == 0 ? "" : group_name_final,
 4554|    147|          key_bits, key_sec_bits, cert_algorithm);
 4555|    147|  }
 4556|    147|}
openssl.c:ossl_verifyhost:
 2056|  1.95k|{
 2057|  1.95k|  bool matched = FALSE;
  ------------------
  |  |  989|  1.95k|#define FALSE false
  ------------------
 2058|  1.95k|  int target; /* target type, GEN_DNS or GEN_IPADD */
 2059|  1.95k|  size_t addrlen = 0;
 2060|  1.95k|  STACK_OF(GENERAL_NAME) *altnames;
 2061|  1.95k|#ifdef USE_IPV6
 2062|  1.95k|  struct in6_addr addr;
 2063|       |#else
 2064|       |  struct in_addr addr;
 2065|       |#endif
 2066|  1.95k|  CURLcode result = CURLE_OK;
 2067|  1.95k|  size_t hostlen = strlen(peer->origin->hostname);
 2068|       |
 2069|  1.95k|  (void)conn;
 2070|  1.95k|  switch(peer->type) {
 2071|      0|  case CURL_SSL_PEER_IPV4:
  ------------------
  |  Branch (2071:3): [True: 0, False: 1.95k]
  ------------------
 2072|      0|    if(!curlx_inet_pton(AF_INET, peer->origin->hostname, &addr))
  ------------------
  |  Branch (2072:8): [True: 0, False: 0]
  ------------------
 2073|      0|      return CURLE_PEER_FAILED_VERIFICATION;
 2074|      0|    target = GEN_IPADD;
 2075|      0|    addrlen = sizeof(struct in_addr);
 2076|      0|    break;
 2077|      0|#ifdef USE_IPV6
 2078|      0|  case CURL_SSL_PEER_IPV6:
  ------------------
  |  Branch (2078:3): [True: 0, False: 1.95k]
  ------------------
 2079|      0|    if(!curlx_inet_pton(AF_INET6, peer->origin->hostname, &addr))
  ------------------
  |  Branch (2079:8): [True: 0, False: 0]
  ------------------
 2080|      0|      return CURLE_PEER_FAILED_VERIFICATION;
 2081|      0|    target = GEN_IPADD;
 2082|      0|    addrlen = sizeof(struct in6_addr);
 2083|      0|    break;
 2084|      0|#endif
 2085|  1.95k|  case CURL_SSL_PEER_DNS:
  ------------------
  |  Branch (2085:3): [True: 1.95k, False: 0]
  ------------------
 2086|  1.95k|    target = GEN_DNS;
 2087|  1.95k|    break;
 2088|      0|  default:
  ------------------
  |  Branch (2088:3): [True: 0, False: 1.95k]
  ------------------
 2089|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (2089:5): [Folded, False: 0]
  |  Branch (2089:5): [Folded, False: 0]
  ------------------
 2090|      0|    failf(data, "unexpected SSL peer type: %d", (int)peer->type);
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2091|      0|    return CURLE_PEER_FAILED_VERIFICATION;
 2092|  1.95k|  }
 2093|       |
 2094|       |  /* get a "list" of alternative names */
 2095|  1.95k|  altnames = X509_get_ext_d2i(server_cert, NID_subject_alt_name, NULL, NULL);
 2096|       |
 2097|  1.95k|  if(altnames) {
  ------------------
  |  Branch (2097:6): [True: 1.95k, False: 0]
  ------------------
 2098|       |#ifdef HAVE_BORINGSSL_LIKE
 2099|       |    size_t numalts;
 2100|       |    size_t i;
 2101|       |#else
 2102|  1.95k|    int numalts;
 2103|  1.95k|    int i;
 2104|  1.95k|#endif
 2105|       |
 2106|       |    /* get amount of alternatives, RFC2459 claims there MUST be at least
 2107|       |       one, but we do not depend on it... */
 2108|  1.95k|    numalts = sk_GENERAL_NAME_num(altnames);
 2109|       |
 2110|       |    /* loop through all alternatives - until a dnsmatch */
 2111|  3.91k|    for(i = 0; (i < numalts) && !matched; i++) {
  ------------------
  |  Branch (2111:16): [True: 1.95k, False: 1.95k]
  |  Branch (2111:33): [True: 1.95k, False: 0]
  ------------------
 2112|       |      /* get a handle to alternative name number i */
 2113|  1.95k|      const GENERAL_NAME *check = sk_GENERAL_NAME_value(altnames, i);
 2114|       |
 2115|       |      /* only check alternatives of the same type the target is */
 2116|  1.95k|      if(check->type == target) {
  ------------------
  |  Branch (2116:10): [True: 1.95k, False: 0]
  ------------------
 2117|       |        /* get data and length */
 2118|  1.95k|        const char *altptr = (const char *)ASN1_STRING_get0_data(check->d.ia5);
 2119|  1.95k|        size_t altlen = ossl_ASN1_STRING_get_length(check->d.ia5);
  ------------------
  |  |  173|  1.95k|#define ossl_ASN1_STRING_get_length ASN1_STRING_get_length
  ------------------
 2120|       |
 2121|  1.95k|        switch(target) {
  ------------------
  |  Branch (2121:16): [True: 1.95k, False: 0]
  ------------------
 2122|  1.95k|        case GEN_DNS: /* name/pattern comparison */
  ------------------
  |  Branch (2122:9): [True: 1.95k, False: 0]
  ------------------
 2123|  1.95k|          if(!memchr(altptr, '\0', altlen) &&
  ------------------
  |  Branch (2123:14): [True: 1.95k, False: 0]
  ------------------
 2124|  1.95k|             Curl_cert_hostcheck(altptr, altlen,
  ------------------
  |  Branch (2124:14): [True: 1.95k, False: 0]
  ------------------
 2125|  1.95k|                                 peer->origin->hostname, hostlen)) {
 2126|  1.95k|            matched = TRUE;
  ------------------
  |  |  986|  1.95k|#define TRUE true
  ------------------
 2127|  1.95k|            infof(data, "  subjectAltName: \"%s\" matches cert's \"%.*s\"",
  ------------------
  |  |  143|  1.95k|  do {                               \
  |  |  144|  1.95k|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|  1.95k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 1.95k, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 147, False: 1.81k]
  |  |  |  |  ------------------
  |  |  |  |  323|  1.95k|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 147, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|    147|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|  1.95k|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|  1.95k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
 2128|  1.95k|                  peer->origin->user_hostname, (int)altlen, altptr);
 2129|  1.95k|          }
 2130|  1.95k|          break;
 2131|       |
 2132|      0|        case GEN_IPADD: /* IP address comparison */
  ------------------
  |  Branch (2132:9): [True: 0, False: 1.95k]
  ------------------
 2133|       |          /* compare alternative IP address if the data chunk is the same size
 2134|       |             our server IP address is */
 2135|      0|          if((altlen == addrlen) && !memcmp(altptr, &addr, altlen)) {
  ------------------
  |  Branch (2135:14): [True: 0, False: 0]
  |  Branch (2135:37): [True: 0, False: 0]
  ------------------
 2136|      0|            matched = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 2137|      0|            infof(data, "  subjectAltName: \"%s\" matches cert's IP address!",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2138|      0|                  peer->origin->user_hostname);
 2139|      0|          }
 2140|      0|          break;
 2141|  1.95k|        }
 2142|  1.95k|      }
 2143|  1.95k|    }
 2144|  1.95k|    GENERAL_NAMES_free(altnames);
 2145|  1.95k|  }
 2146|       |
 2147|  1.95k|  if(matched)
  ------------------
  |  Branch (2147:6): [True: 1.95k, False: 0]
  ------------------
 2148|       |    /* an alternative name matched */
 2149|  1.95k|    ;
 2150|      0|  else {
 2151|      0|    const char *tname = (peer->type == CURL_SSL_PEER_DNS) ? "hostname" :
  ------------------
  |  Branch (2151:25): [True: 0, False: 0]
  ------------------
 2152|      0|                        (peer->type == CURL_SSL_PEER_IPV4) ?
  ------------------
  |  Branch (2152:25): [True: 0, False: 0]
  ------------------
 2153|      0|                        "IPv4 address" : "IPv6 address";
 2154|      0|    infof(data, " subjectAltName does not match %s %s", tname,
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2155|      0|          peer->origin->user_hostname);
 2156|      0|    failf(data, "SSL: no alternative certificate subject name matches "
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 2157|      0|          "target %s '%s'", tname, peer->origin->user_hostname);
 2158|      0|    result = CURLE_PEER_FAILED_VERIFICATION;
 2159|      0|  }
 2160|       |
 2161|  1.95k|  return result;
 2162|  1.95k|}
openssl.c:ossl_check_issuer:
 4565|  1.95k|{
 4566|  1.95k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 4567|  1.95k|  X509 *issuer = NULL;
 4568|  1.95k|  BIO *fp = NULL;
 4569|  1.95k|  char err_buf[256] = "";
 4570|  1.95k|  bool verify_enabled = (conn_config->verifypeer || conn_config->verifyhost);
  ------------------
  |  Branch (4570:26): [True: 1.95k, False: 0]
  |  Branch (4570:53): [True: 0, False: 0]
  ------------------
 4571|  1.95k|  CURLcode result = CURLE_OK;
 4572|       |
 4573|       |  /* e.g. match issuer name with provided issuer certificate */
 4574|  1.95k|  if(conn_config->issuercert_blob) {
  ------------------
  |  Branch (4574:6): [True: 0, False: 1.95k]
  ------------------
 4575|      0|    fp = BIO_new_mem_buf(conn_config->issuercert_blob->data,
 4576|      0|                         (int)conn_config->issuercert_blob->len);
 4577|      0|    if(!fp) {
  ------------------
  |  Branch (4577:8): [True: 0, False: 0]
  ------------------
 4578|      0|      failf(data, "BIO_new_mem_buf NULL, " OSSL_PACKAGE " error %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4579|      0|            ossl_strerror(ERR_get_error(), err_buf, sizeof(err_buf)));
 4580|      0|      result = CURLE_OUT_OF_MEMORY;
 4581|      0|      goto out;
 4582|      0|    }
 4583|      0|  }
 4584|  1.95k|  else if(conn_config->issuercert) {
  ------------------
  |  Branch (4584:11): [True: 0, False: 1.95k]
  ------------------
 4585|      0|    fp = BIO_new(BIO_s_file());
 4586|      0|    if(!fp) {
  ------------------
  |  Branch (4586:8): [True: 0, False: 0]
  ------------------
 4587|      0|      failf(data, "BIO_new return NULL, " OSSL_PACKAGE " error %s",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4588|      0|            ossl_strerror(ERR_get_error(), err_buf, sizeof(err_buf)));
 4589|      0|      result = CURLE_OUT_OF_MEMORY;
 4590|      0|      goto out;
 4591|      0|    }
 4592|       |
 4593|      0|    if(BIO_read_filename(fp, conn_config->issuercert) <= 0) {
  ------------------
  |  Branch (4593:8): [True: 0, False: 0]
  ------------------
 4594|      0|      if(verify_enabled)
  ------------------
  |  Branch (4594:10): [True: 0, False: 0]
  ------------------
 4595|      0|        failf(data, "SSL: Unable to open issuer cert (%s)",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4596|      0|              conn_config->issuercert);
 4597|      0|      result = CURLE_SSL_ISSUER_ERROR;
 4598|      0|      goto out;
 4599|      0|    }
 4600|      0|  }
 4601|       |
 4602|  1.95k|  if(fp) {
  ------------------
  |  Branch (4602:6): [True: 0, False: 1.95k]
  ------------------
 4603|      0|    issuer = PEM_read_bio_X509(fp, NULL, ZERO_NULL, NULL);
  ------------------
  |  | 1174|      0|#define ZERO_NULL 0
  ------------------
 4604|      0|    if(!issuer) {
  ------------------
  |  Branch (4604:8): [True: 0, False: 0]
  ------------------
 4605|      0|      if(verify_enabled)
  ------------------
  |  Branch (4605:10): [True: 0, False: 0]
  ------------------
 4606|      0|        failf(data, "SSL: Unable to read issuer cert (%s)",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4607|      0|              conn_config->issuercert);
 4608|      0|      result = CURLE_SSL_ISSUER_ERROR;
 4609|      0|      goto out;
 4610|      0|    }
 4611|       |
 4612|      0|    if(X509_check_issued(issuer, server_cert) != X509_V_OK) {
  ------------------
  |  Branch (4612:8): [True: 0, False: 0]
  ------------------
 4613|      0|      if(verify_enabled)
  ------------------
  |  Branch (4613:10): [True: 0, False: 0]
  ------------------
 4614|      0|        failf(data, "SSL: Certificate issuer check failed (%s)",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4615|      0|              conn_config->issuercert);
 4616|      0|      result = CURLE_SSL_ISSUER_ERROR;
 4617|      0|      goto out;
 4618|      0|    }
 4619|       |
 4620|      0|    infof(data, " SSL certificate issuer check ok (%s)",
  ------------------
  |  |  143|      0|  do {                               \
  |  |  144|      0|    if(Curl_trc_is_verbose(data))    \
  |  |  ------------------
  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  145|      0|      Curl_infof(data, __VA_ARGS__); \
  |  |  146|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (146:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4621|      0|          conn_config->issuercert);
 4622|      0|  }
 4623|       |
 4624|  1.95k|out:
 4625|  1.95k|  if(fp)
  ------------------
  |  Branch (4625:6): [True: 0, False: 1.95k]
  ------------------
 4626|      0|    BIO_free(fp);
 4627|  1.95k|  if(issuer)
  ------------------
  |  Branch (4627:6): [True: 0, False: 1.95k]
  ------------------
 4628|      0|    X509_free(issuer);
 4629|  1.95k|  return result;
 4630|  1.95k|}
openssl.c:ossl_check_pinned_key:
 4635|  1.95k|{
 4636|  1.95k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 4637|  1.95k|  if(conn_config->pinned_key) {
  ------------------
  |  Branch (4637:6): [True: 0, False: 1.95k]
  ------------------
 4638|      0|    CURLcode result = ossl_pkp_pin_peer_pubkey(data, server_cert,
 4639|      0|                                               conn_config->pinned_key);
 4640|      0|    if(result) {
  ------------------
  |  Branch (4640:8): [True: 0, False: 0]
  ------------------
 4641|      0|      failf(data, "SSL: public key does not match pinned public key");
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
 4642|      0|      return result;
 4643|      0|    }
 4644|      0|  }
 4645|  1.95k|  return CURLE_OK;
 4646|  1.95k|}
openssl.c:ossl_init:
 1628|      2|{
 1629|      2|  const uint64_t flags =
 1630|      2|#ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN
 1631|       |    /* not present in BoringSSL */
 1632|      2|    OPENSSL_INIT_ENGINE_ALL_BUILTIN |
 1633|      2|#endif
 1634|       |#ifdef CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG
 1635|       |    OPENSSL_INIT_NO_LOAD_CONFIG |
 1636|       |#else
 1637|      2|    OPENSSL_INIT_LOAD_CONFIG |
 1638|      2|#endif
 1639|      2|    0;
 1640|      2|  OPENSSL_init_ssl(flags, NULL);
 1641|       |
 1642|      2|#ifndef HAVE_KEYLOG_UPSTREAM
 1643|      2|  Curl_tls_keylog_open();
 1644|      2|#endif
 1645|       |
 1646|      2|  return 1;
 1647|      2|}
openssl.c:ossl_random:
 5508|  79.4k|{
 5509|  79.4k|  int rc;
 5510|  79.4k|  if(data) {
  ------------------
  |  Branch (5510:6): [True: 62.0k, False: 17.3k]
  ------------------
 5511|  62.0k|    if(ossl_seed(data)) /* Initiate the seed if not already done */
  ------------------
  |  Branch (5511:8): [True: 0, False: 62.0k]
  ------------------
 5512|      0|      return CURLE_FAILED_INIT; /* could not seed for some reason */
 5513|  62.0k|  }
 5514|  17.3k|  else {
 5515|  17.3k|    if(!rand_enough())
  ------------------
  |  Branch (5515:8): [True: 0, False: 17.3k]
  ------------------
 5516|      0|      return CURLE_FAILED_INIT;
 5517|  17.3k|  }
 5518|       |  /* RAND_bytes() returns 1 on success, 0 otherwise. */
 5519|  79.4k|  rc = RAND_bytes(entropy, (ossl_valsize_t)curlx_uztosi(length));
 5520|  79.4k|  return rc == 1 ? CURLE_OK : CURLE_FAILED_INIT;
  ------------------
  |  Branch (5520:10): [True: 79.4k, False: 0]
  ------------------
 5521|  79.4k|}
openssl.c:ossl_close_all:
 2039|  19.7k|{
 2040|  19.7k|  (void)data;
 2041|  19.7k|}

Curl_ssl_backend:
  131|  18.8k|{
  132|  18.8k|#ifdef USE_SSL
  133|  18.8k|  multissl_setup(NULL);
  134|  18.8k|  return Curl_ssl->info.id;
  135|       |#else
  136|       |  return CURLSSLBACKEND_NONE;
  137|       |#endif
  138|  18.8k|}
Curl_ssl_init:
  152|      2|{
  153|       |  /* make sure this is only done once */
  154|      2|  if(init_ssl)
  ------------------
  |  Branch (154:6): [True: 0, False: 2]
  ------------------
  155|      0|    return 1;
  156|      2|  init_ssl = TRUE; /* never again */
  ------------------
  |  |  986|      2|#define TRUE true
  ------------------
  157|       |
  158|      2|  if(Curl_ssl->init)
  ------------------
  |  Branch (158:6): [True: 2, False: 0]
  ------------------
  159|      2|    return Curl_ssl->init();
  160|      0|  return 1;
  161|      2|}
Curl_ssl_close_all:
  228|  19.7k|{
  229|  19.7k|  if(Curl_ssl->close_all)
  ------------------
  |  Branch (229:6): [True: 19.7k, False: 0]
  ------------------
  230|  19.7k|    Curl_ssl->close_all(data);
  231|  19.7k|}
Curl_ssl_free_certinfo:
  279|  49.1k|{
  280|  49.1k|  struct curl_certinfo *ci = &data->info.certs;
  281|       |
  282|  49.1k|  if(ci->num_of_certs) {
  ------------------
  |  Branch (282:6): [True: 0, False: 49.1k]
  ------------------
  283|       |    /* free all individual lists used */
  284|      0|    int i;
  285|      0|    for(i = 0; i < ci->num_of_certs; i++) {
  ------------------
  |  Branch (285:16): [True: 0, False: 0]
  ------------------
  286|      0|      curl_slist_free_all(ci->certinfo[i]);
  287|      0|      ci->certinfo[i] = NULL;
  288|      0|    }
  289|       |
  290|       |    curlx_safefree(ci->certinfo); /* free the actual array too */
  ------------------
  |  | 1359|      0|  do {                      \
  |  | 1360|      0|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|      0|    (ptr) = NULL;           \
  |  | 1362|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  291|      0|    ci->num_of_certs = 0;
  292|      0|  }
  293|  49.1k|}
Curl_ssl_random:
  351|  79.4k|{
  352|  79.4k|  if(Curl_ssl->random)
  ------------------
  |  Branch (352:6): [True: 79.4k, False: 0]
  ------------------
  353|  79.4k|    return Curl_ssl->random(data, buffer, length);
  354|      0|  else
  355|      0|    return CURLE_NOT_BUILT_IN;
  356|  79.4k|}
Curl_ssl_peer_cleanup:
  839|  3.37k|{
  840|  3.37k|  Curl_peer_unlink(&peer->origin);
  841|  3.37k|  Curl_peer_unlink(&peer->peer);
  842|  3.37k|  curlx_safefree(peer->sni);
  ------------------
  |  | 1359|  3.37k|  do {                      \
  |  | 1360|  3.37k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  3.37k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  3.37k|    (ptr) = NULL;           \
  |  | 1362|  3.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 3.37k]
  |  |  ------------------
  ------------------
  843|  3.37k|  curlx_safefree(peer->scache_key);
  ------------------
  |  | 1359|  3.37k|  do {                      \
  |  | 1360|  3.37k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  3.37k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  3.37k|    (ptr) = NULL;           \
  |  | 1362|  3.37k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 3.37k]
  |  |  ------------------
  ------------------
  844|  3.37k|  peer->transport = TRNSPRT_NONE;
  ------------------
  |  |  224|  3.37k|#define TRNSPRT_NONE 0
  ------------------
  845|  3.37k|  peer->type = CURL_SSL_PEER_DNS;
  846|  3.37k|}
Curl_ssl_peer_init:
  873|  3.36k|{
  874|  3.36k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  875|       |
  876|       |  /* We expect a clean struct, e.g. called only ONCE */
  877|  3.36k|  if(!ssl_peer || !origin) {
  ------------------
  |  Branch (877:6): [True: 0, False: 3.36k]
  |  Branch (877:19): [True: 0, False: 3.36k]
  ------------------
  878|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (878:5): [Folded, False: 0]
  |  Branch (878:5): [Folded, False: 0]
  ------------------
  879|      0|    return CURLE_FAILED_INIT;
  880|      0|  }
  881|  3.36k|  DEBUGASSERT(!ssl_peer->origin);
  ------------------
  |  | 1016|  3.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (881:3): [True: 0, False: 3.36k]
  |  Branch (881:3): [True: 3.36k, False: 0]
  ------------------
  882|  3.36k|  DEBUGASSERT(!ssl_peer->peer);
  ------------------
  |  | 1016|  3.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (882:3): [True: 0, False: 3.36k]
  |  Branch (882:3): [True: 3.36k, False: 0]
  ------------------
  883|  3.36k|  DEBUGASSERT(!ssl_peer->sni);
  ------------------
  |  | 1016|  3.36k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (883:3): [True: 0, False: 3.36k]
  |  Branch (883:3): [True: 3.36k, False: 0]
  ------------------
  884|  3.36k|  ssl_peer->transport = transport;
  885|       |
  886|  3.36k|  Curl_peer_link(&ssl_peer->origin, origin);
  887|  3.36k|  Curl_peer_link(&ssl_peer->peer, peer);
  888|  3.36k|  ssl_peer->type = get_peer_type(origin->hostname);
  889|  3.36k|  if(ssl_peer->type == CURL_SSL_PEER_DNS) {
  ------------------
  |  Branch (889:6): [True: 2.28k, False: 1.08k]
  ------------------
  890|       |    /* not an IP address, normalize according to RCC 6066 ch. 3,
  891|       |     * max len of SNI is 2^16-1, no trailing dot */
  892|  2.28k|    size_t len = strlen(origin->hostname);
  893|  2.28k|    if(len && (origin->hostname[len - 1] == '.'))
  ------------------
  |  Branch (893:8): [True: 2.28k, False: 0]
  |  Branch (893:15): [True: 0, False: 2.28k]
  ------------------
  894|      0|      len--;
  895|  2.28k|    if(len < USHRT_MAX) {
  ------------------
  |  Branch (895:8): [True: 2.28k, False: 0]
  ------------------
  896|  2.28k|      ssl_peer->sni = curlx_calloc(1, len + 1);
  ------------------
  |  | 1500|  2.28k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  897|  2.28k|      if(!ssl_peer->sni)
  ------------------
  |  Branch (897:10): [True: 0, False: 2.28k]
  ------------------
  898|      0|        goto out;
  899|  2.28k|      Curl_strntolower(ssl_peer->sni, origin->hostname, len);
  900|  2.28k|      ssl_peer->sni[len] = 0;
  901|  2.28k|    }
  902|  2.28k|  }
  903|       |
  904|  3.36k|  result = Curl_ssl_peer_key_make(ssl_peer, sslc, tls_id,
  905|  3.36k|                                  &ssl_peer->scache_key);
  906|       |
  907|  3.36k|out:
  908|  3.36k|  if(result)
  ------------------
  |  Branch (908:6): [True: 11, False: 3.35k]
  ------------------
  909|     11|    Curl_ssl_peer_cleanup(ssl_peer);
  910|  3.36k|  return result;
  911|  3.36k|}
Curl_ssl_supports:
 1455|  9.91k|{
 1456|  9.91k|  (void)data;
 1457|  9.91k|  return (Curl_ssl->supports & ssl_option);
 1458|  9.91k|}
Curl_ssl_ech_enabled:
 1462|  3.33k|{
 1463|  3.33k|  if(Curl_ssl->supports & SSLSUPP_ECH) {
  ------------------
  |  |   43|  3.33k|#define SSLSUPP_ECH          (1 << 7)
  ------------------
  |  Branch (1463:6): [True: 3.33k, False: 0]
  ------------------
 1464|  3.33k|    struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 1465|  3.33k|    return !!conn_config->ech;
 1466|  3.33k|  }
 1467|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1468|  3.33k|}
Curl_ssl_need_httpsrr:
 1471|   117k|{
 1472|   117k|  if(Curl_ssl->supports & SSLSUPP_ECH) {
  ------------------
  |  |   43|   117k|#define SSLSUPP_ECH          (1 << 7)
  ------------------
  |  Branch (1472:6): [True: 117k, False: 0]
  ------------------
 1473|   117k|    struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 1474|   117k|    if(!conn_config->ech)
  ------------------
  |  Branch (1474:8): [True: 117k, False: 0]
  ------------------
 1475|   117k|      return FALSE;
  ------------------
  |  |  989|   117k|#define FALSE false
  ------------------
 1476|      0|    if((conn_config->ech == CURLECH_GREASE) || conn_config->ech_config)
  ------------------
  |  |   55|      0|#define CURLECH_GREASE     1
  ------------------
  |  Branch (1476:8): [True: 0, False: 0]
  |  Branch (1476:48): [True: 0, False: 0]
  ------------------
 1477|      0|      return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1478|      0|    return TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
 1479|      0|  }
 1480|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
 1481|   117k|}
Curl_ssl_cf_is_proxy:
 1564|   179k|{
 1565|   179k|  return (cf->cft->flags & CF_TYPE_SSL) && (cf->cft->flags & CF_TYPE_PROXY);
  ------------------
  |  |  211|   179k|#define CF_TYPE_SSL         (1 << 1)
  ------------------
                return (cf->cft->flags & CF_TYPE_SSL) && (cf->cft->flags & CF_TYPE_PROXY);
  ------------------
  |  |  213|   179k|#define CF_TYPE_PROXY       (1 << 3)
  ------------------
  |  Branch (1565:10): [True: 179k, False: 0]
  |  Branch (1565:44): [True: 0, False: 179k]
  ------------------
 1566|   179k|}
Curl_ssl_cf_get_easy_config:
 1570|  5.29k|{
 1571|       |#ifdef CURL_DISABLE_PROXY
 1572|       |  (void)cf;
 1573|       |  return &data->set.ssl;
 1574|       |#else
 1575|  5.29k|  return Curl_ssl_cf_is_proxy(cf) ? &data->set.proxy_ssl : &data->set.ssl;
  ------------------
  |  Branch (1575:10): [True: 0, False: 5.29k]
  ------------------
 1576|  5.29k|#endif
 1577|  5.29k|}
Curl_ssl_cf_get_filter_config:
 1581|   174k|{
 1582|       |#ifdef CURL_DISABLE_PROXY
 1583|       |  return &CF_CONN(cf)->ssl_config;
 1584|       |#else
 1585|   174k|  return Curl_ssl_cf_is_proxy(cf) ?
  ------------------
  |  Branch (1585:10): [True: 0, False: 174k]
  ------------------
 1586|   174k|    &CF_CONN(cf)->proxy_ssl_config : &CF_CONN(cf)->ssl_config;
  ------------------
  |  |  260|      0|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
                  &CF_CONN(cf)->proxy_ssl_config : &CF_CONN(cf)->ssl_config;
  ------------------
  |  |  260|   174k|#define CF_CONN(cf)             (cf)->chain->conn
  ------------------
 1587|   174k|#endif
 1588|   174k|}
Curl_alpn_to_proto_buf:
 1592|  3.33k|{
 1593|  3.33k|  size_t i, len;
 1594|  3.33k|  int off = 0;
 1595|  3.33k|  unsigned char blen;
 1596|       |
 1597|  3.33k|  memset(buf, 0, sizeof(*buf));
 1598|  10.0k|  for(i = 0; spec && i < spec->count; ++i) {
  ------------------
  |  Branch (1598:14): [True: 10.0k, False: 0]
  |  Branch (1598:22): [True: 6.67k, False: 3.33k]
  ------------------
 1599|  6.67k|    len = strlen(spec->entries[i]);
 1600|  6.67k|    if(len >= ALPN_NAME_MAX)
  ------------------
  |  |   52|  6.67k|#define ALPN_NAME_MAX      10
  ------------------
  |  Branch (1600:8): [True: 0, False: 6.67k]
  ------------------
 1601|      0|      return CURLE_FAILED_INIT;
 1602|  6.67k|    blen = (unsigned char)len;
 1603|  6.67k|    if(off + blen + 1 >= (int)sizeof(buf->data))
  ------------------
  |  Branch (1603:8): [True: 0, False: 6.67k]
  ------------------
 1604|      0|      return CURLE_FAILED_INIT;
 1605|  6.67k|    buf->data[off++] = blen;
 1606|  6.67k|    memcpy(buf->data + off, spec->entries[i], blen);
 1607|  6.67k|    off += blen;
 1608|  6.67k|  }
 1609|  3.33k|  buf->len = off;
 1610|  3.33k|  return CURLE_OK;
 1611|  3.33k|}
Curl_alpn_copy:
 1659|  3.33k|{
 1660|  3.33k|  if(src)
  ------------------
  |  Branch (1660:6): [True: 3.33k, False: 0]
  ------------------
 1661|  3.33k|    memcpy(dest, src, sizeof(*dest));
 1662|      0|  else
 1663|      0|    memset(dest, 0, sizeof(*dest));
 1664|  3.33k|}
vtls.c:multissl_setup:
  750|  18.8k|{
  751|  18.8k|  int i;
  752|  18.8k|  char *env;
  753|       |
  754|  18.8k|  if(Curl_ssl != &Curl_ssl_multi)
  ------------------
  |  Branch (754:6): [True: 18.8k, False: 0]
  ------------------
  755|  18.8k|    return 1;
  756|       |
  757|      0|  if(backend) {
  ------------------
  |  Branch (757:6): [True: 0, False: 0]
  ------------------
  758|      0|    Curl_ssl = backend;
  759|      0|    return 0;
  760|      0|  }
  761|       |
  762|      0|  if(!available_backends[0])
  ------------------
  |  Branch (762:6): [True: 0, False: 0]
  ------------------
  763|      0|    return 1;
  764|       |
  765|      0|  env = curl_getenv("CURL_SSL_BACKEND");
  766|      0|  if(env) {
  ------------------
  |  Branch (766:6): [True: 0, False: 0]
  ------------------
  767|      0|    for(i = 0; available_backends[i]; i++) {
  ------------------
  |  Branch (767:16): [True: 0, False: 0]
  ------------------
  768|      0|      if(curl_strequal(env, available_backends[i]->info.name)) {
  ------------------
  |  Branch (768:10): [True: 0, False: 0]
  ------------------
  769|      0|        Curl_ssl = available_backends[i];
  770|      0|        curlx_free(env);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  771|      0|        return 0;
  772|      0|      }
  773|      0|    }
  774|      0|  }
  775|       |
  776|       |#ifdef CURL_DEFAULT_SSL_BACKEND
  777|       |  for(i = 0; available_backends[i]; i++) {
  778|       |    if(curl_strequal(CURL_DEFAULT_SSL_BACKEND,
  779|       |                     available_backends[i]->info.name)) {
  780|       |      Curl_ssl = available_backends[i];
  781|       |      curlx_free(env);
  782|       |      return 0;
  783|       |    }
  784|       |  }
  785|       |#endif
  786|       |
  787|       |  /* Fall back to first available backend */
  788|      0|  Curl_ssl = available_backends[0];
  789|      0|  curlx_free(env);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  790|      0|  return 0;
  791|      0|}
vtls.c:get_peer_type:
  849|  3.36k|{
  850|  3.36k|  if(hostname && hostname[0]) {
  ------------------
  |  Branch (850:6): [True: 3.36k, False: 0]
  |  Branch (850:18): [True: 3.36k, False: 0]
  ------------------
  851|  3.36k|#ifdef USE_IPV6
  852|  3.36k|    struct in6_addr addr;
  853|       |#else
  854|       |    struct in_addr addr;
  855|       |#endif
  856|  3.36k|    if(curlx_inet_pton(AF_INET, hostname, &addr))
  ------------------
  |  Branch (856:8): [True: 0, False: 3.36k]
  ------------------
  857|      0|      return CURL_SSL_PEER_IPV4;
  858|  3.36k|#ifdef USE_IPV6
  859|  3.36k|    else if(curlx_inet_pton(AF_INET6, hostname, &addr)) {
  ------------------
  |  Branch (859:13): [True: 1.08k, False: 2.28k]
  ------------------
  860|  1.08k|      return CURL_SSL_PEER_IPV6;
  861|  1.08k|    }
  862|  3.36k|#endif
  863|  3.36k|  }
  864|  2.28k|  return CURL_SSL_PEER_DNS;
  865|  3.36k|}

Curl_ssl_config_init:
  101|  39.4k|{
  102|       |  /*
  103|       |   * libcurl 7.10 introduced SSL verification *by default*! This needs to be
  104|       |   * switched off unless wanted.
  105|       |   */
  106|  39.4k|  sslc->verifypeer = TRUE;
  ------------------
  |  |  986|  39.4k|#define TRUE true
  ------------------
  107|  39.4k|  sslc->verifyhost = TRUE;
  ------------------
  |  |  986|  39.4k|#define TRUE true
  ------------------
  108|       |  sslc->cache_session = TRUE; /* caching by default */
  ------------------
  |  |  986|  39.4k|#define TRUE true
  ------------------
  109|  39.4k|}
Curl_ssl_config_cleanup:
  112|  37.6k|{
  113|  37.6k|  if(sslc->deep_copy) {
  ------------------
  |  Branch (113:6): [True: 18.7k, False: 18.8k]
  ------------------
  114|  18.7k|    curlx_safefree(sslc->CApath);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  115|  18.7k|    curlx_safefree(sslc->CAfile);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  116|  18.7k|    curlx_safefree(sslc->issuercert);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  117|  18.7k|    curlx_safefree(sslc->clientcert);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  118|  18.7k|    curlx_safefree(sslc->cipher_list);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  119|  18.7k|    curlx_safefree(sslc->cipher_list13);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  120|  18.7k|    curlx_safefree(sslc->pinned_key);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  121|  18.7k|    curlx_safefree(sslc->cert_blob);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  122|  18.7k|    curlx_safefree(sslc->ca_info_blob);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  123|  18.7k|    curlx_safefree(sslc->issuercert_blob);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  124|  18.7k|    curlx_safefree(sslc->key_blob);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  125|  18.7k|    curlx_safefree(sslc->curves);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  126|  18.7k|    curlx_safefree(sslc->signature_algorithms);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  127|  18.7k|    curlx_safefree(sslc->CRLfile);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  128|  18.7k|    curlx_safefree(sslc->cert_type);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  129|  18.7k|    curlx_safefree(sslc->key);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  130|  18.7k|    curlx_safefree(sslc->key_type);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  131|  18.7k|    curlx_safefree(sslc->key_passwd);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  132|  18.7k|#ifdef USE_ECH
  133|  18.7k|    curlx_safefree(sslc->ech_config);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  134|  18.7k|    curlx_safefree(sslc->ech_public);
  ------------------
  |  | 1359|  18.7k|  do {                      \
  |  | 1360|  18.7k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|  18.7k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|  18.7k|    (ptr) = NULL;           \
  |  | 1362|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  135|  18.7k|#endif
  136|       |    sslc->deep_copy = FALSE;
  ------------------
  |  |  989|  18.7k|#define FALSE false
  ------------------
  137|  18.7k|  }
  138|  37.6k|}
Curl_ssl_filter_config_tmp_init:
  276|  9.40k|{
  277|  9.40k|  struct ssl_easy_config *sslc = &data->set.ssl;
  278|       |#if defined(CURL_CA_PATH) || defined(CURL_CA_BUNDLE)
  279|       |  CURLcode result;
  280|       |#endif
  281|       |
  282|  9.40k|  ssl_easy_config_compl_options(origin, data->state.initial_origin, sslc,
  283|  9.40k|                                ssl_origin);
  284|       |
  285|  9.40k|  if(Curl_ssl_backend() != CURLSSLBACKEND_SCHANNEL) {
  ------------------
  |  Branch (285:6): [True: 9.40k, False: 0]
  ------------------
  286|       |#if defined(USE_APPLE_SECTRUST) || defined(CURL_CA_NATIVE)
  287|       |    if(!sslc->custom_capath && !sslc->custom_cafile && !sslc->custom_cablob)
  288|       |      ssl_origin->native_ca_store = TRUE;
  289|       |#endif
  290|       |#ifdef CURL_CA_PATH
  291|       |    if(!sslc->custom_capath && !CURL_EASY_STR(data, STRING_SSL_CAPATH)) {
  292|       |      result = Curl_setstropt(data, STRING_SSL_CAPATH, CURL_CA_PATH);
  293|       |      if(result)
  294|       |        return result;
  295|       |    }
  296|       |#endif
  297|       |#ifdef CURL_CA_BUNDLE
  298|       |    if(!sslc->custom_cafile && !CURL_EASY_STR(data, STRING_SSL_CAFILE)) {
  299|       |      result = Curl_setstropt(data, STRING_SSL_CAFILE, CURL_CA_BUNDLE);
  300|       |      if(result)
  301|       |        return result;
  302|       |    }
  303|       |#endif
  304|  9.40k|  }
  305|       |
  306|  9.40k|  ssl_origin->version = sslc->version;
  307|  9.40k|  ssl_origin->version_max = sslc->version_max;
  308|  9.40k|  ssl_origin->verifypeer = sslc->verifypeer;
  309|  9.40k|  ssl_origin->verifyhost = sslc->verifyhost;
  310|  9.40k|  ssl_origin->verifystatus = sslc->verifystatus;
  311|  9.40k|  ssl_origin->cache_session = sslc->cache_session;
  312|  9.40k|  ssl_origin->ssl_options = sslc->ssl_options;
  313|  9.40k|  ssl_origin->CAfile = ssl_easy_steal(data, STRING_SSL_CAFILE);
  314|  9.40k|  ssl_origin->CRLfile = ssl_easy_steal(data, STRING_SSL_CRLFILE);
  315|  9.40k|  ssl_origin->CApath = ssl_easy_steal(data, STRING_SSL_CAPATH);
  316|  9.40k|  ssl_origin->cipher_list = ssl_easy_steal(data, STRING_SSL_CIPHER_LIST);
  317|  9.40k|  ssl_origin->cipher_list13 = ssl_easy_steal(data, STRING_SSL_CIPHER13_LIST);
  318|  9.40k|  ssl_origin->signature_algorithms =
  319|  9.40k|    ssl_easy_steal(data, STRING_SSL_SIGNATURE_ALGORITHMS);
  320|  9.40k|  ssl_origin->ca_info_blob = data->set.a.blobs[BLOB_CAINFO];
  321|  9.40k|  ssl_origin->curves = ssl_easy_steal(data, STRING_SSL_EC_CURVES);
  322|       |  /* Maybe these should not be used for another origin. But for
  323|       |   * backwards compatibility, keep them in. */
  324|  9.40k|  ssl_origin->issuercert = ssl_easy_steal(data, STRING_SSL_ISSUERCERT);
  325|  9.40k|  ssl_origin->issuercert_blob = data->set.a.blobs[BLOB_SSL_ISSUERCERT];
  326|       |
  327|  9.40k|  if(Curl_peer_equal(data->state.initial_origin, origin)) {
  ------------------
  |  Branch (327:6): [True: 9.40k, False: 0]
  ------------------
  328|  9.40k|    ssl_origin->pinned_key =
  329|  9.40k|      ssl_easy_steal(data, STRING_SSL_PINNEDPUBLICKEY);
  330|  9.40k|    ssl_origin->cert_blob = data->set.a.blobs[BLOB_CERT];
  331|  9.40k|    ssl_origin->cert_type = ssl_easy_steal(data, STRING_CERT_TYPE);
  332|  9.40k|    ssl_origin->key = ssl_easy_steal(data, STRING_KEY);
  333|  9.40k|    ssl_origin->key_type = ssl_easy_steal(data, STRING_KEY_TYPE);
  334|  9.40k|    ssl_origin->key_passwd = ssl_easy_steal(data, STRING_KEY_PASSWD);
  335|  9.40k|    ssl_origin->clientcert = ssl_easy_steal(data, STRING_CERT);
  336|  9.40k|    ssl_origin->key_blob = data->set.a.blobs[BLOB_KEY];
  337|  9.40k|#ifdef USE_ECH
  338|  9.40k|    ssl_origin->ech = data->set.ssl.ech;
  339|  9.40k|    ssl_origin->ech_config = ssl_easy_steal(data, STRING_ECH_CONFIG);
  340|  9.40k|    ssl_origin->ech_public = ssl_easy_steal(data, STRING_ECH_PUBLIC);
  341|  9.40k|#endif
  342|  9.40k|  }
  343|      0|  else {
  344|      0|    ssl_origin->pinned_key = NULL;
  345|      0|    ssl_origin->cert_blob = NULL;
  346|      0|    ssl_origin->cert_type = NULL;
  347|      0|    ssl_origin->key = NULL;
  348|      0|    ssl_origin->key_type = NULL;
  349|      0|    ssl_origin->key_passwd = NULL;
  350|      0|    ssl_origin->clientcert = NULL;
  351|      0|    ssl_origin->key_blob = NULL;
  352|      0|#ifdef USE_ECH
  353|      0|    ssl_origin->ech = 0;
  354|      0|    ssl_origin->ech_config = NULL;
  355|      0|    ssl_origin->ech_public = NULL;
  356|      0|#endif
  357|      0|  }
  358|       |
  359|  9.40k|#ifndef CURL_DISABLE_PROXY
  360|  9.40k|  sslc = &data->set.proxy_ssl;
  361|       |
  362|  9.40k|  ssl_easy_config_compl_options(NULL, NULL, sslc, ssl_proxy);
  363|  9.40k|  if((Curl_ssl_backend() != CURLSSLBACKEND_SCHANNEL)) {
  ------------------
  |  Branch (363:6): [True: 9.40k, False: 0]
  ------------------
  364|       |    /* no initial origin for proxy, it is not changed for redirects */
  365|       |#if defined(USE_APPLE_SECTRUST) || defined(CURL_CA_NATIVE)
  366|       |    if(!sslc->custom_capath && !sslc->custom_cafile && !sslc->custom_cablob)
  367|       |      ssl_proxy->native_ca_store = TRUE;
  368|       |#endif
  369|       |#ifdef CURL_CA_PATH
  370|       |    if(!sslc->custom_capath &&
  371|       |       !CURL_EASY_STR(data, STRING_SSL_CAPATH_PROXY)) {
  372|       |      result = Curl_setstropt(data, STRING_SSL_CAPATH_PROXY, CURL_CA_PATH);
  373|       |      if(result)
  374|       |        return result;
  375|       |    }
  376|       |#endif
  377|       |#ifdef CURL_CA_BUNDLE
  378|       |    if(!sslc->custom_cafile &&
  379|       |       !CURL_EASY_STR(data, STRING_SSL_CAFILE_PROXY)) {
  380|       |      result = Curl_setstropt(data, STRING_SSL_CAFILE_PROXY, CURL_CA_BUNDLE);
  381|       |      if(result)
  382|       |        return result;
  383|       |    }
  384|       |#endif
  385|  9.40k|  }
  386|       |
  387|  9.40k|  ssl_proxy->version = sslc->version;
  388|  9.40k|  ssl_proxy->version_max = sslc->version_max;
  389|  9.40k|  ssl_proxy->verifypeer = sslc->verifypeer;
  390|  9.40k|  ssl_proxy->verifyhost = sslc->verifyhost;
  391|  9.40k|  ssl_proxy->verifystatus = sslc->verifystatus;
  392|  9.40k|  ssl_proxy->cache_session = sslc->cache_session;
  393|  9.40k|  ssl_proxy->ssl_options = sslc->ssl_options;
  394|  9.40k|  ssl_proxy->CAfile = ssl_easy_steal(data, STRING_SSL_CAFILE_PROXY);
  395|  9.40k|  ssl_proxy->CApath = ssl_easy_steal(data, STRING_SSL_CAPATH_PROXY);
  396|  9.40k|  ssl_proxy->cipher_list =
  397|  9.40k|    ssl_easy_steal(data, STRING_SSL_CIPHER_LIST_PROXY);
  398|  9.40k|  ssl_proxy->cipher_list13 =
  399|  9.40k|    ssl_easy_steal(data, STRING_SSL_CIPHER13_LIST_PROXY);
  400|  9.40k|  ssl_proxy->pinned_key =
  401|  9.40k|    ssl_easy_steal(data, STRING_SSL_PINNEDPUBLICKEY_PROXY);
  402|  9.40k|  ssl_proxy->cert_blob = data->set.a.blobs[BLOB_CERT_PROXY];
  403|  9.40k|  ssl_proxy->ca_info_blob = data->set.a.blobs[BLOB_CAINFO_PROXY];
  404|  9.40k|  ssl_proxy->issuercert = ssl_easy_steal(data, STRING_SSL_ISSUERCERT_PROXY);
  405|  9.40k|  ssl_proxy->issuercert_blob = data->set.a.blobs[BLOB_SSL_ISSUERCERT_PROXY];
  406|  9.40k|  ssl_proxy->CRLfile = ssl_easy_steal(data, STRING_SSL_CRLFILE_PROXY);
  407|  9.40k|  ssl_proxy->cert_type = ssl_easy_steal(data, STRING_CERT_TYPE_PROXY);
  408|  9.40k|  ssl_proxy->key = ssl_easy_steal(data, STRING_KEY_PROXY);
  409|  9.40k|  ssl_proxy->key_type = ssl_easy_steal(data, STRING_KEY_TYPE_PROXY);
  410|  9.40k|  ssl_proxy->key_passwd = ssl_easy_steal(data, STRING_KEY_PASSWD_PROXY);
  411|  9.40k|  ssl_proxy->clientcert = ssl_easy_steal(data, STRING_CERT_PROXY);
  412|  9.40k|  ssl_proxy->key_blob = data->set.a.blobs[BLOB_KEY_PROXY];
  413|  9.40k|#ifdef USE_ECH
  414|       |  /* Not configurable via a CURLOPT_* */
  415|  9.40k|  ssl_proxy->ech = 0;
  416|  9.40k|  ssl_proxy->ech_config = NULL;
  417|  9.40k|  ssl_proxy->ech_public = NULL;
  418|  9.40k|#endif
  419|       |#else
  420|       |  (void)ssl_proxy;
  421|       |#endif /* CURL_DISABLE_PROXY */
  422|       |
  423|  9.40k|  return CURLE_OK;
  424|  9.40k|}
Curl_ssl_conn_config_clone:
  429|  9.39k|{
  430|       |  /* Clone "primary" SSL configurations from the easy handle to
  431|       |   * the connection. They are used for connection cache matching and
  432|       |   * probably outlive the easy handle */
  433|  9.39k|  if(!clone_ssl_primary_config(ssl_config, &conn->ssl_config))
  ------------------
  |  Branch (433:6): [True: 1, False: 9.39k]
  ------------------
  434|      1|    return CURLE_OUT_OF_MEMORY;
  435|  9.39k|#ifndef CURL_DISABLE_PROXY
  436|  9.39k|  if(proxy_ssl_config &&
  ------------------
  |  Branch (436:6): [True: 9.39k, False: 0]
  ------------------
  437|  9.39k|     !clone_ssl_primary_config(proxy_ssl_config, &conn->proxy_ssl_config))
  ------------------
  |  Branch (437:6): [True: 0, False: 9.39k]
  ------------------
  438|      0|    return CURLE_OUT_OF_MEMORY;
  439|       |#else
  440|       |  (void)proxy_ssl_config;
  441|       |#endif
  442|  9.39k|  return CURLE_OK;
  443|  9.39k|}
Curl_ssl_conn_config_cleanup:
  446|  9.42k|{
  447|  9.42k|  Curl_ssl_config_cleanup(&conn->ssl_config);
  448|  9.42k|#ifndef CURL_DISABLE_PROXY
  449|  9.42k|  Curl_ssl_config_cleanup(&conn->proxy_ssl_config);
  450|  9.42k|#endif
  451|  9.42k|}
Curl_ssl_conn_config_update:
  454|  29.7k|{
  455|       |  /* May be called on an easy that has no connection yet */
  456|  29.7k|  if(data->conn) {
  ------------------
  |  Branch (456:6): [True: 0, False: 29.7k]
  ------------------
  457|      0|    struct ssl_easy_config *src;
  458|      0|    struct ssl_filter_config *dest;
  459|      0|#ifndef CURL_DISABLE_PROXY
  460|      0|    src = for_proxy ? &data->set.proxy_ssl : &data->set.ssl;
  ------------------
  |  Branch (460:11): [True: 0, False: 0]
  ------------------
  461|      0|    dest = for_proxy ? &data->conn->proxy_ssl_config : &data->conn->ssl_config;
  ------------------
  |  Branch (461:12): [True: 0, False: 0]
  ------------------
  462|       |#else
  463|       |    (void)for_proxy;
  464|       |    src = &data->set.ssl;
  465|       |    dest = &data->conn->ssl_config;
  466|       |#endif
  467|      0|    dest->verifyhost = src->verifyhost;
  468|      0|    dest->verifypeer = src->verifypeer;
  469|      0|    dest->verifystatus = src->verifystatus;
  470|      0|#ifdef USE_ECH
  471|      0|    dest->ech = src->ech;
  472|      0|#endif
  473|      0|  }
  474|  29.7k|}
vtls_config.c:ssl_easy_config_compl_options:
  249|  18.8k|{
  250|  18.8k|  uint8_t options = sslc->ssl_options;
  251|       |  /* If set via CURLOPT_(PROXY_)SSL_OPTIONS, we definitely use it.
  252|       |   * If not, we switch it on for supported backends if no custom
  253|       |   * CA settings exist. */
  254|  18.8k|  primary->native_ca_store = !!(options & CURLSSLOPT_NATIVE_CA);
  ------------------
  |  |  967|  18.8k|#define CURLSSLOPT_NATIVE_CA (1L << 4)
  ------------------
  255|  18.8k|  primary->earlydata = !!(options & CURLSSLOPT_EARLYDATA);
  ------------------
  |  |  974|  18.8k|#define CURLSSLOPT_EARLYDATA (1L << 6)
  ------------------
  256|  18.8k|  primary->auto_client_cert =
  257|  18.8k|    Curl_peer_equal(origin, initial_origin) &&
  ------------------
  |  Branch (257:5): [True: 18.8k, False: 0]
  ------------------
  258|  18.8k|    !!(options & CURLSSLOPT_AUTO_CLIENT_CERT);
  ------------------
  |  |  971|  18.8k|#define CURLSSLOPT_AUTO_CLIENT_CERT (1L << 5)
  ------------------
  |  Branch (258:5): [True: 0, False: 18.8k]
  ------------------
  259|  18.8k|  primary->enable_beast = !!(options & CURLSSLOPT_ALLOW_BEAST);
  ------------------
  |  |  950|  18.8k|#define CURLSSLOPT_ALLOW_BEAST (1L << 0)
  ------------------
  260|  18.8k|  primary->no_partialchain = !!(options & CURLSSLOPT_NO_PARTIALCHAIN);
  ------------------
  |  |  958|  18.8k|#define CURLSSLOPT_NO_PARTIALCHAIN (1L << 2)
  ------------------
  261|  18.8k|  primary->no_revoke = !!(options & CURLSSLOPT_NO_REVOKE);
  ------------------
  |  |  954|  18.8k|#define CURLSSLOPT_NO_REVOKE (1L << 1)
  ------------------
  262|  18.8k|  primary->revoke_best_effort = !!(options & CURLSSLOPT_REVOKE_BEST_EFFORT);
  ------------------
  |  |  963|  18.8k|#define CURLSSLOPT_REVOKE_BEST_EFFORT (1L << 3)
  ------------------
  263|  18.8k|}
vtls_config.c:ssl_easy_steal:
  266|   263k|{
  267|       |  /* For connection matching, we borrow string references from data
  268|       |   * THIS IS NOT REALLY NICE. */
  269|   263k|  return CURL_UNCONST(CURL_EASY_STR(data, id));
  ------------------
  |  |  793|   263k|#define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
  ------------------
  270|   263k|}
vtls_config.c:clone_ssl_primary_config:
  199|  18.7k|{
  200|  18.7k|  DEBUGASSERT(!dest->deep_copy);
  ------------------
  |  | 1016|  18.7k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (200:3): [True: 0, False: 18.7k]
  |  Branch (200:3): [True: 18.7k, False: 0]
  ------------------
  201|  18.7k|  dest->deep_copy = TRUE;
  ------------------
  |  |  986|  18.7k|#define TRUE true
  ------------------
  202|  18.7k|  dest->version = source->version;
  203|  18.7k|  dest->version_max = source->version_max;
  204|  18.7k|  dest->verifypeer = source->verifypeer;
  205|  18.7k|  dest->verifyhost = source->verifyhost;
  206|  18.7k|  dest->verifystatus = source->verifystatus;
  207|  18.7k|  dest->ssl_options = source->ssl_options;
  208|  18.7k|  dest->native_ca_store = source->native_ca_store;
  209|  18.7k|  dest->cache_session = source->cache_session;
  210|  18.7k|  dest->auto_client_cert = source->auto_client_cert;
  211|  18.7k|  dest->earlydata = source->earlydata;
  212|  18.7k|  dest->enable_beast = source->enable_beast;
  213|  18.7k|  dest->no_partialchain = source->no_partialchain;
  214|  18.7k|  dest->no_revoke = source->no_revoke;
  215|  18.7k|  dest->revoke_best_effort = source->revoke_best_effort;
  216|       |
  217|  18.7k|  CLONE_BLOB(cert_blob);
  ------------------
  |  |   62|  18.7k|  do {                                   \
  |  |   63|  18.7k|    if(blobdup(&dest->var, source->var)) \
  |  |  ------------------
  |  |  |  Branch (63:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   64|  18.7k|      return FALSE;                      \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   65|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (65:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  218|  18.7k|  CLONE_BLOB(ca_info_blob);
  ------------------
  |  |   62|  18.7k|  do {                                   \
  |  |   63|  18.7k|    if(blobdup(&dest->var, source->var)) \
  |  |  ------------------
  |  |  |  Branch (63:8): [True: 1, False: 18.7k]
  |  |  ------------------
  |  |   64|  18.7k|      return FALSE;                      \
  |  |  ------------------
  |  |  |  |  989|      1|#define FALSE false
  |  |  ------------------
  |  |   65|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (65:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  219|  18.7k|  CLONE_BLOB(issuercert_blob);
  ------------------
  |  |   62|  18.7k|  do {                                   \
  |  |   63|  18.7k|    if(blobdup(&dest->var, source->var)) \
  |  |  ------------------
  |  |  |  Branch (63:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   64|  18.7k|      return FALSE;                      \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   65|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (65:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  220|  18.7k|  CLONE_STRING(CApath);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  221|  18.7k|  CLONE_STRING(CAfile);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  222|  18.7k|  CLONE_STRING(issuercert);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  223|  18.7k|  CLONE_STRING(cipher_list);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  224|  18.7k|  CLONE_STRING(cipher_list13);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  225|  18.7k|  CLONE_STRING(pinned_key);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  226|  18.7k|  CLONE_STRING(curves);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  227|  18.7k|  CLONE_STRING(signature_algorithms);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  228|  18.7k|  CLONE_STRING(CRLfile);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  229|       |  /* SSL credentials: client certificate */
  230|  18.7k|  CLONE_STRING(clientcert);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  231|  18.7k|  CLONE_STRING(cert_type);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  232|  18.7k|  CLONE_STRING(key);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  233|  18.7k|  CLONE_STRING(key_type);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  234|  18.7k|  CLONE_STRING(key_passwd);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  235|  18.7k|  CLONE_BLOB(key_blob);
  ------------------
  |  |   62|  18.7k|  do {                                   \
  |  |   63|  18.7k|    if(blobdup(&dest->var, source->var)) \
  |  |  ------------------
  |  |  |  Branch (63:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   64|  18.7k|      return FALSE;                      \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   65|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (65:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  236|  18.7k|#ifdef USE_ECH
  237|  18.7k|  dest->ech = source->ech;
  238|  18.7k|  CLONE_STRING(ech_config);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  239|  18.7k|  CLONE_STRING(ech_public);
  ------------------
  |  |   51|  18.7k|  do {                                       \
  |  |   52|  18.7k|    if(source->var) {                        \
  |  |  ------------------
  |  |  |  Branch (52:8): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   53|      0|      dest->var = curlx_strdup(source->var); \
  |  |  ------------------
  |  |  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  |   54|      0|      if(!dest->var)                         \
  |  |  ------------------
  |  |  |  Branch (54:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   55|      0|        return FALSE;                        \
  |  |  ------------------
  |  |  |  |  989|      0|#define FALSE false
  |  |  ------------------
  |  |   56|      0|    }                                        \
  |  |   57|  18.7k|    else                                     \
  |  |   58|  18.7k|      dest->var = NULL;                      \
  |  |   59|  18.7k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (59:11): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  240|  18.7k|#endif
  241|  18.7k|  return TRUE;
  ------------------
  |  |  986|  18.7k|#define TRUE true
  ------------------
  242|  18.7k|}
vtls_config.c:blobdup:
   68|  75.1k|{
   69|  75.1k|  DEBUGASSERT(dest);
  ------------------
  |  | 1016|  75.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (69:3): [True: 0, False: 75.1k]
  |  Branch (69:3): [True: 75.1k, False: 0]
  ------------------
   70|  75.1k|  DEBUGASSERT(!*dest);
  ------------------
  |  | 1016|  75.1k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (70:3): [True: 0, False: 75.1k]
  |  Branch (70:3): [True: 75.1k, False: 0]
  ------------------
   71|  75.1k|  if(src) {
  ------------------
  |  Branch (71:6): [True: 9.37k, False: 65.7k]
  ------------------
   72|       |    /* only if there is data to dupe! */
   73|  9.37k|    struct curl_blob *d;
   74|  9.37k|    d = curlx_malloc(sizeof(struct curl_blob) + src->len);
  ------------------
  |  | 1498|  9.37k|#define curlx_malloc(size)         curl_dbg_malloc(size, __LINE__, __FILE__)
  ------------------
   75|  9.37k|    if(!d)
  ------------------
  |  Branch (75:8): [True: 1, False: 9.37k]
  ------------------
   76|      1|      return CURLE_OUT_OF_MEMORY;
   77|  9.37k|    d->len = src->len;
   78|       |    /* Always duplicate because the connection may survive longer than the
   79|       |       handle that passed in the blob. */
   80|  9.37k|    d->flags = CURL_BLOB_COPY;
  ------------------
  |  |   31|  9.37k|#define CURL_BLOB_COPY   1 /* tell libcurl to copy the data */
  ------------------
   81|  9.37k|    d->data = (void *)((char *)d + sizeof(struct curl_blob));
   82|  9.37k|    memcpy(d->data, src->data, src->len);
   83|  9.37k|    *dest = d;
   84|  9.37k|  }
   85|  75.1k|  return CURLE_OK;
   86|  75.1k|}

Curl_ssl_peer_key_make:
  367|  3.36k|{
  368|  3.36k|  return ssl_peer_key_build(sslc, peer, tls_id, ppeer_key);
  369|  3.36k|}
Curl_ssl_session_create2:
  426|  1.90k|{
  427|  1.90k|  struct Curl_ssl_session *s;
  428|       |
  429|  1.90k|  if(!sdata || !sdata_len) {
  ------------------
  |  Branch (429:6): [True: 0, False: 1.90k]
  |  Branch (429:16): [True: 0, False: 1.90k]
  ------------------
  430|      0|    curlx_free(sdata);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  431|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  432|      0|  }
  433|       |
  434|  1.90k|  *psession = NULL;
  435|  1.90k|  s = curlx_calloc(1, sizeof(*s));
  ------------------
  |  | 1500|  1.90k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  436|  1.90k|  if(!s) {
  ------------------
  |  Branch (436:6): [True: 0, False: 1.90k]
  ------------------
  437|      0|    curlx_free(sdata);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  438|      0|    curlx_free(quic_tp);
  ------------------
  |  | 1503|      0|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  439|      0|    return CURLE_OUT_OF_MEMORY;
  440|      0|  }
  441|       |
  442|  1.90k|  s->ietf_tls_id = ietf_tls_id;
  443|  1.90k|  s->valid_until = valid_until;
  444|  1.90k|  s->earlydata_max = earlydata_max;
  445|  1.90k|  s->sdata = sdata;
  446|  1.90k|  s->sdata_len = sdata_len;
  447|  1.90k|  s->quic_tp = quic_tp;
  448|  1.90k|  s->quic_tp_len = quic_tp_len;
  449|  1.90k|  if(alpn) {
  ------------------
  |  Branch (449:6): [True: 1.90k, False: 0]
  ------------------
  450|  1.90k|    s->alpn = curlx_strdup(alpn);
  ------------------
  |  | 1497|  1.90k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  451|  1.90k|    if(!s->alpn) {
  ------------------
  |  Branch (451:8): [True: 0, False: 1.90k]
  ------------------
  452|      0|      cf_ssl_scache_session_ldestroy(NULL, s);
  453|      0|      return CURLE_OUT_OF_MEMORY;
  454|      0|    }
  455|  1.90k|  }
  456|  1.90k|  *psession = s;
  457|  1.90k|  return CURLE_OK;
  458|  1.90k|}
Curl_ssl_session_destroy:
  461|  7.13k|{
  462|  7.13k|  if(s) {
  ------------------
  |  Branch (462:6): [True: 0, False: 7.13k]
  ------------------
  463|       |    /* if in the list, the list destructor takes care of it */
  464|      0|    if(Curl_node_llist(&s->list))
  ------------------
  |  Branch (464:8): [True: 0, False: 0]
  ------------------
  465|      0|      Curl_node_remove(&s->list);
  466|      0|    else {
  467|       |      cf_ssl_scache_session_ldestroy(NULL, s);
  468|      0|    }
  469|      0|  }
  470|  7.13k|}
Curl_ssl_scache_create:
  644|  9.78k|{
  645|  9.78k|  struct Curl_ssl_scache *scache;
  646|  9.78k|  struct Curl_ssl_scache_peer *peers;
  647|  9.78k|  size_t i;
  648|       |
  649|  9.78k|  *pscache = NULL;
  650|  9.78k|  peers = curlx_calloc(max_peers, sizeof(*peers));
  ------------------
  |  | 1500|  9.78k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  651|  9.78k|  if(!peers)
  ------------------
  |  Branch (651:6): [True: 1, False: 9.78k]
  ------------------
  652|      1|    return CURLE_OUT_OF_MEMORY;
  653|       |
  654|  9.78k|  scache = curlx_calloc(1, sizeof(*scache));
  ------------------
  |  | 1500|  9.78k|  curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
  ------------------
  655|  9.78k|  if(!scache) {
  ------------------
  |  Branch (655:6): [True: 4, False: 9.77k]
  ------------------
  656|      4|    curlx_free(peers);
  ------------------
  |  | 1503|      4|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  657|      4|    return CURLE_OUT_OF_MEMORY;
  658|      4|  }
  659|       |
  660|  9.77k|  scache->magic = CURL_SCACHE_MAGIC;
  ------------------
  |  |   62|  9.77k|#define CURL_SCACHE_MAGIC 0x000e1551
  ------------------
  661|  9.77k|  scache->default_lifetime_secs = (24 * 60 * 60); /* 1 day */
  662|  9.77k|  scache->peer_count = max_peers;
  663|  9.77k|  scache->peers = peers;
  664|  9.77k|  scache->age = 1;
  665|   254k|  for(i = 0; i < scache->peer_count; ++i) {
  ------------------
  |  Branch (665:14): [True: 244k, False: 9.77k]
  ------------------
  666|   244k|    scache->peers[i].max_sessions = max_sessions_per_peer;
  667|   244k|    Curl_llist_init(&scache->peers[i].sessions,
  668|   244k|                    cf_ssl_scache_session_ldestroy);
  669|   244k|  }
  670|  9.77k|#ifdef USE_MUTEX
  671|       |  Curl_mutex_init(&scache->mutex);
  ------------------
  |  |   50|  9.77k|#  define Curl_mutex_init(m)     pthread_mutex_init(m, NULL)
  ------------------
  672|  9.77k|#endif
  673|  9.77k|  *pscache = scache;
  674|  9.77k|  return CURLE_OK;
  675|  9.78k|}
Curl_ssl_scache_destroy:
  678|  9.82k|{
  679|  9.82k|  if(GOOD_SCACHE(scache)) {
  ------------------
  |  |   64|  9.82k|#define GOOD_SCACHE(x) ((x) && (x)->magic == CURL_SCACHE_MAGIC)
  |  |  ------------------
  |  |  |  |   62|  9.77k|#define CURL_SCACHE_MAGIC 0x000e1551
  |  |  ------------------
  |  |  |  Branch (64:25): [True: 9.77k, False: 52]
  |  |  |  Branch (64:32): [True: 9.77k, False: 0]
  |  |  ------------------
  ------------------
  680|  9.77k|    size_t i;
  681|  9.77k|    scache->magic = 0;
  682|   254k|    for(i = 0; i < scache->peer_count; ++i) {
  ------------------
  |  Branch (682:16): [True: 244k, False: 9.77k]
  ------------------
  683|   244k|      cf_ssl_scache_clear_peer(&scache->peers[i]);
  684|   244k|    }
  685|  9.77k|    curlx_free(scache->peers);
  ------------------
  |  | 1503|  9.77k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  686|  9.77k|#ifdef USE_MUTEX
  687|  9.77k|    Curl_mutex_destroy(&scache->mutex);
  ------------------
  |  |   53|  9.77k|#  define Curl_mutex_destroy(m)  pthread_mutex_destroy(m)
  ------------------
  688|  9.77k|#endif
  689|  9.77k|    curlx_free(scache);
  ------------------
  |  | 1503|  9.77k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  690|  9.77k|  }
  691|  9.82k|}
Curl_ssl_scache_use:
  694|  8.57k|{
  695|  8.57k|  if(cf_ssl_scache_get(data)) {
  ------------------
  |  Branch (695:6): [True: 8.57k, False: 0]
  ------------------
  696|  8.57k|    struct ssl_filter_config *conn_config =
  697|  8.57k|      Curl_ssl_cf_get_filter_config(cf);
  698|  8.57k|    return conn_config ? conn_config->cache_session : FALSE;
  ------------------
  |  |  989|  8.57k|#define FALSE false
  ------------------
  |  Branch (698:12): [True: 8.57k, False: 0]
  ------------------
  699|  8.57k|  }
  700|      0|  return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  701|  8.57k|}
Curl_ssl_scache_lock:
  705|  5.23k|{
  706|  5.23k|  struct Curl_ssl_scache *scache = cf_ssl_scache_get(data);
  707|  5.23k|  if(scache) {
  ------------------
  |  Branch (707:6): [True: 5.23k, False: 0]
  ------------------
  708|  5.23k|    if(CURL_SHARE_ssl_scache(data))
  ------------------
  |  |   94|  5.23k|  ((data)->share &&                                                \
  |  |  ------------------
  |  |  |  Branch (94:4): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |   95|  5.23k|   ((data)->share->specifier & (1 << CURL_LOCK_DATA_SSL_SESSION)))
  |  |  ------------------
  |  |  |  Branch (95:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  709|      0|      Curl_share_lock(data, CURL_LOCK_DATA_SSL_SESSION,
  710|      0|                      CURL_LOCK_ACCESS_SINGLE);
  711|  5.23k|#ifdef USE_MUTEX
  712|  5.23k|    Curl_mutex_acquire(&scache->mutex);
  ------------------
  |  |   51|  5.23k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  713|  5.23k|    scache->locking_thread = Curl_thread_get_current_id();
  714|  5.23k|    DEBUGASSERT(!scache->is_locked);
  ------------------
  |  | 1016|  5.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (714:5): [True: 0, False: 5.23k]
  |  Branch (714:5): [True: 5.23k, False: 0]
  ------------------
  715|  5.23k|    scache->is_locked = TRUE;
  ------------------
  |  |  986|  5.23k|#define TRUE true
  ------------------
  716|  5.23k|    Curl_mutex_release(&scache->mutex);
  ------------------
  |  |   52|  5.23k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  717|       |#else
  718|       |    DEBUGASSERT(!scache->is_locked);
  719|       |    scache->is_locked = TRUE;
  720|       |#endif
  721|  5.23k|  }
  722|  5.23k|}
Curl_ssl_scache_unlock:
  726|  5.23k|{
  727|  5.23k|  struct Curl_ssl_scache *scache = cf_ssl_scache_get(data);
  728|  5.23k|  if(scache) {
  ------------------
  |  Branch (728:6): [True: 5.23k, False: 0]
  ------------------
  729|  5.23k|#ifdef USE_MUTEX
  730|  5.23k|    Curl_mutex_acquire(&scache->mutex);
  ------------------
  |  |   51|  5.23k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  731|  5.23k|    scache->locking_thread = 0;
  732|  5.23k|    DEBUGASSERT(scache->is_locked);
  ------------------
  |  | 1016|  5.23k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (732:5): [True: 0, False: 5.23k]
  |  Branch (732:5): [True: 5.23k, False: 0]
  ------------------
  733|  5.23k|    scache->is_locked = FALSE;
  ------------------
  |  |  989|  5.23k|#define FALSE false
  ------------------
  734|  5.23k|    Curl_mutex_release(&scache->mutex);
  ------------------
  |  |   52|  5.23k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  735|       |#else
  736|       |    DEBUGASSERT(scache->is_locked);
  737|       |    scache->is_locked = FALSE;
  738|       |#endif
  739|  5.23k|    if(CURL_SHARE_ssl_scache(data))
  ------------------
  |  |   94|  5.23k|  ((data)->share &&                                                \
  |  |  ------------------
  |  |  |  Branch (94:4): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |   95|  5.23k|   ((data)->share->specifier & (1 << CURL_LOCK_DATA_SSL_SESSION)))
  |  |  ------------------
  |  |  |  Branch (95:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  740|      0|      Curl_share_unlock(data, CURL_LOCK_DATA_SSL_SESSION);
  741|  5.23k|  }
  742|  5.23k|}
Curl_ssl_scache_is_locked_by_current_thread:
  745|   189k|{
  746|   189k|  struct Curl_ssl_scache *scache = cf_ssl_scache_get(data);
  747|   189k|  bool locked = FALSE;
  ------------------
  |  |  989|   189k|#define FALSE false
  ------------------
  748|   189k|  if(!scache)
  ------------------
  |  Branch (748:6): [True: 0, False: 189k]
  ------------------
  749|      0|    return FALSE;
  ------------------
  |  |  989|      0|#define FALSE false
  ------------------
  750|   189k|#ifdef USE_MUTEX
  751|   189k|  Curl_mutex_acquire(&scache->mutex);
  ------------------
  |  |   51|   189k|#  define Curl_mutex_acquire(m)  pthread_mutex_lock(m)
  ------------------
  752|   189k|  locked = scache->is_locked && Curl_thread_is_current(scache->locking_thread);
  ------------------
  |  Branch (752:12): [True: 0, False: 189k]
  |  Branch (752:33): [True: 0, False: 0]
  ------------------
  753|   189k|  Curl_mutex_release(&scache->mutex);
  ------------------
  |  |   52|   189k|#  define Curl_mutex_release(m)  pthread_mutex_unlock(m)
  ------------------
  754|       |#else
  755|       |  locked = (bool)scache->is_locked;
  756|       |#endif
  757|   189k|  return locked;
  758|   189k|}
Curl_ssl_scache_put:
  997|  1.90k|{
  998|  1.90k|  struct Curl_ssl_scache *scache = cf_ssl_scache_get(data);
  999|  1.90k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 1000|  1.90k|  CURLcode result;
 1001|  1.90k|  DEBUGASSERT(conn_config);
  ------------------
  |  | 1016|  1.90k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (1001:3): [True: 0, False: 1.90k]
  |  Branch (1001:3): [True: 1.90k, False: 0]
  ------------------
 1002|       |
 1003|  1.90k|  if(!scache || !conn_config->cache_session) {
  ------------------
  |  Branch (1003:6): [True: 0, False: 1.90k]
  |  Branch (1003:17): [True: 0, False: 1.90k]
  ------------------
 1004|      0|    Curl_ssl_session_destroy(s);
 1005|      0|    return CURLE_OK;
 1006|      0|  }
 1007|       |
 1008|  1.90k|  Curl_ssl_scache_lock(data);
 1009|  1.90k|  result = cf_scache_add_session(cf, data, scache, ssl_peer_key, s);
 1010|  1.90k|  Curl_ssl_scache_unlock(data);
 1011|  1.90k|  return result;
 1012|  1.90k|}
Curl_ssl_scache_return:
 1018|  3.33k|{
 1019|       |  /* See RFC 8446 C.4:
 1020|       |   * "Clients SHOULD NOT reuse a ticket for multiple connections." */
 1021|  3.33k|  if(s && s->ietf_tls_id < 0x304)
  ------------------
  |  Branch (1021:6): [True: 0, False: 3.33k]
  |  Branch (1021:11): [True: 0, False: 0]
  ------------------
 1022|      0|    (void)Curl_ssl_scache_put(cf, data, ssl_peer_key, s);
 1023|  3.33k|  else
 1024|  3.33k|    Curl_ssl_session_destroy(s);
 1025|  3.33k|}
Curl_ssl_scache_take:
 1031|  3.33k|{
 1032|  3.33k|  struct Curl_ssl_scache *scache = cf_ssl_scache_get(data);
 1033|  3.33k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
 1034|  3.33k|  struct Curl_ssl_scache_peer *peer = NULL;
 1035|  3.33k|  struct Curl_llist_node *n;
 1036|  3.33k|  struct Curl_ssl_session *s = NULL;
 1037|  3.33k|  CURLcode result;
 1038|       |
 1039|  3.33k|  *ps = NULL;
 1040|  3.33k|  if(!scache)
  ------------------
  |  Branch (1040:6): [True: 0, False: 3.33k]
  ------------------
 1041|      0|    return CURLE_OK;
 1042|       |
 1043|  3.33k|  Curl_ssl_scache_lock(data);
 1044|  3.33k|  result = cf_ssl_find_peer_by_key(data, scache, ssl_peer_key, conn_config,
 1045|  3.33k|                                   &peer);
 1046|  3.33k|  if(!result && peer) {
  ------------------
  |  Branch (1046:6): [True: 3.33k, False: 0]
  |  Branch (1046:17): [True: 0, False: 3.33k]
  ------------------
 1047|      0|    cf_scache_peer_remove_expired(peer, (curl_off_t)time(NULL));
 1048|      0|    n = Curl_llist_head(&peer->sessions);
 1049|      0|    if(n) {
  ------------------
  |  Branch (1049:8): [True: 0, False: 0]
  ------------------
 1050|      0|      s = Curl_node_take_elem(n);
 1051|      0|      scache->age++;           /* increase general age */
 1052|      0|      peer->age = scache->age; /* set this as used in this age */
 1053|      0|    }
 1054|      0|  }
 1055|  3.33k|  if(s) {
  ------------------
  |  Branch (1055:6): [True: 0, False: 3.33k]
  ------------------
 1056|      0|    *ps = s;
 1057|      0|    CURL_TRC_SSLS(data, "took session for %s [proto=0x%x, "
  ------------------
  |  |  194|      0|  do {                                                    \
  |  |  195|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|      0|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (196:27): [True: 0, False: 0]
  |  |  ------------------
  |  |  197|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1058|      0|                  "alpn=%s, earlydata=%zu, quic_tp=%s], %zu sessions remain",
 1059|      0|                  ssl_peer_key, (unsigned int)s->ietf_tls_id, s->alpn,
 1060|      0|                  s->earlydata_max, s->quic_tp ? "yes" : "no",
 1061|      0|                  Curl_llist_count(&peer->sessions));
 1062|      0|  }
 1063|  3.33k|  else {
 1064|  3.33k|    CURL_TRC_SSLS(data, "no cached session for %s", ssl_peer_key);
  ------------------
  |  |  194|  3.33k|  do {                                                    \
  |  |  195|  3.33k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  329|  3.33k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  6.67k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 3.33k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 343, False: 2.99k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  6.67k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 343, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    343|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  3.33k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    343|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 70, False: 273]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|  3.33k|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  197|  3.33k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 3.33k]
  |  |  ------------------
  ------------------
 1065|  3.33k|  }
 1066|  3.33k|  Curl_ssl_scache_unlock(data);
 1067|  3.33k|  return result;
 1068|  3.33k|}
vtls_scache.c:ssl_peer_key_build:
  242|  3.36k|{
  243|  3.36k|  struct dynbuf buf;
  244|  3.36k|  size_t key_len;
  245|  3.36k|  bool is_local = FALSE;
  ------------------
  |  |  989|  3.36k|#define FALSE false
  ------------------
  246|  3.36k|  CURLcode result;
  247|       |
  248|  3.36k|  *ppeer_key = NULL;
  249|  3.36k|  curlx_dyn_init(&buf, 10 * 1024);
  250|       |
  251|  3.36k|  result = curlx_dyn_addf(&buf, "%s:%s:%d:KEY-V3",
  252|  3.36k|                          peer->origin->scheme->name,
  253|  3.36k|                          peer->origin->hostname, peer->origin->port);
  254|  3.36k|  if(result)
  ------------------
  |  Branch (254:6): [True: 4, False: 3.36k]
  ------------------
  255|      4|    goto out;
  256|  3.36k|  result = ssl_peer_key_add_transport(&buf, peer->transport);
  257|  3.36k|  if(result)
  ------------------
  |  Branch (257:6): [True: 0, False: 3.36k]
  ------------------
  258|      0|    goto out;
  259|  3.36k|  result = ssl_peer_key_add_vrfy(&buf, ssl, peer);
  260|  3.36k|  if(result)
  ------------------
  |  Branch (260:6): [True: 0, False: 3.36k]
  ------------------
  261|      0|    goto out;
  262|  3.36k|  if(ssl->version || ssl->version_max) {
  ------------------
  |  Branch (262:6): [True: 3.36k, False: 0]
  |  Branch (262:22): [True: 0, False: 0]
  ------------------
  263|  3.36k|    result = curlx_dyn_addf(&buf, ":TLSVER-%d-%u", ssl->version,
  264|  3.36k|                            (ssl->version_max >> 16));
  265|  3.36k|    if(result)
  ------------------
  |  Branch (265:8): [True: 2, False: 3.36k]
  ------------------
  266|      2|      goto out;
  267|  3.36k|  }
  268|  3.36k|  if(ssl->ssl_options) {
  ------------------
  |  Branch (268:6): [True: 0, False: 3.36k]
  ------------------
  269|      0|    result = curlx_dyn_addf(&buf, ":TLSOPT-%x", ssl->ssl_options);
  270|      0|    if(result)
  ------------------
  |  Branch (270:8): [True: 0, False: 0]
  ------------------
  271|      0|      goto out;
  272|      0|  }
  273|  3.36k|  if(ssl->cipher_list) {
  ------------------
  |  Branch (273:6): [True: 0, False: 3.36k]
  ------------------
  274|      0|    result = cf_ssl_peer_key_add_string(&buf, "CIPHER", ssl->cipher_list);
  275|      0|    if(result)
  ------------------
  |  Branch (275:8): [True: 0, False: 0]
  ------------------
  276|      0|      goto out;
  277|      0|  }
  278|  3.36k|  if(ssl->cipher_list13) {
  ------------------
  |  Branch (278:6): [True: 0, False: 3.36k]
  ------------------
  279|      0|    result = cf_ssl_peer_key_add_string(&buf, "CIPHER13", ssl->cipher_list13);
  280|      0|    if(result)
  ------------------
  |  Branch (280:8): [True: 0, False: 0]
  ------------------
  281|      0|      goto out;
  282|      0|  }
  283|  3.36k|  if(ssl->curves) {
  ------------------
  |  Branch (283:6): [True: 0, False: 3.36k]
  ------------------
  284|      0|    result = cf_ssl_peer_key_add_string(&buf, "CURVES", ssl->curves);
  285|      0|    if(result)
  ------------------
  |  Branch (285:8): [True: 0, False: 0]
  ------------------
  286|      0|      goto out;
  287|      0|  }
  288|  3.36k|  if(ssl->signature_algorithms) {
  ------------------
  |  Branch (288:6): [True: 0, False: 3.36k]
  ------------------
  289|      0|    result = cf_ssl_peer_key_add_string(&buf, "SIGALGS",
  290|      0|                                        ssl->signature_algorithms);
  291|      0|    if(result)
  ------------------
  |  Branch (291:8): [True: 0, False: 0]
  ------------------
  292|      0|      goto out;
  293|      0|  }
  294|  3.36k|  if(ssl->verifypeer) {
  ------------------
  |  Branch (294:6): [True: 3.36k, False: 0]
  ------------------
  295|  3.36k|    result = cf_ssl_peer_key_add_path(&buf, "CA", ssl->CAfile, &is_local);
  296|  3.36k|    if(!result)
  ------------------
  |  Branch (296:8): [True: 3.36k, False: 0]
  ------------------
  297|  3.36k|      result = cf_ssl_peer_key_add_path(&buf, "CApath",
  298|  3.36k|                                        ssl->CApath, &is_local);
  299|  3.36k|    if(!result && ssl->native_ca_store)
  ------------------
  |  Branch (299:8): [True: 3.36k, False: 0]
  |  Branch (299:19): [True: 0, False: 3.36k]
  ------------------
  300|      0|      result = curlx_dyn_add(&buf, ":NATIVE-CA");
  301|  3.36k|    if(!result)
  ------------------
  |  Branch (301:8): [True: 3.36k, False: 0]
  ------------------
  302|  3.36k|      result = cf_ssl_peer_key_add_path(&buf, "CRL", ssl->CRLfile, &is_local);
  303|  3.36k|    if(result)
  ------------------
  |  Branch (303:8): [True: 0, False: 3.36k]
  ------------------
  304|      0|      goto out;
  305|  3.36k|    result = cf_ssl_peer_key_add_path(&buf, "Issuer", ssl->issuercert,
  306|  3.36k|                                      &is_local);
  307|  3.36k|    if(result)
  ------------------
  |  Branch (307:8): [True: 0, False: 3.36k]
  ------------------
  308|      0|      goto out;
  309|  3.36k|    if(ssl->ca_info_blob) {
  ------------------
  |  Branch (309:8): [True: 3.34k, False: 20]
  ------------------
  310|  3.34k|      result = cf_ssl_peer_key_add_hash(&buf, "CAInfoBlob", ssl->ca_info_blob);
  311|  3.34k|      if(result)
  ------------------
  |  Branch (311:10): [True: 2, False: 3.33k]
  ------------------
  312|      2|        goto out;
  313|  3.34k|    }
  314|  3.35k|    if(ssl->issuercert_blob) {
  ------------------
  |  Branch (314:8): [True: 0, False: 3.35k]
  ------------------
  315|      0|      result = cf_ssl_peer_key_add_hash(&buf, "IssuerBlob",
  316|      0|                                        ssl->issuercert_blob);
  317|      0|      if(result)
  ------------------
  |  Branch (317:10): [True: 0, False: 0]
  ------------------
  318|      0|        goto out;
  319|      0|    }
  320|  3.35k|  }
  321|  3.35k|  if(ssl->cert_blob) {
  ------------------
  |  Branch (321:6): [True: 0, False: 3.35k]
  ------------------
  322|      0|    result = cf_ssl_peer_key_add_hash(&buf, "CertBlob", ssl->cert_blob);
  323|      0|    if(result)
  ------------------
  |  Branch (323:8): [True: 0, False: 0]
  ------------------
  324|      0|      goto out;
  325|      0|  }
  326|  3.35k|  if(ssl->pinned_key && ssl->pinned_key[0]) {
  ------------------
  |  Branch (326:6): [True: 0, False: 3.35k]
  |  Branch (326:25): [True: 0, False: 0]
  ------------------
  327|      0|    result = cf_ssl_peer_key_add_string(&buf, "Pinned", ssl->pinned_key);
  328|      0|    if(result)
  ------------------
  |  Branch (328:8): [True: 0, False: 0]
  ------------------
  329|      0|      goto out;
  330|      0|  }
  331|  3.35k|  if(ssl->auto_client_cert) {
  ------------------
  |  Branch (331:6): [True: 0, False: 3.35k]
  ------------------
  332|      0|    result = curlx_dyn_add(&buf, ":AUTOC");
  333|      0|    if(result)
  ------------------
  |  Branch (333:8): [True: 0, False: 0]
  ------------------
  334|      0|      goto out;
  335|      0|  }
  336|       |
  337|  3.35k|  result = cf_ssl_peer_key_add_mtls(&buf, ssl, &is_local);
  338|  3.35k|  if(result)
  ------------------
  |  Branch (338:6): [True: 0, False: 3.35k]
  ------------------
  339|      0|    goto out;
  340|       |
  341|  3.35k|  if(!tls_id || !tls_id[0]) {
  ------------------
  |  Branch (341:6): [True: 0, False: 3.35k]
  |  Branch (341:17): [True: 0, False: 3.35k]
  ------------------
  342|      0|    result = CURLE_FAILED_INIT;
  343|      0|    goto out;
  344|      0|  }
  345|  3.35k|  result = cf_ssl_peer_key_add_string(&buf, "IMPL", tls_id);
  346|  3.35k|  if(result)
  ------------------
  |  Branch (346:6): [True: 2, False: 3.35k]
  ------------------
  347|      2|    goto out;
  348|       |
  349|  3.35k|  result = curlx_dyn_addf(&buf, is_local ?
  ------------------
  |  Branch (349:33): [True: 0, False: 3.35k]
  ------------------
  350|  3.35k|                          CURL_SSLS_LOCAL_SUFFIX : CURL_SSLS_GLOBAL_SUFFIX);
  ------------------
  |  |  178|      0|#define CURL_SSLS_LOCAL_SUFFIX     ":L"
  ------------------
                                        CURL_SSLS_LOCAL_SUFFIX : CURL_SSLS_GLOBAL_SUFFIX);
  ------------------
  |  |  179|  3.35k|#define CURL_SSLS_GLOBAL_SUFFIX    ":G"
  ------------------
  351|  3.35k|  if(result)
  ------------------
  |  Branch (351:6): [True: 1, False: 3.35k]
  ------------------
  352|      1|    goto out;
  353|       |
  354|  3.35k|  *ppeer_key = curlx_dyn_take(&buf, &key_len);
  355|       |  /* we added printable char, and dynbuf always null-terminates, no need
  356|       |   * to track length */
  357|       |
  358|  3.36k|out:
  359|  3.36k|  curlx_dyn_free(&buf);
  360|  3.36k|  return result;
  361|  3.35k|}
vtls_scache.c:ssl_peer_key_add_transport:
  191|  3.36k|{
  192|  3.36k|  switch(transport) {
  193|      0|  case TRNSPRT_TCP:
  ------------------
  |  |  225|      0|#define TRNSPRT_TCP  3
  ------------------
  |  Branch (193:3): [True: 0, False: 3.36k]
  ------------------
  194|      0|    return CURLE_OK;
  195|      0|  case TRNSPRT_UDP:
  ------------------
  |  |  226|      0|#define TRNSPRT_UDP  4
  ------------------
  |  Branch (195:3): [True: 0, False: 3.36k]
  ------------------
  196|      0|    return curlx_dyn_add(buf, ":UDP");
  197|  3.36k|  case TRNSPRT_QUIC:
  ------------------
  |  |  227|  3.36k|#define TRNSPRT_QUIC 5
  ------------------
  |  Branch (197:3): [True: 3.36k, False: 0]
  ------------------
  198|  3.36k|    return curlx_dyn_add(buf, ":QUIC");
  199|      0|  case TRNSPRT_UNIX:
  ------------------
  |  |  228|      0|#define TRNSPRT_UNIX 6
  ------------------
  |  Branch (199:3): [True: 0, False: 3.36k]
  ------------------
  200|      0|    return curlx_dyn_add(buf, ":UNIX");
  201|      0|  default:
  ------------------
  |  Branch (201:3): [True: 0, False: 3.36k]
  ------------------
  202|      0|    return curlx_dyn_addf(buf, ":TRNSPRT-%d", transport);
  203|  3.36k|  }
  204|  3.36k|}
vtls_scache.c:ssl_peer_key_add_vrfy:
  209|  3.36k|{
  210|  3.36k|  CURLcode result;
  211|       |
  212|  3.36k|  if(!ssl->verifypeer) {
  ------------------
  |  Branch (212:6): [True: 0, False: 3.36k]
  ------------------
  213|      0|    result = curlx_dyn_add(buf, ":NO-VRFY-PEER");
  214|      0|    if(result)
  ------------------
  |  Branch (214:8): [True: 0, False: 0]
  ------------------
  215|      0|      return result;
  216|      0|  }
  217|  3.36k|  if(!ssl->verifyhost) {
  ------------------
  |  Branch (217:6): [True: 0, False: 3.36k]
  ------------------
  218|      0|    result = curlx_dyn_add(buf, ":NO-VRFY-HOST");
  219|      0|    if(result)
  ------------------
  |  Branch (219:8): [True: 0, False: 0]
  ------------------
  220|      0|      return result;
  221|      0|  }
  222|  3.36k|  if(ssl->verifystatus) {
  ------------------
  |  Branch (222:6): [True: 0, False: 3.36k]
  ------------------
  223|      0|    result = curlx_dyn_add(buf, ":VRFY-STATUS");
  224|      0|    if(result)
  ------------------
  |  Branch (224:8): [True: 0, False: 0]
  ------------------
  225|      0|      return result;
  226|      0|  }
  227|  3.36k|  if((!ssl->verifypeer || !ssl->verifyhost) &&
  ------------------
  |  Branch (227:7): [True: 0, False: 3.36k]
  |  Branch (227:27): [True: 0, False: 3.36k]
  ------------------
  228|      0|     peer->peer && !Curl_peer_equal(peer->origin, peer->peer)) {
  ------------------
  |  Branch (228:6): [True: 0, False: 0]
  |  Branch (228:20): [True: 0, False: 0]
  ------------------
  229|      0|    result = cf_ssl_peer_key_add_string(buf, "CHOST", peer->peer->hostname);
  230|      0|    if(!result)
  ------------------
  |  Branch (230:8): [True: 0, False: 0]
  ------------------
  231|      0|      result = curlx_dyn_addf(buf, ":CPORT-%u", peer->peer->port);
  232|      0|    if(result)
  ------------------
  |  Branch (232:8): [True: 0, False: 0]
  ------------------
  233|      0|      return result;
  234|      0|  }
  235|  3.36k|  return CURLE_OK;
  236|  3.36k|}
vtls_scache.c:cf_ssl_peer_key_add_string:
   70|  3.35k|{
   71|  3.35k|  return curlx_dyn_addf(buf, ":%s-%zu:%s", name, strlen(value), value);
   72|  3.35k|}
vtls_scache.c:cf_ssl_peer_key_add_path:
   78|  13.4k|{
   79|  13.4k|  if(path && path[0]) {
  ------------------
  |  Branch (79:6): [True: 0, False: 13.4k]
  |  Branch (79:14): [True: 0, False: 0]
  ------------------
   80|       |    /* We try to add absolute paths, so that the session key can stay valid
   81|       |     * when used in another process with different CWD. When a path does not
   82|       |     * exist, this does not work. Then, we add the path as is. */
   83|       |#ifdef _WIN32
   84|       |    char *abspath = _fullpath(NULL, path, 0);
   85|       |    if(abspath) {
   86|       |      CURLcode result = cf_ssl_peer_key_add_string(buf, name, abspath);
   87|       |      /* !checksrc! disable BANNEDFUNC 1 */
   88|       |      free(abspath); /* allocated by CRT, use system free() */
   89|       |      return result;
   90|       |    }
   91|       |    *is_local = TRUE;
   92|       |#elif defined(HAVE_REALPATH)
   93|      0|    if(path[0] != '/') {
  ------------------
  |  Branch (93:8): [True: 0, False: 0]
  ------------------
   94|      0|      char *abspath = realpath(path, NULL);
   95|      0|      if(abspath) {
  ------------------
  |  Branch (95:10): [True: 0, False: 0]
  ------------------
   96|      0|        CURLcode result = cf_ssl_peer_key_add_string(buf, name, abspath);
   97|       |        /* !checksrc! disable BANNEDFUNC 1 */
   98|      0|        free(abspath); /* allocated by libc, free without memdebug */
   99|      0|        return result;
  100|      0|      }
  101|      0|      *is_local = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  102|      0|    }
  103|       |#else
  104|       |    (void)is_local;
  105|       |#endif
  106|      0|    return cf_ssl_peer_key_add_string(buf, name, path);
  107|      0|  }
  108|  13.4k|  return CURLE_OK;
  109|  13.4k|}
vtls_scache.c:cf_ssl_peer_key_add_hash:
  114|  3.34k|{
  115|  3.34k|  CURLcode result = CURLE_OK;
  116|  3.34k|  if(blob && blob->len) {
  ------------------
  |  Branch (116:6): [True: 3.34k, False: 0]
  |  Branch (116:14): [True: 3.34k, False: 0]
  ------------------
  117|  3.34k|    uint8_t hash[CURL_SHA256_DIGEST_LEN];
  118|  3.34k|    size_t i;
  119|       |
  120|  3.34k|    result = curlx_dyn_addf(buf, ":%s-", name);
  121|  3.34k|    if(result)
  ------------------
  |  Branch (121:8): [True: 0, False: 3.34k]
  ------------------
  122|      0|      goto out;
  123|  3.34k|    result = Curl_sha256it(hash, blob->data, blob->len);
  124|  3.34k|    if(result)
  ------------------
  |  Branch (124:8): [True: 0, False: 3.34k]
  ------------------
  125|      0|      goto out;
  126|   110k|    for(i = 0; i < CURL_SHA256_DIGEST_LEN; ++i) {
  ------------------
  |  |   87|   110k|#define CURL_SHA256_DIGEST_LEN 32
  ------------------
  |  Branch (126:16): [True: 106k, False: 3.33k]
  ------------------
  127|   106k|      result = curlx_dyn_addf(buf, "%02x", hash[i]);
  128|   106k|      if(result)
  ------------------
  |  Branch (128:10): [True: 2, False: 106k]
  ------------------
  129|      2|        goto out;
  130|   106k|    }
  131|  3.34k|  }
  132|  3.34k|out:
  133|  3.34k|  return result;
  134|  3.34k|}
vtls_scache.c:cf_ssl_peer_key_add_mtls:
  139|  3.35k|{
  140|  3.35k|  CURLcode result = CURLE_OK;
  141|  3.35k|  if(ssl->clientcert && ssl->clientcert[0]) {
  ------------------
  |  Branch (141:6): [True: 0, False: 3.35k]
  |  Branch (141:25): [True: 0, False: 0]
  ------------------
  142|      0|    result = cf_ssl_peer_key_add_path(buf, "CCERT", ssl->clientcert, is_local);
  143|      0|    if(result)
  ------------------
  |  Branch (143:8): [True: 0, False: 0]
  ------------------
  144|      0|      goto out;
  145|      0|  }
  146|  3.35k|  if(ssl->key && ssl->key[0]) {
  ------------------
  |  Branch (146:6): [True: 0, False: 3.35k]
  |  Branch (146:18): [True: 0, False: 0]
  ------------------
  147|      0|    result = cf_ssl_peer_key_add_path(buf, "KEY", ssl->key, is_local);
  148|      0|    if(result)
  ------------------
  |  Branch (148:8): [True: 0, False: 0]
  ------------------
  149|      0|      goto out;
  150|      0|  }
  151|  3.35k|  if(ssl->key_blob) {
  ------------------
  |  Branch (151:6): [True: 0, False: 3.35k]
  ------------------
  152|      0|    result = cf_ssl_peer_key_add_hash(buf, "KEYBlob", ssl->key_blob);
  153|      0|    if(result)
  ------------------
  |  Branch (153:8): [True: 0, False: 0]
  ------------------
  154|      0|      goto out;
  155|      0|  }
  156|  3.35k|  if(ssl->cert_type && ssl->cert_type[0]) {
  ------------------
  |  Branch (156:6): [True: 0, False: 3.35k]
  |  Branch (156:24): [True: 0, False: 0]
  ------------------
  157|      0|    size_t i;
  158|      0|    result = curlx_dyn_addf(buf, ":CT-%zu:", strlen(ssl->cert_type));
  159|      0|    for(i = 0; !result && ssl->cert_type[i]; i++) {
  ------------------
  |  Branch (159:16): [True: 0, False: 0]
  |  Branch (159:27): [True: 0, False: 0]
  ------------------
  160|      0|      char c = Curl_raw_toupper(ssl->cert_type[i]);
  161|      0|      result = curlx_dyn_addn(buf, &c, 1);
  162|      0|    }
  163|      0|    if(result)
  ------------------
  |  Branch (163:8): [True: 0, False: 0]
  ------------------
  164|      0|      goto out;
  165|      0|  }
  166|  3.35k|  if(ssl->key_type && ssl->key_type[0]) {
  ------------------
  |  Branch (166:6): [True: 0, False: 3.35k]
  |  Branch (166:23): [True: 0, False: 0]
  ------------------
  167|      0|    size_t i;
  168|      0|    result = curlx_dyn_addf(buf, ":KT-%zu:", strlen(ssl->key_type));
  169|      0|    for(i = 0; !result && ssl->key_type[i]; i++) {
  ------------------
  |  Branch (169:16): [True: 0, False: 0]
  |  Branch (169:27): [True: 0, False: 0]
  ------------------
  170|      0|      char c = Curl_raw_toupper(ssl->key_type[i]);
  171|      0|      result = curlx_dyn_addn(buf, &c, 1);
  172|      0|    }
  173|      0|  }
  174|  3.35k|out:
  175|  3.35k|  return result;
  176|  3.35k|}
vtls_scache.c:cf_ssl_scache_session_ldestroy:
  402|  1.90k|{
  403|  1.90k|  struct Curl_ssl_session *s = obj;
  404|  1.90k|  (void)udata;
  405|  1.90k|  curlx_free(s->sdata);
  ------------------
  |  | 1503|  1.90k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  406|  1.90k|  curlx_free(s->quic_tp);
  ------------------
  |  | 1503|  1.90k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  407|  1.90k|  curlx_free(s->alpn);
  ------------------
  |  | 1503|  1.90k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  408|  1.90k|  curlx_free(s);
  ------------------
  |  | 1503|  1.90k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  ------------------
  409|  1.90k|}
vtls_scache.c:cf_ssl_scache_clear_peer:
  521|   246k|{
  522|   246k|  Curl_llist_destroy(&peer->sessions, NULL);
  523|   246k|  if(peer->sobj) {
  ------------------
  |  Branch (523:6): [True: 0, False: 246k]
  ------------------
  524|      0|    DEBUGASSERT(peer->sobj_free);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (524:5): [True: 0, False: 0]
  |  Branch (524:5): [True: 0, False: 0]
  ------------------
  525|      0|    if(peer->sobj_free)
  ------------------
  |  Branch (525:8): [True: 0, False: 0]
  ------------------
  526|      0|      peer->sobj_free(peer->sobj);
  527|      0|    peer->sobj = NULL;
  528|      0|  }
  529|   246k|  peer->sobj_free = NULL;
  530|   246k|  curlx_safefree(peer->clientcert);
  ------------------
  |  | 1359|   246k|  do {                      \
  |  | 1360|   246k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|   246k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|   246k|    (ptr) = NULL;           \
  |  | 1362|   246k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 246k]
  |  |  ------------------
  ------------------
  531|   246k|  curlx_safefree(peer->key_passwd);
  ------------------
  |  | 1359|   246k|  do {                      \
  |  | 1360|   246k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|   246k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|   246k|    (ptr) = NULL;           \
  |  | 1362|   246k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 246k]
  |  |  ------------------
  ------------------
  532|   246k|  curlx_safefree(peer->ssl_peer_key);
  ------------------
  |  | 1359|   246k|  do {                      \
  |  | 1360|   246k|    curlx_free(ptr);        \
  |  |  ------------------
  |  |  |  | 1503|   246k|#define curlx_free(ptr)            curl_dbg_free(ptr, __LINE__, __FILE__)
  |  |  ------------------
  |  | 1361|   246k|    (ptr) = NULL;           \
  |  | 1362|   246k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (1362:11): [Folded, False: 246k]
  |  |  ------------------
  ------------------
  533|   246k|  peer->age = 0;
  534|       |  peer->hmac_set = FALSE;
  ------------------
  |  |  989|   246k|#define FALSE false
  ------------------
  535|   246k|}
vtls_scache.c:cf_ssl_scache_get:
  385|   214k|{
  386|   214k|  struct Curl_ssl_scache *scache = NULL;
  387|       |  /* If a share is present, its ssl_scache has preference over the multi */
  388|   214k|  if(data->share && data->share->ssl_scache)
  ------------------
  |  Branch (388:6): [True: 0, False: 214k]
  |  Branch (388:21): [True: 0, False: 0]
  ------------------
  389|      0|    scache = data->share->ssl_scache;
  390|   214k|  else if(data->multi && data->multi->ssl_scache)
  ------------------
  |  Branch (390:11): [True: 214k, False: 0]
  |  Branch (390:26): [True: 214k, False: 0]
  ------------------
  391|   214k|    scache = data->multi->ssl_scache;
  392|   214k|  if(scache && !GOOD_SCACHE(scache)) {
  ------------------
  |  |   64|   214k|#define GOOD_SCACHE(x) ((x) && (x)->magic == CURL_SCACHE_MAGIC)
  |  |  ------------------
  |  |  |  |   62|   214k|#define CURL_SCACHE_MAGIC 0x000e1551
  |  |  ------------------
  |  |  |  Branch (64:25): [True: 214k, False: 0]
  |  |  |  Branch (64:32): [True: 214k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (392:6): [True: 214k, False: 0]
  ------------------
  393|      0|    failf(data, "transfer would use an invalid scache at %p, denied",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  394|      0|          (void *)scache);
  395|      0|    DEBUGASSERT(0);
  ------------------
  |  | 1016|      0|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (395:5): [Folded, False: 0]
  |  Branch (395:5): [Folded, False: 0]
  ------------------
  396|      0|    return NULL;
  397|      0|  }
  398|   214k|  return scache;
  399|   214k|}
vtls_scache.c:cf_scache_add_session:
  942|  1.90k|{
  943|  1.90k|  struct Curl_ssl_scache_peer *peer = NULL;
  944|  1.90k|  struct ssl_filter_config *conn_config = Curl_ssl_cf_get_filter_config(cf);
  945|  1.90k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  946|  1.90k|  curl_off_t now = (curl_off_t)time(NULL);
  947|  1.90k|  curl_off_t max_lifetime;
  948|       |
  949|  1.90k|  if(!scache || !scache->peer_count) {
  ------------------
  |  Branch (949:6): [True: 0, False: 1.90k]
  |  Branch (949:17): [True: 0, False: 1.90k]
  ------------------
  950|      0|    Curl_ssl_session_destroy(s);
  951|      0|    return CURLE_OK;
  952|      0|  }
  953|       |
  954|  1.90k|  if(s->valid_until <= 0)
  ------------------
  |  Branch (954:6): [True: 0, False: 1.90k]
  ------------------
  955|      0|    s->valid_until = now + scache->default_lifetime_secs;
  956|       |
  957|  1.90k|  max_lifetime = (s->ietf_tls_id == CURL_IETF_PROTO_TLS1_3) ?
  ------------------
  |  |   88|  1.90k|#define CURL_IETF_PROTO_TLS1_3        0x0304
  ------------------
  |  Branch (957:18): [True: 1.90k, False: 0]
  ------------------
  958|  1.90k|                 CURL_SCACHE_MAX_13_LIFETIME_SEC :
  ------------------
  |  |   41|  1.90k|#define CURL_SCACHE_MAX_13_LIFETIME_SEC    (60 * 60 * 24 * 7)
  ------------------
  959|  1.90k|                 CURL_SCACHE_MAX_12_LIFETIME_SEC;
  ------------------
  |  |   42|  1.90k|#define CURL_SCACHE_MAX_12_LIFETIME_SEC    (60 * 60 * 24)
  ------------------
  960|  1.90k|  if(s->valid_until > (now + max_lifetime))
  ------------------
  |  Branch (960:6): [True: 0, False: 1.90k]
  ------------------
  961|      0|    s->valid_until = now + max_lifetime;
  962|       |
  963|  1.90k|  if(cf_scache_session_expired(s, now)) {
  ------------------
  |  Branch (963:6): [True: 0, False: 1.90k]
  ------------------
  964|      0|    CURL_TRC_SSLS(data, "add, session already expired");
  ------------------
  |  |  194|      0|  do {                                                    \
  |  |  195|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|      0|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  197|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  965|      0|    Curl_ssl_session_destroy(s);
  966|      0|    return CURLE_OK;
  967|      0|  }
  968|       |
  969|  1.90k|  result = cf_ssl_add_peer(data, scache, ssl_peer_key, conn_config, &peer);
  970|  1.90k|  if(result || !peer) {
  ------------------
  |  Branch (970:6): [True: 0, False: 1.90k]
  |  Branch (970:16): [True: 0, False: 1.90k]
  ------------------
  971|      0|    CURL_TRC_SSLS(data, "unable to add scache peer: %d", (int)result);
  ------------------
  |  |  194|      0|  do {                                                    \
  |  |  195|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|      0|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  197|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  972|      0|    Curl_ssl_session_destroy(s);
  973|      0|    goto out;
  974|      0|  }
  975|       |
  976|  1.90k|  cf_scache_peer_add_session(peer, s, now);
  977|       |
  978|  1.90k|out:
  979|  1.90k|  if(result) {
  ------------------
  |  Branch (979:6): [True: 0, False: 1.90k]
  ------------------
  980|      0|    failf(data, "[SCACHE] failed to add session for %s, error=%d",
  ------------------
  |  |   62|      0|#define failf Curl_failf
  ------------------
  981|      0|          ssl_peer_key, (int)result);
  982|      0|  }
  983|  1.90k|  else
  984|  1.90k|    CURL_TRC_SSLS(data, "added session for %s [proto=0x%x, "
  ------------------
  |  |  194|  1.90k|  do {                                                    \
  |  |  195|  1.90k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  329|  1.90k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  3.80k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 1.90k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 136, False: 1.76k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  3.80k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 136, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    136|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  1.90k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    136|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 4, False: 132]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|  1.90k|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  ------------------
  |  |  |  Branch (196:27): [True: 4, False: 0]
  |  |  |  Branch (196:27): [True: 4, False: 0]
  |  |  ------------------
  |  |  197|  1.90k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 1.90k]
  |  |  ------------------
  ------------------
  985|  1.90k|                  "valid_secs=%" FMT_OFF_T ", alpn=%s, earlydata=%zu, "
  986|  1.90k|                  "quic_tp=%s], peer has %zu sessions now", ssl_peer_key,
  987|  1.90k|                  (unsigned int)s->ietf_tls_id, s->valid_until - now,
  988|  1.90k|                  s->alpn, s->earlydata_max, s->quic_tp ? "yes" : "no",
  989|  1.90k|                  peer ? Curl_llist_count(&peer->sessions) : 0);
  990|  1.90k|  return result;
  991|  1.90k|}
vtls_scache.c:cf_scache_session_expired:
  614|  1.90k|{
  615|  1.90k|  return (s->valid_until > 0) && (s->valid_until < now);
  ------------------
  |  Branch (615:10): [True: 1.90k, False: 0]
  |  Branch (615:34): [True: 0, False: 1.90k]
  ------------------
  616|  1.90k|}
vtls_scache.c:cf_ssl_find_peer_by_key:
  780|  5.23k|{
  781|  5.23k|  size_t i, peer_key_len = 0;
  782|  5.23k|  CURLcode result = CURLE_OK;
  783|       |
  784|  5.23k|  *ppeer = NULL;
  785|  5.23k|  if(!GOOD_SCACHE(scache)) {
  ------------------
  |  |   64|  5.23k|#define GOOD_SCACHE(x) ((x) && (x)->magic == CURL_SCACHE_MAGIC)
  |  |  ------------------
  |  |  |  |   62|  5.23k|#define CURL_SCACHE_MAGIC 0x000e1551
  |  |  ------------------
  |  |  |  Branch (64:25): [True: 5.23k, False: 0]
  |  |  |  Branch (64:32): [True: 5.23k, False: 0]
  |  |  ------------------
  ------------------
  786|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  787|      0|  }
  788|       |
  789|  5.23k|  CURL_TRC_SSLS(data, "find peer slot for %s among %zu slots",
  ------------------
  |  |  194|  5.23k|  do {                                                    \
  |  |  195|  5.23k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  329|  5.23k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  10.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 5.23k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 479, False: 4.75k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  10.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 479, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    479|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  5.23k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    479|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 74, False: 405]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|  5.23k|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  197|  5.23k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 5.23k]
  |  |  ------------------
  ------------------
  790|  5.23k|                ssl_peer_key, scache->peer_count);
  791|       |
  792|       |  /* check for entries with known peer_key */
  793|   136k|  for(i = 0; scache && i < scache->peer_count; i++) {
  ------------------
  |  Branch (793:14): [True: 136k, False: 0]
  |  Branch (793:24): [True: 130k, False: 5.23k]
  ------------------
  794|   130k|    if(scache->peers[i].ssl_peer_key &&
  ------------------
  |  Branch (794:8): [True: 0, False: 130k]
  ------------------
  795|      0|       !strcmp(ssl_peer_key, scache->peers[i].ssl_peer_key) &&
  ------------------
  |  Branch (795:8): [True: 0, False: 0]
  ------------------
  796|      0|       cf_ssl_scache_match_auth(&scache->peers[i], conn_config)) {
  ------------------
  |  Branch (796:8): [True: 0, False: 0]
  ------------------
  797|       |      /* yes, we have a cached session for this! */
  798|      0|      *ppeer = &scache->peers[i];
  799|      0|      goto out;
  800|      0|    }
  801|   130k|  }
  802|       |  /* check for entries with HMAC set but no known peer_key */
  803|   136k|  for(i = 0; scache && i < scache->peer_count; i++) {
  ------------------
  |  Branch (803:14): [True: 136k, False: 0]
  |  Branch (803:24): [True: 130k, False: 5.23k]
  ------------------
  804|   130k|    if(!scache->peers[i].ssl_peer_key &&
  ------------------
  |  Branch (804:8): [True: 130k, False: 0]
  ------------------
  805|   130k|       scache->peers[i].hmac_set &&
  ------------------
  |  Branch (805:8): [True: 0, False: 130k]
  ------------------
  806|      0|       cf_ssl_scache_match_auth(&scache->peers[i], conn_config)) {
  ------------------
  |  Branch (806:8): [True: 0, False: 0]
  ------------------
  807|       |      /* possible entry with unknown peer_key, check hmac */
  808|      0|      uint8_t my_hmac[CURL_SHA256_DIGEST_LEN];
  809|      0|      if(!peer_key_len) /* we are lazy */
  ------------------
  |  Branch (809:10): [True: 0, False: 0]
  ------------------
  810|      0|        peer_key_len = strlen(ssl_peer_key);
  811|      0|      result = Curl_hmacit(&Curl_HMAC_SHA256,
  812|      0|                           scache->peers[i].key_salt,
  813|      0|                           sizeof(scache->peers[i].key_salt),
  814|      0|                           ssl_peer_key, peer_key_len,
  815|      0|                           my_hmac);
  816|      0|      if(result)
  ------------------
  |  Branch (816:10): [True: 0, False: 0]
  ------------------
  817|      0|        goto out;
  818|      0|      if(!memcmp(scache->peers[i].key_hmac, my_hmac, sizeof(my_hmac))) {
  ------------------
  |  Branch (818:10): [True: 0, False: 0]
  ------------------
  819|       |        /* remember peer_key for future lookups */
  820|      0|        CURL_TRC_SSLS(data, "peer entry %zu key recovered: %s",
  ------------------
  |  |  194|      0|  do {                                                    \
  |  |  195|      0|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  329|      0|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|      0|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|      0|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|      0|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|      0|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|      0|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  197|      0|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  821|      0|                      i, ssl_peer_key);
  822|      0|        scache->peers[i].ssl_peer_key = curlx_strdup(ssl_peer_key);
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  823|      0|        if(!scache->peers[i].ssl_peer_key) {
  ------------------
  |  Branch (823:12): [True: 0, False: 0]
  ------------------
  824|      0|          result = CURLE_OUT_OF_MEMORY;
  825|      0|          goto out;
  826|      0|        }
  827|      0|        cf_ssl_cache_peer_update(&scache->peers[i]);
  828|      0|        *ppeer = &scache->peers[i];
  829|      0|        goto out;
  830|      0|      }
  831|      0|    }
  832|   130k|  }
  833|  5.23k|  CURL_TRC_SSLS(data, "peer not found for %s", ssl_peer_key);
  ------------------
  |  |  194|  5.23k|  do {                                                    \
  |  |  195|  5.23k|    if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \
  |  |  ------------------
  |  |  |  |  329|  5.23k|  (Curl_trc_is_verbose(data) &&          \
  |  |  |  |  ------------------
  |  |  |  |  |  |  322|  10.4k|  ((data) && (data)->set.verbose &&                        \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (322:4): [True: 5.23k, False: 0]
  |  |  |  |  |  |  |  Branch (322:14): [True: 479, False: 4.75k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  323|  10.4k|   (!(data)->state.feat ||                                 \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (323:5): [True: 479, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  324|    479|    ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|      0|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (324:5): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  330|  5.23k|   (ft)->log_level >= CURL_LOG_LVL_INFO)
  |  |  |  |  ------------------
  |  |  |  |  |  |   70|    479|#define CURL_LOG_LVL_INFO  1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (330:4): [True: 74, False: 405]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  196|  5.23k|      Curl_trc_ssls(data, __VA_ARGS__);                   \
  |  |  197|  5.23k|  } while(0)
  |  |  ------------------
  |  |  |  Branch (197:11): [Folded, False: 5.23k]
  |  |  ------------------
  ------------------
  834|  5.23k|out:
  835|  5.23k|  return result;
  836|  5.23k|}
vtls_scache.c:cf_ssl_cache_peer_update:
  550|  1.90k|{
  551|       |  /* The sessions of this peer are exportable if
  552|       |   * - it has no confidential information
  553|       |   * - its peer key is not yet known, because sessions were
  554|       |   *   imported using only the salt+hmac
  555|       |   * - the peer key is global, e.g. carrying no relative paths */
  556|  1.90k|  peer->exportable = (!peer->clientcert && !peer->key_passwd &&
  ------------------
  |  Branch (556:23): [True: 1.90k, False: 0]
  |  Branch (556:44): [True: 1.90k, False: 0]
  ------------------
  557|  1.90k|                      (!peer->ssl_peer_key ||
  ------------------
  |  Branch (557:24): [True: 0, False: 1.90k]
  ------------------
  558|  1.90k|                       cf_ssl_peer_key_is_global(peer->ssl_peer_key)));
  ------------------
  |  Branch (558:24): [True: 1.90k, False: 0]
  ------------------
  559|  1.90k|}
vtls_scache.c:cf_ssl_peer_key_is_global:
  182|  1.90k|{
  183|  1.90k|  size_t len = peer_key ? strlen(peer_key) : 0;
  ------------------
  |  Branch (183:16): [True: 1.90k, False: 0]
  ------------------
  184|  1.90k|  return (len > 2) &&
  ------------------
  |  Branch (184:10): [True: 1.90k, False: 0]
  ------------------
  185|  1.90k|         (peer_key[len - 1] == 'G') &&
  ------------------
  |  Branch (185:10): [True: 1.90k, False: 0]
  ------------------
  186|  1.90k|         (peer_key[len - 2] == ':');
  ------------------
  |  Branch (186:10): [True: 1.90k, False: 0]
  ------------------
  187|  1.90k|}
vtls_scache.c:cf_scache_peer_remove_expired:
  620|  1.90k|{
  621|  1.90k|  struct Curl_llist_node *n = Curl_llist_head(&peer->sessions);
  622|  1.90k|  while(n) {
  ------------------
  |  Branch (622:9): [True: 0, False: 1.90k]
  ------------------
  623|      0|    struct Curl_ssl_session *s = Curl_node_elem(n);
  624|      0|    n = Curl_node_next(n);
  625|      0|    if(cf_scache_session_expired(s, now))
  ------------------
  |  Branch (625:8): [True: 0, False: 0]
  ------------------
  626|      0|      cf_scache_session_remove(peer, s);
  627|      0|  }
  628|  1.90k|}
vtls_scache.c:cf_ssl_add_peer:
  873|  1.90k|{
  874|  1.90k|  struct Curl_ssl_scache_peer *peer = NULL;
  875|  1.90k|  CURLcode result = CURLE_OK;
  876|       |
  877|  1.90k|  *ppeer = NULL;
  878|  1.90k|  if(ssl_peer_key) {
  ------------------
  |  Branch (878:6): [True: 1.90k, False: 0]
  ------------------
  879|  1.90k|    result = cf_ssl_find_peer_by_key(data, scache, ssl_peer_key, conn_config,
  880|  1.90k|                                     &peer);
  881|  1.90k|    if(result || !scache->peer_count)
  ------------------
  |  Branch (881:8): [True: 0, False: 1.90k]
  |  Branch (881:18): [True: 0, False: 1.90k]
  ------------------
  882|      0|      return result;
  883|  1.90k|  }
  884|       |
  885|  1.90k|  if(peer) {
  ------------------
  |  Branch (885:6): [True: 0, False: 1.90k]
  ------------------
  886|      0|    *ppeer = peer;
  887|      0|    return CURLE_OK;
  888|      0|  }
  889|       |
  890|  1.90k|  peer = cf_ssl_get_free_peer(scache);
  891|  1.90k|  if(peer) {
  ------------------
  |  Branch (891:6): [True: 1.90k, False: 0]
  ------------------
  892|  1.90k|    char buffer[64];
  893|  1.90k|    const char *ccert = conn_config ? conn_config->clientcert : NULL;
  ------------------
  |  Branch (893:25): [True: 1.90k, False: 0]
  ------------------
  894|  1.90k|    const char *kpasswd = conn_config ? conn_config->key_passwd : NULL;
  ------------------
  |  Branch (894:27): [True: 1.90k, False: 0]
  ------------------
  895|  1.90k|    if(!ccert && conn_config && conn_config->cert_blob) {
  ------------------
  |  Branch (895:8): [True: 1.90k, False: 0]
  |  Branch (895:18): [True: 1.90k, False: 0]
  |  Branch (895:33): [True: 0, False: 1.90k]
  ------------------
  896|       |      /* when using a client cert blob, create a name for it */
  897|      0|      curl_msnprintf(buffer, sizeof(buffer),
  898|      0|                     "cert-%p", conn_config->cert_blob->data);
  899|      0|      ccert = buffer; /* data is strduped by cf_ssl_scache_peer_init */
  900|      0|    }
  901|  1.90k|    result = cf_ssl_scache_peer_init(peer, ssl_peer_key, ccert, kpasswd,
  902|  1.90k|                                     NULL, NULL);
  903|  1.90k|    if(result)
  ------------------
  |  Branch (903:8): [True: 0, False: 1.90k]
  ------------------
  904|      0|      goto out;
  905|       |    /* all ready */
  906|  1.90k|    *ppeer = peer;
  907|  1.90k|    result = CURLE_OK;
  908|  1.90k|  }
  909|       |
  910|  1.90k|out:
  911|  1.90k|  if(result) {
  ------------------
  |  Branch (911:6): [True: 0, False: 1.90k]
  ------------------
  912|      0|    cf_ssl_scache_clear_peer(peer);
  913|      0|  }
  914|  1.90k|  return result;
  915|  1.90k|}
vtls_scache.c:cf_ssl_get_free_peer:
  840|  1.90k|{
  841|  1.90k|  struct Curl_ssl_scache_peer *peer = NULL;
  842|  1.90k|  size_t i;
  843|       |
  844|       |  /* find empty or oldest peer */
  845|  1.90k|  for(i = 0; i < scache->peer_count; ++i) {
  ------------------
  |  Branch (845:14): [True: 1.90k, False: 0]
  ------------------
  846|       |    /* free peer entry? */
  847|  1.90k|    if(!scache->peers[i].ssl_peer_key && !scache->peers[i].hmac_set) {
  ------------------
  |  Branch (847:8): [True: 1.90k, False: 0]
  |  Branch (847:42): [True: 1.90k, False: 0]
  ------------------
  848|  1.90k|      peer = &scache->peers[i];
  849|  1.90k|      break;
  850|  1.90k|    }
  851|       |    /* peer without sessions and obj */
  852|      0|    if(!scache->peers[i].sobj &&
  ------------------
  |  Branch (852:8): [True: 0, False: 0]
  ------------------
  853|      0|       !Curl_llist_count(&scache->peers[i].sessions)) {
  ------------------
  |  Branch (853:8): [True: 0, False: 0]
  ------------------
  854|      0|      peer = &scache->peers[i];
  855|      0|      break;
  856|      0|    }
  857|       |    /* remember "oldest" peer */
  858|      0|    if(!peer || (scache->peers[i].age < peer->age)) {
  ------------------
  |  Branch (858:8): [True: 0, False: 0]
  |  Branch (858:17): [True: 0, False: 0]
  ------------------
  859|      0|      peer = &scache->peers[i];
  860|      0|    }
  861|      0|  }
  862|  1.90k|  DEBUGASSERT(peer);
  ------------------
  |  | 1016|  1.90k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (862:3): [True: 0, False: 1.90k]
  |  Branch (862:3): [True: 1.90k, False: 0]
  ------------------
  863|  1.90k|  if(peer)
  ------------------
  |  Branch (863:6): [True: 1.90k, False: 0]
  ------------------
  864|  1.90k|    cf_ssl_scache_clear_peer(peer);
  865|  1.90k|  return peer;
  866|  1.90k|}
vtls_scache.c:cf_ssl_scache_peer_init:
  567|  1.90k|{
  568|  1.90k|  CURLcode result = CURLE_OUT_OF_MEMORY;
  569|       |
  570|  1.90k|  DEBUGASSERT(!peer->ssl_peer_key);
  ------------------
  |  | 1016|  1.90k|#define DEBUGASSERT(x) assert(x)
  ------------------
  |  Branch (570:3): [True: 0, False: 1.90k]
  |  Branch (570:3): [True: 1.90k, False: 0]
  ------------------
  571|  1.90k|  if(ssl_peer_key) {
  ------------------
  |  Branch (571:6): [True: 1.90k, False: 0]
  ------------------
  572|  1.90k|    peer->ssl_peer_key = curlx_strdup(ssl_peer_key);
  ------------------
  |  | 1497|  1.90k|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  573|  1.90k|    if(!peer->ssl_peer_key)
  ------------------
  |  Branch (573:8): [True: 0, False: 1.90k]
  ------------------
  574|      0|      goto out;
  575|  1.90k|    peer->hmac_set = FALSE;
  ------------------
  |  |  989|  1.90k|#define FALSE false
  ------------------
  576|  1.90k|  }
  577|      0|  else if(salt && hmac) {
  ------------------
  |  Branch (577:11): [True: 0, False: 0]
  |  Branch (577:19): [True: 0, False: 0]
  ------------------
  578|      0|    memcpy(peer->key_salt, salt, sizeof(peer->key_salt));
  579|      0|    memcpy(peer->key_hmac, hmac, sizeof(peer->key_hmac));
  580|      0|    peer->hmac_set = TRUE;
  ------------------
  |  |  986|      0|#define TRUE true
  ------------------
  581|      0|  }
  582|      0|  else {
  583|      0|    result = CURLE_BAD_FUNCTION_ARGUMENT;
  584|      0|    goto out;
  585|      0|  }
  586|  1.90k|  if(clientcert) {
  ------------------
  |  Branch (586:6): [True: 0, False: 1.90k]
  ------------------
  587|      0|    peer->clientcert = curlx_strdup(clientcert);
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  588|      0|    if(!peer->clientcert)
  ------------------
  |  Branch (588:8): [True: 0, False: 0]
  ------------------
  589|      0|      goto out;
  590|      0|  }
  591|  1.90k|  if(key_passwd) {
  ------------------
  |  Branch (591:6): [True: 0, False: 1.90k]
  ------------------
  592|      0|    peer->key_passwd = curlx_strdup(key_passwd);
  ------------------
  |  | 1497|      0|#define curlx_strdup(ptr)          curl_dbg_strdup(ptr, __LINE__, __FILE__)
  ------------------
  593|      0|    if(!peer->key_passwd)
  ------------------
  |  Branch (593:8): [True: 0, False: 0]
  ------------------
  594|      0|      goto out;
  595|      0|  }
  596|  1.90k|  cf_ssl_cache_peer_update(peer);
  597|  1.90k|  result = CURLE_OK;
  598|  1.90k|out:
  599|  1.90k|  if(result)
  ------------------
  |  Branch (599:6): [True: 0, False: 1.90k]
  ------------------
  600|      0|    cf_ssl_scache_clear_peer(peer);
  601|  1.90k|  return result;
  602|  1.90k|}
vtls_scache.c:cf_scache_peer_add_session:
  920|  1.90k|{
  921|       |  /* A session not from TLSv1.3 replaces all other. */
  922|  1.90k|  if(s->ietf_tls_id != CURL_IETF_PROTO_TLS1_3) {
  ------------------
  |  |   88|  1.90k|#define CURL_IETF_PROTO_TLS1_3        0x0304
  ------------------
  |  Branch (922:6): [True: 0, False: 1.90k]
  ------------------
  923|      0|    Curl_llist_destroy(&peer->sessions, NULL);
  924|      0|    Curl_llist_append(&peer->sessions, s, &s->list);
  925|      0|  }
  926|  1.90k|  else {
  927|       |    /* Expire existing, append, trim from head to obey max_sessions */
  928|  1.90k|    cf_scache_peer_remove_expired(peer, now);
  929|  1.90k|    cf_scache_peer_remove_non13(peer);
  930|  1.90k|    Curl_llist_append(&peer->sessions, s, &s->list);
  931|  1.90k|    while(Curl_llist_count(&peer->sessions) > peer->max_sessions) {
  ------------------
  |  Branch (931:11): [True: 0, False: 1.90k]
  ------------------
  932|      0|      Curl_node_remove(Curl_llist_head(&peer->sessions));
  933|      0|    }
  934|  1.90k|  }
  935|  1.90k|}
vtls_scache.c:cf_scache_peer_remove_non13:
  631|  1.90k|{
  632|  1.90k|  struct Curl_llist_node *n = Curl_llist_head(&peer->sessions);
  633|  1.90k|  while(n) {
  ------------------
  |  Branch (633:9): [True: 0, False: 1.90k]
  ------------------
  634|      0|    struct Curl_ssl_session *s = Curl_node_elem(n);
  635|      0|    n = Curl_node_next(n);
  636|      0|    if(s->ietf_tls_id != CURL_IETF_PROTO_TLS1_3)
  ------------------
  |  |   88|      0|#define CURL_IETF_PROTO_TLS1_3        0x0304
  ------------------
  |  Branch (636:8): [True: 0, False: 0]
  ------------------
  637|      0|      cf_scache_session_remove(peer, s);
  638|      0|  }
  639|  1.90k|}

LLVMFuzzerCustomMutator:
   22|      2|                                               unsigned int seed) {
   23|      2|  return proto_fuzzer::ProtoFuzzerCustomMutator(data, size, max_size, seed,
   24|      2|                                                kProfile);
   25|      2|}
LLVMFuzzerCustomCrossOver:
   31|      1|                          unsigned int seed) {
   32|      1|  return proto_fuzzer::ProtoFuzzerCustomCrossOver(
   33|      1|      data1, size1, data2, size2, out, max_out_size, seed, kProfile);
   34|      1|}
LLVMFuzzerTestOneInput:
   37|  10.2k|                                      std::size_t size) {
   38|  10.2k|  return proto_fuzzer::ProtoFuzzerTestOneInput(data, size, kProfile);
   39|  10.2k|}

__wrap_ngtcp2_conn_client_new_versioned:
  415|  3.34k|    void *user_data) {
  416|  3.34k|  if (IsRealCallActive())
  ------------------
  |  Branch (416:7): [True: 0, False: 3.34k]
  ------------------
  417|      0|    return __real_ngtcp2_conn_client_new_versioned(
  418|      0|        pconn, dcid, scid, path, version, callbacks_version, callbacks,
  419|      0|        settings_version, settings, transport_params_version, params, mem,
  420|      0|        user_data);
  421|  3.34k|  int result;
  422|  3.34k|  {
  423|  3.34k|    RealCallScope real_call;
  424|  3.34k|    result = __real_ngtcp2_conn_client_new_versioned(
  425|  3.34k|        pconn, dcid, scid, path, version, callbacks_version, callbacks,
  426|  3.34k|        settings_version, settings, transport_params_version, params, mem,
  427|  3.34k|        user_data);
  428|  3.34k|  }
  429|  3.34k|  if (result == 0 && pconn != nullptr)
  ------------------
  |  Branch (429:7): [True: 3.33k, False: 13]
  |  Branch (429:22): [True: 3.33k, False: 0]
  ------------------
  430|  3.33k|    ForgetContract(*pconn);
  431|  3.34k|  return result;
  432|  3.34k|}
__wrap_ngtcp2_conn_server_new_versioned:
  441|  1.96k|    void *user_data) {
  442|  1.96k|  if (IsRealCallActive())
  ------------------
  |  Branch (442:7): [True: 0, False: 1.96k]
  ------------------
  443|      0|    return __real_ngtcp2_conn_server_new_versioned(
  444|      0|        pconn, dcid, scid, path, version, callbacks_version, callbacks,
  445|      0|        settings_version, settings, transport_params_version, params, mem,
  446|      0|        user_data);
  447|  1.96k|  int result;
  448|  1.96k|  {
  449|  1.96k|    RealCallScope real_call;
  450|  1.96k|    result = __real_ngtcp2_conn_server_new_versioned(
  451|  1.96k|        pconn, dcid, scid, path, version, callbacks_version, callbacks,
  452|  1.96k|        settings_version, settings, transport_params_version, params, mem,
  453|  1.96k|        user_data);
  454|  1.96k|  }
  455|  1.96k|  if (result == 0 && pconn != nullptr)
  ------------------
  |  Branch (455:7): [True: 1.96k, False: 0]
  |  Branch (455:22): [True: 1.96k, False: 0]
  ------------------
  456|  1.96k|    ForgetContract(*pconn);
  457|  1.96k|  return result;
  458|  1.96k|}
__wrap_ngtcp2_conn_del:
  461|  7.83k|extern "C" void __wrap_ngtcp2_conn_del(ngtcp2_conn *conn) {
  462|  7.83k|  if (IsRealCallActive()) {
  ------------------
  |  Branch (462:7): [True: 0, False: 7.83k]
  ------------------
  463|      0|    __real_ngtcp2_conn_del(conn);
  464|      0|    return;
  465|      0|  }
  466|  7.83k|  ForgetContract(conn);
  467|  7.83k|  RealCallScope real_call;
  468|  7.83k|  __real_ngtcp2_conn_del(conn);
  469|  7.83k|}
__wrap_ngtcp2_conn_encode_0rtt_transport_params:
  474|  1.90k|      ->decltype(__real_##name arguments) {                                    \
  475|  1.90k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 1.90k, False: 0]
  ------------------
  476|  1.90k|      return __real_##name arguments;                                          \
  477|  1.90k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|      0|    RealCallScope real_call;                                                   \
  479|      0|    return __real_##name arguments;                                            \
  480|  1.90k|  }                                                                            \
__wrap_ngtcp2_conn_extend_max_offset:
  485|  21.3k|  extern "C" void __wrap_##name parameters {                                   \
  486|  21.3k|    if (IsRealCallActive()) {                                                  \
  ------------------
  |  Branch (486:9): [True: 21.3k, False: 0]
  ------------------
  487|  21.3k|      __real_##name arguments;                                                 \
  488|  21.3k|      return;                                                                  \
  489|  21.3k|    }                                                                          \
  490|  21.3k|    CheckNoTransaction(conn_argument, #name);                                  \
  491|      0|    RealCallScope real_call;                                                   \
  492|      0|    __real_##name arguments;                                                   \
  493|      0|  }                                                                            \
__wrap_ngtcp2_conn_extend_max_stream_offset:
  474|  23.2k|      ->decltype(__real_##name arguments) {                                    \
  475|  23.2k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 21.3k, False: 1.91k]
  ------------------
  476|  23.2k|      return __real_##name arguments;                                          \
  477|  23.2k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|  1.91k|    RealCallScope real_call;                                                   \
  479|  1.91k|    return __real_##name arguments;                                            \
  480|  23.2k|  }                                                                            \
__wrap_ngtcp2_conn_get_cwnd_left:
  474|    740|      ->decltype(__real_##name arguments) {                                    \
  475|    740|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 740]
  ------------------
  476|    740|      return __real_##name arguments;                                          \
  477|    740|    CheckNoTransaction(conn_argument, #name);                                  \
  478|    740|    RealCallScope real_call;                                                   \
  479|    740|    return __real_##name arguments;                                            \
  480|    740|  }                                                                            \
__wrap_ngtcp2_conn_get_expiry:
  474|   127k|      ->decltype(__real_##name arguments) {                                    \
  475|   127k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 127k]
  ------------------
  476|   127k|      return __real_##name arguments;                                          \
  477|   127k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|   127k|    RealCallScope real_call;                                                   \
  479|   127k|    return __real_##name arguments;                                            \
  480|   127k|  }                                                                            \
__wrap_ngtcp2_conn_get_expiry2:
  474|  41.0k|      ->decltype(__real_##name arguments) {                                    \
  475|  41.0k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 41.0k]
  ------------------
  476|  41.0k|      return __real_##name arguments;                                          \
  477|  41.0k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|  41.0k|    RealCallScope real_call;                                                   \
  479|  41.0k|    return __real_##name arguments;                                            \
  480|  41.0k|  }                                                                            \
__wrap_ngtcp2_conn_get_handshake_completed:
  474|   112k|      ->decltype(__real_##name arguments) {                                    \
  475|   112k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 112k]
  ------------------
  476|   112k|      return __real_##name arguments;                                          \
  477|   112k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|   112k|    RealCallScope real_call;                                                   \
  479|   112k|    return __real_##name arguments;                                            \
  480|   112k|  }                                                                            \
__wrap_ngtcp2_conn_get_max_data_left:
  474|  30.3k|      ->decltype(__real_##name arguments) {                                    \
  475|  30.3k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 30.3k]
  ------------------
  476|  30.3k|      return __real_##name arguments;                                          \
  477|  30.3k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|  30.3k|    RealCallScope real_call;                                                   \
  479|  30.3k|    return __real_##name arguments;                                            \
  480|  30.3k|  }                                                                            \
__wrap_ngtcp2_conn_get_max_tx_udp_payload_size:
  474|   128k|      ->decltype(__real_##name arguments) {                                    \
  475|   128k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 128k]
  ------------------
  476|   128k|      return __real_##name arguments;                                          \
  477|   128k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|   128k|    RealCallScope real_call;                                                   \
  479|   128k|    return __real_##name arguments;                                            \
  480|   128k|  }                                                                            \
__wrap_ngtcp2_conn_get_path_max_tx_udp_payload_size:
  474|   236k|      ->decltype(__real_##name arguments) {                                    \
  475|   236k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 236k]
  ------------------
  476|   236k|      return __real_##name arguments;                                          \
  477|   236k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|   236k|    RealCallScope real_call;                                                   \
  479|   236k|    return __real_##name arguments;                                            \
  480|   236k|  }                                                                            \
__wrap_ngtcp2_conn_get_remote_transport_params:
  474|  3.66k|      ->decltype(__real_##name arguments) {                                    \
  475|  3.66k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 147, False: 3.51k]
  ------------------
  476|  3.66k|      return __real_##name arguments;                                          \
  477|  3.66k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|  3.51k|    RealCallScope real_call;                                                   \
  479|  3.51k|    return __real_##name arguments;                                            \
  480|  3.66k|  }                                                                            \
__wrap_ngtcp2_conn_get_send_quantum:
  474|   128k|      ->decltype(__real_##name arguments) {                                    \
  475|   128k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 128k]
  ------------------
  476|   128k|      return __real_##name arguments;                                          \
  477|   128k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|   128k|    RealCallScope real_call;                                                   \
  479|   128k|    return __real_##name arguments;                                            \
  480|   128k|  }                                                                            \
__wrap_ngtcp2_conn_get_streams_uni_left:
  474|  1.96k|      ->decltype(__real_##name arguments) {                                    \
  475|  1.96k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 1.96k, False: 0]
  ------------------
  476|  1.96k|      return __real_##name arguments;                                          \
  477|  1.96k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|      0|    RealCallScope real_call;                                                   \
  479|      0|    return __real_##name arguments;                                            \
  480|  1.96k|  }                                                                            \
__wrap_ngtcp2_conn_get_timestamp:
  474|  10.7k|      ->decltype(__real_##name arguments) {                                    \
  475|  10.7k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 10.7k, False: 0]
  ------------------
  476|  10.7k|      return __real_##name arguments;                                          \
  477|  10.7k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|      0|    RealCallScope real_call;                                                   \
  479|      0|    return __real_##name arguments;                                            \
  480|  10.7k|  }                                                                            \
__wrap_ngtcp2_conn_handle_expiry:
  474|  4.21k|      ->decltype(__real_##name arguments) {                                    \
  475|  4.21k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 4.21k]
  ------------------
  476|  4.21k|      return __real_##name arguments;                                          \
  477|  4.21k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|  4.21k|    RealCallScope real_call;                                                   \
  479|  4.21k|    return __real_##name arguments;                                            \
  480|  4.21k|  }                                                                            \
__wrap_ngtcp2_conn_in_draining_period:
  499|    501|      ->decltype(__real_##name arguments) {                                    \
  500|    501|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (500:9): [True: 0, False: 501]
  ------------------
  501|    501|      return __real_##name arguments;                                          \
  502|    501|    CheckNoTransaction(conn_argument, #name, false, true);                     \
  503|    501|    RealCallScope real_call;                                                   \
  504|    501|    return __real_##name arguments;                                            \
  505|    501|  }                                                                            \
__wrap_ngtcp2_conn_open_bidi_stream:
  474|  1.92k|      ->decltype(__real_##name arguments) {                                    \
  475|  1.92k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 1.92k]
  ------------------
  476|  1.92k|      return __real_##name arguments;                                          \
  477|  1.92k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|  1.92k|    RealCallScope real_call;                                                   \
  479|  1.92k|    return __real_##name arguments;                                            \
  480|  1.92k|  }                                                                            \
__wrap_ngtcp2_conn_open_uni_stream:
  474|  12.1k|      ->decltype(__real_##name arguments) {                                    \
  475|  12.1k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 11.7k, False: 385]
  ------------------
  476|  12.1k|      return __real_##name arguments;                                          \
  477|  12.1k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|    385|    RealCallScope real_call;                                                   \
  479|    385|    return __real_##name arguments;                                            \
  480|  12.1k|  }                                                                            \
__wrap_ngtcp2_conn_read_pkt_versioned:
  474|  49.6k|      ->decltype(__real_##name arguments) {                                    \
  475|  49.6k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 49.6k]
  ------------------
  476|  49.6k|      return __real_##name arguments;                                          \
  477|  49.6k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|  49.6k|    RealCallScope real_call;                                                   \
  479|  49.6k|    return __real_##name arguments;                                            \
  480|  49.6k|  }                                                                            \
__wrap_ngtcp2_conn_set_keep_alive_timeout:
  485|  3.51k|  extern "C" void __wrap_##name parameters {                                   \
  486|  3.51k|    if (IsRealCallActive()) {                                                  \
  ------------------
  |  Branch (486:9): [True: 0, False: 3.51k]
  ------------------
  487|      0|      __real_##name arguments;                                                 \
  488|      0|      return;                                                                  \
  489|      0|    }                                                                          \
  490|  3.51k|    CheckNoTransaction(conn_argument, #name);                                  \
  491|  3.51k|    RealCallScope real_call;                                                   \
  492|  3.51k|    __real_##name arguments;                                                   \
  493|  3.51k|  }                                                                            \
__wrap_ngtcp2_conn_set_stream_user_data:
  474|    850|      ->decltype(__real_##name arguments) {                                    \
  475|    850|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 850]
  ------------------
  476|    850|      return __real_##name arguments;                                          \
  477|    850|    CheckNoTransaction(conn_argument, #name);                                  \
  478|    850|    RealCallScope real_call;                                                   \
  479|    850|    return __real_##name arguments;                                            \
  480|    850|  }                                                                            \
__wrap_ngtcp2_conn_set_tls_native_handle:
  485|  5.30k|  extern "C" void __wrap_##name parameters {                                   \
  486|  5.30k|    if (IsRealCallActive()) {                                                  \
  ------------------
  |  Branch (486:9): [True: 0, False: 5.30k]
  ------------------
  487|      0|      __real_##name arguments;                                                 \
  488|      0|      return;                                                                  \
  489|      0|    }                                                                          \
  490|  5.30k|    CheckNoTransaction(conn_argument, #name);                                  \
  491|  5.30k|    RealCallScope real_call;                                                   \
  492|  5.30k|    __real_##name arguments;                                                   \
  493|  5.30k|  }                                                                            \
__wrap_ngtcp2_conn_update_pkt_tx_time:
  485|  23.7k|  extern "C" void __wrap_##name parameters {                                   \
  486|  23.7k|    if (IsRealCallActive()) {                                                  \
  ------------------
  |  Branch (486:9): [True: 0, False: 23.7k]
  ------------------
  487|      0|      __real_##name arguments;                                                 \
  488|      0|      return;                                                                  \
  489|      0|    }                                                                          \
  490|  23.7k|    CheckNoTransaction(conn_argument, #name);                                  \
  491|  23.7k|    RealCallScope real_call;                                                   \
  492|  23.7k|    __real_##name arguments;                                                   \
  493|  23.7k|  }                                                                            \
__wrap_ngtcp2_conn_write_pkt_versioned:
  474|  48.4k|      ->decltype(__real_##name arguments) {                                    \
  475|  48.4k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (475:9): [True: 0, False: 48.4k]
  ------------------
  476|  48.4k|      return __real_##name arguments;                                          \
  477|  48.4k|    CheckNoTransaction(conn_argument, #name);                                  \
  478|  48.4k|    RealCallScope real_call;                                                   \
  479|  48.4k|    return __real_##name arguments;                                            \
  480|  48.4k|  }                                                                            \
__wrap_ngtcp2_conn_get_tls_alert:
  499|      7|      ->decltype(__real_##name arguments) {                                    \
  500|      7|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (500:9): [True: 0, False: 7]
  ------------------
  501|      7|      return __real_##name arguments;                                          \
  502|      7|    CheckNoTransaction(conn_argument, #name, false, true);                     \
  503|      7|    RealCallScope real_call;                                                   \
  504|      7|    return __real_##name arguments;                                            \
  505|      7|  }                                                                            \
__wrap_ngtcp2_conn_shutdown_stream:
  600|    850|                               int64_t stream_id, uint64_t app_error_code) {   \
  601|    850|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (601:9): [True: 0, False: 850]
  ------------------
  602|    850|      return __real_##name(conn, flags, stream_id, app_error_code);            \
  603|    850|    CheckNoTransaction(conn, #name, true, false);                              \
  604|    850|    RealCallScope real_call;                                                   \
  605|    850|    return __real_##name(conn, flags, stream_id, app_error_code);              \
  606|    850|  }                                                                            \
__wrap_ngtcp2_conn_shutdown_stream_write:
  600|    211|                               int64_t stream_id, uint64_t app_error_code) {   \
  601|    211|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (601:9): [True: 0, False: 211]
  ------------------
  602|    211|      return __real_##name(conn, flags, stream_id, app_error_code);            \
  603|    211|    CheckNoTransaction(conn, #name, true, false);                              \
  604|    211|    RealCallScope real_call;                                                   \
  605|    211|    return __real_##name(conn, flags, stream_id, app_error_code);              \
  606|    211|  }                                                                            \
__wrap_ngtcp2_conn_write_connection_close_versioned:
  618|  1.98k|    const ngtcp2_ccerr *ccerr, ngtcp2_tstamp timestamp) {
  619|  1.98k|  if (IsRealCallActive())
  ------------------
  |  Branch (619:7): [True: 3, False: 1.98k]
  ------------------
  620|      3|    return __real_ngtcp2_conn_write_connection_close_versioned(
  621|      3|        conn, path, pkt_info_version, pi, dest, destlen, ccerr, timestamp);
  622|  1.98k|  ngtcp2_ssize result;
  623|  1.98k|  {
  624|  1.98k|    RealCallScope real_call;
  625|  1.98k|    result = __real_ngtcp2_conn_write_connection_close_versioned(
  626|  1.98k|        conn, path, pkt_info_version, pi, dest, destlen, ccerr, timestamp);
  627|  1.98k|  }
  628|  1.98k|  return result;
  629|  1.98k|}
__wrap_ngtcp2_conn_writev_stream_versioned:
  651|   168k|      data_type *data_name, size_t count_name, ngtcp2_tstamp timestamp) {      \
  652|   168k|    if (IsRealCallActive())                                                    \
  ------------------
  |  Branch (652:9): [True: 0, False: 168k]
  ------------------
  653|   168k|      return __real_##name(conn, path, pkt_info_version, pi, dest, destlen,    \
  654|      0|                           pdatalen, flags, stream_id, data_name, count_name,  \
  655|      0|                           timestamp);                                         \
  656|   168k|    const ContinuationState continuation =                                     \
  657|   168k|        CheckContinuation(conn, path, pi, dest, destlen, timestamp, #name);    \
  658|   168k|    ngtcp2_ssize result;                                                       \
  659|   168k|    bool forced = false;                                                       \
  660|   168k|    (void)forced;                                                              \
  661|   168k|    /* Test builds can inject documented outcomes without constructing a */    \
  662|   168k|    /* complete encrypted QUIC session. */                                     \
  663|   168k|    /* NOLINTNEXTLINE(bugprone-macro-parentheses) */                           \
  664|   168k|    NGTCP2_CONTRACT_TAKE_FORCED_STREAM(result, pdatalen, forced);              \
  ------------------
  |  |  639|   168k|  do {                                                                         \
  |  |  640|   168k|  } while (false)
  |  |  ------------------
  |  |  |  Branch (640:12): [Folded, False: 168k]
  |  |  ------------------
  ------------------
  665|   168k|    if (!forced) {                                                             \
  ------------------
  |  Branch (665:9): [True: 168k, False: 0]
  ------------------
  666|   168k|      RealCallScope real_call;                                                 \
  667|   168k|      result = __real_##name(conn, path, pkt_info_version, pi, dest, destlen,  \
  668|   168k|                             pdatalen, flags, stream_id, data_name,            \
  669|   168k|                             count_name, timestamp);                           \
  670|   168k|    }                                                                          \
  671|   168k|    ValidateStreamPostcondition(#name, result, pdatalen);                      \
  672|   168k|    const TransactionOrigin origin =                                           \
  673|   168k|        continuation.active ? continuation.origin : TransactionOrigin::Stream; \
  ------------------
  |  Branch (673:9): [True: 8.96k, False: 159k]
  ------------------
  674|   168k|    const bool stream_coalescing =                                             \
  675|   168k|        origin == TransactionOrigin::Stream &&                                 \
  ------------------
  |  Branch (675:9): [True: 168k, False: 0]
  ------------------
  676|   168k|        (continuation.active || (flags & NGTCP2_WRITE_STREAM_FLAG_MORE) != 0); \
  ------------------
  |  | 5234|   159k|#define NGTCP2_WRITE_STREAM_FLAG_MORE 0x01U
  ------------------
  |  Branch (676:10): [True: 8.96k, False: 159k]
  |  Branch (676:33): [True: 151k, False: 7.73k]
  ------------------
  677|   168k|    const bool connection_error =                                              \
  678|   168k|        IsFatalResult(result) || (stream_coalescing && result < 0 &&           \
  ------------------
  |  Branch (678:9): [True: 23, False: 168k]
  |  Branch (678:35): [True: 160k, False: 7.73k]
  |  Branch (678:56): [True: 8.96k, False: 151k]
  ------------------
  679|   168k|                                  !IsStreamContinuationResult(result));        \
  ------------------
  |  Branch (679:35): [True: 0, False: 8.96k]
  ------------------
  680|   168k|    if (connection_error) {                                                    \
  ------------------
  |  Branch (680:9): [True: 23, False: 168k]
  ------------------
  681|     23|      RecordCloseOnly(conn, #name, result);                                    \
  682|     23|      return result;                                                           \
  683|     23|    }                                                                          \
  684|   168k|    const bool keep_open =                                                     \
  685|   168k|        (IsStreamContinuationResult(result) &&                                 \
  ------------------
  |  Branch (685:10): [True: 8.96k, False: 159k]
  ------------------
  686|   168k|         (continuation.active ||                                               \
  ------------------
  |  Branch (686:11): [True: 3.91k, False: 5.05k]
  ------------------
  687|  8.96k|          (flags & NGTCP2_WRITE_STREAM_FLAG_MORE) != 0)) ||                    \
  ------------------
  |  | 5234|  5.05k|#define NGTCP2_WRITE_STREAM_FLAG_MORE 0x01U
  ------------------
  |  Branch (687:11): [True: 5.05k, False: 0]
  ------------------
  688|   168k|        (continuation.active &&                                                \
  ------------------
  |  Branch (688:10): [True: 5.05k, False: 154k]
  ------------------
  689|   159k|         continuation.origin == TransactionOrigin::Datagram && result <= 0);   \
  ------------------
  |  Branch (689:10): [True: 0, False: 5.05k]
  |  Branch (689:64): [True: 0, False: 0]
  ------------------
  690|   168k|    RecordTransaction(conn, #name, path, pi, dest, destlen, timestamp, origin, \
  691|   168k|                      keep_open);                                              \
  692|   168k|    return result;                                                             \
  693|   168k|  }                                                                            \
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_116IsRealCallActiveEv:
   99|  1.20M|bool IsRealCallActive() { return real_call_depth != 0; }
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_113RealCallScopeC2Ev:
   92|  1.13M|  RealCallScope() { ++real_call_depth; }
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_113RealCallScopeD2Ev:
   93|  1.13M|  ~RealCallScope() { --real_call_depth; }
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_114ForgetContractEPK11ngtcp2_conn:
  225|   172k|void ForgetContract(const ngtcp2_conn *conn) {
  226|   172k|  if (conn == nullptr || contract_count.load(std::memory_order_acquire) == 0)
  ------------------
  |  Branch (226:7): [True: 2.53k, False: 170k]
  |  Branch (226:26): [True: 164k, False: 5.07k]
  ------------------
  227|   167k|    return;
  228|       |
  229|  5.07k|  std::lock_guard<std::mutex> lock(contracts_mutex);
  230|  5.07k|  ConnectionContract *contract = FindContract(conn);
  231|  5.07k|  if (contract != nullptr) {
  ------------------
  |  Branch (231:7): [True: 5.07k, False: 0]
  ------------------
  232|  5.07k|    *contract = ConnectionContract{};
  233|  5.07k|    contract_count.fetch_sub(1, std::memory_order_release);
  234|  5.07k|  }
  235|  5.07k|}
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_112FindContractEPK11ngtcp2_conn:
  101|  23.0k|ConnectionContract *FindContract(const ngtcp2_conn *conn) {
  102|  1.31M|  for (ConnectionContract &contract : contracts) {
  ------------------
  |  Branch (102:37): [True: 1.31M, False: 5.07k]
  ------------------
  103|  1.31M|    if (contract.conn == conn)
  ------------------
  |  Branch (103:9): [True: 17.9k, False: 1.29M]
  ------------------
  104|  17.9k|      return &contract;
  105|  1.31M|  }
  106|  5.07k|  return nullptr;
  107|  23.0k|}
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_118CheckNoTransactionEPK11ngtcp2_connPKcbb:
  169|   949k|                        bool allow_close_only = false) {
  170|   949k|  if (conn == nullptr || contract_count.load(std::memory_order_acquire) == 0)
  ------------------
  |  Branch (170:7): [True: 0, False: 949k]
  |  Branch (170:26): [True: 949k, False: 23]
  ------------------
  171|   949k|    return;
  172|       |
  173|     23|  ConnectionContract value;
  174|     23|  {
  175|     23|    std::lock_guard<std::mutex> lock(contracts_mutex);
  176|     23|    const ConnectionContract *contract = FindContract(conn);
  177|     23|    if (contract != nullptr)
  ------------------
  |  Branch (177:9): [True: 23, False: 0]
  ------------------
  178|     23|      value = *contract;
  179|     23|  }
  180|     23|  if (value.conn == nullptr)
  ------------------
  |  Branch (180:7): [True: 0, False: 23]
  ------------------
  181|      0|    return;
  182|     23|  if ((allow_coalescing && value.state == ContractState::Coalescing) ||
  ------------------
  |  Branch (182:8): [True: 0, False: 23]
  |  Branch (182:28): [True: 0, False: 0]
  ------------------
  183|     23|      (allow_close_only && value.state == ContractState::CloseOnly))
  ------------------
  |  Branch (183:8): [True: 23, False: 0]
  |  Branch (183:28): [True: 23, False: 0]
  ------------------
  184|     23|    return;
  185|      0|  AbortForbiddenCall(attempted_api, value);
  186|      0|}
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_117CheckContinuationEPK11ngtcp2_connPK11ngtcp2_pathPK15ngtcp2_pkt_infoPKhmmPKc:
  193|   168k|                                    const char *attempted_api) {
  194|   168k|  if (conn == nullptr || contract_count.load(std::memory_order_acquire) == 0)
  ------------------
  |  Branch (194:7): [True: 0, False: 168k]
  |  Branch (194:26): [True: 159k, False: 8.96k]
  ------------------
  195|   159k|    return ContinuationState{};
  196|       |
  197|  8.96k|  ConnectionContract value;
  198|  8.96k|  {
  199|  8.96k|    std::lock_guard<std::mutex> lock(contracts_mutex);
  200|  8.96k|    const ConnectionContract *contract = FindContract(conn);
  201|  8.96k|    if (contract == nullptr)
  ------------------
  |  Branch (201:9): [True: 0, False: 8.96k]
  ------------------
  202|      0|      return ContinuationState{};
  203|  8.96k|    value = *contract;
  204|  8.96k|  }
  205|       |
  206|  8.96k|  if (value.state == ContractState::CloseOnly)
  ------------------
  |  Branch (206:7): [True: 0, False: 8.96k]
  ------------------
  207|      0|    AbortForbiddenCall(attempted_api, value);
  208|       |
  209|  8.96k|  if (value.path != path)
  ------------------
  |  Branch (209:7): [True: 0, False: 8.96k]
  ------------------
  210|      0|    AbortTupleMismatch(attempted_api, "path", value);
  211|  8.96k|  if (value.pi != pi)
  ------------------
  |  Branch (211:7): [True: 0, False: 8.96k]
  ------------------
  212|      0|    AbortTupleMismatch(attempted_api, "packet info", value);
  213|  8.96k|  if (value.dest != dest)
  ------------------
  |  Branch (213:7): [True: 0, False: 8.96k]
  ------------------
  214|      0|    AbortTupleMismatch(attempted_api, "destination buffer", value);
  215|  8.96k|  if (value.destlen != destlen)
  ------------------
  |  Branch (215:7): [True: 0, False: 8.96k]
  ------------------
  216|      0|    AbortTupleMismatch(attempted_api, "destination length", value);
  217|  8.96k|  if (value.timestamp != timestamp)
  ------------------
  |  Branch (217:7): [True: 0, False: 8.96k]
  ------------------
  218|      0|    AbortTupleMismatch(attempted_api, "timestamp", value);
  219|  8.96k|  ContinuationState state;
  220|  8.96k|  state.active = true;
  221|  8.96k|  state.origin = value.origin;
  222|  8.96k|  return state;
  223|  8.96k|}
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_127ValidateStreamPostconditionEPKclPKl:
  315|   168k|                                 const ngtcp2_ssize *pdatalen) {
  316|   168k|  if (pdatalen == nullptr)
  ------------------
  |  Branch (316:7): [True: 0, False: 168k]
  ------------------
  317|      0|    return;
  318|   168k|  if (result == NGTCP2_ERR_WRITE_MORE && *pdatalen < 0)
  ------------------
  |  |  733|   336k|#define NGTCP2_ERR_WRITE_MORE -230
  ------------------
  |  Branch (318:7): [True: 8.96k, False: 159k]
  |  Branch (318:42): [True: 0, False: 8.96k]
  ------------------
  319|      0|    AbortPostcondition(api, result,
  320|      0|                       "pdatalen is negative instead of nonnegative");
  321|   168k|  if ((result == NGTCP2_ERR_STREAM_DATA_BLOCKED ||
  ------------------
  |  |  583|   336k|#define NGTCP2_ERR_STREAM_DATA_BLOCKED -208
  ------------------
  |  Branch (321:8): [True: 0, False: 168k]
  ------------------
  322|   168k|       result == NGTCP2_ERR_STREAM_NOT_FOUND ||
  ------------------
  |  |  664|   336k|#define NGTCP2_ERR_STREAM_NOT_FOUND -220
  ------------------
  |  Branch (322:8): [True: 0, False: 168k]
  ------------------
  323|   168k|       result == NGTCP2_ERR_STREAM_SHUT_WR) &&
  ------------------
  |  |  657|   168k|#define NGTCP2_ERR_STREAM_SHUT_WR -219
  ------------------
  |  Branch (323:8): [True: 3, False: 168k]
  ------------------
  324|      3|      *pdatalen != -1)
  ------------------
  |  Branch (324:7): [True: 0, False: 3]
  ------------------
  325|      0|    AbortPostcondition(api, result, "pdatalen is not -1");
  326|   168k|}
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_113IsFatalResultEl:
  312|   168k|bool IsFatalResult(ngtcp2_ssize result) { return result < NGTCP2_ERR_FATAL; }
  ------------------
  |  |  799|   168k|#define NGTCP2_ERR_FATAL -500
  ------------------
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_126IsStreamContinuationResultEl:
  305|   177k|bool IsStreamContinuationResult(ngtcp2_ssize result) {
  306|   177k|  return result == NGTCP2_ERR_WRITE_MORE ||
  ------------------
  |  |  733|   354k|#define NGTCP2_ERR_WRITE_MORE -230
  ------------------
  |  Branch (306:10): [True: 17.9k, False: 159k]
  ------------------
  307|   159k|         result == NGTCP2_ERR_STREAM_DATA_BLOCKED ||
  ------------------
  |  |  583|   336k|#define NGTCP2_ERR_STREAM_DATA_BLOCKED -208
  ------------------
  |  Branch (307:10): [True: 0, False: 159k]
  ------------------
  308|   159k|         result == NGTCP2_ERR_STREAM_NOT_FOUND ||
  ------------------
  |  |  664|   336k|#define NGTCP2_ERR_STREAM_NOT_FOUND -220
  ------------------
  |  Branch (308:10): [True: 0, False: 159k]
  ------------------
  309|   159k|         result == NGTCP2_ERR_STREAM_SHUT_WR;
  ------------------
  |  |  657|   159k|#define NGTCP2_ERR_STREAM_SHUT_WR -219
  ------------------
  |  Branch (309:10): [True: 6, False: 159k]
  ------------------
  310|   177k|}
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_115RecordCloseOnlyEPK11ngtcp2_connPKcl:
  293|     23|                     ngtcp2_ssize error_result) {
  294|     23|  if (conn == nullptr)
  ------------------
  |  Branch (294:7): [True: 0, False: 23]
  ------------------
  295|      0|    return;
  296|       |
  297|     23|  ConnectionContract value;
  298|     23|  value.conn = conn;
  299|     23|  value.write_api = write_api;
  300|     23|  value.error_result = error_result;
  301|     23|  value.state = ContractState::CloseOnly;
  302|     23|  StoreContract(value, false);
  303|     23|}
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_113StoreContractENS_18ConnectionContractEb:
  237|  8.99k|void StoreContract(ConnectionContract value, bool preserve_origin) {
  238|  8.99k|  bool added = false;
  239|  8.99k|  bool table_full = false;
  240|  8.99k|  {
  241|  8.99k|    std::lock_guard<std::mutex> lock(contracts_mutex);
  242|  8.99k|    ConnectionContract *contract = FindContract(value.conn);
  243|  8.99k|    if (contract == nullptr) {
  ------------------
  |  Branch (243:9): [True: 5.07k, False: 3.91k]
  ------------------
  244|  5.07k|      for (ConnectionContract &entry : contracts) {
  ------------------
  |  Branch (244:38): [True: 5.07k, False: 0]
  ------------------
  245|  5.07k|        if (entry.conn == nullptr) {
  ------------------
  |  Branch (245:13): [True: 5.07k, False: 0]
  ------------------
  246|  5.07k|          contract = &entry;
  247|  5.07k|          added = true;
  248|  5.07k|          break;
  249|  5.07k|        }
  250|  5.07k|      }
  251|  5.07k|    }
  252|  8.99k|    if (contract != nullptr) {
  ------------------
  |  Branch (252:9): [True: 8.99k, False: 0]
  ------------------
  253|  8.99k|      if (!added && preserve_origin &&
  ------------------
  |  Branch (253:11): [True: 3.91k, False: 5.07k]
  |  Branch (253:21): [True: 3.91k, False: 0]
  ------------------
  254|  3.91k|          contract->state == ContractState::Coalescing) {
  ------------------
  |  Branch (254:11): [True: 3.91k, False: 0]
  ------------------
  255|  3.91k|        value.write_api = contract->write_api;
  256|  3.91k|        value.origin = contract->origin;
  257|  3.91k|      }
  258|  8.99k|      *contract = value;
  259|  8.99k|      if (added)
  ------------------
  |  Branch (259:11): [True: 5.07k, False: 3.91k]
  ------------------
  260|  5.07k|        contract_count.fetch_add(1, std::memory_order_release);
  261|  8.99k|    } else
  262|      0|      table_full = true;
  263|  8.99k|  }
  264|  8.99k|  if (table_full)
  ------------------
  |  Branch (264:7): [True: 0, False: 8.99k]
  ------------------
  265|      0|    AbortTrackingOverflow(value);
  266|  8.99k|}
ngtcp2_contract_shim.cc:_ZN12_GLOBAL__N_117RecordTransactionEPK11ngtcp2_connPKcPK11ngtcp2_pathPK15ngtcp2_pkt_infoPKhmmNS_17TransactionOriginEb:
  272|   168k|                       bool keep_open) {
  273|   168k|  if (conn == nullptr)
  ------------------
  |  Branch (273:7): [True: 0, False: 168k]
  ------------------
  274|      0|    return;
  275|   168k|  if (!keep_open) {
  ------------------
  |  Branch (275:7): [True: 159k, False: 8.96k]
  ------------------
  276|   159k|    ForgetContract(conn);
  277|   159k|    return;
  278|   159k|  }
  279|       |
  280|  8.96k|  ConnectionContract value;
  281|  8.96k|  value.conn = conn;
  282|  8.96k|  value.write_api = write_api;
  283|  8.96k|  value.path = path;
  284|  8.96k|  value.pi = pi;
  285|  8.96k|  value.dest = dest;
  286|  8.96k|  value.destlen = destlen;
  287|  8.96k|  value.timestamp = timestamp;
  288|  8.96k|  value.origin = origin;
  289|  8.96k|  StoreContract(value, true);
  290|  8.96k|}

__wrap_SSL_new:
  291|  5.30k|extern "C" SSL *__wrap_SSL_new(SSL_CTX *ctx) {
  292|  5.30k|  if (IsRealCallActive()) {
  ------------------
  |  Branch (292:7): [True: 0, False: 5.30k]
  ------------------
  293|      0|    return __real_SSL_new(ctx);
  294|      0|  }
  295|  5.30k|  SSL *ssl;
  296|  5.30k|  {
  297|  5.30k|    RealCallScope real_call;
  298|  5.30k|    ssl = __real_SSL_new(ctx);
  299|  5.30k|  }
  300|       |  // OpenSSL's allocator may reuse a recently freed address.
  301|  5.30k|  ForgetConnection(ssl);
  302|  5.30k|  return ssl;
  303|  5.30k|}
__wrap_SSL_free:
  307|  5.30k|extern "C" void __wrap_SSL_free(SSL *ssl) {
  308|  5.30k|  if (IsRealCallActive()) {
  ------------------
  |  Branch (308:7): [True: 0, False: 5.30k]
  ------------------
  309|      0|    __real_SSL_free(ssl);
  310|      0|    return;
  311|      0|  }
  312|  5.30k|  ForgetConnection(ssl);
  313|  5.30k|  RealCallScope real_call;
  314|  5.30k|  __real_SSL_free(ssl);
  315|  5.30k|}
__wrap_SSL_clear:
  320|  5.29k|extern "C" int __wrap_SSL_clear(SSL *ssl) {
  321|  5.29k|  if (IsRealCallActive()) {
  ------------------
  |  Branch (321:7): [True: 5.29k, False: 0]
  ------------------
  322|  5.29k|    return __real_SSL_clear(ssl);
  323|  5.29k|  }
  324|      0|  int result;
  325|      0|  {
  326|      0|    RealCallScope real_call;
  327|      0|    result = __real_SSL_clear(ssl);
  328|      0|  }
  329|      0|  if (result == 1) {
  ------------------
  |  Branch (329:7): [True: 0, False: 0]
  ------------------
  330|       |    // A successful clear starts a new connection on the same SSL object.
  331|      0|    ForgetConnection(ssl);
  332|      0|  }
  333|      0|  return result;
  334|  5.29k|}
__wrap_SSL_get_error:
  339|  33.0k|extern "C" int __wrap_SSL_get_error(const SSL *ssl, int io_result) {
  340|  33.0k|  if (IsRealCallActive()) {
  ------------------
  |  Branch (340:7): [True: 0, False: 33.0k]
  ------------------
  341|      0|    return __real_SSL_get_error(ssl, io_result);
  342|      0|  }
  343|  33.0k|  int ssl_error;
  344|  33.0k|  {
  345|  33.0k|    RealCallScope real_call;
  346|  33.0k|    ssl_error = __real_SSL_get_error(ssl, io_result);
  347|  33.0k|  }
  348|  33.0k|  RecordSslError(ssl, io_result, ssl_error);
  349|  33.0k|  return ssl_error;
  350|  33.0k|}
__wrap_SSL_do_handshake:
  358|  31.1k|      ->decltype(__real_##name arguments) {                                    \
  359|  31.1k|    if (IsRealCallActive()) {                                                  \
  ------------------
  |  Branch (359:9): [True: 0, False: 31.1k]
  ------------------
  360|      0|      return __real_##name arguments;                                          \
  361|      0|    }                                                                          \
  362|  31.1k|    CheckUsable(ssl, #name);                                                   \
  363|  31.1k|    decltype(__real_##name arguments) result;                                  \
  364|  31.1k|    {                                                                          \
  365|  31.1k|      RealCallScope real_call;                                                 \
  366|  31.1k|      result = __real_##name arguments;                                        \
  367|  31.1k|    }                                                                          \
  368|  31.1k|    RecordIoResult(ssl, #name, static_cast<long long>(result),                 \
  369|  31.1k|                   zero_is_non_error);                                         \
  370|  31.1k|    return result;                                                             \
  371|  31.1k|  }                                                                            \
__wrap_SSL_read:
  358|  5.81k|      ->decltype(__real_##name arguments) {                                    \
  359|  5.81k|    if (IsRealCallActive()) {                                                  \
  ------------------
  |  Branch (359:9): [True: 0, False: 5.81k]
  ------------------
  360|      0|      return __real_##name arguments;                                          \
  361|      0|    }                                                                          \
  362|  5.81k|    CheckUsable(ssl, #name);                                                   \
  363|  5.81k|    decltype(__real_##name arguments) result;                                  \
  364|  5.81k|    {                                                                          \
  365|  5.81k|      RealCallScope real_call;                                                 \
  366|  5.81k|      result = __real_##name arguments;                                        \
  367|  5.81k|    }                                                                          \
  368|  5.81k|    RecordIoResult(ssl, #name, static_cast<long long>(result),                 \
  369|  5.81k|                   zero_is_non_error);                                         \
  370|  5.81k|    return result;                                                             \
  371|  5.81k|  }                                                                            \
openssl_contract_shim.cc:_ZN12_GLOBAL__N_116IsRealCallActiveEv:
   61|  85.8k|bool IsRealCallActive() { return real_call_depth != 0; }
openssl_contract_shim.cc:_ZN12_GLOBAL__N_113RealCallScopeC2Ev:
   54|  80.5k|  RealCallScope() { ++real_call_depth; }
openssl_contract_shim.cc:_ZN12_GLOBAL__N_113RealCallScopeD2Ev:
   55|  80.5k|  ~RealCallScope() { --real_call_depth; }
openssl_contract_shim.cc:_ZN12_GLOBAL__N_116ForgetConnectionEPK6ssl_st:
  251|  10.6k|void ForgetConnection(const SSL *ssl) {
  252|  10.6k|  ForgetPendingIoCall(ssl);
  253|  10.6k|  if (ssl == nullptr ||
  ------------------
  |  Branch (253:7): [True: 0, False: 10.6k]
  ------------------
  254|  10.6k|      fatal_connection_count.load(std::memory_order_acquire) == 0) {
  ------------------
  |  Branch (254:7): [True: 10.5k, False: 19]
  ------------------
  255|  10.5k|    return;
  256|  10.5k|  }
  257|       |
  258|     19|  std::lock_guard<std::mutex> lock(fatal_connections_mutex);
  259|     19|  FatalConnection *fatal = FindFatalConnection(ssl);
  260|     19|  if (fatal != nullptr) {
  ------------------
  |  Branch (260:7): [True: 19, False: 0]
  ------------------
  261|     19|    *fatal = FatalConnection{};
  262|     19|    fatal_connection_count.fetch_sub(1, std::memory_order_release);
  263|     19|  }
  264|     19|}
openssl_contract_shim.cc:_ZN12_GLOBAL__N_119ForgetPendingIoCallEPK6ssl_st:
  143|  14.5k|void ForgetPendingIoCall(const SSL *ssl) {
  144|  14.5k|  if (ssl == nullptr ||
  ------------------
  |  Branch (144:7): [True: 0, False: 14.5k]
  ------------------
  145|  14.5k|      pending_io_call_count.load(std::memory_order_acquire) == 0) {
  ------------------
  |  Branch (145:7): [True: 14.5k, False: 0]
  ------------------
  146|  14.5k|    return;
  147|  14.5k|  }
  148|       |
  149|      0|  std::lock_guard<std::mutex> lock(pending_io_calls_mutex);
  150|      0|  PendingIoCall *call = FindPendingIoCall(ssl);
  151|      0|  if (call != nullptr) {
  ------------------
  |  Branch (151:7): [True: 0, False: 0]
  ------------------
  152|      0|    *call = PendingIoCall{};
  153|      0|    pending_io_call_count.fetch_sub(1, std::memory_order_release);
  154|      0|  }
  155|      0|}
openssl_contract_shim.cc:_ZN12_GLOBAL__N_117FindPendingIoCallEPK6ssl_st:
  106|  66.0k|PendingIoCall *FindPendingIoCall(const SSL *ssl) {
  107|  8.48M|  for (PendingIoCall &call : pending_io_calls) {
  ------------------
  |  Branch (107:28): [True: 8.48M, False: 33.0k]
  ------------------
  108|  8.48M|    if (call.ssl == ssl) {
  ------------------
  |  Branch (108:9): [True: 33.0k, False: 8.44M]
  ------------------
  109|  33.0k|      return &call;
  110|  33.0k|    }
  111|  8.48M|  }
  112|  33.0k|  return nullptr;
  113|  66.0k|}
openssl_contract_shim.cc:_ZN12_GLOBAL__N_119FindFatalConnectionEPK6ssl_st:
  115|     38|FatalConnection *FindFatalConnection(const SSL *ssl) {
  116|  4.88k|  for (FatalConnection &fatal : fatal_connections) {
  ------------------
  |  Branch (116:31): [True: 4.88k, False: 19]
  ------------------
  117|  4.88k|    if (fatal.ssl == ssl) {
  ------------------
  |  Branch (117:9): [True: 19, False: 4.86k]
  ------------------
  118|     19|      return &fatal;
  119|     19|    }
  120|  4.88k|  }
  121|     19|  return nullptr;
  122|     38|}
openssl_contract_shim.cc:_ZN12_GLOBAL__N_114RecordSslErrorEPK6ssl_stii:
  199|  33.0k|void RecordSslError(const SSL *ssl, int io_result, int ssl_error) {
  200|  33.0k|  if (ssl == nullptr ||
  ------------------
  |  Branch (200:7): [True: 0, False: 33.0k]
  ------------------
  201|  33.0k|      pending_io_call_count.load(std::memory_order_acquire) == 0) {
  ------------------
  |  Branch (201:7): [True: 0, False: 33.0k]
  ------------------
  202|      0|    return;
  203|      0|  }
  204|       |
  205|  33.0k|  PendingIoCall classified_call;
  206|  33.0k|  {
  207|  33.0k|    std::lock_guard<std::mutex> lock(pending_io_calls_mutex);
  208|  33.0k|    PendingIoCall *pending = FindPendingIoCall(ssl);
  209|  33.0k|    if (pending == nullptr || pending->result != io_result) {
  ------------------
  |  Branch (209:9): [True: 0, False: 33.0k]
  |  Branch (209:31): [True: 0, False: 33.0k]
  ------------------
  210|      0|      return;
  211|      0|    }
  212|  33.0k|    classified_call = *pending;
  213|  33.0k|    *pending = PendingIoCall{};
  214|  33.0k|    pending_io_call_count.fetch_sub(1, std::memory_order_release);
  215|  33.0k|  }
  216|  33.0k|  if (ssl_error != SSL_ERROR_SSL && ssl_error != SSL_ERROR_SYSCALL) {
  ------------------
  |  | 1370|  66.0k|#define SSL_ERROR_SSL 1
  ------------------
                if (ssl_error != SSL_ERROR_SSL && ssl_error != SSL_ERROR_SYSCALL) {
  ------------------
  |  | 1374|  32.9k|#define SSL_ERROR_SYSCALL 5 /* look at error stack/return \
  ------------------
  |  Branch (216:7): [True: 32.9k, False: 19]
  |  Branch (216:37): [True: 32.9k, False: 0]
  ------------------
  217|  32.9k|    return;
  218|  32.9k|  }
  219|       |
  220|     19|  bool table_full = false;
  221|     19|  bool added = false;
  222|     19|  {
  223|     19|    std::lock_guard<std::mutex> lock(fatal_connections_mutex);
  224|     19|    FatalConnection *fatal = FindFatalConnection(ssl);
  225|     19|    if (fatal == nullptr) {
  ------------------
  |  Branch (225:9): [True: 19, False: 0]
  ------------------
  226|     19|      for (FatalConnection &entry : fatal_connections) {
  ------------------
  |  Branch (226:35): [True: 19, False: 0]
  ------------------
  227|     19|        if (entry.ssl == nullptr) {
  ------------------
  |  Branch (227:13): [True: 19, False: 0]
  ------------------
  228|     19|          fatal = &entry;
  229|     19|          added = true;
  230|     19|          break;
  231|     19|        }
  232|     19|      }
  233|     19|    }
  234|     19|    if (fatal != nullptr) {
  ------------------
  |  Branch (234:9): [True: 19, False: 0]
  ------------------
  235|     19|      fatal->ssl = ssl;
  236|     19|      fatal->io_api = classified_call.api;
  237|     19|      fatal->io_result = classified_call.result;
  238|     19|      fatal->ssl_error = ssl_error;
  239|     19|      if (added) {
  ------------------
  |  Branch (239:11): [True: 19, False: 0]
  ------------------
  240|     19|        fatal_connection_count.fetch_add(1, std::memory_order_release);
  241|     19|      }
  242|     19|    } else {
  243|      0|      table_full = true;
  244|      0|    }
  245|     19|  }
  246|     19|  if (table_full) {
  ------------------
  |  Branch (246:7): [True: 0, False: 19]
  ------------------
  247|      0|    AbortFatalOverflow(classified_call, ssl_error);
  248|      0|  }
  249|     19|}
openssl_contract_shim.cc:_ZN12_GLOBAL__N_111CheckUsableEPK6ssl_stPKc:
  124|  36.9k|void CheckUsable(const SSL *ssl, const char *attempted_api) {
  125|  36.9k|  if (ssl == nullptr ||
  ------------------
  |  Branch (125:7): [True: 0, False: 36.9k]
  ------------------
  126|  36.9k|      fatal_connection_count.load(std::memory_order_acquire) == 0) {
  ------------------
  |  Branch (126:7): [True: 36.9k, False: 0]
  ------------------
  127|  36.9k|    return;
  128|  36.9k|  }
  129|       |
  130|      0|  FatalConnection fatal;
  131|      0|  {
  132|      0|    std::lock_guard<std::mutex> lock(fatal_connections_mutex);
  133|      0|    const FatalConnection *tracked = FindFatalConnection(ssl);
  134|      0|    if (tracked != nullptr) {
  ------------------
  |  Branch (134:9): [True: 0, False: 0]
  ------------------
  135|      0|      fatal = *tracked;
  136|      0|    }
  137|      0|  }
  138|      0|  if (fatal.ssl != nullptr) {
  ------------------
  |  Branch (138:7): [True: 0, False: 0]
  ------------------
  139|      0|    AbortContractViolation(attempted_api, fatal);
  140|      0|  }
  141|      0|}
openssl_contract_shim.cc:_ZN12_GLOBAL__N_114RecordIoResultEPK6ssl_stPKcxb:
  158|  36.9k|                    bool zero_is_non_error = false) {
  159|  36.9k|  if (ssl == nullptr) {
  ------------------
  |  Branch (159:7): [True: 0, False: 36.9k]
  ------------------
  160|      0|    return;
  161|      0|  }
  162|  36.9k|  if (result > 0 || (zero_is_non_error && result == 0)) {
  ------------------
  |  Branch (162:7): [True: 3.91k, False: 33.0k]
  |  Branch (162:22): [True: 0, False: 33.0k]
  |  Branch (162:43): [True: 0, False: 0]
  ------------------
  163|  3.91k|    ForgetPendingIoCall(ssl);
  164|  3.91k|    return;
  165|  3.91k|  }
  166|       |
  167|  33.0k|  PendingIoCall recorded;
  168|  33.0k|  recorded.ssl = ssl;
  169|  33.0k|  recorded.api = api;
  170|  33.0k|  recorded.result = result;
  171|  33.0k|  bool table_full = false;
  172|  33.0k|  bool added = false;
  173|  33.0k|  {
  174|  33.0k|    std::lock_guard<std::mutex> lock(pending_io_calls_mutex);
  175|  33.0k|    PendingIoCall *call = FindPendingIoCall(ssl);
  176|  33.0k|    if (call == nullptr) {
  ------------------
  |  Branch (176:9): [True: 33.0k, False: 0]
  ------------------
  177|  33.0k|      for (PendingIoCall &entry : pending_io_calls) {
  ------------------
  |  Branch (177:33): [True: 33.0k, False: 0]
  ------------------
  178|  33.0k|        if (entry.ssl == nullptr) {
  ------------------
  |  Branch (178:13): [True: 33.0k, False: 0]
  ------------------
  179|  33.0k|          call = &entry;
  180|  33.0k|          added = true;
  181|  33.0k|          break;
  182|  33.0k|        }
  183|  33.0k|      }
  184|  33.0k|    }
  185|  33.0k|    if (call != nullptr) {
  ------------------
  |  Branch (185:9): [True: 33.0k, False: 0]
  ------------------
  186|  33.0k|      *call = recorded;
  187|  33.0k|      if (added) {
  ------------------
  |  Branch (187:11): [True: 33.0k, False: 0]
  ------------------
  188|  33.0k|        pending_io_call_count.fetch_add(1, std::memory_order_release);
  189|  33.0k|      }
  190|  33.0k|    } else {
  191|      0|      table_full = true;
  192|      0|    }
  193|  33.0k|  }
  194|  33.0k|  if (table_full) {
  ------------------
  |  Branch (194:7): [True: 0, False: 33.0k]
  ------------------
  195|      0|    AbortPendingOverflow(recorded);
  196|      0|  }
  197|  33.0k|}

_ZN12proto_fuzzer26allocation_fault_injection14InitializeCurlEv:
  119|      4|bool InitializeCurl() noexcept {
  120|      4|  std::call_once(initialize_once, [] {
  121|      4|    if (curl_global_init_mem(CURL_GLOBAL_ALL, internal::Malloc, internal::Free, internal::Realloc, internal::Strdup,
  122|      4|                             internal::Calloc) != CURLE_OK) {
  123|      4|      return;
  124|      4|    }
  125|      4|    curl_initialized = true;
  126|       |
  127|      4|    state.armed = true;
  128|      4|    char* probe = curl_escape("allocator callback probe", 0);
  129|      4|    callbacks_active = state.allocation_attempts != 0;
  130|      4|    state.armed = false;
  131|      4|    curl_free(probe);
  132|      4|    state = ThreadState{};
  133|      4|  });
  134|      4|  return callbacks_active;
  135|      4|}
_ZN12proto_fuzzer26allocation_fault_injection32ClaimCurlInitializationReferenceEv:
  157|      2|bool ClaimCurlInitializationReference() noexcept {
  158|      2|  (void)InitializeCurl();
  159|      2|  if (!curl_initialized) {
  ------------------
  |  Branch (159:7): [True: 0, False: 2]
  ------------------
  160|      0|    return false;
  161|      0|  }
  162|      2|  bool expected = false;
  163|      2|  return curl_initialization_claimed.compare_exchange_strong(expected, true, std::memory_order_relaxed,
  164|      2|                                                             std::memory_order_relaxed);
  165|      2|}
_ZN12proto_fuzzer26allocation_fault_injection9ConfigureEPKjm:
  173|  9.96k|void Configure(const std::uint32_t* ordinals, std::size_t count) noexcept {
  174|  9.96k|  state = ThreadState{};
  175|  9.96k|  if (ordinals == nullptr) {
  ------------------
  |  Branch (175:7): [True: 0, False: 9.96k]
  ------------------
  176|      0|    return;
  177|      0|  }
  178|  11.7k|  for (std::size_t index = 0; index < count; ++index) {
  ------------------
  |  Branch (178:31): [True: 1.83k, False: 9.96k]
  ------------------
  179|  1.83k|    InsertOrdinal(CanonicalOrdinal(ordinals[index]));
  180|  1.83k|  }
  181|  9.96k|}
_ZN12proto_fuzzer26allocation_fault_injection3ArmEv:
  186|  9.96k|void Arm() noexcept {
  187|  9.96k|  state.next_ordinal = 0;
  188|  9.96k|  state.allocation_attempts = 0;
  189|  9.96k|  state.injected_failures = 0;
  190|  9.96k|  state.armed = state.ordinal_count != 0;
  191|  9.96k|}
_ZN12proto_fuzzer26allocation_fault_injection5ResetEv:
  209|  20.2k|void Reset() noexcept {
  210|  20.2k|  state = ThreadState{};
  211|  20.2k|  internal::ResetFailureSuppression();
  212|  20.2k|}
_ZN12proto_fuzzer26allocation_fault_injection8internal6MallocEm:
  224|   496k|void* Malloc(std::size_t size) noexcept { return ShouldFail(size != 0) ? nullptr : std::malloc(size); }
  ------------------
  |  Branch (224:50): [True: 755, False: 495k]
  ------------------
_ZN12proto_fuzzer26allocation_fault_injection8internal4FreeEPv:
  227|  1.36M|void Free(void* pointer) noexcept { std::free(pointer); }
_ZN12proto_fuzzer26allocation_fault_injection8internal7ReallocEPvm:
  231|   182k|void* Realloc(void* pointer, std::size_t size) noexcept {
  232|   182k|  return ShouldFail(size != 0) ? nullptr : std::realloc(pointer, size);
  ------------------
  |  Branch (232:10): [True: 130, False: 182k]
  ------------------
  233|   182k|}
_ZN12proto_fuzzer26allocation_fault_injection8internal6CallocEmm:
  253|   643k|void* Calloc(std::size_t count, std::size_t size) noexcept {
  254|   643k|  return ShouldFail(count != 0 && size != 0) ? nullptr : std::calloc(count, size);
  ------------------
  |  Branch (254:10): [True: 562, False: 642k]
  |  Branch (254:21): [True: 643k, False: 0]
  |  Branch (254:35): [True: 643k, False: 0]
  ------------------
  255|   643k|}
allocation_fault_injection.cc:_ZN12proto_fuzzer26allocation_fault_injection12_GLOBAL__N_113InsertOrdinalEj:
   68|  1.83k|void InsertOrdinal(std::uint32_t ordinal) noexcept {
   69|  1.83k|  if (ordinal == 0) {
  ------------------
  |  Branch (69:7): [True: 0, False: 1.83k]
  ------------------
   70|      0|    return;
   71|      0|  }
   72|  1.83k|  const auto begin = state.ordinals.begin();
   73|  1.83k|  const auto end = begin + static_cast<std::ptrdiff_t>(state.ordinal_count);
   74|  1.83k|  const auto position = std::lower_bound(begin, end, ordinal);
   75|  1.83k|  if (position != end && *position == ordinal) {
  ------------------
  |  Branch (75:7): [True: 0, False: 1.83k]
  |  Branch (75:26): [True: 0, False: 0]
  ------------------
   76|      0|    return;
   77|      0|  }
   78|  1.83k|  const std::size_t index = static_cast<std::size_t>(position - begin);
   79|  1.83k|  if (index >= state.ordinals.size()) {
  ------------------
  |  Branch (79:7): [True: 0, False: 1.83k]
  ------------------
   80|      0|    return;
   81|      0|  }
   82|  1.83k|  if (state.ordinal_count < state.ordinals.size()) {
  ------------------
  |  Branch (82:7): [True: 1.83k, False: 0]
  ------------------
   83|  1.83k|    ++state.ordinal_count;
   84|  1.83k|  }
   85|  1.83k|  for (std::size_t destination = state.ordinal_count - 1; destination > index; --destination) {
  ------------------
  |  Branch (85:59): [True: 0, False: 1.83k]
  ------------------
   86|      0|    state.ordinals[destination] = state.ordinals[destination - 1];
   87|      0|  }
   88|  1.83k|  state.ordinals[index] = ordinal;
   89|  1.83k|}
allocation_fault_injection.cc:_ZN12proto_fuzzer26allocation_fault_injection12_GLOBAL__N_116CanonicalOrdinalEj:
   56|  1.83k|std::uint32_t CanonicalOrdinal(std::uint32_t ordinal) noexcept {
   57|  1.83k|  if (ordinal == 0) {
  ------------------
  |  Branch (57:7): [True: 0, False: 1.83k]
  ------------------
   58|      0|    return 0;
   59|      0|  }
   60|  1.83k|  const std::uint32_t maximum = static_cast<std::uint32_t>(scenario_limits::kMaxAllocationOrdinal);
   61|  1.83k|  return 1U + ((ordinal - 1U) % maximum);
   62|  1.83k|}
allocation_fault_injection.cc:_ZN12proto_fuzzer26allocation_fault_injection12_GLOBAL__N_110ShouldFailEb:
   97|  1.32M|bool ShouldFail(bool positive_size) noexcept {
   98|  1.32M|  if (!positive_size || !state.armed || internal::FailuresSuppressed()) {
  ------------------
  |  Branch (98:7): [True: 0, False: 1.32M]
  |  Branch (98:25): [True: 1.23M, False: 85.4k]
  |  Branch (98:41): [True: 746, False: 84.6k]
  ------------------
   99|  1.23M|    return false;
  100|  1.23M|  }
  101|  84.6k|  ++state.allocation_attempts;
  102|  84.6k|  if (state.next_ordinal < state.ordinal_count && state.allocation_attempts == state.ordinals[state.next_ordinal]) {
  ------------------
  |  Branch (102:7): [True: 55.7k, False: 28.9k]
  |  Branch (102:51): [True: 1.44k, False: 54.2k]
  ------------------
  103|  1.44k|    ++state.next_ordinal;
  104|  1.44k|    ++state.injected_failures;
  105|  1.44k|    errno = ENOMEM;
  106|  1.44k|    return true;
  107|  1.44k|  }
  108|  83.2k|  return false;
  109|  84.6k|}
allocation_fault_injection.cc:_ZZN12proto_fuzzer26allocation_fault_injection14InitializeCurlEvENK3$_0clEv:
  120|      2|  std::call_once(initialize_once, [] {
  121|      2|    if (curl_global_init_mem(CURL_GLOBAL_ALL, internal::Malloc, internal::Free, internal::Realloc, internal::Strdup,
  ------------------
  |  | 3047|      2|#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  ------------------
  |  |  |  | 3044|      2|#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
  |  |  ------------------
  |  |               #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  ------------------
  |  |  |  | 3045|      2|#define CURL_GLOBAL_WINSOCK (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (121:9): [True: 0, False: 2]
  ------------------
  122|      2|                             internal::Calloc) != CURLE_OK) {
  123|      0|      return;
  124|      0|    }
  125|      2|    curl_initialized = true;
  126|       |
  127|      2|    state.armed = true;
  128|      2|    char* probe = curl_escape("allocator callback probe", 0);
  129|      2|    callbacks_active = state.allocation_attempts != 0;
  130|      2|    state.armed = false;
  131|      2|    curl_free(probe);
  132|      2|    state = ThreadState{};
  133|      2|  });

_ZN12proto_fuzzer26allocation_fault_injection8internal23ResetFailureSuppressionEv:
   41|  20.2k|inline void ResetFailureSuppression() noexcept {
   42|  20.2k|  failure_suppression_depth = 0;
   43|  20.2k|  ++failure_suppression_generation;
   44|  20.2k|}
_ZN12proto_fuzzer26allocation_fault_injection8internal18FailuresSuppressedEv:
   38|  85.4k|inline bool FailuresSuppressed() noexcept { return failure_suppression_depth != 0; }
_ZN12proto_fuzzer26allocation_fault_injection24ScopedFailureSuppressionC2Ev:
   59|  9.76k|  ScopedFailureSuppression() noexcept : generation_(internal::BeginFailureSuppression()) {}
_ZN12proto_fuzzer26allocation_fault_injection24ScopedFailureSuppressionD2Ev:
   60|  9.76k|  ~ScopedFailureSuppression() { internal::EndFailureSuppression(generation_); }
_ZN12proto_fuzzer26allocation_fault_injection8internal23BeginFailureSuppressionEv:
   24|  9.76k|inline std::uint64_t BeginFailureSuppression() noexcept {
   25|  9.76k|  ++failure_suppression_depth;
   26|  9.76k|  return failure_suppression_generation;
   27|  9.76k|}
_ZN12proto_fuzzer26allocation_fault_injection8internal21EndFailureSuppressionEm:
   31|  9.76k|inline void EndFailureSuppression(std::uint64_t generation) noexcept {
   32|  9.76k|  if (generation == failure_suppression_generation && failure_suppression_depth != 0) {
  ------------------
  |  Branch (32:7): [True: 9.76k, False: 0]
  |  Branch (32:55): [True: 9.76k, False: 0]
  ------------------
   33|  9.76k|    --failure_suppression_depth;
   34|  9.76k|  }
   35|  9.76k|}

_ZN12proto_fuzzer25ConnectUdpProxyMockServer7InstallEPv:
   22|  7.65k|void ConnectUdpProxyMockServer::Install(CURL* easy) {
   23|  7.65k|  MockServer::Install(easy);
   24|       |
   25|       |  // The numeric proxy authority avoids DNS before OPENSOCKETFUNCTION replaces
   26|       |  // its transport with MockServer's socketpair. Clearing CONNECT_TO preserves
   27|       |  // the scenario's origin in the MASQUE URI template rather than rewriting it
   28|       |  // to the baseline loopback sentinel.
   29|  7.65k|  static constexpr char kProxyUrl[] = "http://127.0.0.1:80";
   30|  7.65k|  struct curl_blob trust_anchor = {const_cast<char*>(tls_test_credentials::kCertificatePem),
   31|  7.65k|                                   sizeof(tls_test_credentials::kCertificatePem) - 1, CURL_BLOB_NOCOPY};
  ------------------
  |  |   32|  7.65k|#define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */
  ------------------
   32|  7.65k|  (void)curl_easy_setopt(easy, CURLOPT_CONNECT_TO, nullptr);
  ------------------
  |  | 3364|  7.65k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  7.65k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   33|  7.65k|  (void)curl_easy_setopt(easy, CURLOPT_PROXY, kProxyUrl);
  ------------------
  |  | 3364|  7.65k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  7.65k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   34|  7.65k|  (void)curl_easy_setopt(easy, CURLOPT_PROXYTYPE, static_cast<long>(CURLPROXY_HTTP));
  ------------------
  |  | 3364|  7.65k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  7.65k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   35|  7.65k|  (void)curl_easy_setopt(easy, CURLOPT_NOPROXY, "");
  ------------------
  |  | 3364|  7.65k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  7.65k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   36|  7.65k|  (void)curl_easy_setopt(easy, CURLOPT_HTTPPROXYTUNNEL, 1L);
  ------------------
  |  | 3364|  7.65k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  7.65k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   37|  7.65k|  (void)curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_3ONLY);
  ------------------
  |  | 3364|  7.65k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  7.65k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   38|       |
   39|       |  // Capsules carry the origin's QUIC/TLS exchange, so retain the same fixed
   40|       |  // trust anchor and hostname verification as the direct HTTP/3 peer.
   41|  7.65k|  (void)curl_easy_setopt(easy, CURLOPT_CAINFO_BLOB, &trust_anchor);
  ------------------
  |  | 3364|  7.65k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  7.65k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   42|  7.65k|  (void)curl_easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 1L);
  ------------------
  |  | 3364|  7.65k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  7.65k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   43|  7.65k|  (void)curl_easy_setopt(easy, CURLOPT_SSL_VERIFYHOST, 2L);
  ------------------
  |  | 3364|  7.65k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  7.65k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   44|  7.65k|}

_ZN12proto_fuzzer25ConnectUdpProxyMockServerC2Ev:
   22|  7.67k|  ConnectUdpProxyMockServer() = default;

_ZN12proto_fuzzer19CurlGlobalLifecycleC2EPFvvE:
   27|      2|    : cleanup_(cleanup != nullptr ? cleanup : &curl_global_cleanup) {
  ------------------
  |  Branch (27:16): [True: 0, False: 2]
  ------------------
   28|       |  // Curl_tls_keylog_open() runs once during global initialization. Keep the
   29|       |  // default output bounded while allowing a reproducer to select another path.
   30|      2|  (void)setenv("SSLKEYLOGFILE", "/dev/null", 0);
   31|       |
   32|       |  // Mock-peer teardown can race a write. Surface that as a socket error rather
   33|       |  // than allowing SIGPIPE to terminate the process.
   34|      2|  std::signal(SIGPIPE, SIG_IGN);
   35|       |
   36|      2|  const bool callbacks_active = allocation_fault_injection::InitializeCurl();
   37|      2|  if (allocation_fault_injection::ClaimCurlInitializationReference()) {
  ------------------
  |  Branch (37:7): [True: 2, False: 0]
  ------------------
   38|      2|    ++initialization_count_;
   39|      2|  }
   40|      2|  if (!callbacks_active) {
  ------------------
  |  Branch (40:7): [True: 0, False: 2]
  ------------------
   41|      0|    std::fputs("warning: libcurl allocation fault injection is unavailable\n", stderr);
   42|      0|  }
   43|      2|  if (initialization_count_ == 0 && curl_global_init(CURL_GLOBAL_ALL) == CURLE_OK) {
  ------------------
  |  | 3047|      0|#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  ------------------
  |  |  |  | 3044|      0|#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
  |  |  ------------------
  |  |               #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  ------------------
  |  |  |  | 3045|      0|#define CURL_GLOBAL_WINSOCK (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (43:7): [True: 0, False: 2]
  |  Branch (43:37): [True: 0, False: 0]
  ------------------
   44|      0|    ++initialization_count_;
   45|      0|  }
   46|      2|  initialized_ = initialization_count_ != 0;
   47|      2|  next_registered_ = registered_lifecycles;
   48|      2|  registered_lifecycles = this;
   49|      2|}

_ZNK12proto_fuzzer15CurlEasyDeleterclEPv:
   23|  9.91k|  void operator()(CURL* easy) const noexcept {
   24|  9.91k|    if (easy != nullptr) {
  ------------------
  |  Branch (24:9): [True: 9.91k, False: 0]
  ------------------
   25|  9.91k|      curl_easy_cleanup(easy);
   26|  9.91k|    }
   27|  9.91k|  }
_ZNK12proto_fuzzer16CurlMultiDeleterclEPv:
   34|  9.76k|  void operator()(CURLM* multi) const noexcept {
   35|  9.76k|    if (multi != nullptr) {
  ------------------
  |  Branch (35:9): [True: 9.76k, False: 0]
  ------------------
   36|  9.76k|      (void)curl_multi_cleanup(multi);
   37|  9.76k|    }
   38|  9.76k|  }
_ZNK12proto_fuzzer16CurlSlistDeleterclEP10curl_slist:
   56|  10.1k|  void operator()(curl_slist* list) const noexcept { curl_slist_free_all(list); }
_ZNK12proto_fuzzer15CurlMimeDeleterclEP9curl_mime:
   63|  1.01k|  void operator()(curl_mime* mime) const noexcept { curl_mime_free(mime); }

_ZN12proto_fuzzer24ProtoFuzzerCustomMutatorEPhmmjRKNS_19ProfileFuzzerTraitsE:
   91|      2|                                     const ProfileFuzzerTraits& traits) {
   92|      2|  allocation_fault_injection::Reset();
   93|      2|  if (traits.custom_mutator == nullptr) {
  ------------------
  |  Branch (93:7): [True: 0, False: 2]
  ------------------
   94|      0|    return 0;
   95|      0|  }
   96|      2|  return traits.custom_mutator(data, size, max_size, seed);
   97|      2|}
_ZN12proto_fuzzer26ProtoFuzzerCustomCrossOverEPKhmS1_mPhmjRKNS_19ProfileFuzzerTraitsE:
  111|      1|                                       unsigned int seed, const ProfileFuzzerTraits& traits) {
  112|      1|  allocation_fault_injection::Reset();
  113|      1|  if (traits.custom_crossover == nullptr) {
  ------------------
  |  Branch (113:7): [True: 0, False: 1]
  ------------------
  114|      0|    return 0;
  115|      0|  }
  116|      1|  return traits.custom_crossover(data1, size1, data2, size2, out, max_out_size, seed);
  117|      1|}
_ZN12proto_fuzzer23ProtoFuzzerTestOneInputEPKhmRKNS_19ProfileFuzzerTraitsE:
  124|  10.2k|int ProtoFuzzerTestOneInput(const std::uint8_t* data, std::size_t size, const ProfileFuzzerTraits& traits) {
  125|  10.2k|  allocation_fault_injection::Reset();
  126|  10.2k|#if defined(PROTO_FUZZER_OBSERVE_STATE)
  127|  10.2k|  ProbeMutationEntrypoints();
  128|  10.2k|  if (traits.probe_mutation_helpers != nullptr) {
  ------------------
  |  Branch (128:7): [True: 0, False: 10.2k]
  ------------------
  129|      0|    traits.probe_mutation_helpers();
  130|      0|  }
  131|  10.2k|#endif
  132|  10.2k|  curl::fuzzer::proto::Scenario scenario;
  133|  10.2k|  if (traits.load_input == nullptr || !traits.load_input(data, size, &scenario)) {
  ------------------
  |  Branch (133:7): [True: 0, False: 10.2k]
  |  Branch (133:39): [True: 306, False: 9.96k]
  ------------------
  134|    306|    return 0;
  135|    306|  }
  136|       |
  137|  9.96k|  NormalizeScenarioForExecution(&scenario);
  138|  9.96k|  allocation_fault_injection::Configure(scenario.fail_allocations().data(),
  139|  9.96k|                                        static_cast<std::size_t>(scenario.fail_allocations_size()));
  140|  9.96k|  allocation_fault_injection::Arm();
  141|  9.96k|  proto_fuzzer::RunScenario(scenario, RunModeFor(traits.profile));
  142|  9.96k|  allocation_fault_injection::Reset();
  143|  9.96k|  if (traits.profile == TargetProfile::kResolver &&
  ------------------
  |  Branch (143:7): [True: 0, False: 9.96k]
  ------------------
  144|      0|      scenario.resolver_mode() == curl::fuzzer::proto::RESOLVER_MODE_GLOBAL_LIFECYCLE) {
  ------------------
  |  Branch (144:7): [True: 0, False: 0]
  ------------------
  145|      0|    curl_global_cleanup();
  146|      0|    if (!allocation_fault_injection::ReinitializeCurl()) {
  ------------------
  |  Branch (146:9): [True: 0, False: 0]
  ------------------
  147|      0|      std::fputs("warning: libcurl reinitialization failed\n", stderr);
  148|      0|      (void)curl_global_init(CURL_GLOBAL_ALL);
  ------------------
  |  | 3047|      0|#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  ------------------
  |  |  |  | 3044|      0|#define CURL_GLOBAL_SSL (1 << 0) /* no purpose since 7.57.0 */
  |  |  ------------------
  |  |               #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WINSOCK)
  |  |  ------------------
  |  |  |  | 3045|      0|#define CURL_GLOBAL_WINSOCK (1 << 1)
  |  |  ------------------
  ------------------
  149|      0|    }
  150|      0|  }
  151|  9.96k|  return 0;
  152|  10.2k|}
fuzzer_main.cc:_ZN12_GLOBAL__N_124ProbeMutationEntrypointsEv:
   58|  10.2k|void ProbeMutationEntrypoints() {
   59|  10.2k|  static const bool mutation_entrypoints_probed = [] {
   60|  10.2k|    constexpr std::size_t kBufferSize = 1024;
   61|  10.2k|    constexpr unsigned int kFirstSeed = 0x4355524cU;
   62|  10.2k|    constexpr unsigned int kSecondSeed = 0x46555a5aU;
   63|       |
   64|  10.2k|    std::array<std::uint8_t, kBufferSize> first = {};
   65|  10.2k|    std::array<std::uint8_t, kBufferSize> second = {};
   66|  10.2k|    std::array<std::uint8_t, kBufferSize> child = {};
   67|  10.2k|    const std::size_t first_size = LLVMFuzzerCustomMutator(first.data(), 0, first.size(), kFirstSeed);
   68|  10.2k|    const std::size_t second_size = LLVMFuzzerCustomMutator(second.data(), 0, second.size(), kSecondSeed);
   69|  10.2k|    const std::size_t child_size = LLVMFuzzerCustomCrossOver(first.data(), first_size, second.data(), second_size,
   70|  10.2k|                                                             child.data(), child.size(), kFirstSeed);
   71|  10.2k|    const volatile std::size_t result_sizes[] = {first_size, second_size, child_size};
   72|  10.2k|    (void)result_sizes;
   73|  10.2k|    return true;
   74|  10.2k|  }();
   75|  10.2k|  (void)mutation_entrypoints_probed;
   76|  10.2k|}
fuzzer_main.cc:_ZZN12_GLOBAL__N_124ProbeMutationEntrypointsEvENK3$_0clEv:
   59|      1|  static const bool mutation_entrypoints_probed = [] {
   60|      1|    constexpr std::size_t kBufferSize = 1024;
   61|      1|    constexpr unsigned int kFirstSeed = 0x4355524cU;
   62|      1|    constexpr unsigned int kSecondSeed = 0x46555a5aU;
   63|       |
   64|      1|    std::array<std::uint8_t, kBufferSize> first = {};
   65|      1|    std::array<std::uint8_t, kBufferSize> second = {};
   66|      1|    std::array<std::uint8_t, kBufferSize> child = {};
   67|      1|    const std::size_t first_size = LLVMFuzzerCustomMutator(first.data(), 0, first.size(), kFirstSeed);
   68|      1|    const std::size_t second_size = LLVMFuzzerCustomMutator(second.data(), 0, second.size(), kSecondSeed);
   69|      1|    const std::size_t child_size = LLVMFuzzerCustomCrossOver(first.data(), first_size, second.data(), second_size,
   70|      1|                                                             child.data(), child.size(), kFirstSeed);
   71|      1|    const volatile std::size_t result_sizes[] = {first_size, second_size, child_size};
   72|      1|    (void)result_sizes;
   73|      1|    return true;
   74|      1|  }();

_ZN12proto_fuzzer15Http3MockServerC2EN4curl6fuzzer5proto26TlsCertificateChainProfileE:
 1597|  2.28k|    : MockServerBase(MultiDrivePolicy::kSocketAction),
 1598|  2.28k|      impl_(std::make_unique<Http3MockServerImpl>(certificate_chain)) {}
_ZN12proto_fuzzer15Http3MockServerD2Ev:
 1600|  2.28k|Http3MockServer::~Http3MockServer() = default;
_ZN12proto_fuzzer15Http3MockServer7InstallEPv:
 1605|  2.25k|void Http3MockServer::Install(CURL* easy) {
 1606|       |  // Curl trusts the checked-in server certificate directly and must use HTTP/3
 1607|       |  // rather than silently falling back to an HTTP/1 or HTTP/2 code path.
 1608|  2.25k|  MockServerBase::Install(easy);
 1609|  2.25k|  struct curl_blob trust_anchor = {const_cast<char*>(tls_test_credentials::kCertificatePem),
 1610|  2.25k|                                   sizeof(tls_test_credentials::kCertificatePem) - 1, CURL_BLOB_NOCOPY};
  ------------------
  |  |   32|  2.25k|#define CURL_BLOB_NOCOPY 0 /* tell libcurl to NOT copy the data */
  ------------------
 1611|  2.25k|  (void)curl_easy_setopt(easy, CURLOPT_CAINFO_BLOB, &trust_anchor);
  ------------------
  |  | 3364|  2.25k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  2.25k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
 1612|  2.25k|  (void)curl_easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 1L);
  ------------------
  |  | 3364|  2.25k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  2.25k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
 1613|  2.25k|  (void)curl_easy_setopt(easy, CURLOPT_SSL_VERIFYHOST, 2L);
  ------------------
  |  | 3364|  2.25k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  2.25k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
 1614|  2.25k|  (void)curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_3ONLY);
  ------------------
  |  | 3364|  2.25k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  2.25k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
 1615|  2.25k|}
_ZNK12proto_fuzzer15Http3MockServer18handshake_completeEv:
 1618|  2.25k|bool Http3MockServer::handshake_complete() const { return impl_ != nullptr && impl_->handshake_complete(); }
  ------------------
  |  Branch (1618:59): [True: 2.25k, False: 0]
  |  Branch (1618:79): [True: 1.95k, False: 298]
  ------------------
_ZNK12proto_fuzzer15Http3MockServer24request_headers_receivedEv:
 1621|  2.25k|bool Http3MockServer::request_headers_received() const { return impl_ != nullptr && impl_->request_headers_received(); }
  ------------------
  |  Branch (1621:65): [True: 2.25k, False: 0]
  |  Branch (1621:85): [True: 1.91k, False: 340]
  ------------------
_ZNK12proto_fuzzer15Http3MockServer21executed_action_countEv:
 1630|  2.25k|std::size_t Http3MockServer::executed_action_count() const {
 1631|  2.25k|  return impl_ == nullptr ? 0 : impl_->executed_action_count();
  ------------------
  |  Branch (1631:10): [True: 0, False: 2.25k]
  ------------------
 1632|  2.25k|}
_ZNK12proto_fuzzer15Http3MockServer11server_portEv:
 1635|  2.25k|std::uint16_t Http3MockServer::server_port() const { return impl_ == nullptr ? 0 : impl_->server_port(); }
  ------------------
  |  Branch (1635:61): [True: 0, False: 2.25k]
  ------------------
_ZN12proto_fuzzer15Http3MockServer16HandleOpenSocketE12curlsocktypeP13curl_sockaddr:
 1642|  1.97k|curl_socket_t Http3MockServer::HandleOpenSocket(curlsocktype purpose, struct curl_sockaddr* address) {
 1643|  1.97k|  return impl_ == nullptr ? CURL_SOCKET_BAD : impl_->OpenSocket(purpose, address);
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  |  Branch (1643:10): [True: 0, False: 1.97k]
  ------------------
 1644|  1.97k|}
_ZNK12proto_fuzzer15Http3MockServer25GetSocketSetupDispositionEi12curlsocktype:
 1652|  1.97k|                                                                  curlsocktype /*purpose*/) const {
 1653|  1.97k|  return SocketSetupDisposition::kNeedsSetup;
 1654|  1.97k|}
_ZN12proto_fuzzer15Http3MockServer7RunLoopEPvS1_RKN4curl6fuzzer5proto8ScenarioE:
 1661|  2.21k|void Http3MockServer::RunLoop(CURLM* multi, CURL* easy, const curl::fuzzer::proto::Scenario& scenario) {
 1662|  2.21k|  (void)easy;
 1663|  2.21k|  if (impl_ == nullptr) {
  ------------------
  |  Branch (1663:7): [True: 0, False: 2.21k]
  ------------------
 1664|      0|    return;
 1665|      0|  }
 1666|  2.21k|  impl_->BeginScenario(scenario);
 1667|       |
 1668|  2.21k|  int still_running = 1;
 1669|  2.21k|  int idle_iterations = 0;
 1670|  2.21k|  if (MultiSocketDriver* driver = multi_socket_driver(); driver != nullptr) {
  ------------------
  |  Branch (1670:58): [True: 2.21k, False: 0]
  ------------------
 1671|       |    // Alternate curl readiness processing with one bounded peer turn. Neither
 1672|       |    // side blocks, so an idle limit prevents a malformed case spinning forever.
 1673|  2.21k|    CURLMcode result = driver->Start(&still_running);
 1674|  47.0k|    for (int iteration = 0; result == CURLM_OK && iteration < kMaxDriveIterations; ++iteration) {
  ------------------
  |  Branch (1674:29): [True: 47.0k, False: 18]
  |  Branch (1674:51): [True: 47.0k, False: 1]
  ------------------
 1675|  47.0k|      std::size_t progress = impl_->DrivePeerTurn();
 1676|       |      // Curl can queue the final ACK or reset while completing the transfer.
 1677|       |      // Give the peer its next bounded turn before stopping, without driving
 1678|       |      // curl again or extending the existing operation budget.
 1679|  47.0k|      if (still_running == 0) {
  ------------------
  |  Branch (1679:11): [True: 1.37k, False: 45.6k]
  ------------------
 1680|  1.37k|        break;
 1681|  1.37k|      }
 1682|  45.6k|      const MultiSocketDriver::DriveResult drive_result = driver->DriveReady(&still_running);
 1683|  45.6k|      result = drive_result.code;
 1684|  45.6k|      progress += drive_result.made_progress ? 1U : 0U;
  ------------------
  |  Branch (1684:19): [True: 11.1k, False: 34.5k]
  ------------------
 1685|  45.6k|      if (progress != 0) {
  ------------------
  |  Branch (1685:11): [True: 14.2k, False: 31.3k]
  ------------------
 1686|  14.2k|        idle_iterations = 0;
 1687|  31.3k|      } else {
 1688|  31.3k|        if (++idle_iterations >= kHttp3IdleIterations) {
  ------------------
  |  Branch (1688:13): [True: 817, False: 30.5k]
  ------------------
 1689|    817|          break;
 1690|    817|        }
 1691|       |        // The client can have a positive QUIC timer while waiting for stream
 1692|       |        // credit. A zero-timeout spin exhausts the idle budget before it fires.
 1693|  30.5k|        (void)::poll(nullptr, 0, 1);
 1694|  30.5k|      }
 1695|  45.6k|    }
 1696|  2.21k|    return;
 1697|  2.21k|  }
 1698|       |
 1699|       |  // The fallback exercises curl's public multi-perform API while preserving
 1700|       |  // the same peer-first/idle-limit behavior as the socket-action driver.
 1701|      0|  for (int iteration = 0; iteration < kMaxDriveIterations && still_running != 0; ++iteration) {
  ------------------
  |  Branch (1701:27): [True: 0, False: 0]
  |  Branch (1701:62): [True: 0, False: 0]
  ------------------
 1702|      0|    const int running_before = still_running;
 1703|      0|    const CURLMcode result = curl_multi_perform(multi, &still_running);
 1704|      0|    if (result != CURLM_OK) {
  ------------------
  |  Branch (1704:9): [True: 0, False: 0]
  ------------------
 1705|      0|      break;
 1706|      0|    }
 1707|       |
 1708|      0|    std::size_t progress = still_running == running_before ? 0U : 1U;
  ------------------
  |  Branch (1708:28): [True: 0, False: 0]
  ------------------
 1709|      0|    progress += impl_->DrivePeerTurn();
 1710|      0|    if (progress != 0) {
  ------------------
  |  Branch (1710:9): [True: 0, False: 0]
  ------------------
 1711|      0|      idle_iterations = 0;
 1712|      0|    } else if (++idle_iterations >= kHttp3IdleIterations) {
  ------------------
  |  Branch (1712:16): [True: 0, False: 0]
  ------------------
 1713|      0|      break;
 1714|      0|    }
 1715|      0|  }
 1716|      0|}
_ZN12proto_fuzzer15Http3MockServer12ObserveStateEv:
 1719|  2.25k|void Http3MockServer::ObserveState() {
 1720|  2.25k|#if defined(PROTO_FUZZER_OBSERVE_STATE)
 1721|  2.25k|  MockServerBase::ObserveState();
 1722|  2.25k|  const volatile std::size_t http3_observation[] = {handshake_complete(), request_headers_received(),
 1723|  2.25k|                                                    executed_action_count(), server_port()};
 1724|  2.25k|  (void)http3_observation;
 1725|  2.25k|#endif
 1726|  2.25k|}
_ZNK12proto_fuzzer19Http3MockServerImpl18handshake_completeEv:
  384|  2.25k|  bool handshake_complete() const { return handshake_complete_; }
_ZNK12proto_fuzzer19Http3MockServerImpl24request_headers_receivedEv:
  386|  2.25k|  bool request_headers_received() const { return request_headers_received_; }
_ZNK12proto_fuzzer19Http3MockServerImpl21executed_action_countEv:
  392|  2.25k|  std::size_t executed_action_count() const { return next_action_; }
_ZNK12proto_fuzzer19Http3MockServerImpl11server_portEv:
  394|  2.25k|  std::uint16_t server_port() const { return server_port_; }
_ZN12proto_fuzzer19Http3MockServerImpl10OpenSocketE12curlsocktypeP13curl_sockaddr:
  326|  1.97k|  curl_socket_t OpenSocket(curlsocktype purpose, struct curl_sockaddr* address) {
  327|  1.97k|    if (purpose != CURLSOCKTYPE_IPCXN || address == nullptr || socket_opened_ || context_ == nullptr) {
  ------------------
  |  Branch (327:9): [True: 0, False: 1.97k]
  |  Branch (327:42): [True: 0, False: 1.97k]
  |  Branch (327:64): [True: 0, False: 1.97k]
  |  Branch (327:82): [True: 0, False: 1.97k]
  ------------------
  328|      0|      return CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  329|      0|    }
  330|  1.97k|    socket_opened_ = true;
  331|       |
  332|  1.97k|    struct sockaddr_in listener_address = {};
  333|  1.97k|    server_fd_ = OpenLoopbackSocket(&listener_address);
  334|  1.97k|    if (server_fd_ < 0 || !RewriteDestination(address, listener_address)) {
  ------------------
  |  Branch (334:9): [True: 0, False: 1.97k]
  |  Branch (334:27): [True: 0, False: 1.97k]
  ------------------
  335|      0|      ResetPeer();
  336|      0|      return CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  337|      0|    }
  338|  1.97k|    server_port_ = ntohs(listener_address.sin_port);
  339|  1.97k|    local_address_ = listener_address;
  340|       |
  341|  1.97k|    const int client_fd = ::socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
  342|  1.97k|    if (client_fd < 0 || !ConfigureSocket(client_fd)) {
  ------------------
  |  Branch (342:9): [True: 0, False: 1.97k]
  |  Branch (342:26): [True: 0, False: 1.97k]
  ------------------
  343|      0|      if (client_fd >= 0) {
  ------------------
  |  Branch (343:11): [True: 0, False: 0]
  ------------------
  344|      0|        (void)::close(client_fd);
  345|      0|      }
  346|      0|      ResetPeer();
  347|      0|      return CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  348|      0|    }
  349|  1.97k|    return static_cast<curl_socket_t>(client_fd);
  350|  1.97k|  }
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_118OpenLoopbackSocketEP11sockaddr_in:
   97|  1.97k|int OpenLoopbackSocket(struct sockaddr_in* bound_address) {
   98|  1.97k|  if (bound_address == nullptr) {
  ------------------
  |  Branch (98:7): [True: 0, False: 1.97k]
  ------------------
   99|      0|    return -1;
  100|      0|  }
  101|       |
  102|  1.97k|  const int fd = ::socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
  103|  1.97k|  if (fd < 0 || !ConfigureSocket(fd)) {
  ------------------
  |  Branch (103:7): [True: 0, False: 1.97k]
  |  Branch (103:17): [True: 0, False: 1.97k]
  ------------------
  104|      0|    if (fd >= 0) {
  ------------------
  |  Branch (104:9): [True: 0, False: 0]
  ------------------
  105|      0|      (void)::close(fd);
  106|      0|    }
  107|      0|    return -1;
  108|      0|  }
  109|       |
  110|  1.97k|  struct sockaddr_in requested = {};
  111|  1.97k|  requested.sin_family = AF_INET;
  112|  1.97k|  requested.sin_port = htons(0);
  113|  1.97k|  requested.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
  114|  1.97k|  if (::bind(fd, reinterpret_cast<const struct sockaddr*>(&requested), sizeof(requested)) != 0) {
  ------------------
  |  Branch (114:7): [True: 0, False: 1.97k]
  ------------------
  115|      0|    (void)::close(fd);
  116|      0|    return -1;
  117|      0|  }
  118|       |
  119|  1.97k|  socklen_t length = sizeof(*bound_address);
  120|  1.97k|  std::memset(bound_address, 0, sizeof(*bound_address));
  121|  1.97k|  if (::getsockname(fd, reinterpret_cast<struct sockaddr*>(bound_address), &length) != 0 ||
  ------------------
  |  Branch (121:7): [True: 0, False: 1.97k]
  ------------------
  122|  1.97k|      length != sizeof(*bound_address) || bound_address->sin_family != AF_INET) {
  ------------------
  |  Branch (122:7): [True: 0, False: 1.97k]
  |  Branch (122:43): [True: 0, False: 1.97k]
  ------------------
  123|      0|    (void)::close(fd);
  124|      0|    return -1;
  125|      0|  }
  126|  1.97k|  return fd;
  127|  1.97k|}
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_118RewriteDestinationEP13curl_sockaddrRK11sockaddr_in:
  130|  1.97k|bool RewriteDestination(struct curl_sockaddr* address, const struct sockaddr_in& destination) {
  131|  1.97k|  if (address == nullptr || sizeof(destination) > sizeof(address->addr)) {
  ------------------
  |  Branch (131:7): [True: 0, False: 1.97k]
  |  Branch (131:29): [Folded, False: 0]
  ------------------
  132|      0|    return false;
  133|      0|  }
  134|  1.97k|  address->family = AF_INET;
  135|  1.97k|  address->socktype = SOCK_DGRAM;
  136|       |  address->protocol = IPPROTO_UDP;
  137|  1.97k|  address->addrlen = sizeof(destination);
  138|  1.97k|  std::memset(&address->addr, 0, sizeof(address->addr));
  139|  1.97k|  std::memcpy(&address->addr, &destination, sizeof(destination));
  140|  1.97k|  return true;
  141|  1.97k|}
_ZN12proto_fuzzer19Http3MockServerImpl9ResetPeerEv:
  453|  4.49k|  void ResetPeer() {
  454|  4.49k|    OpenSslErrorQueueGuard error_guard;
  455|  4.49k|    pending_write_.Clear();
  456|  4.49k|    nghttp3_conn_del(http3_connection_);
  457|  4.49k|    http3_connection_ = nullptr;
  458|  4.49k|    ngtcp2_conn_del(quic_connection_);
  459|  4.49k|    quic_connection_ = nullptr;
  460|  4.49k|    if (tls_connection_ != nullptr) {
  ------------------
  |  Branch (460:9): [True: 1.96k, False: 2.53k]
  ------------------
  461|  1.96k|      SSL_set_app_data(tls_connection_, nullptr);
  ------------------
  |  | 1138|  1.96k|#define SSL_set_app_data(s, arg) (SSL_set_ex_data(s, 0, (char *)(arg)))
  ------------------
  462|  1.96k|      SSL_free(tls_connection_);
  463|  1.96k|      tls_connection_ = nullptr;
  464|  1.96k|    }
  465|  4.49k|    ngtcp2_crypto_ossl_ctx_del(crypto_context_);
  466|  4.49k|    crypto_context_ = nullptr;
  467|  4.49k|    streams_.clear();
  468|  4.49k|    retained_writes_.clear();
  469|  4.49k|    if (server_fd_ >= 0) {
  ------------------
  |  Branch (469:9): [True: 1.97k, False: 2.52k]
  ------------------
  470|  1.97k|      (void)::close(server_fd_);
  471|  1.97k|      server_fd_ = -1;
  472|  1.97k|    }
  473|       |
  474|  4.49k|    scenario_ = nullptr;
  475|  4.49k|    role_stream_ids_.fill(kNoStreamId);
  476|  4.49k|    std::memset(&local_address_, 0, sizeof(local_address_));
  477|  4.49k|    std::memset(&remote_address_, 0, sizeof(remote_address_));
  478|  4.49k|    ngtcp2_path_storage_zero(&path_storage_);
  479|  4.49k|    response_body_.chunks.clear();
  480|  4.49k|    response_body_.next_chunk = 0;
  481|  4.49k|    response_body_.finish_stream = false;
  482|  4.49k|    response_body_.has_trailers = false;
  483|  4.49k|    next_action_ = 0;
  484|  4.49k|    request_body_bytes_ = 0;
  485|  4.49k|    request_body_turns_ = 0;
  486|  4.49k|    last_request_body_turn_ = 0;
  487|  4.49k|    peer_turn_ = 0;
  488|  4.49k|    request_stream_finished_ = false;
  489|  4.49k|    server_port_ = 0;
  490|  4.49k|    socket_opened_ = false;
  491|  4.49k|    handshake_complete_ = false;
  492|  4.49k|    request_headers_received_ = false;
  493|  4.49k|    server_streams_bound_ = false;
  494|  4.49k|    bootstrap_drained_ = false;
  495|  4.49k|    waiting_for_h3_drain_ = false;
  496|  4.49k|    waiting_drain_completes_action_ = false;
  497|  4.49k|    final_response_submitted_ = false;
  498|  4.49k|    default_response_started_ = false;
  499|  4.49k|    http3_failed_ = false;
  500|  4.49k|    transport_failed_ = false;
  501|  4.49k|    close_requested_ = false;
  502|  4.49k|    close_sent_ = false;
  503|  4.49k|    close_error_code_ = 0;
  504|  4.49k|    random_counter_ = 0;
  505|  4.49k|  }
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_122OpenSslErrorQueueGuardC2Ev:
   75|  52.1k|  OpenSslErrorQueueGuard() { ERR_clear_error(); }
_ZN12proto_fuzzer19Http3MockServerImpl12PendingWrite5ClearEv:
  426|  12.2k|    void Clear() {
  427|  12.2k|      stream_id = kNoStreamId;
  428|  12.2k|      bytes = nullptr;
  429|  12.2k|      offset = 0;
  430|  12.2k|      finish_stream = false;
  431|  12.2k|      nghttp3_managed = false;
  432|  12.2k|      completes_action = false;
  433|  12.2k|    }
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_122OpenSslErrorQueueGuardD2Ev:
   76|  52.1k|  ~OpenSslErrorQueueGuard() { ERR_clear_error(); }
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_115ConfigureSocketEi:
   84|  3.94k|bool ConfigureSocket(int fd) {
   85|  3.94k|  if (fd < 0) {
  ------------------
  |  Branch (85:7): [True: 0, False: 3.94k]
  ------------------
   86|      0|    return false;
   87|      0|  }
   88|  3.94k|  const int descriptor_flags = ::fcntl(fd, F_GETFD, 0);
   89|  3.94k|  if (descriptor_flags < 0 || ::fcntl(fd, F_SETFD, descriptor_flags | FD_CLOEXEC) < 0) {
  ------------------
  |  Branch (89:7): [True: 0, False: 3.94k]
  |  Branch (89:31): [True: 0, False: 3.94k]
  ------------------
   90|      0|    return false;
   91|      0|  }
   92|  3.94k|  const int status_flags = ::fcntl(fd, F_GETFL, 0);
   93|  3.94k|  return status_flags >= 0 && ::fcntl(fd, F_SETFL, status_flags | O_NONBLOCK) == 0;
  ------------------
  |  Branch (93:10): [True: 3.94k, False: 0]
  |  Branch (93:31): [True: 3.94k, False: 0]
  ------------------
   94|  3.94k|}
_ZN12proto_fuzzer19Http3MockServerImpl13BeginScenarioERKN4curl6fuzzer5proto8ScenarioE:
  352|  2.21k|  void BeginScenario(const curl::fuzzer::proto::Scenario& scenario) {
  353|  2.21k|    ResetPeer();
  354|  2.21k|    scenario_ = &scenario;
  355|  2.21k|    default_response_.Clear();
  356|  2.21k|    default_response_.set_status_code(200);
  357|  2.21k|    default_response_.set_finish_stream(true);
  358|  2.21k|  }
_ZN12proto_fuzzer19Http3MockServerImpl13DrivePeerTurnEv:
  360|  47.0k|  std::size_t DrivePeerTurn() {
  361|  47.0k|    ++peer_turn_;
  362|  47.0k|    if (server_fd_ < 0 || transport_failed_) {
  ------------------
  |  Branch (362:9): [True: 2.85k, False: 44.1k]
  |  Branch (362:27): [True: 1.15k, False: 43.0k]
  ------------------
  363|  4.00k|      return 0;
  364|  4.00k|    }
  365|       |
  366|  43.0k|    OpenSslErrorQueueGuard error_guard;
  367|  43.0k|    std::size_t progress = HandleExpiry();
  368|  43.0k|    if (transport_failed_) {
  ------------------
  |  Branch (368:9): [True: 0, False: 43.0k]
  ------------------
  369|      0|      return progress;
  370|      0|    }
  371|  43.0k|    progress += ReadDatagrams();
  372|  43.0k|    if (quic_connection_ == nullptr || transport_failed_) {
  ------------------
  |  Branch (372:9): [True: 4, False: 43.0k]
  |  Branch (372:40): [True: 72, False: 42.9k]
  ------------------
  373|     76|      return progress;
  374|     76|    }
  375|       |
  376|  42.9k|    if (handshake_complete_ && !close_requested_ && !close_sent_) {
  ------------------
  |  Branch (376:9): [True: 39.0k, False: 3.86k]
  |  Branch (376:32): [True: 38.7k, False: 322]
  |  Branch (376:53): [True: 38.7k, False: 0]
  ------------------
  377|  38.7k|      progress += CreateServerStreams();
  378|  38.7k|      progress += DriveApplicationOutput();
  379|  38.7k|    }
  380|  42.9k|    progress += FlushTransportPackets();
  381|  42.9k|    return progress;
  382|  43.0k|  }
_ZN12proto_fuzzer19Http3MockServerImpl12HandleExpiryEv:
  875|  43.0k|  std::size_t HandleExpiry() {
  876|  43.0k|    if (quic_connection_ == nullptr) {
  ------------------
  |  Branch (876:9): [True: 1.97k, False: 41.0k]
  ------------------
  877|  1.97k|      return 0;
  878|  1.97k|    }
  879|  41.0k|    const ngtcp2_tstamp now = QuicNow();
  880|  41.0k|    if (ngtcp2_conn_get_expiry2(quic_connection_) > now) {
  ------------------
  |  Branch (880:9): [True: 37.1k, False: 3.92k]
  ------------------
  881|  37.1k|      return 0;
  882|  37.1k|    }
  883|  3.92k|    const int result = ngtcp2_conn_handle_expiry(quic_connection_, now);
  884|  3.92k|    if (result != 0) {
  ------------------
  |  Branch (884:9): [True: 0, False: 3.92k]
  ------------------
  885|      0|      transport_failed_ = true;
  886|      0|    }
  887|  3.92k|    return 1;
  888|  41.0k|  }
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_17QuicNowEv:
  298|   119k|ngtcp2_tstamp QuicNow() {
  299|   119k|  const auto now = std::chrono::steady_clock::now().time_since_epoch();
  300|   119k|  return static_cast<ngtcp2_tstamp>(std::chrono::duration_cast<std::chrono::nanoseconds>(now).count());
  301|   119k|}
_ZN12proto_fuzzer19Http3MockServerImpl13ReadDatagramsEv:
  830|  43.0k|  std::size_t ReadDatagrams() {
  831|  43.0k|    std::size_t progress = 0;
  832|  62.4k|    for (std::size_t packet = 0; packet < kMaxDatagramsPerTurn; ++packet) {
  ------------------
  |  Branch (832:34): [True: 62.4k, False: 0]
  ------------------
  833|  62.4k|      struct sockaddr_in remote_address = {};
  834|  62.4k|      socklen_t remote_length = sizeof(remote_address);
  835|  62.4k|      const ssize_t received = ::recvfrom(server_fd_, receive_buffer_.data(), receive_buffer_.size(), 0,
  836|  62.4k|                                          reinterpret_cast<struct sockaddr*>(&remote_address), &remote_length);
  837|  62.4k|      if (received < 0) {
  ------------------
  |  Branch (837:11): [True: 42.9k, False: 19.5k]
  ------------------
  838|  42.9k|        if (errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) {
  ------------------
  |  Branch (838:13): [True: 0, False: 42.9k]
  |  Branch (838:32): [True: 0, False: 0]
  |  Branch (838:56): [True: 0, False: 0]
  ------------------
  839|      0|          transport_failed_ = true;
  840|      0|        }
  841|  42.9k|        break;
  842|  42.9k|      }
  843|  19.5k|      if (received == 0 || remote_length != sizeof(remote_address) || remote_address.sin_family != AF_INET) {
  ------------------
  |  Branch (843:11): [True: 0, False: 19.5k]
  |  Branch (843:28): [True: 0, False: 19.5k]
  |  Branch (843:71): [True: 0, False: 19.5k]
  ------------------
  844|      0|        continue;
  845|      0|      }
  846|  19.5k|      ++progress;
  847|       |
  848|  19.5k|      if (quic_connection_ == nullptr) {
  ------------------
  |  Branch (848:11): [True: 1.96k, False: 17.5k]
  ------------------
  849|  1.96k|        ngtcp2_pkt_hd header = {};
  850|  1.96k|        if (ngtcp2_accept(&header, receive_buffer_.data(), static_cast<std::size_t>(received)) != 0) {
  ------------------
  |  Branch (850:13): [True: 0, False: 1.96k]
  ------------------
  851|      0|          continue;
  852|      0|        }
  853|  1.96k|        if (!InitializeConnection(header, remote_address)) {
  ------------------
  |  Branch (853:13): [True: 0, False: 1.96k]
  ------------------
  854|      0|          transport_failed_ = true;
  855|      0|          return progress;
  856|      0|        }
  857|  17.5k|      } else if (remote_address.sin_port != remote_address_.sin_port ||
  ------------------
  |  Branch (857:18): [True: 0, False: 17.5k]
  ------------------
  858|  17.5k|                 remote_address.sin_addr.s_addr != remote_address_.sin_addr.s_addr) {
  ------------------
  |  Branch (858:18): [True: 0, False: 17.5k]
  ------------------
  859|      0|        continue;
  860|      0|      }
  861|       |
  862|  19.5k|      ngtcp2_pkt_info packet_info = {};
  863|  19.5k|      const int result = ngtcp2_conn_read_pkt(quic_connection_, &path_storage_.path, &packet_info,
  ------------------
  |  | 7392|  19.5k|  ngtcp2_conn_read_pkt_versioned((CONN), (PATH), NGTCP2_PKT_INFO_VERSION,      \
  |  |  ------------------
  |  |  |  |  506|  19.5k|#define NGTCP2_PKT_INFO_VERSION NGTCP2_PKT_INFO_V1
  |  |  |  |  ------------------
  |  |  |  |  |  |  505|  19.5k|#define NGTCP2_PKT_INFO_V1 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 7393|  19.5k|                                 (PI), (PKT), (PKTLEN), (TS))
  ------------------
  864|  19.5k|                                              receive_buffer_.data(), static_cast<std::size_t>(received), QuicNow());
  865|  19.5k|      if (result != 0) {
  ------------------
  |  Branch (865:11): [True: 72, False: 19.4k]
  ------------------
  866|     72|        transport_failed_ = true;
  867|     72|        return progress;
  868|     72|      }
  869|  19.5k|    }
  870|  42.9k|    return progress;
  871|  43.0k|  }
_ZN12proto_fuzzer19Http3MockServerImpl20InitializeConnectionERK13ngtcp2_pkt_hdRK11sockaddr_in:
  746|  1.96k|  bool InitializeConnection(const ngtcp2_pkt_hd& header, const struct sockaddr_in& remote_address) {
  747|  1.96k|    if (quic_connection_ != nullptr || header.type != NGTCP2_PKT_INITIAL) {
  ------------------
  |  Branch (747:9): [True: 0, False: 1.96k]
  |  Branch (747:40): [True: 0, False: 1.96k]
  ------------------
  748|      0|      return false;
  749|      0|    }
  750|       |
  751|  1.96k|    remote_address_ = remote_address;
  752|  1.96k|    ngtcp2_path_storage_init(&path_storage_, reinterpret_cast<const ngtcp2_sockaddr*>(&local_address_),
  753|  1.96k|                             sizeof(local_address_), reinterpret_cast<const ngtcp2_sockaddr*>(&remote_address_),
  754|  1.96k|                             sizeof(remote_address_), nullptr);
  755|       |
  756|  1.96k|    ngtcp2_callbacks callbacks = {};
  757|  1.96k|    callbacks.recv_client_initial = ngtcp2_crypto_recv_client_initial_cb;
  758|  1.96k|    callbacks.recv_crypto_data = ngtcp2_crypto_recv_crypto_data_cb;
  759|  1.96k|    callbacks.handshake_completed = &HandshakeCompleted;
  760|  1.96k|    callbacks.encrypt = ngtcp2_crypto_encrypt_cb;
  761|  1.96k|    callbacks.decrypt = ngtcp2_crypto_decrypt_cb;
  762|  1.96k|    callbacks.hp_mask = ngtcp2_crypto_hp_mask_cb;
  763|  1.96k|    callbacks.recv_stream_data = &ReceiveQuicStreamData;
  764|  1.96k|    callbacks.acked_stream_data_offset = &AckedStreamDataOffset;
  765|  1.96k|    callbacks.stream_open = &OpenRemoteStream;
  766|  1.96k|    callbacks.stream_reset = &ResetQuicStream;
  767|  1.96k|    callbacks.rand = &GenerateRandomBytes;
  768|  1.96k|    callbacks.update_key = ngtcp2_crypto_update_key_cb;
  769|  1.96k|    callbacks.delete_crypto_aead_ctx = ngtcp2_crypto_delete_crypto_aead_ctx_cb;
  770|  1.96k|    callbacks.delete_crypto_cipher_ctx = ngtcp2_crypto_delete_crypto_cipher_ctx_cb;
  771|  1.96k|    callbacks.stream_stop_sending = &StopSendingQuicStream;
  772|  1.96k|    callbacks.version_negotiation = ngtcp2_crypto_version_negotiation_cb;
  773|  1.96k|    callbacks.recv_tx_key = &ReceiveTransmitKey;
  774|  1.96k|    callbacks.get_new_connection_id2 = &GetNewConnectionId;
  775|  1.96k|    callbacks.get_path_challenge_data2 = ngtcp2_crypto_get_path_challenge_data2_cb;
  776|  1.96k|    callbacks.stream_close2 = &CloseQuicStream;
  777|       |
  778|  1.96k|    ngtcp2_settings settings;
  779|  1.96k|    ngtcp2_settings_default(&settings);
  ------------------
  |  | 7564|  1.96k|  ngtcp2_settings_default_versioned(NGTCP2_SETTINGS_VERSION, (SETTINGS))
  |  |  ------------------
  |  |  |  | 1865|  1.96k|#define NGTCP2_SETTINGS_VERSION NGTCP2_SETTINGS_V5
  |  |  |  |  ------------------
  |  |  |  |  |  | 1864|  1.96k|#define NGTCP2_SETTINGS_V5 5
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  780|  1.96k|    settings.initial_ts = QuicNow();
  781|  1.96k|    settings.rand_ctx.native_handle = this;
  782|  1.96k|    settings.no_pmtud = 1;
  783|  1.96k|    settings.max_tx_udp_payload_size = packet_buffer_.size();
  784|       |
  785|  1.96k|    ngtcp2_transport_params parameters;
  786|  1.96k|    ngtcp2_transport_params_default(&parameters);
  ------------------
  |  | 7516|  1.96k|  ngtcp2_transport_params_default_versioned(NGTCP2_TRANSPORT_PARAMS_VERSION,   \
  |  |  ------------------
  |  |  |  | 1472|  1.96k|#define NGTCP2_TRANSPORT_PARAMS_VERSION NGTCP2_TRANSPORT_PARAMS_V1
  |  |  |  |  ------------------
  |  |  |  |  |  | 1471|  1.96k|#define NGTCP2_TRANSPORT_PARAMS_V1 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 7517|  1.96k|                                            (PARAMS))
  ------------------
  787|  1.96k|    parameters.initial_max_stream_data_bidi_local = kMaxPendingPlaintextBytes;
  788|       |    // From the server's view, curl opens the remote bidirectional streams.
  789|       |    // Keep the normal receive window on the unidirectional control and QPACK streams.
  790|  1.96k|    parameters.initial_max_stream_data_bidi_remote =
  791|  1.96k|        scenario_ != nullptr && scenario_->http3_plan().small_upload_window()
  ------------------
  |  Branch (791:9): [True: 1.96k, False: 0]
  |  Branch (791:33): [True: 0, False: 1.96k]
  ------------------
  792|  1.96k|            ? scenario_limits::kHttp3SmallUploadWindowBytes
  793|  1.96k|            : kMaxPendingPlaintextBytes;
  794|  1.96k|    parameters.initial_max_stream_data_uni = kMaxPendingPlaintextBytes;
  795|  1.96k|    parameters.initial_max_data = kMaxPendingPlaintextBytes * 4U;
  796|  1.96k|    parameters.initial_max_streams_bidi = kMaxStreams;
  797|  1.96k|    parameters.initial_max_streams_uni = kMaxStreams;
  798|  1.96k|    parameters.max_idle_timeout = 5U * NGTCP2_SECONDS;
  ------------------
  |  |  244|  1.96k|#define NGTCP2_SECONDS ((ngtcp2_duration)(1000ULL * NGTCP2_MILLISECONDS))
  |  |  ------------------
  |  |  |  |  236|  1.96k|#define NGTCP2_MILLISECONDS ((ngtcp2_duration)(1000ULL * NGTCP2_MICROSECONDS))
  |  |  |  |  ------------------
  |  |  |  |  |  |  228|  1.96k|#define NGTCP2_MICROSECONDS ((ngtcp2_duration)(1000ULL * NGTCP2_NANOSECONDS))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  220|  1.96k|#define NGTCP2_NANOSECONDS ((ngtcp2_duration)1ULL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  799|  1.96k|    parameters.active_connection_id_limit = 2;
  800|  1.96k|    parameters.original_dcid = header.dcid;
  801|  1.96k|    parameters.original_dcid_present = 1;
  802|       |
  803|  1.96k|    ngtcp2_cid server_cid = {};
  804|  1.96k|    server_cid.datalen = kServerConnectionIdBytes;
  805|  1.96k|    FillRandom(server_cid.data, server_cid.datalen);
  806|  1.96k|    if (ngtcp2_conn_server_new(&quic_connection_, &header.scid, &server_cid, &path_storage_.path, header.version,
  ------------------
  |  | 7496|  1.96k|  ngtcp2_conn_server_new_versioned(                                            \
  |  | 7497|  1.96k|    (PCONN), (DCID), (SCID), (PATH), (VERSION), NGTCP2_CALLBACKS_VERSION,      \
  |  |  ------------------
  |  |  |  | 3779|  1.96k|#define NGTCP2_CALLBACKS_VERSION NGTCP2_CALLBACKS_V6
  |  |  |  |  ------------------
  |  |  |  |  |  | 3778|  1.96k|#define NGTCP2_CALLBACKS_V6 6
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 7498|  1.96k|    (CALLBACKS), NGTCP2_SETTINGS_VERSION, (SETTINGS),                          \
  |  |  ------------------
  |  |  |  | 1865|  1.96k|#define NGTCP2_SETTINGS_VERSION NGTCP2_SETTINGS_V5
  |  |  |  |  ------------------
  |  |  |  |  |  | 1864|  1.96k|#define NGTCP2_SETTINGS_V5 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 7499|  1.96k|    NGTCP2_TRANSPORT_PARAMS_VERSION, (PARAMS), (MEM), (USER_DATA))
  |  |  ------------------
  |  |  |  | 1472|  1.96k|#define NGTCP2_TRANSPORT_PARAMS_VERSION NGTCP2_TRANSPORT_PARAMS_V1
  |  |  |  |  ------------------
  |  |  |  |  |  | 1471|  1.96k|#define NGTCP2_TRANSPORT_PARAMS_V1 1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (806:9): [True: 0, False: 1.96k]
  ------------------
  807|  1.96k|                               &callbacks, &settings, &parameters, nullptr, this) != 0) {
  808|      0|      return false;
  809|      0|    }
  810|       |
  811|  1.96k|    if (ngtcp2_crypto_ossl_ctx_new(&crypto_context_, nullptr) != 0) {
  ------------------
  |  Branch (811:9): [True: 0, False: 1.96k]
  ------------------
  812|      0|      return false;
  813|      0|    }
  814|  1.96k|    tls_connection_ = SSL_new(context_);
  815|  1.96k|    if (tls_connection_ == nullptr) {
  ------------------
  |  Branch (815:9): [True: 0, False: 1.96k]
  ------------------
  816|      0|      return false;
  817|      0|    }
  818|  1.96k|    ngtcp2_crypto_ossl_ctx_set_ssl(crypto_context_, tls_connection_);
  819|  1.96k|    if (ngtcp2_crypto_ossl_configure_server_session(tls_connection_) != 0) {
  ------------------
  |  Branch (819:9): [True: 0, False: 1.96k]
  ------------------
  820|      0|      return false;
  821|      0|    }
  822|  1.96k|    SSL_set_app_data(tls_connection_, &crypto_connection_ref_);
  ------------------
  |  | 1138|  1.96k|#define SSL_set_app_data(s, arg) (SSL_set_ex_data(s, 0, (char *)(arg)))
  ------------------
  823|  1.96k|    SSL_set_accept_state(tls_connection_);
  824|  1.96k|    ngtcp2_conn_set_tls_native_handle(quic_connection_, crypto_context_);
  825|  1.96k|    return true;
  826|  1.96k|  }
_ZN12proto_fuzzer19Http3MockServerImpl18HandshakeCompletedEP11ngtcp2_connPv:
  515|  1.95k|  static int HandshakeCompleted(ngtcp2_conn* /*connection*/, void* user_data) {
  516|  1.95k|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
  517|  1.95k|    if (self == nullptr) {
  ------------------
  |  Branch (517:9): [True: 0, False: 1.95k]
  ------------------
  518|      0|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  519|      0|    }
  520|  1.95k|    self->handshake_complete_ = true;
  521|  1.95k|    return 0;
  522|  1.95k|  }
_ZN12proto_fuzzer19Http3MockServerImpl21ReceiveQuicStreamDataEP11ngtcp2_connjlmPKhmPvS5_:
  588|  10.7k|                                   void* user_data, void* /*stream_user_data*/) {
  589|  10.7k|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
  590|  10.7k|    if (self == nullptr || self->http3_connection_ == nullptr || self->http3_failed_) {
  ------------------
  |  Branch (590:9): [True: 0, False: 10.7k]
  |  Branch (590:28): [True: 0, False: 10.7k]
  |  Branch (590:66): [True: 0, False: 10.7k]
  ------------------
  591|      0|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  592|      0|    }
  593|  10.7k|    const nghttp3_ssize consumed =
  594|  10.7k|        nghttp3_conn_read_stream2(self->http3_connection_, stream_id, data, length, flags & NGTCP2_STREAM_DATA_FLAG_FIN,
  ------------------
  |  | 2930|  10.7k|#define NGTCP2_STREAM_DATA_FLAG_FIN 0x01U
  ------------------
  595|  10.7k|                                  ngtcp2_conn_get_timestamp(connection));
  596|  10.7k|    if (consumed < 0) {
  ------------------
  |  Branch (596:9): [True: 12, False: 10.7k]
  ------------------
  597|     12|      self->http3_failed_ = true;
  598|     12|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|     12|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  599|     12|    }
  600|  10.7k|    ngtcp2_conn_extend_max_stream_offset(connection, stream_id, static_cast<std::uint64_t>(consumed));
  601|  10.7k|    ngtcp2_conn_extend_max_offset(connection, static_cast<std::uint64_t>(consumed));
  602|  10.7k|    return 0;
  603|  10.7k|  }
_ZN12proto_fuzzer19Http3MockServerImpl21AckedStreamDataOffsetEP11ngtcp2_connlmmPvS3_:
  609|  7.01k|                                   std::uint64_t length, void* user_data, void* /*stream_user_data*/) {
  610|  7.01k|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
  611|  7.01k|    if (self == nullptr || self->http3_connection_ == nullptr || self->http3_failed_) {
  ------------------
  |  Branch (611:9): [True: 0, False: 7.01k]
  |  Branch (611:28): [True: 0, False: 7.01k]
  |  Branch (611:66): [True: 0, False: 7.01k]
  ------------------
  612|      0|      return 0;
  613|      0|    }
  614|       |
  615|  7.01k|    StreamState* stream = self->FindStream(stream_id);
  616|  7.01k|    if (stream == nullptr || offset > UINT64_MAX - length) {
  ------------------
  |  Branch (616:9): [True: 0, False: 7.01k]
  |  Branch (616:30): [True: 0, False: 7.01k]
  ------------------
  617|      0|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  618|      0|    }
  619|       |
  620|  7.01k|    if (length == 0) {
  ------------------
  |  Branch (620:9): [True: 0, False: 7.01k]
  ------------------
  621|      0|      if (stream->next_managed_fin_offset < stream->managed_fin_offsets.size() &&
  ------------------
  |  Branch (621:11): [True: 0, False: 0]
  ------------------
  622|      0|          stream->managed_fin_offsets[stream->next_managed_fin_offset] == offset) {
  ------------------
  |  Branch (622:11): [True: 0, False: 0]
  ------------------
  623|      0|        ++stream->next_managed_fin_offset;
  624|      0|        if (nghttp3_conn_add_ack_offset(self->http3_connection_, stream_id, 0) != 0) {
  ------------------
  |  Branch (624:13): [True: 0, False: 0]
  ------------------
  625|      0|          self->http3_failed_ = true;
  626|      0|          return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  627|      0|        }
  628|      0|      }
  629|      0|      return 0;
  630|      0|    }
  631|       |
  632|  7.01k|    const std::uint64_t end = offset + length;
  633|  7.01k|    std::uint64_t managed_length = 0;
  634|  13.6k|    for (std::size_t index = stream->next_managed_ack_range; index < stream->managed_write_ranges.size(); ++index) {
  ------------------
  |  Branch (634:62): [True: 7.03k, False: 6.62k]
  ------------------
  635|  7.03k|      const StreamState::ManagedWriteRange& range = stream->managed_write_ranges[index];
  636|  7.03k|      if (range.end <= offset) {
  ------------------
  |  Branch (636:11): [True: 0, False: 7.03k]
  ------------------
  637|      0|        stream->next_managed_ack_range = index + 1;
  638|      0|        continue;
  639|      0|      }
  640|  7.03k|      if (range.begin >= end) {
  ------------------
  |  Branch (640:11): [True: 383, False: 6.65k]
  ------------------
  641|    383|        break;
  642|    383|      }
  643|  6.65k|      managed_length += std::min(range.end, end) - std::max(range.begin, offset);
  644|  6.65k|      if (range.end <= end) {
  ------------------
  |  Branch (644:11): [True: 6.65k, False: 0]
  ------------------
  645|  6.65k|        stream->next_managed_ack_range = index + 1;
  646|  6.65k|      }
  647|  6.65k|    }
  648|       |
  649|  7.01k|    if (managed_length != 0 && nghttp3_conn_add_ack_offset(self->http3_connection_, stream_id, managed_length) != 0) {
  ------------------
  |  Branch (649:9): [True: 6.65k, False: 362]
  |  Branch (649:32): [True: 0, False: 6.65k]
  ------------------
  650|      0|      self->http3_failed_ = true;
  651|      0|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  652|      0|    }
  653|  7.01k|    return 0;
  654|  7.01k|  }
_ZN12proto_fuzzer19Http3MockServerImpl10FindStreamEl:
 1435|  21.8k|  StreamState* FindStream(std::int64_t stream_id) {
 1436|  62.9k|    for (StreamState& stream : streams_) {
  ------------------
  |  Branch (1436:30): [True: 62.9k, False: 0]
  ------------------
 1437|  62.9k|      if (stream.id == stream_id) {
  ------------------
  |  Branch (1437:11): [True: 21.8k, False: 41.0k]
  ------------------
 1438|  21.8k|        return &stream;
 1439|  21.8k|      }
 1440|  62.9k|    }
 1441|      0|    return nullptr;
 1442|  21.8k|  }
_ZN12proto_fuzzer19Http3MockServerImpl16OpenRemoteStreamEP11ngtcp2_connlPv:
  569|  7.80k|  static int OpenRemoteStream(ngtcp2_conn* /*connection*/, std::int64_t stream_id, void* user_data) {
  570|  7.80k|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
  571|  7.80k|    if (self == nullptr || self->streams_.size() >= kMaxStreams) {
  ------------------
  |  Branch (571:9): [True: 0, False: 7.80k]
  |  Branch (571:28): [True: 0, False: 7.80k]
  ------------------
  572|      0|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  573|      0|    }
  574|  7.80k|    StreamState state;
  575|  7.80k|    state.id = stream_id;
  576|  7.80k|    self->streams_.push_back(state);
  577|  7.80k|    if (self->role_stream_ids_[kResponseStream] == kNoStreamId && ngtcp2_is_bidi_stream(stream_id)) {
  ------------------
  |  Branch (577:9): [True: 7.80k, False: 0]
  |  Branch (577:67): [True: 1.92k, False: 5.87k]
  ------------------
  578|  1.92k|      self->role_stream_ids_[kResponseStream] = stream_id;
  579|  1.92k|    }
  580|  7.80k|    return 0;
  581|  7.80k|  }
_ZN12proto_fuzzer19Http3MockServerImpl15ResetQuicStreamEP11ngtcp2_connlmmPvS3_:
  682|      7|                             std::uint64_t /*application_error_code*/, void* user_data, void* /*stream_user_data*/) {
  683|      7|    return ShutdownHttp3StreamRead(stream_id, user_data);
  684|      7|  }
_ZN12proto_fuzzer19Http3MockServerImpl23ShutdownHttp3StreamReadElPv:
  692|      7|  static int ShutdownHttp3StreamRead(std::int64_t stream_id, void* user_data) {
  693|      7|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
  694|      7|    if (self == nullptr || self->http3_connection_ == nullptr || self->http3_failed_) {
  ------------------
  |  Branch (694:9): [True: 0, False: 7]
  |  Branch (694:28): [True: 0, False: 7]
  |  Branch (694:66): [True: 0, False: 7]
  ------------------
  695|      0|      return 0;
  696|      0|    }
  697|      7|    const int result = nghttp3_conn_shutdown_stream_read(self->http3_connection_, stream_id);
  698|      7|    if (result != 0 && result != NGHTTP3_ERR_STREAM_NOT_FOUND) {
  ------------------
  |  |  231|      0|#define NGHTTP3_ERR_STREAM_NOT_FOUND -110
  ------------------
  |  Branch (698:9): [True: 0, False: 7]
  |  Branch (698:24): [True: 0, False: 0]
  ------------------
  699|      0|      self->http3_failed_ = true;
  700|      0|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  701|      0|    }
  702|      7|    return 0;
  703|      7|  }
_ZN12proto_fuzzer19Http3MockServerImpl19GenerateRandomBytesEPhmPK15ngtcp2_rand_ctx:
  542|  7.87k|                                  const ngtcp2_rand_ctx* random_context) {
  543|  7.87k|    if (random_context == nullptr) {
  ------------------
  |  Branch (543:9): [True: 0, False: 7.87k]
  ------------------
  544|      0|      std::memset(destination, 0, length);
  545|      0|      return;
  546|      0|    }
  547|  7.87k|    auto* self = static_cast<Http3MockServerImpl*>(random_context->native_handle);
  548|  7.87k|    if (self == nullptr) {
  ------------------
  |  Branch (548:9): [True: 0, False: 7.87k]
  ------------------
  549|      0|      std::memset(destination, 0, length);
  550|      0|      return;
  551|      0|    }
  552|  7.87k|    self->FillRandom(destination, length);
  553|  7.87k|  }
_ZN12proto_fuzzer19Http3MockServerImpl18ReceiveTransmitKeyEP11ngtcp2_conn23ngtcp2_encryption_levelPv:
  524|  3.93k|  static int ReceiveTransmitKey(ngtcp2_conn* /*connection*/, ngtcp2_encryption_level level, void* user_data) {
  525|  3.93k|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
  526|  3.93k|    if (self == nullptr) {
  ------------------
  |  Branch (526:9): [True: 0, False: 3.93k]
  ------------------
  527|      0|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  528|      0|    }
  529|  3.93k|    if (level != NGTCP2_ENCRYPTION_LEVEL_1RTT || self->server_streams_bound_) {
  ------------------
  |  Branch (529:9): [True: 1.96k, False: 1.96k]
  |  Branch (529:50): [True: 0, False: 1.96k]
  ------------------
  530|  1.96k|      return 0;
  531|  1.96k|    }
  532|       |    // HTTP/3 application streams become valid only after 1-RTT keys exist.
  533|       |    // Bind its critical streams before allowing script output onto the peer.
  534|  1.96k|    if (!self->CreateHttp3Connection()) {
  ------------------
  |  Branch (534:9): [True: 0, False: 1.96k]
  ------------------
  535|      0|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  536|      0|    }
  537|  1.96k|    (void)self->CreateServerStreams();
  538|  1.96k|    return self->server_streams_bound_ ? 0 : NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  |  Branch (538:12): [True: 1.96k, False: 0]
  ------------------
  539|  1.96k|  }
_ZN12proto_fuzzer19Http3MockServerImpl21CreateHttp3ConnectionEv:
  708|  1.96k|  bool CreateHttp3Connection() {
  709|  1.96k|    if (http3_connection_ != nullptr) {
  ------------------
  |  Branch (709:9): [True: 0, False: 1.96k]
  ------------------
  710|      0|      return true;
  711|      0|    }
  712|  1.96k|    nghttp3_callbacks callbacks = {};
  713|  1.96k|    callbacks.recv_data = &ReceiveRequestData;
  714|  1.96k|    callbacks.deferred_consume = &DeferredConsumeRequestData;
  715|  1.96k|    callbacks.end_headers = &EndRequestHeaders;
  716|  1.96k|    callbacks.end_stream = &EndRequestStream;
  717|  1.96k|    nghttp3_settings settings;
  718|  1.96k|    nghttp3_settings_default(&settings);
  ------------------
  |  | 3651|  1.96k|  nghttp3_settings_default_versioned(NGHTTP3_SETTINGS_VERSION, (SETTINGS))
  |  |  ------------------
  |  |  |  | 1801|  1.96k|#define NGHTTP3_SETTINGS_VERSION NGHTTP3_SETTINGS_V4
  |  |  |  |  ------------------
  |  |  |  |  |  | 1800|  1.96k|#define NGHTTP3_SETTINGS_V4 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  719|  1.96k|    settings.qpack_max_dtable_capacity = 0;
  720|  1.96k|    settings.qpack_encoder_max_dtable_capacity = 0;
  721|  1.96k|    settings.qpack_blocked_streams = 0;
  722|  1.96k|    if (nghttp3_conn_server_new(&http3_connection_, &callbacks, &settings, nullptr, this) != 0) {
  ------------------
  |  | 3669|  1.96k|  nghttp3_conn_server_new_versioned((PCONN), NGHTTP3_CALLBACKS_VERSION,        \
  |  |  ------------------
  |  |  |  | 2320|  1.96k|#define NGHTTP3_CALLBACKS_VERSION NGHTTP3_CALLBACKS_V4
  |  |  |  |  ------------------
  |  |  |  |  |  | 2319|  1.96k|#define NGHTTP3_CALLBACKS_V4 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3670|  1.96k|                                    (CALLBACKS), NGHTTP3_SETTINGS_VERSION,     \
  |  |  ------------------
  |  |  |  | 1801|  1.96k|#define NGHTTP3_SETTINGS_VERSION NGHTTP3_SETTINGS_V4
  |  |  |  |  ------------------
  |  |  |  |  |  | 1800|  1.96k|#define NGHTTP3_SETTINGS_V4 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3671|  1.96k|                                    (SETTINGS), (MEM), (USER_DATA))
  ------------------
  |  Branch (722:9): [True: 0, False: 1.96k]
  ------------------
  723|      0|      http3_failed_ = true;
  724|      0|      return false;
  725|      0|    }
  726|  1.96k|    nghttp3_conn_set_max_concurrent_streams(http3_connection_, kMaxStreams);
  727|  1.96k|    return true;
  728|  1.96k|  }
_ZN12proto_fuzzer19Http3MockServerImpl18ReceiveRequestDataEP12nghttp3_connlPKhmPvS5_:
 1455|  2.93k|                                std::size_t data_length, void* user_data, void* /*stream_user_data*/) {
 1456|  2.93k|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
 1457|  2.93k|    if (self != nullptr && self->quic_connection_ != nullptr) {
  ------------------
  |  Branch (1457:9): [True: 2.93k, False: 0]
  |  Branch (1457:28): [True: 2.93k, False: 0]
  ------------------
 1458|       |      // A turn can deliver several DATA callbacks. Count the turn once so
 1459|       |      // fragmentation within a turn cannot satisfy the multi-turn test.
 1460|  2.93k|      if (data_length != 0 && self->last_request_body_turn_ != self->peer_turn_) {
  ------------------
  |  Branch (1460:11): [True: 2.93k, False: 0]
  |  Branch (1460:31): [True: 640, False: 2.29k]
  ------------------
 1461|    640|        ++self->request_body_turns_;
 1462|    640|        self->last_request_body_turn_ = self->peer_turn_;
 1463|    640|      }
 1464|  2.93k|      self->request_body_bytes_ += data_length;
 1465|  2.93k|      ngtcp2_conn_extend_max_stream_offset(self->quic_connection_, stream_id, data_length);
 1466|  2.93k|      ngtcp2_conn_extend_max_offset(self->quic_connection_, data_length);
 1467|  2.93k|    }
 1468|  2.93k|    return 0;
 1469|  2.93k|  }
_ZN12proto_fuzzer19Http3MockServerImpl17EndRequestHeadersEP12nghttp3_connliPvS3_:
 1482|  1.91k|                               void* user_data, void* /*stream_user_data*/) {
 1483|  1.91k|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
 1484|  1.91k|    if (self != nullptr) {
  ------------------
  |  Branch (1484:9): [True: 1.91k, False: 0]
  ------------------
 1485|  1.91k|      if (self->role_stream_ids_[kResponseStream] == kNoStreamId) {
  ------------------
  |  Branch (1485:11): [True: 0, False: 1.91k]
  ------------------
 1486|      0|        self->role_stream_ids_[kResponseStream] = stream_id;
 1487|      0|        if (self->FindStream(stream_id) == nullptr && self->streams_.size() < kMaxStreams) {
  ------------------
  |  Branch (1487:13): [True: 0, False: 0]
  |  Branch (1487:55): [True: 0, False: 0]
  ------------------
 1488|      0|          StreamState state;
 1489|      0|          state.id = stream_id;
 1490|      0|          self->streams_.push_back(state);
 1491|      0|        }
 1492|      0|      }
 1493|  1.91k|      if (self->role_stream_ids_[kResponseStream] == stream_id) {
  ------------------
  |  Branch (1493:11): [True: 1.91k, False: 0]
  ------------------
 1494|  1.91k|        self->request_headers_received_ = true;
 1495|  1.91k|      }
 1496|  1.91k|    }
 1497|  1.91k|    return 0;
 1498|  1.91k|  }
_ZN12proto_fuzzer19Http3MockServerImpl16EndRequestStreamEP12nghttp3_connlPvS3_:
 1501|  1.88k|                              void* /*stream_user_data*/) {
 1502|  1.88k|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
 1503|       |    // Only FIN on the request selected for the response releases the wait.
 1504|       |    // Curl can finish that request before it uses all the scripted bytes.
 1505|  1.88k|    if (self != nullptr && self->role_stream_ids_[kResponseStream] == stream_id) {
  ------------------
  |  Branch (1505:9): [True: 1.88k, False: 0]
  |  Branch (1505:28): [True: 1.88k, False: 0]
  ------------------
 1506|  1.88k|      self->request_stream_finished_ = true;
 1507|  1.88k|    }
 1508|  1.88k|    return 0;
 1509|  1.88k|  }
_ZN12proto_fuzzer19Http3MockServerImpl18GetNewConnectionIdEP11ngtcp2_connP10ngtcp2_cidP28ngtcp2_stateless_reset_tokenmPv:
  557|  1.96k|                                void* user_data) {
  558|  1.96k|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
  559|  1.96k|    if (self == nullptr || connection_id == nullptr || reset_token == nullptr ||
  ------------------
  |  Branch (559:9): [True: 0, False: 1.96k]
  |  Branch (559:28): [True: 0, False: 1.96k]
  |  Branch (559:56): [True: 0, False: 1.96k]
  ------------------
  560|  1.96k|        connection_id_length > sizeof(connection_id->data)) {
  ------------------
  |  Branch (560:9): [True: 0, False: 1.96k]
  ------------------
  561|      0|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  562|      0|    }
  563|  1.96k|    connection_id->datalen = connection_id_length;
  564|  1.96k|    self->FillRandom(connection_id->data, connection_id_length);
  565|  1.96k|    self->FillRandom(reset_token->data, sizeof(reset_token->data));
  566|  1.96k|    return 0;
  567|  1.96k|  }
_ZN12proto_fuzzer19Http3MockServerImpl15CloseQuicStreamEP11ngtcp2_connjlmmPvS3_:
  660|     54|                             void* /*stream_user_data*/) {
  661|     54|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
  662|     54|    if (self == nullptr || self->http3_connection_ == nullptr || self->http3_failed_) {
  ------------------
  |  Branch (662:9): [True: 0, False: 54]
  |  Branch (662:28): [True: 0, False: 54]
  |  Branch (662:66): [True: 0, False: 54]
  ------------------
  663|      0|      return 0;
  664|      0|    }
  665|     54|    std::uint32_t http3_flags = NGHTTP3_STREAM_CLOSE_FLAG_NONE;
  ------------------
  |  | 2260|     54|#define NGHTTP3_STREAM_CLOSE_FLAG_NONE 0x00U
  ------------------
  666|     54|    if ((flags & NGTCP2_STREAM_CLOSE2_FLAG_RX_APP_ERROR_CODE_SET) != 0) {
  ------------------
  |  | 3705|     54|#define NGTCP2_STREAM_CLOSE2_FLAG_RX_APP_ERROR_CODE_SET 0x01U
  ------------------
  |  Branch (666:9): [True: 5, False: 49]
  ------------------
  667|      5|      http3_flags |= NGHTTP3_STREAM_CLOSE_FLAG_RX_APP_ERROR_CODE_SET;
  ------------------
  |  | 2270|      5|#define NGHTTP3_STREAM_CLOSE_FLAG_RX_APP_ERROR_CODE_SET 0x01U
  ------------------
  668|      5|    }
  669|     54|    if ((flags & NGTCP2_STREAM_CLOSE2_FLAG_TX_APP_ERROR_CODE_SET) != 0) {
  ------------------
  |  | 3715|     54|#define NGTCP2_STREAM_CLOSE2_FLAG_TX_APP_ERROR_CODE_SET 0x02U
  ------------------
  |  Branch (669:9): [True: 12, False: 42]
  ------------------
  670|     12|      http3_flags |= NGHTTP3_STREAM_CLOSE_FLAG_TX_APP_ERROR_CODE_SET;
  ------------------
  |  | 2280|     12|#define NGHTTP3_STREAM_CLOSE_FLAG_TX_APP_ERROR_CODE_SET 0x02U
  ------------------
  671|     12|    }
  672|     54|    const int result = nghttp3_conn_close_stream2(self->http3_connection_, http3_flags, stream_id, receive_error_code,
  673|     54|                                                  transmit_error_code);
  674|     54|    if (result != 0 && result != NGHTTP3_ERR_STREAM_NOT_FOUND) {
  ------------------
  |  |  231|      0|#define NGHTTP3_ERR_STREAM_NOT_FOUND -110
  ------------------
  |  Branch (674:9): [True: 0, False: 54]
  |  Branch (674:24): [True: 0, False: 0]
  ------------------
  675|      0|      self->http3_failed_ = true;
  676|      0|      return NGTCP2_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  812|      0|#define NGTCP2_ERR_CALLBACK_FAILURE -502
  ------------------
  677|      0|    }
  678|     54|    return 0;
  679|     54|  }
_ZN12proto_fuzzer19Http3MockServerImpl10FillRandomEPhm:
  733|  13.7k|  void FillRandom(std::uint8_t* destination, std::size_t length) {
  734|  13.7k|    std::uint64_t state = ++random_counter_ * UINT64_C(0x9e3779b97f4a7c15);
  735|   151k|    for (std::size_t index = 0; index < length; ++index) {
  ------------------
  |  Branch (735:33): [True: 137k, False: 13.7k]
  ------------------
  736|   137k|      state ^= state >> 12U;
  737|   137k|      state ^= state << 25U;
  738|   137k|      state ^= state >> 27U;
  739|       |      destination[index] = static_cast<std::uint8_t>((state * UINT64_C(0x2545f4914f6cdd1d)) >> 56U);
  740|   137k|    }
  741|  13.7k|  }
_ZN12proto_fuzzer19Http3MockServerImpl19CreateServerStreamsEv:
  966|  40.7k|  std::size_t CreateServerStreams() {
  967|  40.7k|    if (server_streams_bound_ || quic_connection_ == nullptr || http3_connection_ == nullptr || http3_failed_) {
  ------------------
  |  Branch (967:9): [True: 38.7k, False: 1.96k]
  |  Branch (967:34): [True: 0, False: 1.96k]
  |  Branch (967:65): [True: 0, False: 1.96k]
  |  Branch (967:97): [True: 0, False: 1.96k]
  ------------------
  968|  38.7k|      return 0;
  969|  38.7k|    }
  970|       |
  971|  1.96k|    std::size_t progress = 0;
  972|  1.96k|    const std::array<StreamRoleIndex, 3> roles = {kControlStream, kQpackEncoderStream, kQpackDecoderStream};
  973|  5.90k|    for (const StreamRoleIndex role : roles) {
  ------------------
  |  Branch (973:37): [True: 5.90k, False: 1.96k]
  ------------------
  974|  5.90k|      if (role_stream_ids_[role] != kNoStreamId) {
  ------------------
  |  Branch (974:11): [True: 0, False: 5.90k]
  ------------------
  975|      0|        continue;
  976|      0|      }
  977|  5.90k|      const std::int64_t stream_id = OpenUnidirectionalStream();
  978|  5.90k|      if (stream_id == kNoStreamId) {
  ------------------
  |  Branch (978:11): [True: 0, False: 5.90k]
  ------------------
  979|      0|        return progress;
  980|      0|      }
  981|  5.90k|      role_stream_ids_[role] = stream_id;
  982|  5.90k|      ++progress;
  983|  5.90k|    }
  984|       |
  985|  1.96k|    if (role_stream_ids_[kControlStream] == kNoStreamId || role_stream_ids_[kQpackEncoderStream] == kNoStreamId ||
  ------------------
  |  Branch (985:9): [True: 0, False: 1.96k]
  |  Branch (985:60): [True: 0, False: 1.96k]
  ------------------
  986|  1.96k|        role_stream_ids_[kQpackDecoderStream] == kNoStreamId) {
  ------------------
  |  Branch (986:9): [True: 0, False: 1.96k]
  ------------------
  987|      0|      return progress;
  988|      0|    }
  989|  1.96k|    if (nghttp3_conn_bind_qpack_streams(http3_connection_, role_stream_ids_[kQpackEncoderStream],
  ------------------
  |  Branch (989:9): [True: 0, False: 1.96k]
  ------------------
  990|  1.96k|                                        role_stream_ids_[kQpackDecoderStream]) != 0 ||
  991|  1.96k|        nghttp3_conn_bind_control_stream(http3_connection_, role_stream_ids_[kControlStream]) != 0) {
  ------------------
  |  Branch (991:9): [True: 0, False: 1.96k]
  ------------------
  992|      0|      http3_failed_ = true;
  993|      0|      return progress;
  994|      0|    }
  995|  1.96k|    server_streams_bound_ = true;
  996|  1.96k|    return progress + 1;
  997|  1.96k|  }
_ZN12proto_fuzzer19Http3MockServerImpl24OpenUnidirectionalStreamEv:
  999|  6.28k|  std::int64_t OpenUnidirectionalStream() {
 1000|  6.28k|    if (quic_connection_ == nullptr || streams_.size() >= kMaxStreams) {
  ------------------
  |  Branch (1000:9): [True: 0, False: 6.28k]
  |  Branch (1000:40): [True: 0, False: 6.28k]
  ------------------
 1001|      0|      return kNoStreamId;
 1002|      0|    }
 1003|  6.28k|    std::int64_t stream_id = kNoStreamId;
 1004|  6.28k|    if (ngtcp2_conn_open_uni_stream(quic_connection_, &stream_id, nullptr) != 0) {
  ------------------
  |  Branch (1004:9): [True: 385, False: 5.90k]
  ------------------
 1005|    385|      return kNoStreamId;
 1006|    385|    }
 1007|       |
 1008|  5.90k|    StreamState state;
 1009|  5.90k|    state.id = stream_id;
 1010|  5.90k|    streams_.push_back(state);
 1011|  5.90k|    return stream_id;
 1012|  6.28k|  }
_ZN12proto_fuzzer19Http3MockServerImpl22DriveApplicationOutputEv:
 1017|  38.7k|  std::size_t DriveApplicationOutput() {
 1018|  38.7k|    std::size_t progress = 0;
 1019|       |
 1020|  38.7k|    if (pending_write_.active()) {
  ------------------
  |  Branch (1020:9): [True: 871, False: 37.8k]
  ------------------
 1021|    871|      const bool completes_action = pending_write_.completes_action;
 1022|    871|      const WriteResult result = FlushPendingWrite(&progress);
 1023|    871|      if (result == WriteResult::kBlocked) {
  ------------------
  |  Branch (1023:11): [True: 208, False: 663]
  ------------------
 1024|    208|        return progress;
 1025|    208|      }
 1026|    663|      if (result == WriteResult::kFailed && transport_failed_) {
  ------------------
  |  Branch (1026:11): [True: 0, False: 663]
  |  Branch (1026:45): [True: 0, False: 0]
  ------------------
 1027|      0|        return progress;
 1028|      0|      }
 1029|    663|      if (completes_action) {
  ------------------
  |  Branch (1029:11): [True: 621, False: 42]
  ------------------
 1030|    621|        ++next_action_;
 1031|    621|        return progress + 1;
 1032|    621|      }
 1033|     42|      if (result == WriteResult::kFailed && waiting_for_h3_drain_) {
  ------------------
  |  Branch (1033:11): [True: 0, False: 42]
  |  Branch (1033:45): [True: 0, False: 0]
  ------------------
 1034|      0|        waiting_for_h3_drain_ = false;
 1035|      0|        if (waiting_drain_completes_action_) {
  ------------------
  |  Branch (1035:13): [True: 0, False: 0]
  ------------------
 1036|      0|          ++next_action_;
 1037|      0|        }
 1038|      0|        return progress + 1;
 1039|      0|      }
 1040|     42|    }
 1041|       |
 1042|  37.9k|    if (!server_streams_bound_) {
  ------------------
  |  Branch (1042:9): [True: 0, False: 37.9k]
  ------------------
 1043|      0|      return progress;
 1044|      0|    }
 1045|  37.9k|    if (!bootstrap_drained_) {
  ------------------
  |  Branch (1045:9): [True: 1.94k, False: 35.9k]
  ------------------
 1046|  1.94k|      if (http3_failed_ || PumpNghttp3(&progress)) {
  ------------------
  |  Branch (1046:11): [True: 0, False: 1.94k]
  |  Branch (1046:28): [True: 1.94k, False: 2]
  ------------------
 1047|  1.94k|        bootstrap_drained_ = true;
 1048|  1.94k|        ++progress;
 1049|  1.94k|      }
 1050|  1.94k|      return progress;
 1051|  1.94k|    }
 1052|  35.9k|    if (waiting_for_h3_drain_) {
  ------------------
  |  Branch (1052:9): [True: 1.23k, False: 34.7k]
  ------------------
 1053|  1.23k|      if (http3_failed_ || PumpNghttp3(&progress)) {
  ------------------
  |  Branch (1053:11): [True: 0, False: 1.23k]
  |  Branch (1053:28): [True: 1.19k, False: 40]
  ------------------
 1054|  1.19k|        waiting_for_h3_drain_ = false;
 1055|  1.19k|        if (waiting_drain_completes_action_) {
  ------------------
  |  Branch (1055:13): [True: 1.19k, False: 0]
  ------------------
 1056|  1.19k|          ++next_action_;
 1057|  1.19k|        }
 1058|  1.19k|        waiting_drain_completes_action_ = false;
 1059|  1.19k|        ++progress;
 1060|  1.19k|      }
 1061|  1.23k|      return progress;
 1062|  1.23k|    }
 1063|       |
 1064|       |    // Reading a request can produce QPACK decoder instructions independently
 1065|       |    // of a response action. Keep those ahead of script-controlled raw writes.
 1066|  34.7k|    if (!http3_failed_ && !PumpNghttp3(&progress)) {
  ------------------
  |  Branch (1066:9): [True: 34.7k, False: 0]
  |  Branch (1066:27): [True: 0, False: 34.7k]
  ------------------
 1067|      0|      return progress;
 1068|      0|    }
 1069|  34.7k|    if (transport_failed_) {
  ------------------
  |  Branch (1069:9): [True: 0, False: 34.7k]
  ------------------
 1070|      0|      return progress;
 1071|      0|    }
 1072|       |
 1073|  34.7k|    const bool waiting_for_upload =
 1074|  34.7k|        scenario_ != nullptr && scenario_->http3_plan().small_upload_window() && !request_stream_finished_;
  ------------------
  |  Branch (1074:9): [True: 34.7k, False: 0]
  |  Branch (1074:33): [True: 0, False: 34.7k]
  |  Branch (1074:82): [True: 0, False: 0]
  ------------------
 1075|  34.7k|    const std::size_t action_count =
 1076|  34.7k|        scenario_ == nullptr
  ------------------
  |  Branch (1076:9): [True: 0, False: 34.7k]
  ------------------
 1077|  34.7k|            ? 0
 1078|  34.7k|            : std::min<std::size_t>(scenario_limits::kMaxHttp3Actions, scenario_->http3_plan().actions_size());
 1079|  34.7k|    if (next_action_ >= action_count) {
  ------------------
  |  Branch (1079:9): [True: 31.8k, False: 2.95k]
  ------------------
 1080|       |      // An empty H3 plan still needs one successful response after a request.
 1081|  31.8k|      if (action_count == 0 && !default_response_started_ && request_headers_received_ && !waiting_for_upload) {
  ------------------
  |  Branch (1081:11): [True: 0, False: 31.8k]
  |  Branch (1081:32): [True: 0, False: 0]
  |  Branch (1081:62): [True: 0, False: 0]
  |  Branch (1081:91): [True: 0, False: 0]
  ------------------
 1082|      0|        default_response_started_ = true;
 1083|      0|        if (SubmitStructuredResponse(default_response_)) {
  ------------------
  |  Branch (1083:13): [True: 0, False: 0]
  ------------------
 1084|      0|          waiting_for_h3_drain_ = true;
 1085|      0|          waiting_drain_completes_action_ = false;
 1086|      0|          ++progress;
 1087|      0|        }
 1088|      0|      }
 1089|  31.8k|      return progress;
 1090|  31.8k|    }
 1091|       |
 1092|  2.95k|    const auto& action = scenario_->http3_plan().actions(static_cast<int>(next_action_));
 1093|       |    // If curl sends Expect: 100-continue, it waits for the interim response
 1094|       |    // before sending the body. Let the next informational response through.
 1095|       |    // Leave other actions queued in order until the request stream ends.
 1096|  2.95k|    if (waiting_for_upload && (!action.has_structured_response() ||
  ------------------
  |  Branch (1096:9): [True: 0, False: 2.95k]
  |  Branch (1096:32): [True: 0, False: 0]
  ------------------
 1097|      0|                               NormalizeResponseStatus(action.structured_response().status_code()) >= 200U)) {
  ------------------
  |  Branch (1097:32): [True: 0, False: 0]
  ------------------
 1098|      0|      return progress;
 1099|      0|    }
 1100|  2.95k|    if (action.has_structured_response()) {
  ------------------
  |  Branch (1100:9): [True: 1.37k, False: 1.57k]
  ------------------
 1101|  1.37k|      if (!request_headers_received_) {
  ------------------
  |  Branch (1101:11): [True: 0, False: 1.37k]
  ------------------
 1102|      0|        return progress;
 1103|      0|      }
 1104|  1.37k|      if (SubmitStructuredResponse(action.structured_response())) {
  ------------------
  |  Branch (1104:11): [True: 1.20k, False: 176]
  ------------------
 1105|  1.20k|        waiting_for_h3_drain_ = true;
 1106|  1.20k|        waiting_drain_completes_action_ = true;
 1107|  1.20k|      } else {
 1108|    176|        ++next_action_;
 1109|    176|      }
 1110|  1.37k|      return progress + 1;
 1111|  1.37k|    }
 1112|       |
 1113|  1.57k|    if (action.has_stream_write()) {
  ------------------
  |  Branch (1113:9): [True: 364, False: 1.21k]
  ------------------
 1114|    364|      const auto& write = action.stream_write();
 1115|    364|      const std::int64_t stream_id = StreamForRole(write.role());
 1116|    364|      if (stream_id == kNoStreamId) {
  ------------------
  |  Branch (1116:11): [True: 0, False: 364]
  ------------------
 1117|      0|        return progress;
 1118|      0|      }
 1119|    364|      const std::size_t length = std::min<std::size_t>(scenario_limits::kMaxHttp3RawWriteBytes, write.data().size());
 1120|    364|      QueueWrite(stream_id, write.data().substr(0, length), write.finish_stream(), false, true);
 1121|    364|      return progress + 1;
 1122|    364|    }
 1123|       |
 1124|  1.21k|    if (action.has_open_unidirectional_stream()) {
  ------------------
  |  Branch (1124:9): [True: 385, False: 826]
  ------------------
 1125|    385|      const auto& open = action.open_unidirectional_stream();
 1126|    385|      const std::int64_t stream_id = OpenUnidirectionalStream();
 1127|    385|      if (stream_id == kNoStreamId) {
  ------------------
  |  Branch (1127:11): [True: 385, False: 0]
  ------------------
 1128|    385|        ++next_action_;
 1129|    385|        return progress + 1;
 1130|    385|      }
 1131|      0|      const std::size_t length = std::min<std::size_t>(scenario_limits::kMaxHttp3RawWriteBytes, open.data().size());
 1132|      0|      QueueWrite(stream_id, open.data().substr(0, length), open.finish_stream(), false, true);
 1133|      0|      return progress + 1;
 1134|    385|    }
 1135|       |
 1136|    826|    if (action.has_stream_reset()) {
  ------------------
  |  Branch (1136:9): [True: 211, False: 615]
  ------------------
 1137|    211|      const auto& reset = action.stream_reset();
 1138|    211|      const std::int64_t stream_id = StreamForRole(reset.role());
 1139|    211|      if (stream_id == kNoStreamId) {
  ------------------
  |  Branch (1139:11): [True: 0, False: 211]
  ------------------
 1140|      0|        return progress;
 1141|      0|      }
 1142|    211|      (void)ngtcp2_conn_shutdown_stream_write(quic_connection_, 0, stream_id,
 1143|    211|                                              reset.application_error_code() & scenario_limits::kMaxQuicVarint);
 1144|    211|      ++next_action_;
 1145|    211|      return progress + 1;
 1146|    211|    }
 1147|       |
 1148|    615|    if (action.has_goaway()) {
  ------------------
  |  Branch (1148:9): [True: 290, False: 325]
  ------------------
 1149|    290|      const std::int64_t control_stream_id = StreamForRole(curl::fuzzer::proto::HTTP3_STREAM_CONTROL);
 1150|    290|      if (control_stream_id == kNoStreamId) {
  ------------------
  |  Branch (1150:11): [True: 0, False: 290]
  ------------------
 1151|      0|        return progress;
 1152|      0|      }
 1153|       |      // HTTP/3 GOAWAY is a raw control-stream frame so its identifier remains
 1154|       |      // directly mutation-controlled instead of being selected by nghttp3.
 1155|    290|      std::string payload;
 1156|    290|      AppendQuicVarint(&payload, action.goaway().id());
 1157|    290|      std::string frame;
 1158|    290|      AppendQuicVarint(&frame, 0x07U);
 1159|    290|      AppendQuicVarint(&frame, payload.size());
 1160|    290|      frame.append(payload);
 1161|    290|      QueueWrite(control_stream_id, std::move(frame), false, false, true);
 1162|    290|      return progress + 1;
 1163|    290|    }
 1164|       |
 1165|    325|    if (action.has_connection_close()) {
  ------------------
  |  Branch (1165:9): [True: 325, False: 0]
  ------------------
 1166|    325|      close_error_code_ = action.connection_close().application_error_code() & scenario_limits::kMaxQuicVarint;
 1167|    325|      close_requested_ = true;
 1168|    325|      ++next_action_;
 1169|    325|      return progress + 1;
 1170|    325|    }
 1171|       |
 1172|      0|    ++next_action_;
 1173|      0|    return progress + 1;
 1174|    325|  }
_ZNK12proto_fuzzer19Http3MockServerImpl12PendingWrite6activeEv:
  424|  91.8k|    bool active() const { return stream_id != kNoStreamId; }
_ZN12proto_fuzzer19Http3MockServerImpl17FlushPendingWriteEPm:
 1192|  8.00k|  WriteResult FlushPendingWrite(std::size_t* progress) {
 1193|  8.00k|    if (!pending_write_.active()) {
  ------------------
  |  Branch (1193:9): [True: 0, False: 8.00k]
  ------------------
 1194|      0|      return WriteResult::kComplete;
 1195|      0|    }
 1196|       |
 1197|  8.00k|    if (pending_write_.bytes == nullptr || pending_write_.offset > pending_write_.bytes->size()) {
  ------------------
  |  Branch (1197:9): [True: 0, False: 8.00k]
  |  Branch (1197:44): [True: 0, False: 8.00k]
  ------------------
 1198|      0|      pending_write_.Clear();
 1199|      0|      return WriteResult::kFailed;
 1200|      0|    }
 1201|       |
 1202|  8.00k|    const std::size_t remaining = pending_write_.bytes->size() - pending_write_.offset;
 1203|  8.00k|    if (remaining == 0 && !pending_write_.finish_stream) {
  ------------------
  |  Branch (1203:9): [True: 272, False: 7.73k]
  |  Branch (1203:27): [True: 268, False: 4]
  ------------------
 1204|    268|      pending_write_.Clear();
 1205|    268|      ++*progress;
 1206|    268|      return WriteResult::kComplete;
 1207|    268|    }
 1208|       |
 1209|  7.73k|    ngtcp2_vec vector = {};
 1210|  7.73k|    vector.base =
 1211|  7.73k|        reinterpret_cast<std::uint8_t*>(const_cast<char*>(pending_write_.bytes->data() + pending_write_.offset));
 1212|  7.73k|    vector.len = remaining;
 1213|  7.73k|    const std::size_t vector_count = remaining == 0 ? 0 : 1;
  ------------------
  |  Branch (1213:38): [True: 4, False: 7.73k]
  ------------------
 1214|  7.73k|    const std::uint32_t flags =
 1215|  7.73k|        pending_write_.finish_stream ? NGTCP2_WRITE_STREAM_FLAG_FIN : NGTCP2_WRITE_STREAM_FLAG_NONE;
  ------------------
  |  | 5242|    585|#define NGTCP2_WRITE_STREAM_FLAG_FIN 0x02U
  ------------------
                      pending_write_.finish_stream ? NGTCP2_WRITE_STREAM_FLAG_FIN : NGTCP2_WRITE_STREAM_FLAG_NONE;
  ------------------
  |  | 5226|  7.15k|#define NGTCP2_WRITE_STREAM_FLAG_NONE 0x00U
  ------------------
  |  Branch (1215:9): [True: 585, False: 7.15k]
  ------------------
 1216|  7.73k|    ngtcp2_path_storage output_path;
 1217|  7.73k|    ngtcp2_path_storage_zero(&output_path);
 1218|  7.73k|    ngtcp2_pkt_info packet_info = {};
 1219|  7.73k|    ngtcp2_ssize submitted = -1;
 1220|  7.73k|    const ngtcp2_tstamp now = QuicNow();
 1221|  7.73k|    const ngtcp2_ssize packet_length = ngtcp2_conn_writev_stream(
  ------------------
  |  | 7422|  7.73k|  ngtcp2_conn_writev_stream_versioned(                                         \
  |  | 7423|  7.73k|    (CONN), (PATH), NGTCP2_PKT_INFO_VERSION, (PI), (DEST), (DESTLEN),          \
  |  |  ------------------
  |  |  |  |  506|  7.73k|#define NGTCP2_PKT_INFO_VERSION NGTCP2_PKT_INFO_V1
  |  |  |  |  ------------------
  |  |  |  |  |  |  505|  7.73k|#define NGTCP2_PKT_INFO_V1 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 7424|  15.4k|    (PDATALEN), (FLAGS), (STREAM_ID), (DATAV), (DATAVCNT), (TS))
  |  |  ------------------
  |  |  |  Branch (7424:40): [True: 4, False: 7.73k]
  |  |  ------------------
  ------------------
 1222|  7.73k|        quic_connection_, &output_path.path, &packet_info, packet_buffer_.data(), packet_buffer_.size(), &submitted,
 1223|  7.73k|        flags, pending_write_.stream_id, vector_count == 0 ? nullptr : &vector, vector_count, now);
 1224|  7.73k|    if (packet_length == NGTCP2_ERR_STREAM_DATA_BLOCKED) {
  ------------------
  |  |  583|  7.73k|#define NGTCP2_ERR_STREAM_DATA_BLOCKED -208
  ------------------
  |  Branch (1224:9): [True: 0, False: 7.73k]
  ------------------
 1225|      0|      return WriteResult::kBlocked;
 1226|      0|    }
 1227|  7.73k|    if (packet_length == NGTCP2_ERR_STREAM_SHUT_WR || packet_length == NGTCP2_ERR_STREAM_NOT_FOUND) {
  ------------------
  |  |  657|  15.4k|#define NGTCP2_ERR_STREAM_SHUT_WR -219
  ------------------
                  if (packet_length == NGTCP2_ERR_STREAM_SHUT_WR || packet_length == NGTCP2_ERR_STREAM_NOT_FOUND) {
  ------------------
  |  |  664|  7.73k|#define NGTCP2_ERR_STREAM_NOT_FOUND -220
  ------------------
  |  Branch (1227:9): [True: 0, False: 7.73k]
  |  Branch (1227:55): [True: 0, False: 7.73k]
  ------------------
 1228|      0|      pending_write_.Clear();
 1229|      0|      return WriteResult::kFailed;
 1230|      0|    }
 1231|  7.73k|    if (packet_length < 0) {
  ------------------
  |  Branch (1231:9): [True: 0, False: 7.73k]
  ------------------
 1232|      0|      transport_failed_ = true;
 1233|      0|      pending_write_.Clear();
 1234|      0|      return WriteResult::kFailed;
 1235|      0|    }
 1236|  7.73k|    if (packet_length == 0) {
  ------------------
  |  Branch (1236:9): [True: 2, False: 7.73k]
  ------------------
 1237|      2|      return WriteResult::kBlocked;
 1238|      2|    }
 1239|  7.73k|    ngtcp2_conn_update_pkt_tx_time(quic_connection_, now);
 1240|  7.73k|    (void)SendPacket(output_path.path, packet_buffer_.data(), static_cast<std::size_t>(packet_length));
 1241|  7.73k|    ++*progress;
 1242|  7.73k|    if (transport_failed_) {
  ------------------
  |  Branch (1242:9): [True: 0, False: 7.73k]
  ------------------
 1243|      0|      pending_write_.Clear();
 1244|      0|      return WriteResult::kFailed;
 1245|      0|    }
 1246|       |
 1247|  7.73k|    if (submitted >= 0) {
  ------------------
  |  Branch (1247:9): [True: 7.73k, False: 0]
  ------------------
 1248|  7.73k|      StreamState* stream = FindStream(pending_write_.stream_id);
 1249|  7.73k|      if (stream == nullptr || static_cast<std::uint64_t>(submitted) > UINT64_MAX - stream->write_offset) {
  ------------------
  |  Branch (1249:11): [True: 0, False: 7.73k]
  |  Branch (1249:32): [True: 0, False: 7.73k]
  ------------------
 1250|      0|        transport_failed_ = true;
 1251|      0|        pending_write_.Clear();
 1252|      0|        return WriteResult::kFailed;
 1253|      0|      }
 1254|  7.73k|      const std::uint64_t write_begin = stream->write_offset;
 1255|  7.73k|      stream->write_offset += static_cast<std::uint64_t>(submitted);
 1256|  7.73k|      if (pending_write_.nghttp3_managed) {
  ------------------
  |  Branch (1256:11): [True: 7.33k, False: 395]
  ------------------
 1257|  7.33k|        if (nghttp3_conn_add_write_offset(http3_connection_, pending_write_.stream_id,
  ------------------
  |  Branch (1257:13): [True: 0, False: 7.33k]
  ------------------
 1258|  7.33k|                                          static_cast<std::uint64_t>(submitted)) != 0) {
 1259|      0|          http3_failed_ = true;
 1260|      0|          pending_write_.Clear();
 1261|      0|          return WriteResult::kFailed;
 1262|      0|        }
 1263|  7.33k|        if (submitted != 0) {
  ------------------
  |  Branch (1263:13): [True: 7.33k, False: 0]
  ------------------
 1264|  7.33k|          stream->managed_write_ranges.push_back({write_begin, stream->write_offset});
 1265|  7.33k|        } else if (pending_write_.finish_stream && pending_write_.offset == pending_write_.bytes->size()) {
  ------------------
  |  Branch (1265:20): [True: 0, False: 0]
  |  Branch (1265:52): [True: 0, False: 0]
  ------------------
 1266|      0|          stream->managed_fin_offsets.push_back(write_begin);
 1267|      0|        }
 1268|  7.33k|      }
 1269|  7.73k|      pending_write_.offset += static_cast<std::size_t>(submitted);
 1270|  7.73k|    }
 1271|  7.73k|    if (submitted < 0 || pending_write_.offset != pending_write_.bytes->size()) {
  ------------------
  |  Branch (1271:9): [True: 0, False: 7.73k]
  |  Branch (1271:26): [True: 248, False: 7.48k]
  ------------------
 1272|    248|      return WriteResult::kBlocked;
 1273|    248|    }
 1274|  7.48k|    pending_write_.Clear();
 1275|  7.48k|    return WriteResult::kComplete;
 1276|  7.73k|  }
_ZN12proto_fuzzer19Http3MockServerImpl10SendPacketERK11ngtcp2_pathPKhm:
  892|  14.1k|  bool SendPacket(const ngtcp2_path& path, const std::uint8_t* data, std::size_t length) {
  893|  14.1k|    const ngtcp2_addr* destination = &path.remote;
  894|  14.1k|    if (destination->addr == nullptr || destination->addrlen == 0) {
  ------------------
  |  Branch (894:9): [True: 0, False: 14.1k]
  |  Branch (894:41): [True: 0, False: 14.1k]
  ------------------
  895|      0|      destination = &path_storage_.path.remote;
  896|      0|    }
  897|  14.1k|    const ssize_t sent = ::sendto(server_fd_, data, length, 0,
  898|  14.1k|                                  reinterpret_cast<const struct sockaddr*>(destination->addr), destination->addrlen);
  899|  14.1k|    if (sent == static_cast<ssize_t>(length)) {
  ------------------
  |  Branch (899:9): [True: 14.1k, False: 0]
  ------------------
  900|  14.1k|      return true;
  901|  14.1k|    }
  902|      0|    if (sent < 0 && (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)) {
  ------------------
  |  Branch (902:9): [True: 0, False: 0]
  |  Branch (902:22): [True: 0, False: 0]
  |  Branch (902:41): [True: 0, False: 0]
  |  Branch (902:65): [True: 0, False: 0]
  ------------------
  903|      0|      return false;
  904|      0|    }
  905|      0|    transport_failed_ = true;
  906|      0|    return false;
  907|      0|  }
_ZN12proto_fuzzer19Http3MockServerImpl11PumpNghttp3EPm:
 1281|  37.9k|  bool PumpNghttp3(std::size_t* progress) {
 1282|  37.9k|    if (http3_connection_ == nullptr || http3_failed_) {
  ------------------
  |  Branch (1282:9): [True: 0, False: 37.9k]
  |  Branch (1282:41): [True: 0, False: 37.9k]
  ------------------
 1283|      0|      return true;
 1284|      0|    }
 1285|       |
 1286|  45.0k|    for (std::size_t operation = 0; operation < kMaxWritesPerTurn; ++operation) {
  ------------------
  |  Branch (1286:37): [True: 45.0k, False: 0]
  ------------------
 1287|  45.0k|      if (pending_write_.active()) {
  ------------------
  |  Branch (1287:11): [True: 7.13k, False: 37.9k]
  ------------------
 1288|  7.13k|        if (!pending_write_.nghttp3_managed) {
  ------------------
  |  Branch (1288:13): [True: 0, False: 7.13k]
  ------------------
 1289|      0|          return false;
 1290|      0|        }
 1291|  7.13k|        const WriteResult result = FlushPendingWrite(progress);
 1292|  7.13k|        if (result == WriteResult::kBlocked) {
  ------------------
  |  Branch (1292:13): [True: 42, False: 7.09k]
  ------------------
 1293|     42|          return false;
 1294|     42|        }
 1295|  7.09k|        if (result == WriteResult::kFailed) {
  ------------------
  |  Branch (1295:13): [True: 0, False: 7.09k]
  ------------------
 1296|      0|          http3_failed_ = true;
 1297|      0|          return true;
 1298|      0|        }
 1299|  7.09k|      }
 1300|       |
 1301|  45.0k|      std::array<nghttp3_vec, 16> vectors;
 1302|  45.0k|      std::int64_t stream_id = -1;
 1303|  45.0k|      int finish_stream = 0;
 1304|  45.0k|      const nghttp3_ssize vector_count =
 1305|  45.0k|          nghttp3_conn_writev_stream(http3_connection_, &stream_id, &finish_stream, vectors.data(), vectors.size());
 1306|  45.0k|      if (vector_count < 0) {
  ------------------
  |  Branch (1306:11): [True: 0, False: 45.0k]
  ------------------
 1307|      0|        http3_failed_ = true;
 1308|      0|        return true;
 1309|      0|      }
 1310|  45.0k|      if (vector_count == 0 && stream_id == -1) {
  ------------------
  |  Branch (1310:11): [True: 37.8k, False: 7.13k]
  |  Branch (1310:32): [True: 37.8k, False: 0]
  ------------------
 1311|  37.8k|        return true;
 1312|  37.8k|      }
 1313|       |
 1314|  7.13k|      StreamState* stream = FindStream(stream_id);
 1315|  7.13k|      if (stream == nullptr) {
  ------------------
  |  Branch (1315:11): [True: 0, False: 7.13k]
  ------------------
 1316|      0|        http3_failed_ = true;
 1317|      0|        return true;
 1318|      0|      }
 1319|       |
 1320|  7.13k|      std::string bytes;
 1321|  7.13k|      if (vector_count > 0) {
  ------------------
  |  Branch (1321:11): [True: 7.13k, False: 0]
  ------------------
 1322|  7.13k|        std::size_t total = 0;
 1323|  14.5k|        for (nghttp3_ssize index = 0; index < vector_count; ++index) {
  ------------------
  |  Branch (1323:39): [True: 7.36k, False: 7.13k]
  ------------------
 1324|  7.36k|          if (vectors[static_cast<std::size_t>(index)].len > kMaxPendingPlaintextBytes - total) {
  ------------------
  |  Branch (1324:15): [True: 0, False: 7.36k]
  ------------------
 1325|      0|            http3_failed_ = true;
 1326|      0|            return true;
 1327|      0|          }
 1328|  7.36k|          total += vectors[static_cast<std::size_t>(index)].len;
 1329|  7.36k|        }
 1330|  7.13k|        bytes.reserve(total);
 1331|  14.5k|        for (nghttp3_ssize index = 0; index < vector_count; ++index) {
  ------------------
  |  Branch (1331:39): [True: 7.36k, False: 7.13k]
  ------------------
 1332|  7.36k|          const nghttp3_vec& vector = vectors[static_cast<std::size_t>(index)];
 1333|  7.36k|          bytes.append(reinterpret_cast<const char*>(vector.base), vector.len);
 1334|  7.36k|        }
 1335|  7.13k|      }
 1336|       |
 1337|  7.13k|      QueueWrite(stream->id, std::move(bytes), finish_stream != 0, true, false);
 1338|  7.13k|    }
 1339|      0|    return false;
 1340|  37.9k|  }
_ZN12proto_fuzzer19Http3MockServerImpl24SubmitStructuredResponseERKN4curl6fuzzer5proto13Http3ResponseE:
 1344|  1.37k|  bool SubmitStructuredResponse(const curl::fuzzer::proto::Http3Response& response) {
 1345|  1.37k|    if (http3_connection_ == nullptr || http3_failed_ || role_stream_ids_[kResponseStream] == kNoStreamId) {
  ------------------
  |  Branch (1345:9): [True: 0, False: 1.37k]
  |  Branch (1345:41): [True: 0, False: 1.37k]
  |  Branch (1345:58): [True: 0, False: 1.37k]
  ------------------
 1346|      0|      return false;
 1347|      0|    }
 1348|       |
 1349|  1.37k|    const std::uint32_t status_code = NormalizeResponseStatus(response.status_code());
 1350|  1.37k|    std::vector<std::pair<std::string, std::string>> fields;
 1351|  1.37k|    fields.reserve(1 + std::min<std::size_t>(scenario_limits::kMaxHttp3Headers, response.response_headers_size()));
 1352|  1.37k|    fields.emplace_back(":status", std::to_string(status_code));
 1353|  1.37k|    AppendHeaders(&fields, response.response_headers(), scenario_limits::kMaxHttp3Headers);
 1354|  1.37k|    const std::vector<nghttp3_nv> name_values = MakeNameValues(fields);
 1355|  1.37k|    const std::int64_t response_stream_id = static_cast<std::int64_t>(role_stream_ids_[kResponseStream]);
 1356|       |
 1357|  1.37k|    if (status_code < 200U) {
  ------------------
  |  Branch (1357:9): [True: 559, False: 817]
  ------------------
 1358|    559|      return nghttp3_conn_submit_info(http3_connection_, response_stream_id, name_values.data(), name_values.size()) ==
 1359|    559|             0;
 1360|    559|    }
 1361|    817|    if (final_response_submitted_) {
  ------------------
  |  Branch (1361:9): [True: 175, False: 642]
  ------------------
 1362|    175|      return false;
 1363|    175|    }
 1364|       |
 1365|    642|    response_body_.chunks.clear();
 1366|    642|    response_body_.next_chunk = 0;
 1367|    642|    response_body_.finish_stream = response.finish_stream();
 1368|    642|    response_body_.has_trailers = response.response_trailers_size() != 0;
 1369|    642|    std::size_t body_bytes = 0;
 1370|    642|    const std::size_t body_chunks =
 1371|    642|        std::min<std::size_t>(scenario_limits::kMaxHttp3BodyChunks, response.body_chunks_size());
 1372|    642|    response_body_.chunks.reserve(body_chunks);
 1373|    828|    for (std::size_t index = 0; index < body_chunks && body_bytes < scenario_limits::kMaxHttp3BodyBytes; ++index) {
  ------------------
  |  Branch (1373:33): [True: 186, False: 642]
  |  Branch (1373:56): [True: 186, False: 0]
  ------------------
 1374|    186|      const std::string& source = response.body_chunks(static_cast<int>(index));
 1375|    186|      const std::size_t length = std::min(source.size(), scenario_limits::kMaxHttp3BodyBytes - body_bytes);
 1376|    186|      response_body_.chunks.emplace_back(source.data(), length);
 1377|    186|      body_bytes += length;
 1378|    186|    }
 1379|       |
 1380|    642|    nghttp3_data_reader reader = {};
 1381|    642|    reader.read_data = &ReadResponseBody;
 1382|    642|    if (nghttp3_conn_submit_response(http3_connection_, response_stream_id, name_values.data(), name_values.size(),
  ------------------
  |  Branch (1382:9): [True: 1, False: 641]
  ------------------
 1383|    642|                                     &reader) != 0) {
 1384|      1|      return false;
 1385|      1|    }
 1386|    641|    final_response_submitted_ = true;
 1387|       |
 1388|    641|    if (response_body_.has_trailers) {
  ------------------
  |  Branch (1388:9): [True: 49, False: 592]
  ------------------
 1389|     49|      std::vector<std::pair<std::string, std::string>> trailers;
 1390|     49|      trailers.reserve(std::min<std::size_t>(scenario_limits::kMaxHttp3Trailers, response.response_trailers_size()));
 1391|     49|      AppendHeaders(&trailers, response.response_trailers(), scenario_limits::kMaxHttp3Trailers);
 1392|     49|      const std::vector<nghttp3_nv> trailer_values = MakeNameValues(trailers);
 1393|     49|      if (nghttp3_conn_submit_trailers(http3_connection_, response_stream_id, trailer_values.data(),
  ------------------
  |  Branch (1393:11): [True: 0, False: 49]
  ------------------
 1394|     49|                                       trailer_values.size()) != 0) {
 1395|      0|        http3_failed_ = true;
 1396|      0|      }
 1397|     49|    }
 1398|    641|    return true;
 1399|    642|  }
_ZN12proto_fuzzer19Http3MockServerImpl13AppendHeadersIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto11Http3HeaderEEEEEvPNSt3__16vectorINSA_4pairINSA_12basic_stringIcNSA_11char_traitsIcEENSA_9allocatorIcEEEESI_EENSG_ISJ_EEEERKT_m:
 1403|  1.42k|                            const RepeatedHeaders& source, std::size_t count_limit) {
 1404|  1.42k|    std::size_t remaining = scenario_limits::kMaxHttp3HeaderBytes;
 1405|  1.42k|    const std::size_t count = std::min<std::size_t>(count_limit, source.size());
 1406|  2.88k|    for (std::size_t index = 0; index < count && remaining != 0; ++index) {
  ------------------
  |  Branch (1406:33): [True: 1.45k, False: 1.42k]
  |  Branch (1406:50): [True: 1.45k, False: 0]
  ------------------
 1407|  1.45k|      std::string name = NormalizeHeaderName(source.Get(static_cast<int>(index)).name());
 1408|  1.45k|      std::string value = NormalizeHeaderValue(source.Get(static_cast<int>(index)).value());
 1409|  1.45k|      if (name.size() > remaining) {
  ------------------
  |  Branch (1409:11): [True: 0, False: 1.45k]
  ------------------
 1410|      0|        name.resize(remaining);
 1411|      0|        value.clear();
 1412|  1.45k|      } else if (value.size() > remaining - name.size()) {
  ------------------
  |  Branch (1412:18): [True: 0, False: 1.45k]
  ------------------
 1413|      0|        value.resize(remaining - name.size());
 1414|      0|      }
 1415|  1.45k|      remaining -= name.size() + value.size();
 1416|  1.45k|      destination->emplace_back(std::move(name), std::move(value));
 1417|  1.45k|    }
 1418|  1.42k|  }
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_119NormalizeHeaderNameERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  258|  1.45k|std::string NormalizeHeaderName(const std::string& source) {
  259|  1.45k|  std::string result = source.substr(0, scenario_limits::kMaxHttp3HeaderNameBytes);
  260|  1.45k|  if (result.empty()) {
  ------------------
  |  Branch (260:7): [True: 0, False: 1.45k]
  ------------------
  261|      0|    return "x-fuzz";
  262|      0|  }
  263|  17.9k|  for (char& byte : result) {
  ------------------
  |  Branch (263:19): [True: 17.9k, False: 1.45k]
  ------------------
  264|  17.9k|    const unsigned char value = static_cast<unsigned char>(byte);
  265|  17.9k|    const bool lower = value >= 'a' && value <= 'z';
  ------------------
  |  Branch (265:24): [True: 6.32k, False: 11.6k]
  |  Branch (265:40): [True: 5.80k, False: 519]
  ------------------
  266|  17.9k|    const bool upper = value >= 'A' && value <= 'Z';
  ------------------
  |  Branch (266:24): [True: 7.08k, False: 10.8k]
  |  Branch (266:40): [True: 0, False: 7.08k]
  ------------------
  267|  17.9k|    const bool digit = value >= '0' && value <= '9';
  ------------------
  |  Branch (267:24): [True: 8.70k, False: 9.24k]
  |  Branch (267:40): [True: 1.62k, False: 7.08k]
  ------------------
  268|  17.9k|    const bool punctuation = value == '!' || value == '#' || value == '$' || value == '%' || value == '&' ||
  ------------------
  |  Branch (268:30): [True: 254, False: 17.6k]
  |  Branch (268:46): [True: 404, False: 17.2k]
  |  Branch (268:62): [True: 413, False: 16.8k]
  |  Branch (268:78): [True: 1.04k, False: 15.8k]
  |  Branch (268:94): [True: 304, False: 15.5k]
  ------------------
  269|  15.5k|                             value == '\'' || value == '*' || value == '+' || value == '-' || value == '.' ||
  ------------------
  |  Branch (269:30): [True: 201, False: 15.3k]
  |  Branch (269:47): [True: 299, False: 15.0k]
  |  Branch (269:63): [True: 129, False: 14.9k]
  |  Branch (269:79): [True: 6.07k, False: 8.83k]
  |  Branch (269:95): [True: 127, False: 8.70k]
  ------------------
  270|  8.70k|                             value == '^' || value == '_' || value == '`' || value == '|' || value == '~';
  ------------------
  |  Branch (270:30): [True: 27, False: 8.68k]
  |  Branch (270:46): [True: 252, False: 8.42k]
  |  Branch (270:62): [True: 480, False: 7.94k]
  |  Branch (270:78): [True: 62, False: 7.88k]
  |  Branch (270:94): [True: 457, False: 7.43k]
  ------------------
  271|  17.9k|    if (upper) {
  ------------------
  |  Branch (271:9): [True: 0, False: 17.9k]
  ------------------
  272|      0|      byte = static_cast<char>(value - 'A' + 'a');
  273|  17.9k|    } else if (!lower && !digit && !punctuation) {
  ------------------
  |  Branch (273:16): [True: 12.1k, False: 5.80k]
  |  Branch (273:26): [True: 10.5k, False: 1.62k]
  |  Branch (273:36): [True: 0, False: 10.5k]
  ------------------
  274|      0|      byte = '-';
  275|      0|    }
  276|  17.9k|  }
  277|  1.45k|  return result;
  278|  1.45k|}
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_120NormalizeHeaderValueERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  281|  1.45k|std::string NormalizeHeaderValue(const std::string& source) {
  282|  1.45k|  std::string result = source.substr(0, scenario_limits::kMaxHttp3HeaderValueBytes);
  283|   273k|  for (char& byte : result) {
  ------------------
  |  Branch (283:19): [True: 273k, False: 1.45k]
  ------------------
  284|   273k|    const unsigned char value = static_cast<unsigned char>(byte);
  285|   273k|    if ((value < 0x20U && value != '\t') || value == 0x7fU) {
  ------------------
  |  Branch (285:10): [True: 1.34k, False: 272k]
  |  Branch (285:27): [True: 0, False: 1.34k]
  |  Branch (285:45): [True: 0, False: 273k]
  ------------------
  286|      0|      byte = ' ';
  287|      0|    }
  288|   273k|  }
  289|  1.45k|  return result;
  290|  1.45k|}
_ZN12proto_fuzzer19Http3MockServerImpl14MakeNameValuesERKNSt3__16vectorINS1_4pairINS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES9_EENS7_ISA_EEEE:
 1420|  1.42k|  static std::vector<nghttp3_nv> MakeNameValues(const std::vector<std::pair<std::string, std::string>>& fields) {
 1421|  1.42k|    std::vector<nghttp3_nv> name_values;
 1422|  1.42k|    name_values.reserve(fields.size());
 1423|  2.83k|    for (const auto& field : fields) {
  ------------------
  |  Branch (1423:28): [True: 2.83k, False: 1.42k]
  ------------------
 1424|  2.83k|      nghttp3_nv name_value = {};
 1425|  2.83k|      name_value.name = reinterpret_cast<std::uint8_t*>(const_cast<char*>(field.first.data()));
 1426|  2.83k|      name_value.value = reinterpret_cast<std::uint8_t*>(const_cast<char*>(field.second.data()));
 1427|  2.83k|      name_value.namelen = field.first.size();
 1428|  2.83k|      name_value.valuelen = field.second.size();
 1429|  2.83k|      name_value.flags = NGHTTP3_NV_FLAG_NONE;
  ------------------
  |  |  766|  2.83k|#define NGHTTP3_NV_FLAG_NONE 0x00U
  ------------------
 1430|  2.83k|      name_values.push_back(name_value);
 1431|  2.83k|    }
 1432|  1.42k|    return name_values;
 1433|  1.42k|  }
_ZN12proto_fuzzer19Http3MockServerImpl16ReadResponseBodyEP12nghttp3_connlP11nghttp3_vecmPjPvS6_:
 1515|    736|                                        void* /*stream_user_data*/) {
 1516|    736|    auto* self = static_cast<Http3MockServerImpl*>(user_data);
 1517|    736|    if (self == nullptr || vectors == nullptr || vector_count == 0 || flags == nullptr) {
  ------------------
  |  Branch (1517:9): [True: 0, False: 736]
  |  Branch (1517:28): [True: 0, False: 736]
  |  Branch (1517:50): [True: 0, False: 736]
  |  Branch (1517:71): [True: 0, False: 736]
  ------------------
 1518|      0|      return NGHTTP3_ERR_CALLBACK_FAILURE;
  ------------------
  |  |  358|      0|#define NGHTTP3_ERR_CALLBACK_FAILURE -902
  ------------------
 1519|      0|    }
 1520|       |
 1521|    772|    while (self->response_body_.next_chunk < self->response_body_.chunks.size() &&
  ------------------
  |  Branch (1521:12): [True: 169, False: 603]
  ------------------
 1522|    169|           self->response_body_.chunks[self->response_body_.next_chunk].empty()) {
  ------------------
  |  Branch (1522:12): [True: 36, False: 133]
  ------------------
 1523|     36|      ++self->response_body_.next_chunk;
 1524|     36|    }
 1525|    736|    if (self->response_body_.next_chunk == self->response_body_.chunks.size()) {
  ------------------
  |  Branch (1525:9): [True: 603, False: 133]
  ------------------
 1526|    603|      *flags = NGHTTP3_DATA_FLAG_EOF;
  ------------------
  |  | 2990|    603|#define NGHTTP3_DATA_FLAG_EOF 0x01U
  ------------------
 1527|    603|      if (!self->response_body_.finish_stream && !self->response_body_.has_trailers) {
  ------------------
  |  Branch (1527:11): [True: 109, False: 494]
  |  Branch (1527:50): [True: 76, False: 33]
  ------------------
 1528|     76|        *flags |= NGHTTP3_DATA_FLAG_NO_END_STREAM;
  ------------------
  |  | 3002|     76|#define NGHTTP3_DATA_FLAG_NO_END_STREAM 0x02U
  ------------------
 1529|     76|      }
 1530|    603|      return 0;
 1531|    603|    }
 1532|       |
 1533|    133|    const std::string& chunk = self->response_body_.chunks[self->response_body_.next_chunk++];
 1534|    133|    vectors[0].base = reinterpret_cast<std::uint8_t*>(const_cast<char*>(chunk.data()));
 1535|    133|    vectors[0].len = chunk.size();
 1536|    133|    *flags = NGHTTP3_DATA_FLAG_NONE;
  ------------------
  |  | 2980|    133|#define NGHTTP3_DATA_FLAG_NONE 0x00U
  ------------------
 1537|    133|    if (self->response_body_.next_chunk == self->response_body_.chunks.size()) {
  ------------------
  |  Branch (1537:9): [True: 35, False: 98]
  ------------------
 1538|     35|      *flags |= NGHTTP3_DATA_FLAG_EOF;
  ------------------
  |  | 2990|     35|#define NGHTTP3_DATA_FLAG_EOF 0x01U
  ------------------
 1539|     35|      if (!self->response_body_.finish_stream && !self->response_body_.has_trailers) {
  ------------------
  |  Branch (1539:11): [True: 24, False: 11]
  |  Branch (1539:50): [True: 19, False: 5]
  ------------------
 1540|     19|        *flags |= NGHTTP3_DATA_FLAG_NO_END_STREAM;
  ------------------
  |  | 3002|     19|#define NGHTTP3_DATA_FLAG_NO_END_STREAM 0x02U
  ------------------
 1541|     19|      }
 1542|     35|    }
 1543|    133|    return 1;
 1544|    736|  }
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_123NormalizeResponseStatusEj:
  293|  1.37k|std::uint32_t NormalizeResponseStatus(std::uint32_t status_code) {
  294|  1.37k|  return status_code >= 100U && status_code <= 599U ? status_code : 100U + status_code % 500U;
  ------------------
  |  Branch (294:10): [True: 1.37k, False: 0]
  |  Branch (294:33): [True: 1.37k, False: 0]
  ------------------
  295|  1.37k|}
_ZN12proto_fuzzer19Http3MockServerImpl13StreamForRoleEN4curl6fuzzer5proto15Http3StreamRoleE:
 1444|    865|  std::int64_t StreamForRole(curl::fuzzer::proto::Http3StreamRole role) {
 1445|    865|    const int role_value = static_cast<int>(role);
 1446|    865|    if (role_value < 0 || role_value >= static_cast<int>(kStreamRoleCount)) {
  ------------------
  |  Branch (1446:9): [True: 0, False: 865]
  |  Branch (1446:27): [True: 0, False: 865]
  ------------------
 1447|      0|      return kNoStreamId;
 1448|      0|    }
 1449|    865|    return role_stream_ids_[static_cast<std::size_t>(role_value)];
 1450|    865|  }
_ZN12proto_fuzzer19Http3MockServerImpl10QueueWriteElNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEbbb:
 1179|  7.78k|                  bool completes_action) {
 1180|  7.78k|    retained_writes_.push_back(std::make_unique<std::string>(std::move(bytes)));
 1181|  7.78k|    pending_write_.stream_id = stream_id;
 1182|  7.78k|    pending_write_.bytes = retained_writes_.back().get();
 1183|  7.78k|    pending_write_.offset = 0;
 1184|  7.78k|    pending_write_.finish_stream = finish_stream;
 1185|  7.78k|    pending_write_.nghttp3_managed = nghttp3_managed;
 1186|  7.78k|    pending_write_.completes_action = completes_action;
 1187|  7.78k|  }
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_116AppendQuicVarintEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEm:
  234|    870|void AppendQuicVarint(std::string* output, std::uint64_t value) {
  235|    870|  value &= scenario_limits::kMaxQuicVarint;
  236|    876|  for (std::size_t encoding = 0; encoding < kQuicVarintByteWidths.size(); ++encoding) {
  ------------------
  |  Branch (236:34): [True: 876, False: 0]
  ------------------
  237|    876|    const std::size_t byte_width = kQuicVarintByteWidths[encoding];
  238|    876|    const unsigned int value_bits = static_cast<unsigned int>(byte_width * CHAR_BIT - kQuicVarintTagBits);
  239|    876|    if (value >= (std::uint64_t{1} << value_bits)) {
  ------------------
  |  Branch (239:9): [True: 6, False: 870]
  ------------------
  240|      6|      continue;
  241|      6|    }
  242|       |
  243|  1.75k|    for (std::size_t byte = byte_width; byte != 0; --byte) {
  ------------------
  |  Branch (243:41): [True: 884, False: 870]
  ------------------
  244|    884|      const unsigned int shift = static_cast<unsigned int>((byte - 1) * CHAR_BIT);
  245|    884|      unsigned char encoded_byte = static_cast<unsigned char>(value >> shift);
  246|    884|      if (byte == byte_width) {
  ------------------
  |  Branch (246:11): [True: 870, False: 14]
  ------------------
  247|    870|        encoded_byte |= static_cast<unsigned char>(encoding << kQuicVarintTagShift);
  248|    870|      }
  249|    884|      output->push_back(static_cast<char>(encoded_byte));
  250|    884|    }
  251|    870|    return;
  252|    876|  }
  253|    870|}
_ZN12proto_fuzzer19Http3MockServerImpl21FlushTransportPacketsEv:
  911|  42.9k|  std::size_t FlushTransportPackets() {
  912|  42.9k|    if (quic_connection_ == nullptr || transport_failed_ || close_sent_) {
  ------------------
  |  Branch (912:9): [True: 0, False: 42.9k]
  |  Branch (912:40): [True: 0, False: 42.9k]
  |  Branch (912:61): [True: 322, False: 42.6k]
  ------------------
  913|    322|      return 0;
  914|    322|    }
  915|       |
  916|  42.6k|    if (close_requested_) {
  ------------------
  |  Branch (916:9): [True: 325, False: 42.3k]
  ------------------
  917|    325|      ngtcp2_ccerr error;
  918|    325|      ngtcp2_ccerr_default(&error);
  919|    325|      ngtcp2_ccerr_set_application_error(&error, close_error_code_, nullptr, 0);
  920|    325|      ngtcp2_path_storage output_path;
  921|    325|      ngtcp2_path_storage_zero(&output_path);
  922|    325|      ngtcp2_pkt_info packet_info = {};
  923|    325|      const ngtcp2_tstamp now = QuicNow();
  924|    325|      const ngtcp2_ssize written = ngtcp2_conn_write_connection_close(
  ------------------
  |  | 7455|    325|  ngtcp2_conn_write_connection_close_versioned(                                \
  |  | 7456|    325|    (CONN), (PATH), NGTCP2_PKT_INFO_VERSION, (PI), (DEST), (DESTLEN), (CCERR), \
  |  |  ------------------
  |  |  |  |  506|    325|#define NGTCP2_PKT_INFO_VERSION NGTCP2_PKT_INFO_V1
  |  |  |  |  ------------------
  |  |  |  |  |  |  505|    325|#define NGTCP2_PKT_INFO_V1 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 7457|    325|    (TS))
  ------------------
  925|    325|          quic_connection_, &output_path.path, &packet_info, packet_buffer_.data(), packet_buffer_.size(), &error, now);
  926|    325|      if (written < 0) {
  ------------------
  |  Branch (926:11): [True: 0, False: 325]
  ------------------
  927|      0|        transport_failed_ = true;
  928|      0|        return 0;
  929|      0|      }
  930|    325|      close_sent_ = true;
  931|    325|      if (written == 0) {
  ------------------
  |  Branch (931:11): [True: 0, False: 325]
  ------------------
  932|      0|        return 1;
  933|      0|      }
  934|    325|      ngtcp2_conn_update_pkt_tx_time(quic_connection_, now);
  935|    325|      (void)SendPacket(output_path.path, packet_buffer_.data(), static_cast<std::size_t>(written));
  936|    325|      return 1;
  937|    325|    }
  938|       |
  939|  42.3k|    std::size_t progress = 0;
  940|  48.4k|    for (std::size_t packet = 0; packet < kMaxWritesPerTurn; ++packet) {
  ------------------
  |  Branch (940:34): [True: 48.4k, False: 0]
  ------------------
  941|  48.4k|      ngtcp2_path_storage output_path;
  942|  48.4k|      ngtcp2_path_storage_zero(&output_path);
  943|  48.4k|      ngtcp2_pkt_info packet_info = {};
  944|  48.4k|      const ngtcp2_tstamp now = QuicNow();
  945|  48.4k|      const ngtcp2_ssize written = ngtcp2_conn_write_pkt(quic_connection_, &output_path.path, &packet_info,
  ------------------
  |  | 7401|  48.4k|  ngtcp2_conn_write_pkt_versioned((CONN), (PATH), NGTCP2_PKT_INFO_VERSION,     \
  |  |  ------------------
  |  |  |  |  506|  48.4k|#define NGTCP2_PKT_INFO_VERSION NGTCP2_PKT_INFO_V1
  |  |  |  |  ------------------
  |  |  |  |  |  |  505|  48.4k|#define NGTCP2_PKT_INFO_V1 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 7402|  48.4k|                                  (PI), (DEST), (DESTLEN), (TS))
  ------------------
  946|  48.4k|                                                         packet_buffer_.data(), packet_buffer_.size(), now);
  947|  48.4k|      if (written < 0) {
  ------------------
  |  Branch (947:11): [True: 0, False: 48.4k]
  ------------------
  948|      0|        transport_failed_ = true;
  949|      0|        break;
  950|      0|      }
  951|  48.4k|      if (written == 0) {
  ------------------
  |  Branch (951:11): [True: 42.3k, False: 6.13k]
  ------------------
  952|  42.3k|        break;
  953|  42.3k|      }
  954|  6.13k|      ngtcp2_conn_update_pkt_tx_time(quic_connection_, now);
  955|  6.13k|      if (!SendPacket(output_path.path, packet_buffer_.data(), static_cast<std::size_t>(written))) {
  ------------------
  |  Branch (955:11): [True: 0, False: 6.13k]
  ------------------
  956|      0|        break;
  957|      0|      }
  958|  6.13k|      ++progress;
  959|  6.13k|    }
  960|  42.3k|    return progress;
  961|  42.6k|  }
_ZN12proto_fuzzer19Http3MockServerImplC2EN4curl6fuzzer5proto26TlsCertificateChainProfileE:
  311|  2.28k|      : context_(CreateTlsContext(certificate_chain)), crypto_connection_ref_{&GetQuicConnection, this} {
  312|  2.28k|    role_stream_ids_.fill(kNoStreamId);
  313|  2.28k|    streams_.reserve(kMaxStreams);
  314|  2.28k|    retained_writes_.reserve(kMaxWritesPerTurn);
  315|  2.28k|  }
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_116CreateTlsContextEN4curl6fuzzer5proto26TlsCertificateChainProfileE:
  215|  2.28k|SSL_CTX* CreateTlsContext(curl::fuzzer::proto::TlsCertificateChainProfile certificate_chain) {
  216|  2.28k|  OpenSslErrorQueueGuard error_guard;
  217|  2.28k|  SSL_CTX* context = SSL_CTX_new(TLS_server_method());
  218|  2.28k|  if (context == nullptr || !LoadCredentials(context, certificate_chain)) {
  ------------------
  |  Branch (218:7): [True: 0, False: 2.28k]
  |  Branch (218:29): [True: 0, False: 2.28k]
  ------------------
  219|      0|    SSL_CTX_free(context);
  220|      0|    return nullptr;
  221|      0|  }
  222|       |
  223|  2.28k|  if (SSL_CTX_set_min_proto_version(context, TLS1_3_VERSION) != 1 ||
  ------------------
  |  | 1668|  2.28k|    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL)
  |  |  ------------------
  |  |  |  | 1488|  2.28k|#define SSL_CTRL_SET_MIN_PROTO_VERSION 123
  |  |  ------------------
  ------------------
  |  Branch (223:7): [True: 0, False: 2.28k]
  ------------------
  224|  2.28k|      SSL_CTX_set_max_proto_version(context, TLS1_3_VERSION) != 1) {
  ------------------
  |  | 1670|  2.28k|    SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL)
  |  |  ------------------
  |  |  |  | 1489|  2.28k|#define SSL_CTRL_SET_MAX_PROTO_VERSION 124
  |  |  ------------------
  ------------------
  |  Branch (224:7): [True: 0, False: 2.28k]
  ------------------
  225|      0|    SSL_CTX_free(context);
  226|      0|    return nullptr;
  227|      0|  }
  228|  2.28k|  (void)SSL_CTX_set_options(context, SSL_OP_NO_COMPRESSION);
  ------------------
  |  |  433|  2.28k|#define SSL_OP_NO_COMPRESSION SSL_OP_BIT(17)
  |  |  ------------------
  |  |  |  |  389|  2.28k|#define SSL_OP_BIT(n) ((uint64_t)1 << (uint64_t)n)
  |  |  ------------------
  ------------------
  229|  2.28k|  SSL_CTX_set_alpn_select_cb(context, &SelectHttp3Alpn, nullptr);
  230|  2.28k|  return context;
  231|  2.28k|}
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_115LoadCredentialsEP10ssl_ctx_stN4curl6fuzzer5proto26TlsCertificateChainProfileE:
  179|  2.28k|bool LoadCredentials(SSL_CTX* context, curl::fuzzer::proto::TlsCertificateChainProfile certificate_chain) {
  180|  2.28k|  BIO* certificate_bio = BIO_new_mem_buf(tls_test_credentials::kCertificatePem, -1);
  181|  2.28k|  BIO* key_bio = BIO_new_mem_buf(tls_test_credentials::kPrivateKeyPem, -1);
  182|  2.28k|  if (certificate_bio == nullptr || key_bio == nullptr) {
  ------------------
  |  Branch (182:7): [True: 0, False: 2.28k]
  |  Branch (182:37): [True: 0, False: 2.28k]
  ------------------
  183|      0|    BIO_free(certificate_bio);
  184|      0|    BIO_free(key_bio);
  185|      0|    return false;
  186|      0|  }
  187|       |
  188|  2.28k|  X509* certificate = PEM_read_bio_X509(certificate_bio, nullptr, nullptr, nullptr);
  189|  2.28k|  EVP_PKEY* key = PEM_read_bio_PrivateKey(key_bio, nullptr, nullptr, nullptr);
  190|  2.28k|  BIO_free(certificate_bio);
  191|  2.28k|  BIO_free(key_bio);
  192|  2.28k|  if (certificate == nullptr || key == nullptr) {
  ------------------
  |  Branch (192:7): [True: 0, False: 2.28k]
  |  Branch (192:33): [True: 0, False: 2.28k]
  ------------------
  193|      0|    X509_free(certificate);
  194|      0|    EVP_PKEY_free(key);
  195|      0|    return false;
  196|      0|  }
  197|       |
  198|  2.28k|  const bool loaded = SSL_CTX_use_certificate(context, certificate) == 1 && SSL_CTX_use_PrivateKey(context, key) == 1 &&
  ------------------
  |  Branch (198:23): [True: 2.28k, False: 0]
  |  Branch (198:77): [True: 2.28k, False: 0]
  ------------------
  199|  2.28k|                      SSL_CTX_check_private_key(context) == 1;
  ------------------
  |  Branch (199:23): [True: 2.28k, False: 0]
  ------------------
  200|  2.28k|  X509_free(certificate);
  201|  2.28k|  EVP_PKEY_free(key);
  202|  2.28k|  if (!loaded) {
  ------------------
  |  Branch (202:7): [True: 0, False: 2.28k]
  ------------------
  203|      0|    return false;
  204|      0|  }
  205|       |
  206|  2.28k|  if (certificate_chain == curl::fuzzer::proto::TLS_CERTIFICATE_CHAIN_ALL_KEY_TYPES) {
  ------------------
  |  Branch (206:7): [True: 94, False: 2.19k]
  ------------------
  207|     94|    return AddExtraChainCertificate(context, tls_test_credentials::kRsaCertificatePem) &&
  ------------------
  |  Branch (207:12): [True: 94, False: 0]
  ------------------
  208|     94|           AddExtraChainCertificate(context, tls_test_credentials::kDsaCertificatePem) &&
  ------------------
  |  Branch (208:12): [True: 94, False: 0]
  ------------------
  209|     94|           AddExtraChainCertificate(context, tls_test_credentials::kDhCertificatePem);
  ------------------
  |  Branch (209:12): [True: 94, False: 0]
  ------------------
  210|     94|  }
  211|  2.19k|  return true;
  212|  2.28k|}
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_124AddExtraChainCertificateEP10ssl_ctx_stPKc:
  161|    282|bool AddExtraChainCertificate(SSL_CTX* context, const char* certificate_pem) {
  162|    282|  BIO* certificate_bio = BIO_new_mem_buf(certificate_pem, -1);
  163|    282|  if (certificate_bio == nullptr) {
  ------------------
  |  Branch (163:7): [True: 0, False: 282]
  ------------------
  164|      0|    return false;
  165|      0|  }
  166|    282|  X509* certificate = PEM_read_bio_X509(certificate_bio, nullptr, nullptr, nullptr);
  167|    282|  BIO_free(certificate_bio);
  168|    282|  if (certificate == nullptr) {
  ------------------
  |  Branch (168:7): [True: 0, False: 282]
  ------------------
  169|      0|    return false;
  170|      0|  }
  171|    282|  if (SSL_CTX_add_extra_chain_cert(context, certificate) != 1) {
  ------------------
  |  | 1541|    282|    SSL_CTX_ctrl(ctx, SSL_CTRL_EXTRA_CHAIN_CERT, 0, (char *)(x509))
  |  |  ------------------
  |  |  |  | 1395|    282|#define SSL_CTRL_EXTRA_CHAIN_CERT 14
  |  |  ------------------
  ------------------
  |  Branch (171:7): [True: 0, False: 282]
  ------------------
  172|      0|    X509_free(certificate);
  173|      0|    return false;
  174|      0|  }
  175|    282|  return true;
  176|    282|}
http3_mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_115SelectHttp3AlpnEP6ssl_stPPKhPhS4_jPv:
  145|  1.96k|                    const unsigned char* client_protocols, unsigned int client_protocols_length, void* /*userdata*/) {
  146|  1.96k|  static constexpr unsigned char server_protocols[] = {2, 'h', '3'};
  147|  1.96k|  unsigned char* match = nullptr;
  148|  1.96k|  unsigned char match_length = 0;
  149|  1.96k|  const int result = SSL_select_next_proto(&match, &match_length, server_protocols, sizeof(server_protocols),
  150|  1.96k|                                           client_protocols, client_protocols_length);
  151|  1.96k|  if (result != OPENSSL_NPN_NEGOTIATED) {
  ------------------
  |  |  899|  1.96k|#define OPENSSL_NPN_NEGOTIATED 1
  ------------------
  |  Branch (151:7): [True: 0, False: 1.96k]
  ------------------
  152|      0|    return SSL_TLSEXT_ERR_ALERT_FATAL;
  ------------------
  |  |  352|      0|#define SSL_TLSEXT_ERR_ALERT_FATAL 2
  ------------------
  153|      0|  }
  154|  1.96k|  *selected = match;
  155|  1.96k|  *selected_length = match_length;
  156|  1.96k|  return SSL_TLSEXT_ERR_OK;
  ------------------
  |  |  350|  1.96k|#define SSL_TLSEXT_ERR_OK 0
  ------------------
  157|  1.96k|}
_ZN12proto_fuzzer19Http3MockServerImpl17GetQuicConnectionEP22ngtcp2_crypto_conn_ref:
  510|  88.7k|  static ngtcp2_conn* GetQuicConnection(ngtcp2_crypto_conn_ref* connection_ref) {
  511|  88.7k|    auto* self = static_cast<Http3MockServerImpl*>(connection_ref->user_data);
  512|  88.7k|    return self == nullptr ? nullptr : self->quic_connection_;
  ------------------
  |  Branch (512:12): [True: 0, False: 88.7k]
  ------------------
  513|  88.7k|  }
_ZN12proto_fuzzer19Http3MockServerImplD2Ev:
  317|  2.28k|  ~Http3MockServerImpl() {
  318|  2.28k|    ResetPeer();
  319|  2.28k|    OpenSslErrorQueueGuard error_guard;
  320|  2.28k|    SSL_CTX_free(context_);
  321|  2.28k|  }

_ZN12proto_fuzzer14MockConnectionC2Ev:
   58|  7.23k|MockConnection::MockConnection() : server_fd_(-1), client_fd_(-1), drain_limit_(0), incoming_data_observer_(nullptr) {
   59|  7.23k|  int fds[2];
   60|       |
   61|  7.23k|  if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) != 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 7.23k]
  ------------------
   62|      0|    return;
   63|      0|  }
   64|       |
   65|       |  // The fds must be small enough to fit in an fd_set for select(). If not, close them and fail the constructor.
   66|  7.23k|  if (!FdFitsInFdSet(fds[0]) || !FdFitsInFdSet(fds[1])) {
  ------------------
  |  Branch (66:7): [True: 0, False: 7.23k]
  |  Branch (66:33): [True: 0, False: 7.23k]
  ------------------
   67|      0|    close(fds[0]);
   68|      0|    close(fds[1]);
   69|      0|    return;
   70|      0|  }
   71|       |
   72|       |  // Set the server-side fd non-blocking so we can write to it without risk of hanging the fuzzer.
   73|  7.23k|  int flags = fcntl(fds[0], F_GETFL, 0);
   74|  7.23k|  if (flags < 0 || fcntl(fds[0], F_SETFL, flags | O_NONBLOCK) < 0) {
  ------------------
  |  Branch (74:7): [True: 0, False: 7.23k]
  |  Branch (74:20): [True: 0, False: 7.23k]
  ------------------
   75|      0|    close(fds[0]);
   76|      0|    close(fds[1]);
   77|      0|    return;
   78|      0|  }
   79|       |
   80|       |  // Success: store the file descriptors.
   81|  7.23k|  server_fd_ = fds[0];
   82|  7.23k|  client_fd_ = fds[1];
   83|  7.23k|}
_ZN12proto_fuzzer14MockConnectionD2Ev:
  102|  7.23k|MockConnection::~MockConnection() {
  103|  7.23k|  if (server_fd_ >= 0) {
  ------------------
  |  Branch (103:7): [True: 7.23k, False: 0]
  ------------------
  104|  7.23k|    close(server_fd_);
  105|  7.23k|  }
  106|  7.23k|  if (client_fd_ >= 0) {
  ------------------
  |  Branch (106:7): [True: 0, False: 7.23k]
  ------------------
  107|      0|    close(client_fd_);
  108|      0|  }
  109|  7.23k|}
_ZNK12proto_fuzzer14MockConnection2okEv:
  112|  7.23k|bool MockConnection::ok() const { return server_fd_ >= 0; }
_ZN12proto_fuzzer14MockConnection14take_client_fdEv:
  187|  7.23k|curl_socket_t MockConnection::take_client_fd() {
  188|  7.23k|  int fd = client_fd_;
  189|  7.23k|  client_fd_ = -1;
  190|  7.23k|  return static_cast<curl_socket_t>(fd);
  191|  7.23k|}
_ZN12proto_fuzzer14MockConnection8WriteAllEPKhm:
  201|  8.92k|bool MockConnection::WriteAll(const unsigned char* data, std::size_t size) {
  202|  8.92k|  if (server_fd_ < 0) {
  ------------------
  |  Branch (202:7): [True: 0, False: 8.92k]
  ------------------
  203|      0|    return false;
  204|      0|  }
  205|  8.92k|  std::size_t written = 0;
  206|  17.8k|  while (written < size) {
  ------------------
  |  Branch (206:10): [True: 8.92k, False: 8.92k]
  ------------------
  207|  8.92k|    ssize_t n = ::send(server_fd_, data + written, size - written, MSG_NOSIGNAL);
  208|  8.92k|    if (n <= 0) {
  ------------------
  |  Branch (208:9): [True: 0, False: 8.92k]
  ------------------
  209|      0|      return false;
  210|      0|    }
  211|  8.92k|    written += static_cast<std::size_t>(n);
  212|  8.92k|  }
  213|  8.92k|  return true;
  214|  8.92k|}
_ZN12proto_fuzzer14MockConnection13DrainIncomingEv:
  225|   123k|std::size_t MockConnection::DrainIncoming() {
  226|   123k|  if (server_fd_ < 0) {
  ------------------
  |  Branch (226:7): [True: 0, False: 123k]
  ------------------
  227|      0|    return 0;
  228|      0|  }
  229|   123k|  unsigned char scratch[4096];
  230|   123k|  std::size_t drained = 0;
  231|   174k|  while (drain_limit_ == 0 || drained < drain_limit_) {
  ------------------
  |  Branch (231:10): [True: 25.1k, False: 149k]
  |  Branch (231:31): [True: 100k, False: 49.1k]
  ------------------
  232|   125k|    std::size_t want = sizeof(scratch);
  233|   125k|    if (drain_limit_ != 0) {
  ------------------
  |  Branch (233:9): [True: 100k, False: 25.1k]
  ------------------
  234|   100k|      const std::size_t remaining = drain_limit_ - drained;
  235|   100k|      if (remaining < want) {
  ------------------
  |  Branch (235:11): [True: 98.4k, False: 1.66k]
  ------------------
  236|  98.4k|        want = remaining;
  237|  98.4k|      }
  238|   100k|    }
  239|   125k|    ssize_t n = ::read(server_fd_, scratch, want);
  240|   125k|    if (n <= 0) {
  ------------------
  |  Branch (240:9): [True: 73.9k, False: 51.3k]
  ------------------
  241|  73.9k|      break;
  242|  73.9k|    }
  243|  51.3k|    NotifyIncomingData(scratch, static_cast<std::size_t>(n));
  244|  51.3k|    drained += static_cast<std::size_t>(n);
  245|  51.3k|  }
  246|   123k|  return drained;
  247|   123k|}
_ZN12proto_fuzzer14MockConnection18NotifyIncomingDataEPKhm:
  258|  51.3k|void MockConnection::NotifyIncomingData(const unsigned char* data, std::size_t size) {
  259|  51.3k|  if (incoming_data_observer_ != nullptr) {
  ------------------
  |  Branch (259:7): [True: 0, False: 51.3k]
  ------------------
  260|      0|    incoming_data_observer_->ObserveIncomingData(data, size);
  261|      0|  }
  262|  51.3k|}
_ZN12proto_fuzzer14MockConnection17ApplyBackpressureEim:
  272|  7.23k|void MockConnection::ApplyBackpressure(int recv_buf_bytes, std::size_t drain_limit) {
  273|  7.23k|  if (recv_buf_bytes > 0) {
  ------------------
  |  Branch (273:7): [True: 207, False: 7.02k]
  ------------------
  274|    207|    if (server_fd_ >= 0) {
  ------------------
  |  Branch (274:9): [True: 207, False: 0]
  ------------------
  275|    207|      (void)setsockopt(server_fd_, SOL_SOCKET, SO_RCVBUF, &recv_buf_bytes, sizeof(recv_buf_bytes));
  276|    207|    }
  277|    207|    if (client_fd_ >= 0) {
  ------------------
  |  Branch (277:9): [True: 207, False: 0]
  ------------------
  278|    207|      (void)setsockopt(client_fd_, SOL_SOCKET, SO_SNDBUF, &recv_buf_bytes, sizeof(recv_buf_bytes));
  279|    207|    }
  280|    207|  }
  281|  7.23k|  drain_limit_ = drain_limit;
  282|  7.23k|}
_ZN12proto_fuzzer14MockConnection13ShutdownWriteEv:
  303|  7.17k|void MockConnection::ShutdownWrite() {
  304|  7.17k|  if (server_fd_ < 0) {
  ------------------
  |  Branch (304:7): [True: 0, False: 7.17k]
  ------------------
  305|      0|    return;
  306|      0|  }
  307|  7.17k|  ::shutdown(server_fd_, SHUT_WR);
  308|  7.17k|}
_ZN12proto_fuzzer10MockServerC2ENS_16MultiDrivePolicyE:
  320|  7.67k|    : MockServerBase(drive_policy),
  321|  7.67k|      script_count_(0),
  322|  7.67k|      next_script_(0),
  323|  7.67k|      active_script_(nullptr),
  324|  7.67k|      preload_all_chunks_(false),
  325|  7.67k|      keep_connections_open_(false) {}
_ZN12proto_fuzzer10MockServerD2Ev:
  329|  7.67k|MockServer::~MockServer() = default;
_ZN12proto_fuzzer10MockServer10SetScriptsERKN4curl6fuzzer5proto8ScenarioE:
  340|  7.54k|void MockServer::SetScripts(const curl::fuzzer::proto::Scenario& scenario) {
  341|  7.54k|  ResetConnections();
  342|  7.54k|  script_count_ = 0;
  343|  7.54k|  next_script_ = 0;
  344|       |
  345|  7.54k|  const auto append_script = [this](const curl::fuzzer::proto::Connection& connection) {
  346|  7.54k|    ConnectionScript& script = scripts_[script_count_++];
  347|  7.54k|    script.connection = &connection;
  348|  7.54k|    script.raw_chunk_count = std::min<std::size_t>(scenario_limits::kMaxResponseChunks, connection.on_readable_size());
  349|  7.54k|    const std::size_t frame_budget = scenario_limits::kMaxResponseChunks - script.raw_chunk_count;
  350|  7.54k|    script.frame_chunk_count = std::min<std::size_t>(frame_budget, connection.server_frames_size());
  351|  7.54k|    script.next_chunk = 0;
  352|  7.54k|  };
  353|       |
  354|  7.54k|  append_script(scenario.connection());
  355|  7.54k|  const std::size_t subsequent_count = std::min<std::size_t>(
  356|  7.54k|      scenario_limits::kMaxConnections - 1, static_cast<std::size_t>(scenario.subsequent_connections_size()));
  357|  7.54k|  for (std::size_t i = 0; i < subsequent_count; ++i) {
  ------------------
  |  Branch (357:27): [True: 0, False: 7.54k]
  ------------------
  358|      0|    append_script(scenario.subsequent_connections(static_cast<int>(i)));
  359|      0|  }
  360|  7.54k|}
_ZNK12proto_fuzzer10MockServer15has_more_chunksEv:
  369|   130k|bool MockServer::has_more_chunks() const {
  370|   130k|  return active_script_ != nullptr && active_script_->next_chunk < active_script_->chunk_count();
  ------------------
  |  Branch (370:10): [True: 130k, False: 112]
  |  Branch (370:39): [True: 20.5k, False: 110k]
  ------------------
  371|   130k|}
_ZN12proto_fuzzer10MockServer16CreateConnectionEv:
  377|  7.23k|std::unique_ptr<MockConnection> MockServer::CreateConnection() { return std::make_unique<MockConnection>(); }
_ZN12proto_fuzzer10MockServer16ResetConnectionsEv:
  383|  7.54k|void MockServer::ResetConnections() {
  384|  7.54k|  active_script_ = nullptr;
  385|  7.54k|  connection_.reset();
  386|  7.54k|  previous_connections_.clear();
  387|  7.54k|}
_ZN12proto_fuzzer10MockServer21ObserveActiveTransferEPv:
  393|   122k|void MockServer::ObserveActiveTransfer(CURL* /*easy*/) {}
_ZN12proto_fuzzer10MockServer16HandleOpenSocketE12curlsocktypeP13curl_sockaddr:
  404|  7.23k|curl_socket_t MockServer::HandleOpenSocket(curlsocktype purpose, struct curl_sockaddr* address) {
  405|  7.23k|  (void)purpose;
  406|  7.23k|  (void)address;
  407|  7.23k|  if (next_script_ >= script_count_) {
  ------------------
  |  Branch (407:7): [True: 0, False: 7.23k]
  ------------------
  408|       |    // Refusing a fifth socket keeps redirect loops bounded even if curl's own
  409|       |    // redirect limit is mutated upward or an authentication scheme retries.
  410|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  411|      0|  }
  412|       |
  413|  7.23k|  if (connection_) {
  ------------------
  |  Branch (413:7): [True: 0, False: 7.23k]
  ------------------
  414|       |    // libcurl owns the corresponding client fd, so retain the server half
  415|       |    // until the easy handle leaves the multi instead of closing it at the
  416|       |    // moment a redirect or retry opens its replacement.
  417|      0|    previous_connections_.push_back(std::move(connection_));
  418|      0|  }
  419|       |
  420|  7.23k|  active_script_ = &scripts_[next_script_++];
  421|  7.23k|  const curl::fuzzer::proto::Connection& script_connection = *active_script_->connection;
  422|  7.23k|  connection_ = CreateConnection();
  423|  7.23k|  if (!connection_ || !connection_->ok()) {
  ------------------
  |  Branch (423:7): [True: 0, False: 7.23k]
  |  Branch (423:23): [True: 0, False: 7.23k]
  ------------------
  424|      0|    connection_.reset();
  425|      0|    active_script_ = nullptr;
  426|      0|    return CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  427|      0|  }
  428|       |
  429|       |  // Target policies clamp/clear these values before execution. Saturating the
  430|       |  // compatibility lane's raw uint32 avoids implementation-defined narrowing
  431|       |  // while preserving its ability to request any representable socket size.
  432|  7.23k|  const std::uint32_t int_max = static_cast<std::uint32_t>(std::numeric_limits<int>::max());
  433|  7.23k|  const auto& backpressure = script_connection.backpressure();
  434|  7.23k|  const int recv_buf_bytes = static_cast<int>(std::min(backpressure.recv_buf_bytes(), int_max));
  435|  7.23k|  connection_->ApplyBackpressure(recv_buf_bytes, static_cast<std::size_t>(backpressure.drain_limit()));
  436|       |
  437|  7.23k|  const std::string& initial_response = script_connection.initial_response();
  438|  7.23k|  if (!initial_response.empty()) {
  ------------------
  |  Branch (438:7): [True: 1.83k, False: 5.40k]
  ------------------
  439|  1.83k|    if (!connection_->WriteAll(reinterpret_cast<const unsigned char*>(initial_response.data()),
  ------------------
  |  Branch (439:9): [True: 0, False: 1.83k]
  ------------------
  440|  1.83k|                               initial_response.size())) {
  441|      0|      connection_.reset();
  442|      0|      active_script_ = nullptr;
  443|      0|      return CURL_SOCKET_BAD;
  ------------------
  |  |  147|      0|#define CURL_SOCKET_BAD (-1)
  ------------------
  444|      0|    }
  445|  1.83k|  }
  446|  7.23k|  if (preload_all_chunks_) {
  ------------------
  |  Branch (446:7): [True: 0, False: 7.23k]
  ------------------
  447|      0|    while (has_more_chunks()) {
  ------------------
  |  Branch (447:12): [True: 0, False: 0]
  ------------------
  448|      0|      (void)DeliverNextChunk();
  449|      0|    }
  450|      0|  }
  451|  7.23k|  if (active_script_->chunk_count() == 0 && !keep_connections_open_) {
  ------------------
  |  Branch (451:7): [True: 5.34k, False: 1.88k]
  |  Branch (451:45): [True: 5.34k, False: 0]
  ------------------
  452|  5.34k|    connection_->ShutdownWrite();
  453|  5.34k|  }
  454|  7.23k|  return connection_->take_client_fd();
  455|  7.23k|}
_ZN12proto_fuzzer10MockServer16DeliverNextChunkEv:
  541|  7.44k|bool MockServer::DeliverNextChunk() {
  542|  7.44k|  if (!connection_ || !has_more_chunks()) {
  ------------------
  |  Branch (542:7): [True: 0, False: 7.44k]
  |  Branch (542:23): [True: 0, False: 7.44k]
  ------------------
  543|      0|    return false;
  544|      0|  }
  545|  7.44k|  connection_->DrainIncoming();
  546|  7.44k|  const std::size_t chunk_index = active_script_->next_chunk++;
  547|  7.44k|  const auto& script_connection = *active_script_->connection;
  548|  7.44k|  if (chunk_index < active_script_->raw_chunk_count) {
  ------------------
  |  Branch (548:7): [True: 3.59k, False: 3.84k]
  ------------------
  549|  3.59k|    const std::string& chunk = script_connection.on_readable(static_cast<int>(chunk_index));
  550|  3.59k|    if (!chunk.empty()) {
  ------------------
  |  Branch (550:9): [True: 3.25k, False: 344]
  ------------------
  551|  3.25k|      connection_->WriteAll(reinterpret_cast<const unsigned char*>(chunk.data()), chunk.size());
  552|  3.25k|    }
  553|  3.84k|  } else {
  554|       |    // HTTP scenarios historically accept structured WebSocket frames as raw
  555|       |    // response bytes after every on_readable chunk. Serialize only the frame
  556|       |    // curl is about to receive: follow-on scripts and capped suffix frames may
  557|       |    // never be consumed, so eagerly materialising all of them wastes mutations.
  558|  3.84k|    const std::size_t frame_index = chunk_index - active_script_->raw_chunk_count;
  559|  3.84k|    const std::string chunk = SerializeWebSocketFrame(script_connection.server_frames(static_cast<int>(frame_index)));
  560|  3.84k|    if (!chunk.empty()) {
  ------------------
  |  Branch (560:9): [True: 3.84k, False: 0]
  ------------------
  561|  3.84k|      connection_->WriteAll(reinterpret_cast<const unsigned char*>(chunk.data()), chunk.size());
  562|  3.84k|    }
  563|  3.84k|  }
  564|  7.44k|  if (!has_more_chunks() && !keep_connections_open_) {
  ------------------
  |  Branch (564:7): [True: 1.82k, False: 5.61k]
  |  Branch (564:29): [True: 1.82k, False: 0]
  ------------------
  565|  1.82k|    connection_->ShutdownWrite();
  566|  1.82k|  }
  567|  7.44k|  return true;
  568|  7.44k|}
_ZN12proto_fuzzer10MockServer24DrainIncomingConnectionsEv:
  575|   115k|std::size_t MockServer::DrainIncomingConnections() {
  576|   115k|  std::size_t drained = 0;
  577|   115k|  for (const auto& previous : previous_connections_) {
  ------------------
  |  Branch (577:29): [True: 0, False: 115k]
  ------------------
  578|      0|    drained += previous->DrainIncoming();
  579|      0|  }
  580|   115k|  if (connection_) {
  ------------------
  |  Branch (580:7): [True: 115k, False: 112]
  ------------------
  581|   115k|    drained += connection_->DrainIncoming();
  582|   115k|  }
  583|   115k|  return drained;
  584|   115k|}
_ZN12proto_fuzzer10MockServer18ServiceConnectionsEv:
  594|   115k|bool MockServer::ServiceConnections() {
  595|   115k|  bool made_progress = DrainIncomingConnections() != 0;
  596|   115k|  if (has_more_chunks()) {
  ------------------
  |  Branch (596:7): [True: 7.44k, False: 108k]
  ------------------
  597|  7.44k|    made_progress = DeliverNextChunk() || made_progress;
  ------------------
  |  Branch (597:21): [True: 7.44k, False: 0]
  |  Branch (597:43): [True: 0, False: 0]
  ------------------
  598|  7.44k|  }
  599|   115k|  return made_progress;
  600|   115k|}
_ZN12proto_fuzzer10MockServer7RunLoopEPvS1_RKN4curl6fuzzer5proto8ScenarioE:
  654|  7.54k|void MockServer::RunLoop(CURLM* multi, CURL* easy, const curl::fuzzer::proto::Scenario& scenario) {
  655|  7.54k|  SetScripts(scenario);
  656|       |
  657|  7.54k|  if (multi_socket_driver() != nullptr) {
  ------------------
  |  Branch (657:7): [True: 0, False: 7.54k]
  ------------------
  658|      0|    RunSocketActionLoop(multi, easy);
  659|      0|    return;
  660|      0|  }
  661|       |
  662|  7.54k|  int still_running = 1;
  663|  7.54k|  int idle_iterations = 0;
  664|  7.54k|  int drive_iterations = 0;
  665|  7.54k|  bool pollset_probed = false;
  666|       |  // Each newly opened socket can carry its own pressure settings. Inspect only
  667|       |  // the borrowed, runtime-bounded scripts: ignored repeated protobuf entries must
  668|       |  // not opt a fast transfer into timed waits.
  669|  7.54k|  const bool timed_drive =
  670|  7.54k|      std::any_of(scripts_.begin(), scripts_.begin() + script_count_, [](const ConnectionScript& script) {
  671|  7.54k|        const auto& backpressure = script.connection->backpressure();
  672|  7.54k|        return backpressure.recv_buf_bytes() != 0 || backpressure.drain_limit() != 0;
  673|  7.54k|      });
  674|  7.54k|  const int idle_limit = timed_drive ? kMaxTimedIdleIterations : kMaxIdleIterations;
  ------------------
  |  Branch (674:26): [True: 507, False: 7.03k]
  ------------------
  675|  7.54k|  const bool repeated_pollset_probe = scenario.probe_multi_pollset() && SupportsRepeatedPollsetProbe();
  ------------------
  |  Branch (675:39): [True: 0, False: 7.54k]
  |  Branch (675:73): [True: 0, False: 0]
  ------------------
  676|  7.54k|  CURLMcode rc = CURLM_OK;
  677|       |
  678|   123k|  while (still_running && idle_iterations < idle_limit && drive_iterations++ < kMaxDriveIterations) {
  ------------------
  |  Branch (678:10): [True: 123k, False: 0]
  |  Branch (678:27): [True: 122k, False: 789]
  |  Branch (678:59): [True: 122k, False: 84]
  ------------------
  679|   122k|    bool made_progress = false;
  680|   122k|    const int running_before = still_running;
  681|   122k|    rc = curl_multi_perform(multi, &still_running);
  682|   122k|    if (rc != CURLM_OK) {
  ------------------
  |  Branch (682:9): [True: 0, False: 122k]
  ------------------
  683|      0|      break;
  684|      0|    }
  685|   122k|    ObserveActiveTransfer(easy);
  686|   122k|    ResumeResponseIfRequested(easy);
  687|   122k|    made_progress = still_running != running_before;
  688|   122k|    if (still_running && ((timed_drive && !pollset_probed) || repeated_pollset_probe)) {
  ------------------
  |  Branch (688:9): [True: 115k, False: 6.67k]
  |  Branch (688:28): [True: 103k, False: 11.8k]
  |  Branch (688:43): [True: 395, False: 103k]
  |  Branch (688:63): [True: 0, False: 115k]
  ------------------
  689|       |      // Probe only after curl has built the socket/filter chain. Timing cases
  690|       |      // need one zero-timeout poll; an explicit protocol opt-in probes each
  691|       |      // bounded perform turn so filters installed after a SOCKS handshake
  692|       |      // (notably HAProxy) are observed while active. Default fast paths remain
  693|       |      // free of a per-input polling syscall.
  694|    395|      ProbeMultiPollset(multi);
  695|    395|      pollset_probed = true;
  696|    395|    }
  697|   122k|    if (!still_running) {
  ------------------
  |  Branch (697:9): [True: 6.67k, False: 115k]
  ------------------
  698|  6.67k|      break;
  699|  6.67k|    }
  700|       |
  701|       |    // Always drain whatever curl has written. Under backpressure the kernel
  702|       |    // recv buffer would otherwise stay full — curl short-writes, the mock
  703|       |    // never consumes, and the transfer wedges until the drive budget. With
  704|       |    // drain_limit set this still honours the per-tick byte budget.
  705|   115k|    made_progress = ServiceConnections() || made_progress;
  ------------------
  |  Branch (705:21): [True: 55.9k, False: 59.7k]
  |  Branch (705:45): [True: 0, False: 59.7k]
  ------------------
  706|       |
  707|   115k|    if (made_progress) {
  ------------------
  |  Branch (707:9): [True: 55.9k, False: 59.7k]
  ------------------
  708|  55.9k|      idle_iterations = 0;
  709|  55.9k|      continue;
  710|  55.9k|    }
  711|       |
  712|       |    // Ordinary socketpair scenarios never sleep: repeated no-progress
  713|       |    // performs are enough to settle curl's local state machine. Only an
  714|       |    // explicit BackpressureConfig opts into short waits so timeout-related
  715|       |    // behaviour remains fuzzable without taxing every corpus entry.
  716|  59.7k|    if (timed_drive) {
  ------------------
  |  Branch (716:9): [True: 54.8k, False: 4.95k]
  ------------------
  717|  54.8k|      (void)WaitOnMultiFdset(multi, &rc);
  718|  54.8k|      if (rc != CURLM_OK) {
  ------------------
  |  Branch (718:11): [True: 0, False: 54.8k]
  ------------------
  719|      0|        break;
  720|      0|      }
  721|  54.8k|    }
  722|  59.7k|    ++idle_iterations;
  723|  59.7k|  }
  724|  7.54k|}
mock_server.cc:_ZN12proto_fuzzer12_GLOBAL__N_113FdFitsInFdSetEi:
   48|  14.4k|bool FdFitsInFdSet(int fd) { return fd >= 0 && fd < FD_SETSIZE; }
  ------------------
  |  Branch (48:37): [True: 14.4k, False: 0]
  |  Branch (48:48): [True: 14.4k, False: 0]
  ------------------
mock_server.cc:_ZZN12proto_fuzzer10MockServer10SetScriptsERKN4curl6fuzzer5proto8ScenarioEENK3$_0clERKNS3_10ConnectionE:
  345|  7.54k|  const auto append_script = [this](const curl::fuzzer::proto::Connection& connection) {
  346|  7.54k|    ConnectionScript& script = scripts_[script_count_++];
  347|  7.54k|    script.connection = &connection;
  348|  7.54k|    script.raw_chunk_count = std::min<std::size_t>(scenario_limits::kMaxResponseChunks, connection.on_readable_size());
  349|  7.54k|    const std::size_t frame_budget = scenario_limits::kMaxResponseChunks - script.raw_chunk_count;
  350|  7.54k|    script.frame_chunk_count = std::min<std::size_t>(frame_budget, connection.server_frames_size());
  351|  7.54k|    script.next_chunk = 0;
  352|  7.54k|  };
mock_server.cc:_ZZN12proto_fuzzer10MockServer7RunLoopEPvS1_RKN4curl6fuzzer5proto8ScenarioEENK3$_0clERKNS0_16ConnectionScriptE:
  670|  7.54k|      std::any_of(scripts_.begin(), scripts_.begin() + script_count_, [](const ConnectionScript& script) {
  671|  7.54k|        const auto& backpressure = script.connection->backpressure();
  672|  7.54k|        return backpressure.recv_buf_bytes() != 0 || backpressure.drain_limit() != 0;
  ------------------
  |  Branch (672:16): [True: 210, False: 7.33k]
  |  Branch (672:54): [True: 297, False: 7.03k]
  ------------------
  673|  7.54k|      });

_ZNK12proto_fuzzer10MockServer16ConnectionScript11chunk_countEv:
  120|   137k|    std::size_t chunk_count() const { return raw_chunk_count + frame_chunk_count; }

_ZN12proto_fuzzer34MockServerBaseOpenSocketTrampolineEPv12curlsocktypeP13curl_sockaddr:
   48|  9.20k|curl_socket_t MockServerBaseOpenSocketTrampoline(void* clientp, curlsocktype purpose, struct curl_sockaddr* address) {
   49|  9.20k|  return static_cast<MockServerBase*>(clientp)->HandleOpenSocket(purpose, address);
   50|  9.20k|}
_ZN12proto_fuzzer31MockServerBaseSockOptTrampolineEPvi12curlsocktype:
   61|  9.20k|int MockServerBaseSockOptTrampoline(void* clientp, curl_socket_t curlfd, curlsocktype purpose) {
   62|  9.20k|  const auto disposition = static_cast<MockServerBase*>(clientp)->GetSocketSetupDisposition(curlfd, purpose);
   63|  9.20k|  return disposition == SocketSetupDisposition::kAlreadyConnected ? CURL_SOCKOPT_ALREADY_CONNECTED : CURL_SOCKOPT_OK;
  ------------------
  |  |  423|  7.23k|#define CURL_SOCKOPT_ALREADY_CONNECTED 2
  ------------------
                return disposition == SocketSetupDisposition::kAlreadyConnected ? CURL_SOCKOPT_ALREADY_CONNECTED : CURL_SOCKOPT_OK;
  ------------------
  |  |  420|  1.97k|#define CURL_SOCKOPT_OK 0
  ------------------
  |  Branch (63:10): [True: 7.23k, False: 1.97k]
  ------------------
   64|  9.20k|}
_ZN12proto_fuzzer14MockServerBaseC2ENS_16MultiDrivePolicyE:
   70|  9.96k|    : connection_(nullptr),
   71|  9.96k|      pending_recv_buf_bytes_(0),
   72|  9.96k|      pending_drain_limit_(0),
   73|  9.96k|      multi_socket_driver_(nullptr),
   74|  9.96k|      additional_handle_cleanup_count_(0),
   75|  9.96k|      resume_response_(false),
   76|  9.96k|      drive_policy_(drive_policy) {}
_ZN12proto_fuzzer14MockServerBaseD2Ev:
   81|  9.96k|MockServerBase::~MockServerBase() = default;
_ZN12proto_fuzzer14MockServerBase12ObserveStateEv:
   86|  9.91k|void MockServerBase::ObserveState() {}
_ZN12proto_fuzzer14MockServerBase7InstallEPv:
   97|  9.91k|void MockServerBase::Install(CURL* easy) {
   98|  9.91k|  curl_easy_setopt(easy, CURLOPT_OPENSOCKETFUNCTION, &MockServerBaseOpenSocketTrampoline);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
   99|  9.91k|  curl_easy_setopt(easy, CURLOPT_OPENSOCKETDATA, this);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  100|  9.91k|  curl_easy_setopt(easy, CURLOPT_SOCKOPTFUNCTION, &MockServerBaseSockOptTrampoline);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  101|  9.91k|  curl_easy_setopt(easy, CURLOPT_SOCKOPTDATA, this);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  102|  9.91k|}
_ZNK12proto_fuzzer14MockServerBase25GetSocketSetupDispositionEi12curlsocktype:
  110|  7.23k|SocketSetupDisposition MockServerBase::GetSocketSetupDisposition(curl_socket_t /*curlfd*/, curlsocktype purpose) const {
  111|       |  // curl itself accepted CURLSOCKTYPE_ACCEPT descriptors, so they must follow
  112|       |  // its normal post-accept option path. Every IPCXN socket returned by the
  113|       |  // ordinary stream mocks is one end of an already-connected socketpair.
  114|  7.23k|  return purpose == CURLSOCKTYPE_ACCEPT ? SocketSetupDisposition::kNeedsSetup
  ------------------
  |  Branch (114:10): [True: 0, False: 7.23k]
  ------------------
  115|  7.23k|                                        : SocketSetupDisposition::kAlreadyConnected;
  116|  7.23k|}
_ZN12proto_fuzzer14MockServerBase20ConfigureRequestDataEPNS_19ScenarioRequestDataE:
  125|  9.91k|void MockServerBase::ConfigureRequestData(ScenarioRequestData* /*request_data*/) {}
_ZN12proto_fuzzer14MockServerBase13DriveScenarioEPvRKN4curl6fuzzer5proto8ScenarioE:
  138|  9.91k|CURLcode MockServerBase::DriveScenario(CURL* easy, const curl::fuzzer::proto::Scenario& scenario) {
  139|  9.91k|  const curl::fuzzer::proto::ApiPlan* api_plan =
  140|  9.91k|      drive_policy_ == MultiDrivePolicy::kFromApiPlan && scenario.has_api_plan() ? &scenario.api_plan() : nullptr;
  ------------------
  |  Branch (140:7): [True: 0, False: 9.91k]
  |  Branch (140:58): [True: 0, False: 0]
  ------------------
  141|  9.91k|  const bool use_multi_socket =
  142|  9.91k|      drive_policy_ == MultiDrivePolicy::kSocketAction ||
  ------------------
  |  Branch (142:7): [True: 2.25k, False: 7.65k]
  ------------------
  143|  7.65k|      (api_plan != nullptr && api_plan->drive_mode() == curl::fuzzer::proto::API_DRIVE_MULTI_SOCKET);
  ------------------
  |  Branch (143:8): [True: 0, False: 7.65k]
  |  Branch (143:31): [True: 0, False: 0]
  ------------------
  144|       |
  145|       |  // Cache backpressure knobs so HandleOpenSocket can apply them the moment
  146|       |  // connection_ exists. Both default to 0, which matches the legacy "drain
  147|       |  // greedily, kernel-default buffers" behaviour exactly.
  148|  9.91k|  const auto& bp = scenario.connection().backpressure();
  149|  9.91k|  pending_recv_buf_bytes_ = static_cast<int>(bp.recv_buf_bytes());
  150|  9.91k|  pending_drain_limit_ = static_cast<std::size_t>(bp.drain_limit());
  151|  9.91k|  additional_handle_cleanup_count_ = 0;
  152|  9.91k|  resume_response_ = api_plan != nullptr && api_plan->pause_response_once();
  ------------------
  |  Branch (152:22): [True: 0, False: 9.91k]
  |  Branch (152:45): [True: 0, False: 0]
  ------------------
  153|       |
  154|  9.91k|  CurlMultiPtr multi(curl_multi_init());
  155|  9.91k|  if (multi == nullptr) {
  ------------------
  |  Branch (155:7): [True: 155, False: 9.76k]
  ------------------
  156|    155|    resume_response_ = false;
  157|    155|    return CURLE_FAILED_INIT;
  158|    155|  }
  159|       |
  160|  9.76k|  CURLcode transfer_result = CURLE_FAILED_INIT;
  161|       |
  162|       |  // Callback data must survive both remove_handle and multi_cleanup, since
  163|       |  // either may emit CURL_POLL_REMOVE. Keeping it in this outer scope provides
  164|       |  // that lifetime without allocating per-watch state.
  165|  9.76k|  MultiSocketDriver socket_driver;
  166|  9.76k|  if (use_multi_socket && socket_driver.Install(multi.get())) {
  ------------------
  |  Branch (166:7): [True: 2.21k, False: 7.54k]
  |  Branch (166:27): [True: 2.21k, False: 0]
  ------------------
  167|  2.21k|    multi_socket_driver_ = &socket_driver;
  168|  2.21k|  }
  169|  9.76k|  if (curl_multi_add_handle(multi.get(), easy) == CURLM_OK) {
  ------------------
  |  Branch (169:7): [True: 9.76k, False: 0]
  ------------------
  170|  9.76k|    if (multi_observer_) {
  ------------------
  |  Branch (170:9): [True: 0, False: 9.76k]
  ------------------
  171|      0|      multi_observer_(multi.get());
  172|      0|    }
  173|  9.76k|    if (api_plan != nullptr && api_plan->wake_multi()) {
  ------------------
  |  Branch (173:9): [True: 0, False: 9.76k]
  |  Branch (173:32): [True: 0, False: 0]
  ------------------
  174|      0|      if (multi_socket_driver_ != nullptr) {
  ------------------
  |  Branch (174:11): [True: 0, False: 0]
  ------------------
  175|      0|        multi_socket_driver_->ProbeControlApis();
  176|      0|      } else {
  177|      0|        long timeout_ms = -1;
  178|      0|        (void)curl_multi_timeout(multi.get(), &timeout_ms);
  179|      0|        (void)curl_multi_wakeup(multi.get());
  180|      0|      }
  181|      0|    }
  182|  9.76k|    RunLoop(multi.get(), easy, scenario);
  183|       |
  184|       |    // Completion messages are the multi API's only durable record of the
  185|       |    // transfer result. Consume them while all easy handles are still attached:
  186|       |    // otherwise every scenario systematically skips curl_multi_info_read's
  187|       |    // result path and removal discards the opportunity. An accepted HTTP/2
  188|       |    // push can contribute one additional completion message; only the caller's
  189|       |    // parent determines DriveScenario's result.
  190|  9.76k|    int messages_remaining = 0;
  191|  9.76k|    CURLMsg* message = nullptr;
  192|  17.8k|    while ((message = curl_multi_info_read(multi.get(), &messages_remaining)) != nullptr) {
  ------------------
  |  Branch (192:12): [True: 8.05k, False: 9.76k]
  ------------------
  193|  8.05k|      if (message->msg == CURLMSG_DONE && message->easy_handle == easy) {
  ------------------
  |  Branch (193:11): [True: 8.05k, False: 0]
  |  Branch (193:43): [True: 8.05k, False: 0]
  ------------------
  194|  8.05k|        transfer_result = message->data.result;
  195|  8.05k|      }
  196|  8.05k|    }
  197|       |
  198|       |    // CURL_PUSH_OK transfers ownership of each automatically-added easy to
  199|       |    // the application. Enumerate attached handles only after draining their
  200|       |    // completion messages, then honor the public remove-before-cleanup
  201|       |    // lifecycle. The original `easy` remains caller-owned.
  202|  9.76k|    CURL** handles = GetHandlesForCleanup(multi.get());
  203|  9.76k|    if (handles != nullptr) {
  ------------------
  |  Branch (203:9): [True: 9.76k, False: 0]
  ------------------
  204|  19.5k|      for (std::size_t index = 0; handles[index] != nullptr; ++index) {
  ------------------
  |  Branch (204:35): [True: 9.76k, False: 9.76k]
  ------------------
  205|  9.76k|        CURL* handle = handles[index];
  206|  9.76k|        if (handle != easy && curl_multi_remove_handle(multi.get(), handle) == CURLM_OK) {
  ------------------
  |  Branch (206:13): [True: 0, False: 9.76k]
  |  Branch (206:31): [True: 0, False: 0]
  ------------------
  207|      0|          curl_easy_cleanup(handle);
  208|      0|          ++additional_handle_cleanup_count_;
  209|      0|        }
  210|  9.76k|      }
  211|  9.76k|      curl_free(handles);
  212|  9.76k|    }
  213|       |
  214|  9.76k|    curl_multi_remove_handle(multi.get(), easy);
  215|  9.76k|  }
  216|       |  // Socket-action callbacks borrow the stack driver above, so that path must
  217|       |  // clean its multi before this function returns. Perform-based protocol mocks
  218|       |  // may retain the detached multi when their fixed lifecycle requires it.
  219|  9.76k|  if (use_multi_socket) {
  ------------------
  |  Branch (219:7): [True: 2.21k, False: 7.54k]
  ------------------
  220|  2.21k|    multi.reset();
  221|  7.54k|  } else {
  222|  7.54k|    HandleDetachedMulti(std::move(multi));
  223|  7.54k|  }
  224|  9.76k|  multi_socket_driver_ = nullptr;
  225|  9.76k|  if (socket_driver.watch_exhausted()) {
  ------------------
  |  Branch (225:7): [True: 0, False: 9.76k]
  ------------------
  226|       |    std::fputs("curl-fuzzer: socket watch capacity exhausted\n", stderr);
  227|      0|  }
  228|  9.76k|  resume_response_ = false;
  229|  9.76k|  return transfer_result;
  230|  9.91k|}
_ZN12proto_fuzzer14MockServerBase19HandleDetachedMultiENSt3__110unique_ptrIvNS_16CurlMultiDeleterEEE:
  237|  7.54k|void MockServerBase::HandleDetachedMulti(CurlMultiPtr /*multi*/) {}
_ZN12proto_fuzzer14MockServerBase19multi_socket_driverEv:
  272|  9.76k|MultiSocketDriver* MockServerBase::multi_socket_driver() { return multi_socket_driver_; }
_ZN12proto_fuzzer14MockServerBase25ResumeResponseIfRequestedEPv:
  285|   122k|void MockServerBase::ResumeResponseIfRequested(CURL* easy) {
  286|   122k|  if (resume_response_) {
  ------------------
  |  Branch (286:7): [True: 0, False: 122k]
  ------------------
  287|      0|    (void)curl_easy_pause(easy, CURLPAUSE_CONT);
  ------------------
  |  | 3291|      0|#define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT | CURLPAUSE_SEND_CONT)
  |  |  ------------------
  |  |  |  | 3285|      0|#define CURLPAUSE_RECV_CONT 0
  |  |  ------------------
  |  |               #define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT | CURLPAUSE_SEND_CONT)
  |  |  ------------------
  |  |  |  | 3288|      0|#define CURLPAUSE_SEND_CONT 0
  |  |  ------------------
  ------------------
  288|      0|  }
  289|   122k|}
_ZN12proto_fuzzer14MockServerBase16WaitOnMultiFdsetEPvP9CURLMcode:
  318|  54.8k|int MockServerBase::WaitOnMultiFdset(CURLM* multi, CURLMcode* rc) {
  319|  54.8k|  fd_set readfds;
  320|  54.8k|  fd_set writefds;
  321|  54.8k|  fd_set excfds;
  322|  54.8k|  FD_ZERO(&readfds);
  ------------------
  |  Branch (322:3): [True: 877k, False: 54.8k]
  |  Branch (322:3): [Folded, False: 54.8k]
  ------------------
  323|  54.8k|  FD_ZERO(&writefds);
  ------------------
  |  Branch (323:3): [True: 877k, False: 54.8k]
  |  Branch (323:3): [Folded, False: 54.8k]
  ------------------
  324|  54.8k|  FD_ZERO(&excfds);
  ------------------
  |  Branch (324:3): [True: 877k, False: 54.8k]
  |  Branch (324:3): [Folded, False: 54.8k]
  ------------------
  325|  54.8k|  int maxfd = -1;
  326|  54.8k|  *rc = curl_multi_fdset(multi, &readfds, &writefds, &excfds, &maxfd);
  327|  54.8k|  if (*rc != CURLM_OK) {
  ------------------
  |  Branch (327:7): [True: 0, False: 54.8k]
  ------------------
  328|      0|    return -1;
  329|      0|  }
  330|  54.8k|  if (maxfd < 0) {
  ------------------
  |  Branch (330:7): [True: 0, False: 54.8k]
  ------------------
  331|      0|    return 0;
  332|      0|  }
  333|  54.8k|  struct timeval timeout;
  334|  54.8k|  timeout.tv_sec = 0;
  335|  54.8k|  timeout.tv_usec = kSelectTimeoutUs;
  336|  54.8k|  return ::select(maxfd + 1, &readfds, &writefds, &excfds, &timeout);
  337|  54.8k|}
_ZN12proto_fuzzer14MockServerBase17ProbeMultiPollsetEPv:
  346|    395|void MockServerBase::ProbeMultiPollset(CURLM* multi) {
  347|    395|  int numfds = 0;
  348|    395|  (void)curl_multi_poll(multi, nullptr, 0, 0, &numfds);
  349|    395|}
mock_server_base.cc:_ZN12proto_fuzzer12_GLOBAL__N_120GetHandlesForCleanupEPv:
   35|  9.76k|CURL** GetHandlesForCleanup(CURLM* multi) {
   36|  9.76k|  allocation_fault_injection::ScopedFailureSuppression suppress_failures;
   37|  9.76k|  return curl_multi_get_handles(multi);
   38|  9.76k|}

_ZN12proto_fuzzer17MultiSocketDriverC2Ev:
   55|  9.76k|    : multi_(nullptr), timeout_ms_(-1), timer_pending_(false), watch_exhausted_(false), generation_(0) {}
_ZN12proto_fuzzer17MultiSocketDriverD2Ev:
   59|  9.76k|MultiSocketDriver::~MultiSocketDriver() = default;
_ZN12proto_fuzzer17MultiSocketDriver7InstallEPv:
   67|  2.21k|bool MultiSocketDriver::Install(CURLM* multi) {
   68|  2.21k|  multi_ = multi;
   69|  2.21k|  if (multi_ == nullptr) {
  ------------------
  |  Branch (69:7): [True: 0, False: 2.21k]
  ------------------
   70|      0|    return false;
   71|      0|  }
   72|  2.21k|  return curl_multi_setopt(multi_, CURLMOPT_SOCKETFUNCTION, &MultiSocketDriver::SocketCallback) == CURLM_OK &&
  ------------------
  |  | 3370|  2.21k|  curl_multi_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  2.21k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  |  Branch (72:10): [True: 2.21k, False: 0]
  ------------------
   73|  2.21k|         curl_multi_setopt(multi_, CURLMOPT_SOCKETDATA, this) == CURLM_OK &&
  ------------------
  |  | 3370|  2.21k|  curl_multi_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  2.21k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  |  Branch (73:10): [True: 2.21k, False: 0]
  ------------------
   74|  2.21k|         curl_multi_setopt(multi_, CURLMOPT_TIMERFUNCTION, &MultiSocketDriver::TimerCallback) == CURLM_OK &&
  ------------------
  |  | 3370|  2.21k|  curl_multi_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  2.21k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  |  Branch (74:10): [True: 2.21k, False: 0]
  ------------------
   75|  2.21k|         curl_multi_setopt(multi_, CURLMOPT_TIMERDATA, this) == CURLM_OK;
  ------------------
  |  | 3370|  2.21k|  curl_multi_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  2.21k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  |  Branch (75:10): [True: 2.21k, False: 0]
  ------------------
   76|  2.21k|}
_ZN12proto_fuzzer17MultiSocketDriver5StartEPi:
   84|  2.21k|CURLMcode MultiSocketDriver::Start(int* running_handles) {
   85|  2.21k|  if (multi_ == nullptr) {
  ------------------
  |  Branch (85:7): [True: 0, False: 2.21k]
  ------------------
   86|      0|    return CURLM_BAD_HANDLE;
   87|      0|  }
   88|  2.21k|  timer_pending_ = false;
   89|  2.21k|  return curl_multi_socket_action(multi_, CURL_SOCKET_TIMEOUT, 0, running_handles);
  ------------------
  |  |  288|  2.21k|#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
  |  |  ------------------
  |  |  |  |  147|  2.21k|#define CURL_SOCKET_BAD (-1)
  |  |  ------------------
  ------------------
   90|  2.21k|}
_ZN12proto_fuzzer17MultiSocketDriver10DriveReadyEPi:
  101|  45.6k|MultiSocketDriver::DriveResult MultiSocketDriver::DriveReady(int* running_handles) {
  102|  45.6k|  DriveResult result;
  103|  45.6k|  if (multi_ == nullptr) {
  ------------------
  |  Branch (103:7): [True: 0, False: 45.6k]
  ------------------
  104|      0|    result.code = CURLM_BAD_HANDLE;
  105|      0|    return result;
  106|      0|  }
  107|       |
  108|  45.6k|  std::array<struct pollfd, kMaxWatches> poll_fds{};
  109|  45.6k|  std::size_t poll_count = 0;
  110|   730k|  for (const Watch& watch : watches_) {
  ------------------
  |  Branch (110:27): [True: 730k, False: 45.6k]
  ------------------
  111|   730k|    if (!watch.active) {
  ------------------
  |  Branch (111:9): [True: 641k, False: 88.6k]
  ------------------
  112|   641k|      continue;
  113|   641k|    }
  114|  88.6k|    poll_fds[poll_count].fd = watch.socket;
  115|  88.6k|    poll_fds[poll_count].events = PollEventsForInterest(watch.interest);
  116|  88.6k|    ++poll_count;
  117|  88.6k|  }
  118|       |
  119|  45.6k|  const std::uint64_t generation_before = generation_;
  120|  45.6k|  const int running_before = running_handles == nullptr ? 0 : *running_handles;
  ------------------
  |  Branch (120:30): [True: 0, False: 45.6k]
  ------------------
  121|  45.6k|  bool action_dispatched = false;
  122|  45.6k|  if (poll_count != 0 && ::poll(poll_fds.data(), static_cast<nfds_t>(poll_count), 0) > 0) {
  ------------------
  |  Branch (122:7): [True: 45.6k, False: 0]
  |  Branch (122:26): [True: 9.97k, False: 35.6k]
  ------------------
  123|  19.8k|    for (std::size_t index = 0; index < poll_count; ++index) {
  ------------------
  |  Branch (123:33): [True: 19.8k, False: 0]
  ------------------
  124|  19.8k|      if (running_handles != nullptr && *running_handles == 0) {
  ------------------
  |  Branch (124:11): [True: 19.8k, False: 0]
  |  Branch (124:41): [True: 0, False: 19.8k]
  ------------------
  125|      0|        break;
  126|      0|      }
  127|       |      // An earlier action can synchronously remove or repurpose any later fd
  128|       |      // in the snapshot. Revalidate it against the callback-owned table so a
  129|       |      // stale readiness notification never reaches curl under a new meaning.
  130|  19.8k|      Watch* current = FindWatch(poll_fds[index].fd);
  131|  19.8k|      if (current == nullptr) {
  ------------------
  |  Branch (131:11): [True: 0, False: 19.8k]
  ------------------
  132|      0|        continue;
  133|      0|      }
  134|  19.8k|      const int events = CurlEventsForPollResult(poll_fds[index].revents);
  135|  19.8k|      if (events == 0) {
  ------------------
  |  Branch (135:11): [True: 9.83k, False: 9.97k]
  ------------------
  136|  9.83k|        continue;
  137|  9.83k|      }
  138|  9.97k|      result.code = curl_multi_socket_action(multi_, poll_fds[index].fd, events, running_handles);
  139|  9.97k|      action_dispatched = true;
  140|       |      // Process at most one snapshot entry. Its callbacks can repurpose an fd
  141|       |      // with the same numeric value and interest, which no post-hoc lookup can
  142|       |      // distinguish; the outer loop rebuilds readiness from fresh watches.
  143|  9.97k|      break;
  144|  19.8k|    }
  145|  9.97k|  }
  146|       |
  147|  45.6k|  long remaining_ms = -1;
  148|  45.6k|  if (result.code == CURLM_OK && timer_pending_ && timeout_ms_ > 0) {
  ------------------
  |  Branch (148:7): [True: 45.6k, False: 0]
  |  Branch (148:34): [True: 44.4k, False: 1.23k]
  |  Branch (148:52): [True: 44.4k, False: 0]
  ------------------
  149|  44.4k|    (void)curl_multi_timeout(multi_, &remaining_ms);
  150|  44.4k|  }
  151|  45.6k|  if (result.code == CURLM_OK && timer_pending_ && (timeout_ms_ == 0 || (timeout_ms_ > 0 && remaining_ms == 0))) {
  ------------------
  |  Branch (151:7): [True: 45.6k, False: 0]
  |  Branch (151:34): [True: 44.4k, False: 1.23k]
  |  Branch (151:53): [True: 0, False: 44.4k]
  |  Branch (151:74): [True: 44.4k, False: 0]
  |  Branch (151:93): [True: 1.15k, False: 43.2k]
  ------------------
  152|       |    // Clear first: the action may synchronously install another zero timer,
  153|       |    // which belongs to the next outer loop turn rather than recursive work.
  154|  1.15k|    timer_pending_ = false;
  155|  1.15k|    result.code = curl_multi_socket_action(multi_, CURL_SOCKET_TIMEOUT, 0, running_handles);
  ------------------
  |  |  288|  1.15k|#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
  |  |  ------------------
  |  |  |  |  147|  1.15k|#define CURL_SOCKET_BAD (-1)
  |  |  ------------------
  ------------------
  156|  1.15k|    action_dispatched = true;
  157|  1.15k|  }
  158|       |
  159|  45.6k|  const int running_after = running_handles == nullptr ? 0 : *running_handles;
  ------------------
  |  Branch (159:29): [True: 0, False: 45.6k]
  ------------------
  160|       |  // A successful action can consume buffered protocol bytes without changing
  161|       |  // either callbacks or handle count, so dispatch itself is observable
  162|       |  // progress. The outer fixed operation cap still bounds permanently-ready
  163|       |  // sockets.
  164|  45.6k|  result.made_progress = action_dispatched || generation_ != generation_before || running_after != running_before;
  ------------------
  |  Branch (164:26): [True: 11.1k, False: 34.5k]
  |  Branch (164:47): [True: 0, False: 34.5k]
  |  Branch (164:83): [True: 0, False: 34.5k]
  ------------------
  165|  45.6k|  return result;
  166|  45.6k|}
_ZN12proto_fuzzer17MultiSocketDriver14SocketCallbackEPviiS1_S1_:
  184|  8.36k|                                      void* socket_data) {
  185|  8.36k|  return static_cast<MultiSocketDriver*>(user_data)->UpdateSocket(socket, what, socket_data);
  186|  8.36k|}
_ZN12proto_fuzzer17MultiSocketDriver13TimerCallbackEPvlS1_:
  191|  10.6k|int MultiSocketDriver::TimerCallback(CURLM* /*multi*/, long timeout_ms, void* user_data) {
  192|  10.6k|  return static_cast<MultiSocketDriver*>(user_data)->UpdateTimer(timeout_ms);
  193|  10.6k|}
_ZN12proto_fuzzer17MultiSocketDriver12UpdateSocketEiiPv:
  199|  8.36k|int MultiSocketDriver::UpdateSocket(curl_socket_t socket, int what, void* socket_data) {
  200|  8.36k|  Watch* watch = FindWatch(socket);
  201|  8.36k|  if (what == CURL_POLL_REMOVE) {
  ------------------
  |  |  286|  8.36k|#define CURL_POLL_REMOVE 4
  ------------------
  |  Branch (201:7): [True: 4.16k, False: 4.19k]
  ------------------
  202|  4.16k|    if (watch != nullptr) {
  ------------------
  |  Branch (202:9): [True: 4.16k, False: 0]
  ------------------
  203|  4.16k|      (void)curl_multi_assign(multi_, socket, nullptr);
  204|  4.16k|      watch->active = false;
  205|  4.16k|      watch->socket = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  4.16k|#define CURL_SOCKET_BAD (-1)
  ------------------
  206|  4.16k|      watch->interest = CURL_POLL_NONE;
  ------------------
  |  |  282|  4.16k|#define CURL_POLL_NONE   0
  ------------------
  207|  4.16k|      ++generation_;
  208|  4.16k|    }
  209|  4.16k|    return 0;
  210|  4.16k|  }
  211|       |
  212|  4.19k|  if (watch == nullptr) {
  ------------------
  |  Branch (212:7): [True: 4.16k, False: 29]
  ------------------
  213|  4.16k|    watch = FindFreeWatch();
  214|  4.16k|    if (watch == nullptr) {
  ------------------
  |  Branch (214:9): [True: 0, False: 4.16k]
  ------------------
  215|      0|      watch_exhausted_ = true;
  216|      0|      return -1;
  217|      0|    }
  218|  4.16k|    watch->socket = socket;
  219|  4.16k|    watch->active = true;
  220|  4.16k|    (void)curl_multi_assign(multi_, socket, watch);
  221|  4.16k|    ++generation_;
  222|  4.16k|  } else if (socket_data != nullptr && socket_data != watch) {
  ------------------
  |  Branch (222:14): [True: 29, False: 0]
  |  Branch (222:40): [True: 0, False: 29]
  ------------------
  223|       |    // Reassert the stable association if an unusual transition supplied a
  224|       |    // different application pointer. Never dereference foreign socket_data.
  225|      0|    (void)curl_multi_assign(multi_, socket, watch);
  226|      0|  }
  227|       |
  228|  4.19k|  if (watch->interest != what) {
  ------------------
  |  Branch (228:7): [True: 4.19k, False: 0]
  ------------------
  229|  4.19k|    watch->interest = what;
  230|  4.19k|    ++generation_;
  231|  4.19k|  }
  232|  4.19k|  return 0;
  233|  4.19k|}
_ZN12proto_fuzzer17MultiSocketDriver11UpdateTimerEl:
  239|  10.6k|int MultiSocketDriver::UpdateTimer(long timeout_ms) {
  240|  10.6k|  if (!timer_pending_ || timeout_ms_ != timeout_ms) {
  ------------------
  |  Branch (240:7): [True: 5.58k, False: 5.06k]
  |  Branch (240:26): [True: 2.53k, False: 2.53k]
  ------------------
  241|  8.11k|    ++generation_;
  242|  8.11k|  }
  243|  10.6k|  timeout_ms_ = timeout_ms;
  244|  10.6k|  timer_pending_ = timeout_ms >= 0;
  245|  10.6k|  return 0;
  246|  10.6k|}
_ZN12proto_fuzzer17MultiSocketDriver9FindWatchEi:
  250|  28.1k|MultiSocketDriver::Watch* MultiSocketDriver::FindWatch(curl_socket_t socket) {
  251|   102k|  for (Watch& watch : watches_) {
  ------------------
  |  Branch (251:21): [True: 102k, False: 4.16k]
  ------------------
  252|   102k|    if (watch.active && watch.socket == socket) {
  ------------------
  |  Branch (252:9): [True: 36.2k, False: 66.2k]
  |  Branch (252:25): [True: 24.0k, False: 12.2k]
  ------------------
  253|  24.0k|      return &watch;
  254|  24.0k|    }
  255|   102k|  }
  256|  4.16k|  return nullptr;
  257|  28.1k|}
_ZN12proto_fuzzer17MultiSocketDriver13FindFreeWatchEv:
  262|  4.16k|MultiSocketDriver::Watch* MultiSocketDriver::FindFreeWatch() {
  263|  6.13k|  for (Watch& watch : watches_) {
  ------------------
  |  Branch (263:21): [True: 6.13k, False: 0]
  ------------------
  264|  6.13k|    if (!watch.active) {
  ------------------
  |  Branch (264:9): [True: 4.16k, False: 1.96k]
  ------------------
  265|  4.16k|      return &watch;
  266|  4.16k|    }
  267|  6.13k|  }
  268|      0|  return nullptr;
  269|  4.16k|}
multi_socket_driver.cc:_ZN12proto_fuzzer12_GLOBAL__N_121PollEventsForInterestEi:
   23|  88.6k|short PollEventsForInterest(int interest) {
   24|  88.6k|  short events = 0;
   25|  88.6k|  if ((interest & CURL_POLL_IN) != 0) {
  ------------------
  |  |  283|  88.6k|#define CURL_POLL_IN     1
  ------------------
  |  Branch (25:7): [True: 88.6k, False: 0]
  ------------------
   26|  88.6k|    events |= POLLIN;
   27|  88.6k|  }
   28|  88.6k|  if ((interest & CURL_POLL_OUT) != 0) {
  ------------------
  |  |  284|  88.6k|#define CURL_POLL_OUT    2
  ------------------
  |  Branch (28:7): [True: 667, False: 88.0k]
  ------------------
   29|       |    events |= POLLOUT;
   30|    667|  }
   31|  88.6k|  return events;
   32|  88.6k|}
multi_socket_driver.cc:_ZN12proto_fuzzer12_GLOBAL__N_123CurlEventsForPollResultEs:
   35|  19.8k|int CurlEventsForPollResult(short events) {
   36|  19.8k|  int result = 0;
   37|  19.8k|  if ((events & (POLLIN | POLLHUP)) != 0) {
  ------------------
  |  Branch (37:7): [True: 9.40k, False: 10.3k]
  ------------------
   38|       |    // A stream hangup remains readable until curl consumes EOF.
   39|  9.40k|    result |= CURL_CSELECT_IN;
  ------------------
  |  |  290|  9.40k|#define CURL_CSELECT_IN   0x01
  ------------------
   40|  9.40k|  }
   41|  19.8k|  if ((events & POLLOUT) != 0) {
  ------------------
  |  Branch (41:7): [True: 667, False: 19.1k]
  ------------------
   42|    667|    result |= CURL_CSELECT_OUT;
  ------------------
  |  |  291|    667|#define CURL_CSELECT_OUT  0x02
  ------------------
   43|    667|  }
   44|  19.8k|  if ((events & (POLLERR | POLLHUP | POLLNVAL)) != 0) {
  ------------------
  |  Branch (44:7): [True: 0, False: 19.8k]
  ------------------
   45|      0|    result |= CURL_CSELECT_ERR;
  ------------------
  |  |  292|      0|#define CURL_CSELECT_ERR  0x04
  ------------------
   46|      0|  }
   47|  19.8k|  return result;
   48|  19.8k|}

_ZNK12proto_fuzzer17MultiSocketDriver15watch_exhaustedEv:
   55|  9.76k|  bool watch_exhausted() const { return watch_exhausted_; }

_ZN12proto_fuzzer20ApplyBaselineOptionsEPvN4curl6fuzzer5proto6SchemeEbRKNSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE:
  100|  9.91k|                                  const std::string& trace_config) {
  101|  9.91k|  EnableDebugHttpTransportMetadata();
  102|       |
  103|  9.91k|  curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, &SilentWriteCallback);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  104|  9.91k|  curl_easy_setopt(easy, CURLOPT_HEADERFUNCTION, &SilentWriteCallback);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  105|       |
  106|  9.91k|  const bool user_requested_verbose = std::getenv(kVerboseEnvVar) != nullptr;
  107|  9.91k|  if (!trace_config.empty()) {
  ------------------
  |  Branch (107:7): [True: 626, False: 9.28k]
  ------------------
  108|       |    // Apply the fuzzer-selected categories before any explicit trace-ID
  109|       |    // request so a scenario cannot accidentally disable its own ID prefixes.
  110|    626|    (void)curl_global_trace(trace_config.c_str());
  111|    626|  }
  112|  9.91k|  if (trace_ids) {
  ------------------
  |  Branch (112:7): [True: 434, False: 9.48k]
  ------------------
  113|    434|    EnableTraceIds();
  114|    434|  }
  115|  9.91k|  if (trace_ids || !trace_config.empty()) {
  ------------------
  |  Branch (115:7): [True: 434, False: 9.48k]
  |  Branch (115:20): [True: 551, False: 8.93k]
  ------------------
  116|       |    // Keep trace coverage enabled during fuzzing without flooding the process
  117|       |    // log. The callback still executes curl_trc.c's formatting path. A stable
  118|       |    // ignored userdata pointer also lets internal DoH handles exercise the
  119|       |    // public debug-data propagation path without adding per-input ownership.
  120|    985|    curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, &SilentDebugCallback);
  ------------------
  |  | 3364|    985|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    985|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  121|    985|    curl_easy_setopt(easy, CURLOPT_DEBUGDATA, easy);
  ------------------
  |  | 3364|    985|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    985|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  122|    985|    curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L);
  ------------------
  |  | 3364|    985|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    985|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  123|  8.93k|  } else if (scheme == curl::fuzzer::proto::SCHEME_TELNET && !user_requested_verbose) {
  ------------------
  |  Branch (123:14): [True: 0, False: 8.93k]
  |  Branch (123:62): [True: 0, False: 0]
  ------------------
  124|       |    // printoption() and printsub() contain a substantial part of curl's TELNET
  125|       |    // parser diagnostics but run only in verbose mode. Keep those paths in the
  126|       |    // ordinary TELNET coverage lane while suppressing their high-volume text.
  127|       |    // An explicit FUZZ_VERBOSE still skips the sink so reproductions remain
  128|       |    // inspectable from the terminal.
  129|      0|    curl_easy_setopt(easy, CURLOPT_DEBUGFUNCTION, &SilentDebugCallback);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  130|      0|    curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  131|      0|  }
  132|       |
  133|       |  // Each non-HTTP protocol must use its dedicated peer invariants. Keep them
  134|       |  // out of the redirect allowlist so an HTTP response cannot switch a stream
  135|       |  // mock into synchronous TELNET, two-channel FTP, or datagram TFTP semantics.
  136|       |  // CURLOPT_PROTOCOLS_STR arrived in 7.85.0.
  137|  9.91k|  const char* direct_protocols = kEventDrivenProtocolsAllowed;
  138|  9.91k|  switch (scheme) {
  139|      0|    case curl::fuzzer::proto::SCHEME_TELNET:
  ------------------
  |  Branch (139:5): [True: 0, False: 9.91k]
  ------------------
  140|      0|      direct_protocols = kTelnetProtocolAllowed;
  141|      0|      break;
  142|      0|    case curl::fuzzer::proto::SCHEME_FTP:
  ------------------
  |  Branch (142:5): [True: 0, False: 9.91k]
  ------------------
  143|      0|    case curl::fuzzer::proto::SCHEME_FTPS:
  ------------------
  |  Branch (143:5): [True: 0, False: 9.91k]
  ------------------
  144|      0|      direct_protocols = kFtpProtocolAllowed;
  145|      0|      break;
  146|      0|    case curl::fuzzer::proto::SCHEME_TFTP:
  ------------------
  |  Branch (146:5): [True: 0, False: 9.91k]
  ------------------
  147|      0|      direct_protocols = kTftpProtocolAllowed;
  148|      0|      break;
  149|      0|    case curl::fuzzer::proto::SCHEME_SMTP:
  ------------------
  |  Branch (149:5): [True: 0, False: 9.91k]
  ------------------
  150|      0|    case curl::fuzzer::proto::SCHEME_SMTPS:
  ------------------
  |  Branch (150:5): [True: 0, False: 9.91k]
  ------------------
  151|      0|      direct_protocols = kSmtpProtocolAllowed;
  152|      0|      break;
  153|      0|    case curl::fuzzer::proto::SCHEME_IMAP:
  ------------------
  |  Branch (153:5): [True: 0, False: 9.91k]
  ------------------
  154|      0|    case curl::fuzzer::proto::SCHEME_IMAPS:
  ------------------
  |  Branch (154:5): [True: 0, False: 9.91k]
  ------------------
  155|      0|      direct_protocols = kImapProtocolAllowed;
  156|      0|      break;
  157|      0|    case curl::fuzzer::proto::SCHEME_POP3:
  ------------------
  |  Branch (157:5): [True: 0, False: 9.91k]
  ------------------
  158|      0|    case curl::fuzzer::proto::SCHEME_POP3S:
  ------------------
  |  Branch (158:5): [True: 0, False: 9.91k]
  ------------------
  159|      0|      direct_protocols = kPop3ProtocolAllowed;
  160|      0|      break;
  161|      0|    case curl::fuzzer::proto::SCHEME_MQTT:
  ------------------
  |  Branch (161:5): [True: 0, False: 9.91k]
  ------------------
  162|      0|    case curl::fuzzer::proto::SCHEME_MQTTS:
  ------------------
  |  Branch (162:5): [True: 0, False: 9.91k]
  ------------------
  163|      0|      direct_protocols = kMqttProtocolAllowed;
  164|      0|      break;
  165|      0|    case curl::fuzzer::proto::SCHEME_DICT:
  ------------------
  |  Branch (165:5): [True: 0, False: 9.91k]
  ------------------
  166|      0|      direct_protocols = kDictProtocolAllowed;
  167|      0|      break;
  168|      0|    case curl::fuzzer::proto::SCHEME_GOPHER:
  ------------------
  |  Branch (168:5): [True: 0, False: 9.91k]
  ------------------
  169|      0|      direct_protocols = "gopher";
  170|      0|      break;
  171|      0|    case curl::fuzzer::proto::SCHEME_GOPHERS:
  ------------------
  |  Branch (171:5): [True: 0, False: 9.91k]
  ------------------
  172|      0|      direct_protocols = "gophers";
  173|      0|      break;
  174|      0|    case curl::fuzzer::proto::SCHEME_FILE:
  ------------------
  |  Branch (174:5): [True: 0, False: 9.91k]
  ------------------
  175|      0|      direct_protocols = kFileProtocolAllowed;
  176|      0|      break;
  177|      0|    case curl::fuzzer::proto::SCHEME_LDAP:
  ------------------
  |  Branch (177:5): [True: 0, False: 9.91k]
  ------------------
  178|      0|    case curl::fuzzer::proto::SCHEME_LDAPS:
  ------------------
  |  Branch (178:5): [True: 0, False: 9.91k]
  ------------------
  179|      0|      direct_protocols = kLdapProtocolAllowed;
  180|      0|      break;
  181|      0|    case curl::fuzzer::proto::SCHEME_RTSP:
  ------------------
  |  Branch (181:5): [True: 0, False: 9.91k]
  ------------------
  182|      0|      direct_protocols = kRtspProtocolAllowed;
  183|      0|      break;
  184|      0|    case curl::fuzzer::proto::SCHEME_HTTP:
  ------------------
  |  Branch (184:5): [True: 0, False: 9.91k]
  ------------------
  185|  9.91k|    case curl::fuzzer::proto::SCHEME_HTTPS:
  ------------------
  |  Branch (185:5): [True: 9.91k, False: 0]
  ------------------
  186|  9.91k|    case curl::fuzzer::proto::SCHEME_WS:
  ------------------
  |  Branch (186:5): [True: 0, False: 9.91k]
  ------------------
  187|  9.91k|    case curl::fuzzer::proto::SCHEME_WSS:
  ------------------
  |  Branch (187:5): [True: 0, False: 9.91k]
  ------------------
  188|  9.91k|    case curl::fuzzer::proto::SCHEME_IPFS:
  ------------------
  |  Branch (188:5): [True: 0, False: 9.91k]
  ------------------
  189|  9.91k|    case curl::fuzzer::proto::SCHEME_IPNS:
  ------------------
  |  Branch (189:5): [True: 0, False: 9.91k]
  ------------------
  190|  9.91k|    case curl::fuzzer::proto::SCHEME_UNSPECIFIED:
  ------------------
  |  Branch (190:5): [True: 0, False: 9.91k]
  ------------------
  191|  9.91k|    default:
  ------------------
  |  Branch (191:5): [True: 0, False: 9.91k]
  ------------------
  192|  9.91k|      break;
  193|  9.91k|  }
  194|  9.91k|  curl_easy_setopt(easy, CURLOPT_PROTOCOLS_STR, direct_protocols);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  195|  9.91k|  curl_easy_setopt(easy, CURLOPT_REDIR_PROTOCOLS_STR, kEventDrivenProtocolsAllowed);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  196|       |
  197|       |  // CONNECT_TO confines direct connections, but an ambient http_proxy or
  198|       |  // ALL_PROXY can select a proxy before curl asks the harness for a socket.
  199|       |  // An explicit empty proxy keeps every transfer inside the socketpair and
  200|       |  // makes replay independent of the machine running the fuzzer.
  201|  9.91k|  curl_easy_setopt(easy, CURLOPT_PROXY, "");
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  202|       |
  203|       |  // Keep raw secure-scheme inputs independent of the host trust store. The
  204|       |  // dedicated TLS mock installs its own in-memory trust anchor after this
  205|       |  // baseline; scenario options still run last and can deliberately select
  206|       |  // verification failures.
  207|  9.91k|  curl_easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 0L);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  208|       |
  209|       |  // Force every name lookup to the fuzzer's in-process mock peer. The returned
  210|       |  // owner keeps the list alive through curl_easy_cleanup.
  211|  9.91k|  CurlSlistPtr connect_to(curl_slist_append(nullptr, kConnectToOverride));
  212|  9.91k|  curl_easy_setopt(easy, CURLOPT_CONNECT_TO, connect_to.get());
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  213|       |
  214|       |  // Short bounds: fuzzing should never sit waiting on real I/O. Response
  215|       |  // volume is already bounded by libFuzzer's input-size limit, so do not rate
  216|       |  // limit receive traffic here: a global bytes-per-second throttle turns every
  217|       |  // otherwise-complete large response into wall-clock sleep.
  218|  9.91k|  curl_easy_setopt(easy, CURLOPT_CONNECTTIMEOUT_MS, kConnectTimeoutMs);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  219|  9.91k|  curl_easy_setopt(easy, CURLOPT_TIMEOUT_MS, kTimeoutMs);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  220|       |
  221|       |  // Keep every persistence/read path deterministic and prevent scenarios from
  222|       |  // leaking state onto the filesystem. COOKIEFILE also makes the in-memory
  223|       |  // engine's RELOAD command traverse its loader against a harmless empty
  224|       |  // source. These path options deliberately remain absent from the generated
  225|       |  // mutation manifest, so a proto cannot replace /dev/null.
  226|  9.91k|  curl_easy_setopt(easy, CURLOPT_COOKIEJAR, kDevNull);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  227|  9.91k|  curl_easy_setopt(easy, CURLOPT_COOKIEFILE, kDevNull);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  228|  9.91k|  curl_easy_setopt(easy, CURLOPT_ALTSVC, kDevNull);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  229|  9.91k|  curl_easy_setopt(easy, CURLOPT_HSTS, kDevNull);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  230|  9.91k|  curl_easy_setopt(easy, CURLOPT_NETRC_FILE, kDevNull);
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  231|       |  // Do not set CRLFILE to a placeholder path. An empty CRL is
  232|       |  // not a harmless sink: when a scenario restores certificate verification,
  233|       |  // OpenSSL rejects /dev/null before it can exercise useful handshake and
  234|       |  // verification paths. The option is absent from the mutation manifest, so
  235|       |  // leaving it unset introduces neither filesystem writes nor external input.
  236|       |
  237|       |  // FUZZ_VERBOSE in the environment flips curl's own verbose logging on. This
  238|       |  // is useful when reproducing a crashing corpus entry.
  239|  9.91k|  if (user_requested_verbose) {
  ------------------
  |  Branch (239:7): [True: 0, False: 9.91k]
  ------------------
  240|      0|    curl_easy_setopt(easy, CURLOPT_VERBOSE, 1L);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  241|      0|  }
  242|  9.91k|  return connect_to;
  243|  9.91k|}
_ZN12proto_fuzzer14ApplySetOptionEPvRKN4curl6fuzzer5proto9SetOptionE:
  351|  32.8k|CURLcode ApplySetOption(CURL* easy, const curl::fuzzer::proto::SetOption& option) {
  352|  32.8k|  const OptionDescriptor* desc = LookupOptionDescriptor(option.option_id());
  353|  32.8k|  if (desc == nullptr) {
  ------------------
  |  Branch (353:7): [True: 0, False: 32.8k]
  ------------------
  354|      0|    return CURLE_UNKNOWN_OPTION;
  355|      0|  }
  356|  32.8k|  const CURLoption curlopt = static_cast<CURLoption>(desc->curlopt);
  357|       |
  358|  32.8k|  switch (desc->kind) {
  ------------------
  |  Branch (358:11): [True: 32.8k, False: 0]
  ------------------
  359|  17.5k|    case OptionValueKind::kString: {
  ------------------
  |  Branch (359:5): [True: 17.5k, False: 15.3k]
  ------------------
  360|  17.5k|      const std::string& value = option.string_value();
  361|       |
  362|       |      // COPYPOSTFIELDS allocates after reading the separately configured
  363|       |      // POSTFIELDSIZE. First install the same protobuf-owned bytes as a
  364|       |      // no-allocation borrowed fallback. A genuine OOM then still leaves a
  365|       |      // coherent pointer and length for later consumers such as AWS SigV4.
  366|  17.5k|      if (desc->curlopt == CURLOPT_COPYPOSTFIELDS) {
  ------------------
  |  Branch (366:11): [True: 0, False: 17.5k]
  ------------------
  367|      0|        CURLcode result = curl_easy_setopt(easy, CURLOPT_POSTFIELDS, value.c_str());
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  368|      0|        if (result != CURLE_OK) {
  ------------------
  |  Branch (368:13): [True: 0, False: 0]
  ------------------
  369|      0|          return result;
  370|      0|        }
  371|      0|      }
  372|       |
  373|       |      // POSTFIELDS borrows its pointer and COPYPOSTFIELDS copies exactly the
  374|       |      // previously configured size. Apply the correlated byte length first so
  375|       |      // either option accepts embedded NULs without strlen semantics and the
  376|       |      // copying variant can never read beyond the protobuf-owned buffer.
  377|  17.5k|      if (desc->curlopt == CURLOPT_POSTFIELDS || desc->curlopt == CURLOPT_COPYPOSTFIELDS) {
  ------------------
  |  Branch (377:11): [True: 866, False: 16.6k]
  |  Branch (377:50): [True: 0, False: 16.6k]
  ------------------
  378|    866|        CURLcode result = curl_easy_setopt(easy, CURLOPT_POSTFIELDSIZE_LARGE, static_cast<curl_off_t>(value.size()));
  ------------------
  |  | 3364|    866|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    866|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  379|    866|        if (result != CURLE_OK) {
  ------------------
  |  Branch (379:13): [True: 0, False: 866]
  ------------------
  380|      0|          return result;
  381|      0|        }
  382|    866|      }
  383|       |
  384|  17.5k|      if (desc->curlopt == CURLOPT_COPYPOSTFIELDS) {
  ------------------
  |  Branch (384:11): [True: 0, False: 17.5k]
  ------------------
  385|       |        // Copy ownership is a harness invariant rather than an allocation-
  386|       |        // failure target. Preserve pending ordinals for later injectable work.
  387|      0|        allocation_fault_injection::ScopedFailureSuppression suppress_failures;
  388|      0|        return curl_easy_setopt(easy, CURLOPT_COPYPOSTFIELDS, value.c_str());
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  389|      0|      }
  390|       |
  391|       |      // Curl otherwise treats this option as a filename during the TLS
  392|       |      // handshake. Fixed-policy inputs normally arrive pre-constrained by the
  393|       |      // postprocessor; this runtime check also protects compatibility inputs,
  394|       |      // which intentionally bypass it. Curl copies this option in setopt, so
  395|       |      // the temporary remains valid for the call's full ownership contract.
  396|  17.5k|      if (desc->curlopt == CURLOPT_PINNEDPUBLICKEY && !UsesInMemoryPublicKeyPin(value)) {
  ------------------
  |  Branch (396:11): [True: 0, False: 17.5k]
  |  Branch (396:55): [True: 0, False: 0]
  ------------------
  397|      0|        std::string constrained = value;
  398|      0|        ConstrainPinnedPublicKeyValue(&constrained);
  399|      0|        return curl_easy_setopt(easy, curlopt, constrained.c_str());
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  400|      0|      }
  401|       |
  402|  17.5k|      return curl_easy_setopt(easy, curlopt, value.c_str());
  ------------------
  |  | 3364|  17.5k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  17.5k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  403|  17.5k|    }
  404|       |
  405|       |    // Decode the uint_value and pass it as either a long or a curl_off_t depending on the option.
  406|  8.41k|    case OptionValueKind::kUint: {
  ------------------
  |  Branch (406:5): [True: 8.41k, False: 24.4k]
  ------------------
  407|  8.41k|      const std::uint64_t raw = DecodeIntegralOptionValue(*desc, option);
  408|       |      // CURLOPTTYPE_OFF_T options start at 30000. Everything below takes a
  409|       |      // long; everything at/above takes a curl_off_t.
  410|  8.41k|      if (static_cast<int>(desc->curlopt) >= 30000) {
  ------------------
  |  Branch (410:11): [True: 1.79k, False: 6.62k]
  ------------------
  411|  1.79k|        return curl_easy_setopt(easy, curlopt, static_cast<curl_off_t>(raw));
  ------------------
  |  | 3364|  1.79k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  1.79k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  412|  1.79k|      }
  413|  6.62k|      return curl_easy_setopt(easy, curlopt, static_cast<long>(raw));
  ------------------
  |  | 3364|  6.62k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  6.62k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  414|  8.41k|    }
  415|       |
  416|       |    // Decode the bool_value and pass it as a long flag (0 or 1).
  417|  6.92k|    case OptionValueKind::kBool: {
  ------------------
  |  Branch (417:5): [True: 6.92k, False: 25.9k]
  ------------------
  418|  6.92k|      const long flag = static_cast<long>(DecodeIntegralOptionValue(*desc, option));
  419|  6.92k|      return curl_easy_setopt(easy, curlopt, flag);
  ------------------
  |  | 3364|  6.92k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  6.92k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  420|  8.41k|    }
  421|  32.8k|  }
  422|      0|  return CURLE_UNKNOWN_OPTION;
  423|  32.8k|}
_ZN12proto_fuzzer18RuntimeOptionCountERKN4curl6fuzzer5proto8ScenarioE:
  432|  19.3k|std::size_t RuntimeOptionCount(const curl::fuzzer::proto::Scenario& scenario) {
  433|  19.3k|  return std::min<std::size_t>(static_cast<std::size_t>(scenario.options_size()), scenario_limits::kMaxOptions);
  434|  19.3k|}
_ZN12proto_fuzzer20ApplyScenarioOptionsEPvRKN4curl6fuzzer5proto8ScenarioE:
  443|  9.91k|std::size_t ApplyScenarioOptions(CURL* easy, const curl::fuzzer::proto::Scenario& scenario) {
  444|  9.91k|  const std::size_t option_count = RuntimeOptionCount(scenario);
  445|  42.7k|  for (std::size_t index = 0; index < option_count; ++index) {
  ------------------
  |  Branch (445:31): [True: 32.8k, False: 9.91k]
  ------------------
  446|  32.8k|    (void)ApplySetOption(easy, scenario.options(static_cast<int>(index)));
  447|  32.8k|  }
  448|  9.91k|  return option_count;
  449|  9.91k|}
option_apply.cc:_ZN12proto_fuzzer12_GLOBAL__N_132EnableDebugHttpTransportMetadataEv:
   74|  9.91k|void EnableDebugHttpTransportMetadata() {
   75|  9.91k|  static const bool configured = [] {
   76|       |    // CMake builds the fuzzing copy of curl with ENABLE_DEBUG specifically so
   77|       |    // these curl-provided test hooks are available. Do not overwrite values a
   78|       |    // reproducer deliberately supplied in its environment.
   79|  9.91k|    (void)setenv(kAltSvcHttpEnvVar, "1", 0);
   80|  9.91k|    (void)setenv(kHstsHttpEnvVar, "1", 0);
   81|  9.91k|    return true;
   82|  9.91k|  }();
   83|  9.91k|  (void)configured;
   84|  9.91k|}
option_apply.cc:_ZZN12proto_fuzzer12_GLOBAL__N_132EnableDebugHttpTransportMetadataEvENK3$_0clEv:
   75|      1|  static const bool configured = [] {
   76|       |    // CMake builds the fuzzing copy of curl with ENABLE_DEBUG specifically so
   77|       |    // these curl-provided test hooks are available. Do not overwrite values a
   78|       |    // reproducer deliberately supplied in its environment.
   79|      1|    (void)setenv(kAltSvcHttpEnvVar, "1", 0);
   80|      1|    (void)setenv(kHstsHttpEnvVar, "1", 0);
   81|      1|    return true;
   82|      1|  }();
option_apply.cc:_ZN12proto_fuzzer12_GLOBAL__N_119SilentWriteCallbackEPvmmS1_:
   60|  36.9k|size_t SilentWriteCallback(void* /*contents*/, size_t size, size_t nmemb, void* /*userdata*/) { return size * nmemb; }
option_apply.cc:_ZN12proto_fuzzer12_GLOBAL__N_114EnableTraceIdsEv:
   86|    434|void EnableTraceIds() { (void)curl_global_trace("+LIB-IDS"); }
option_apply.cc:_ZN12proto_fuzzer12_GLOBAL__N_119SilentDebugCallbackEPv13curl_infotypePcmS1_:
   66|   512k|int SilentDebugCallback(CURL* /*handle*/, curl_infotype /*type*/, char* /*data*/, size_t /*size*/, void* /*userdata*/) {
   67|   512k|  return 0;
   68|   512k|}

_ZN12proto_fuzzer16ScopedTraceResetC2Ev:
   37|  9.96k|  ScopedTraceReset() { (void)curl_global_trace("-all"); }
_ZN12proto_fuzzer16ScopedTraceResetD2Ev:
   38|  9.96k|  ~ScopedTraceReset() { (void)curl_global_trace("-all"); }

_ZN12proto_fuzzer25DecodeIntegralOptionValueERKNS_16OptionDescriptorERKN4curl6fuzzer5proto9SetOptionE:
   32|  19.8k|                                        const curl::fuzzer::proto::SetOption& option) {
   33|  19.8k|  if (descriptor.kind == OptionValueKind::kString) {
  ------------------
  |  Branch (33:7): [True: 0, False: 19.8k]
  ------------------
   34|      0|    return 0;
   35|      0|  }
   36|  19.8k|  switch (option.value_case()) {
  ------------------
  |  Branch (36:11): [True: 19.8k, False: 0]
  ------------------
   37|  9.83k|    case curl::fuzzer::proto::SetOption::kBoolValue:
  ------------------
  |  Branch (37:5): [True: 9.83k, False: 10.0k]
  ------------------
   38|  9.83k|      return option.bool_value() ? 1U : 0U;
  ------------------
  |  Branch (38:14): [True: 7.38k, False: 2.44k]
  ------------------
   39|  10.0k|    case curl::fuzzer::proto::SetOption::kUintValue:
  ------------------
  |  Branch (39:5): [True: 10.0k, False: 9.83k]
  ------------------
   40|  10.0k|      return descriptor.kind == OptionValueKind::kBool ? (option.uint_value() != 0 ? 1U : 0U) : option.uint_value();
  ------------------
  |  Branch (40:14): [True: 0, False: 10.0k]
  |  Branch (40:59): [True: 0, False: 0]
  ------------------
   41|      0|    case curl::fuzzer::proto::SetOption::kStringValue:
  ------------------
  |  Branch (41:5): [True: 0, False: 19.8k]
  ------------------
   42|      0|    case curl::fuzzer::proto::SetOption::VALUE_NOT_SET:
  ------------------
  |  Branch (42:5): [True: 0, False: 19.8k]
  ------------------
   43|      0|      return 0;
   44|  19.8k|  }
   45|      0|  return 0;
   46|  19.8k|}
_ZN12proto_fuzzer22LookupOptionDescriptorEN4curl6fuzzer5proto12CurlOptionIdE:
   51|   104k|const OptionDescriptor* LookupOptionDescriptor(curl::fuzzer::proto::CurlOptionId id) {
   52|   104k|  return generated::LookupOptionDescriptor(id);
   53|   104k|}
_ZN12proto_fuzzer25DecodeIntegralOptionValueERKN4curl6fuzzer5proto9SetOptionE:
   74|  4.51k|std::uint64_t DecodeIntegralOptionValue(const curl::fuzzer::proto::SetOption& option) {
   75|  4.51k|  const OptionDescriptor* descriptor = LookupOptionDescriptor(option.option_id());
   76|  4.51k|  return descriptor == nullptr ? 0 : DecodeIntegralOptionValue(*descriptor, option);
  ------------------
  |  Branch (76:10): [True: 0, False: 4.51k]
  ------------------
   77|  4.51k|}
_ZN12proto_fuzzer28CanonicalizeOptionValueCasesEPN4curl6fuzzer5proto8ScenarioE:
   83|  19.9k|void CanonicalizeOptionValueCases(curl::fuzzer::proto::Scenario* scenario) {
   84|  19.9k|  if (scenario == nullptr) {
  ------------------
  |  Branch (84:7): [True: 0, False: 19.9k]
  ------------------
   85|      0|    return;
   86|      0|  }
   87|  66.7k|  for (auto& option : *scenario->mutable_options()) {
  ------------------
  |  Branch (87:21): [True: 66.7k, False: 19.9k]
  ------------------
   88|  66.7k|    const OptionDescriptor* descriptor = LookupOptionDescriptor(option.option_id());
   89|  66.7k|    if (descriptor == nullptr) {
  ------------------
  |  Branch (89:9): [True: 0, False: 66.7k]
  ------------------
   90|      0|      continue;
   91|      0|    }
   92|  66.7k|    switch (descriptor->kind) {
  ------------------
  |  Branch (92:13): [True: 66.7k, False: 0]
  ------------------
   93|  35.3k|      case OptionValueKind::kString:
  ------------------
  |  Branch (93:7): [True: 35.3k, False: 31.4k]
  ------------------
   94|  35.3k|        if (option.value_case() != curl::fuzzer::proto::SetOption::kStringValue) {
  ------------------
  |  Branch (94:13): [True: 0, False: 35.3k]
  ------------------
   95|      0|          option.set_string_value("");
   96|      0|        }
   97|  35.3k|        if (descriptor->id == curl::fuzzer::proto::CURLOPT_PINNEDPUBLICKEY) {
  ------------------
  |  Branch (97:13): [True: 0, False: 35.3k]
  ------------------
   98|      0|          ConstrainPinnedPublicKeyValue(option.mutable_string_value());
   99|      0|        }
  100|  35.3k|        break;
  101|  17.0k|      case OptionValueKind::kUint:
  ------------------
  |  Branch (101:7): [True: 17.0k, False: 49.6k]
  ------------------
  102|  17.0k|        if (option.value_case() != curl::fuzzer::proto::SetOption::kUintValue) {
  ------------------
  |  Branch (102:13): [True: 0, False: 17.0k]
  ------------------
  103|      0|          option.set_uint_value(DecodeIntegralOptionValue(*descriptor, option));
  104|      0|        }
  105|  17.0k|        break;
  106|  14.3k|      case OptionValueKind::kBool:
  ------------------
  |  Branch (106:7): [True: 14.3k, False: 52.4k]
  ------------------
  107|  14.3k|        if (option.value_case() != curl::fuzzer::proto::SetOption::kBoolValue) {
  ------------------
  |  Branch (107:13): [True: 0, False: 14.3k]
  ------------------
  108|      0|          option.set_bool_value(DecodeIntegralOptionValue(*descriptor, option) != 0);
  109|      0|        }
  110|  14.3k|        break;
  111|  66.7k|    }
  112|  66.7k|  }
  113|  19.9k|}

_ZN12proto_fuzzer18ProfileFuzzerHooksINS_9generated15FastHttp3TraitsEE13CustomMutatorEPhmmj:
  107|      2|  static std::size_t CustomMutator(std::uint8_t* data, std::size_t size, std::size_t max_size, unsigned int seed) {
  108|      2|    EnsurePostProcessor();
  109|      2|    Message message;
  110|      2|    return protobuf_mutator::libfuzzer::CustomProtoMutator(true, data, size, max_size, seed, &message);
  111|      2|  }
_ZN12proto_fuzzer18ProfileFuzzerHooksINS_9generated15FastHttp3TraitsEE19EnsurePostProcessorEv:
   77|  10.2k|  static void EnsurePostProcessor() {
   78|  10.2k|    static const protobuf_mutator::libfuzzer::PostProcessorRegistration<Message> registration(
   79|  10.2k|        [](Message* message, unsigned int /*seed*/) { NormalizeMessage(message); });
   80|  10.2k|    (void)registration;
   81|  10.2k|  }
_ZZN12proto_fuzzer18ProfileFuzzerHooksINS_9generated15FastHttp3TraitsEE19EnsurePostProcessorEvENKUlPN4curl6fuzzer9generated10fast_http317FastHttp3ScenarioEjE_clES9_j:
   79|  9.96k|        [](Message* message, unsigned int /*seed*/) { NormalizeMessage(message); });
_ZN12proto_fuzzer18ProfileFuzzerHooksINS_9generated15FastHttp3TraitsEE16NormalizeMessageEPN4curl6fuzzer9generated10fast_http317FastHttp3ScenarioE:
   86|  9.96k|  static void NormalizeMessage(Message* message) {
   87|  9.96k|    if (message == nullptr) {
  ------------------
  |  Branch (87:9): [True: 0, False: 9.96k]
  ------------------
   88|      0|      return;
   89|      0|    }
   90|       |
   91|  9.96k|    message->DiscardUnknownFields();
   92|  9.96k|    RuntimeScenario runtime;
   93|  9.96k|    Traits::Lower(message, &runtime);
   94|  9.96k|    if constexpr (Traits::kProfile != TargetProfile::kCompatibility) {
   95|  9.96k|      NormalizeScenarioForTarget(&runtime, Traits::kProfile, &Traits::PruneConditionalEligibility);
   96|  9.96k|    }
   97|  9.96k|    message->Clear();
   98|  9.96k|    Traits::Lift(&runtime, message);
   99|  9.96k|  }
_ZN12proto_fuzzer18ProfileFuzzerHooksINS_9generated15FastHttp3TraitsEE15CustomCrossOverEPKhmS5_mPhmj:
  124|      1|                                     unsigned int seed) {
  125|      1|    EnsurePostProcessor();
  126|      1|    Message message1;
  127|      1|    Message message2;
  128|      1|    return protobuf_mutator::libfuzzer::CustomProtoCrossOver(true, data1, size1, data2, size2, out, max_out_size, seed,
  129|      1|                                                             &message1, &message2);
  130|      1|  }
_ZN12proto_fuzzer16LoadProfileInputINS_9generated15FastHttp3TraitsEEEbPKhmPN4curl6fuzzer5proto8ScenarioE:
  176|  10.2k|bool LoadProfileInput(const std::uint8_t* data, std::size_t size, curl::fuzzer::proto::Scenario* runtime) {
  177|  10.2k|  return ProfileFuzzerHooks<Traits>::LoadAndLower(data, size, runtime);
  178|  10.2k|}
_ZN12proto_fuzzer18ProfileFuzzerHooksINS_9generated15FastHttp3TraitsEE12LoadAndLowerEPKhmPN4curl6fuzzer5proto8ScenarioE:
  141|  10.2k|  static bool LoadAndLower(const std::uint8_t* data, std::size_t size, RuntimeScenario* runtime) {
  142|  10.2k|    if (runtime == nullptr) {
  ------------------
  |  Branch (142:9): [True: 0, False: 10.2k]
  ------------------
  143|      0|      return false;
  144|      0|    }
  145|       |
  146|  10.2k|    EnsurePostProcessor();
  147|  10.2k|    Message message;
  148|  10.2k|    if (!protobuf_mutator::libfuzzer::LoadProtoInput(true, data, size, &message)) {
  ------------------
  |  Branch (148:9): [True: 306, False: 9.96k]
  ------------------
  149|    306|      return false;
  150|    306|    }
  151|       |
  152|       |    // Mutated inputs have already passed the postprocessor before entering
  153|       |    // LPM's cache. Parsed inputs pass it in Fix(). Discarding once more is
  154|       |    // harmless and makes the lowering boundary fail closed for either path.
  155|  9.96k|    message.DiscardUnknownFields();
  156|  9.96k|    runtime->Clear();
  157|  9.96k|    Traits::Lower(&message, runtime);
  158|       |    // A projected profile root intentionally cannot carry policy-owned state
  159|       |    // such as a fixed scheme. The postprocessor normalized that state before
  160|       |    // Lift, but Lift necessarily omitted it; restore it at the final lowering
  161|       |    // boundary instead of assuming the serialized root can round-trip it.
  162|  9.96k|    if constexpr (Traits::kProfile != TargetProfile::kCompatibility) {
  163|  9.96k|      NormalizeScenarioForTarget(runtime, Traits::kProfile, &Traits::PruneConditionalEligibility);
  164|  9.96k|    }
  165|  9.96k|    return true;
  166|  10.2k|  }

_ZN12proto_fuzzer17UploadScriptStateC2ERKN4curl6fuzzer5proto8ScenarioE:
  307|  9.91k|    : data_(),
  308|  9.91k|      read_step_count_(0),
  309|  9.91k|      total_size_(scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET ? 0 : scenario_limits::kMaxUploadBytes),
  ------------------
  |  Branch (309:19): [True: 0, False: 9.91k]
  ------------------
  310|  9.91k|      max_read_size_(scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET ? scenario_limits::kMaxTelnetUploadReadSize
  ------------------
  |  Branch (310:22): [True: 0, False: 9.91k]
  ------------------
  311|  9.91k|                                                                             : scenario_limits::kMaxUploadReadSize),
  312|  9.91k|      offset_(0),
  313|  9.91k|      next_read_size_(0),
  314|  9.91k|      seek_calls_(0),
  315|  9.91k|      terminal_(curl::fuzzer::proto::UPLOAD_TERMINAL_EOF),
  316|  9.91k|      seek_result_(curl::fuzzer::proto::UPLOAD_SEEK_CANTSEEK),
  317|  9.91k|      before_read_callback_(nullptr),
  318|  9.91k|      before_read_userdata_(nullptr),
  319|  9.91k|      scripted_(scenario.has_upload()) {
  320|  9.91k|  if (!scripted_) {
  ------------------
  |  Branch (320:7): [True: 9.44k, False: 470]
  ------------------
  321|  9.44k|    return;
  322|  9.44k|  }
  323|       |
  324|    470|  const auto& upload = scenario.upload();
  325|    470|  const std::size_t data_limit = scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET
  ------------------
  |  Branch (325:34): [True: 0, False: 470]
  ------------------
  326|    470|                                     ? scenario_limits::kMaxTelnetUploadBytes
  327|    470|                                     : scenario_limits::kMaxUploadBytes;
  328|    470|  const std::size_t data_size = std::min(upload.data().size(), data_limit);
  329|    470|  data_ = std::string_view(upload.data().data(), data_size);
  330|    470|  total_size_ = data_.size();
  331|    470|  terminal_ = upload.terminal();
  332|    470|  if (scenario.scheme() != curl::fuzzer::proto::SCHEME_TELNET &&
  ------------------
  |  Branch (332:7): [True: 470, False: 0]
  ------------------
  333|    470|      terminal_ == curl::fuzzer::proto::UPLOAD_TERMINAL_PAUSE) {
  ------------------
  |  Branch (333:7): [True: 0, False: 470]
  ------------------
  334|       |    // Event-driven protocols need an external resume source. Interpret this
  335|       |    // TELNET-specific outcome as EOF before curl can retain a paused transfer.
  336|      0|    terminal_ = curl::fuzzer::proto::UPLOAD_TERMINAL_EOF;
  337|      0|  }
  338|    470|  seek_result_ = upload.seek_result();
  339|       |
  340|    470|  const std::size_t read_step_limit = scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET
  ------------------
  |  Branch (340:39): [True: 0, False: 470]
  ------------------
  341|    470|                                          ? scenario_limits::kMaxTelnetUploadReadSteps
  342|    470|                                          : scenario_limits::kMaxUploadReadSteps;
  343|    470|  read_step_count_ = std::min<std::size_t>(upload.read_sizes_size(), read_step_limit);
  344|  1.84k|  for (std::size_t i = 0; i < read_step_count_; ++i) {
  ------------------
  |  Branch (344:27): [True: 1.37k, False: 470]
  ------------------
  345|  1.37k|    const std::size_t requested = upload.read_sizes(static_cast<int>(i));
  346|       |    // Zero-as-one ensures every retained step makes progress; see the schema
  347|       |    // comment for why zero is not treated as an early EOF sentinel.
  348|  1.37k|    read_sizes_[i] = std::max<std::size_t>(1, std::min(requested, max_read_size_));
  349|  1.37k|  }
  350|    470|}
_ZN12proto_fuzzer17UploadScriptState4ReadEPcm:
  361|    265|std::size_t UploadScriptState::Read(char* buffer, std::size_t capacity) {
  362|       |  // TELNET can produce negotiation replies while one curl_multi_perform call
  363|       |  // owns the thread. Empty them before returning more callback bytes;
  364|       |  // otherwise send_telnet_data() can consume the whole bounded transfer
  365|       |  // timeout while the synchronous path waits for socket capacity.
  366|    265|  if (before_read_callback_ != nullptr) {
  ------------------
  |  Branch (366:7): [True: 0, False: 265]
  ------------------
  367|      0|    before_read_callback_(before_read_userdata_);
  368|      0|  }
  369|    265|  if (offset_ >= total_size_) {
  ------------------
  |  Branch (369:7): [True: 123, False: 142]
  ------------------
  370|    123|    switch (terminal_) {
  371|      0|      case curl::fuzzer::proto::UPLOAD_TERMINAL_ABORT:
  ------------------
  |  Branch (371:7): [True: 0, False: 123]
  ------------------
  372|      0|        return CURL_READFUNC_ABORT;
  ------------------
  |  |  392|      0|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  373|      0|      case curl::fuzzer::proto::UPLOAD_TERMINAL_PAUSE:
  ------------------
  |  Branch (373:7): [True: 0, False: 123]
  ------------------
  374|      0|        return CURL_READFUNC_PAUSE;
  ------------------
  |  |  395|      0|#define CURL_READFUNC_PAUSE 0x10000001
  ------------------
  375|    123|      case curl::fuzzer::proto::UPLOAD_TERMINAL_EOF:
  ------------------
  |  Branch (375:7): [True: 123, False: 0]
  ------------------
  376|    123|      default:
  ------------------
  |  Branch (376:7): [True: 0, False: 123]
  ------------------
  377|    123|        return 0;
  378|    123|    }
  379|    123|  }
  380|    142|  if (buffer == nullptr || capacity == 0) {
  ------------------
  |  Branch (380:7): [True: 0, False: 142]
  |  Branch (380:28): [True: 0, False: 142]
  ------------------
  381|      0|    return 0;
  382|      0|  }
  383|       |
  384|    142|  std::size_t chunk_limit = std::min(capacity, max_read_size_);
  385|    142|  if (next_read_size_ < read_step_count_) {
  ------------------
  |  Branch (385:7): [True: 12, False: 130]
  ------------------
  386|     12|    chunk_limit = std::min(chunk_limit, read_sizes_[next_read_size_++]);
  387|     12|  }
  388|    142|  const std::size_t count = std::min(chunk_limit, total_size_ - offset_);
  389|    142|  if (scripted_) {
  ------------------
  |  Branch (389:7): [True: 44, False: 98]
  ------------------
  390|     44|    std::memcpy(buffer, data_.data() + offset_, count);
  391|     98|  } else {
  392|     98|    std::memset(buffer, 'U', count);
  393|     98|  }
  394|    142|  offset_ += count;
  395|    142|  return count;
  396|    142|}
_ZN12proto_fuzzer17UploadScriptState12ReadCallbackEPcmmPv:
  451|    265|std::size_t UploadScriptState::ReadCallback(char* buffer, std::size_t size, std::size_t nitems, void* userdata) {
  452|    265|  if (userdata == nullptr || size == 0 || nitems == 0) {
  ------------------
  |  Branch (452:7): [True: 0, False: 265]
  |  Branch (452:30): [True: 0, False: 265]
  |  Branch (452:43): [True: 0, False: 265]
  ------------------
  453|      0|    return 0;
  454|      0|  }
  455|    265|  const std::size_t max = std::numeric_limits<std::size_t>::max();
  456|    265|  if (nitems > max / size) {
  ------------------
  |  Branch (456:7): [True: 0, False: 265]
  ------------------
  457|      0|    return CURL_READFUNC_ABORT;
  ------------------
  |  |  392|      0|#define CURL_READFUNC_ABORT 0x10000000
  ------------------
  458|      0|  }
  459|    265|  return static_cast<UploadScriptState*>(userdata)->Read(buffer, size * nitems);
  460|    265|}
_ZNK12proto_fuzzer17UploadScriptState9data_sizeEv:
  473|  9.91k|std::size_t UploadScriptState::data_size() const { return total_size_; }
_ZNK12proto_fuzzer17UploadScriptState15read_step_countEv:
  476|  9.91k|std::size_t UploadScriptState::read_step_count() const { return read_step_count_; }
_ZNK12proto_fuzzer17UploadScriptState6offsetEv:
  479|  9.91k|std::size_t UploadScriptState::offset() const { return offset_; }
_ZNK12proto_fuzzer17UploadScriptState10seek_callsEv:
  482|  9.91k|std::size_t UploadScriptState::seek_calls() const { return seek_calls_; }
_ZNK12proto_fuzzer17UploadScriptState8scriptedEv:
  485|  9.91k|bool UploadScriptState::scripted() const { return scripted_; }
_ZN12proto_fuzzer17UploadScriptState17InstallAsMimePartEP13curl_mimepart:
  492|    163|CURLcode UploadScriptState::InstallAsMimePart(curl_mimepart* part) {
  493|    163|  if (part == nullptr) {
  ------------------
  |  Branch (493:7): [True: 0, False: 163]
  ------------------
  494|      0|    return CURLE_BAD_FUNCTION_ARGUMENT;
  495|      0|  }
  496|    163|  return curl_mime_data_cb(part, static_cast<curl_off_t>(total_size_), &UploadScriptState::ReadCallback,
  497|    163|                           &UploadScriptState::SeekCallback, nullptr, this);
  498|    163|}
_ZN12proto_fuzzer22HttpUploadTrailerStateC2ERKN4curl6fuzzer5proto8ScenarioE:
  512|  9.91k|    : line_count_(0),
  513|  9.91k|      callback_count_(0),
  514|  9.91k|      result_(curl::fuzzer::proto::HTTP_UPLOAD_TRAILER_SUCCESS),
  515|  9.91k|      enabled_(scenario.has_http_upload_trailers() && SupportsHttpUploadTrailers(scenario)) {
  ------------------
  |  Branch (515:16): [True: 0, False: 9.91k]
  |  Branch (515:55): [True: 0, False: 0]
  ------------------
  516|  9.91k|  if (!enabled_) {
  ------------------
  |  Branch (516:7): [True: 9.91k, False: 0]
  ------------------
  517|  9.91k|    return;
  518|  9.91k|  }
  519|       |
  520|      0|  const auto& source = scenario.http_upload_trailers();
  521|      0|  if (source.result() == curl::fuzzer::proto::HTTP_UPLOAD_TRAILER_ABORT) {
  ------------------
  |  Branch (521:7): [True: 0, False: 0]
  ------------------
  522|      0|    result_ = source.result();
  523|      0|  }
  524|      0|  line_count_ = std::min<std::size_t>(scenario_limits::kMaxHttpUploadTrailers, source.lines_size());
  525|      0|  for (std::size_t index = 0; index < line_count_; ++index) {
  ------------------
  |  Branch (525:31): [True: 0, False: 0]
  ------------------
  526|      0|    const std::string& line = source.lines(static_cast<int>(index));
  527|      0|    lines_[index].assign(line.data(), std::min(line.size(), scenario_limits::kMaxHttpUploadTrailerBytes));
  528|      0|  }
  529|      0|}
_ZNK12proto_fuzzer22HttpUploadTrailerState7enabledEv:
  573|  9.91k|bool HttpUploadTrailerState::enabled() const { return enabled_; }
_ZN12proto_fuzzer19ScenarioRequestDataC2EPvRKN4curl6fuzzer5proto8ScenarioEb:
  593|  9.91k|    : easy_(easy),
  594|  9.91k|      request_headers_(nullptr),
  595|  9.91k|      resolve_entries_(nullptr),
  596|  9.91k|      telnet_options_(nullptr),
  597|  9.91k|      mail_rcpt_(nullptr),
  598|  9.91k|      ftp_quote_(nullptr),
  599|  9.91k|      ftp_prequote_(nullptr),
  600|  9.91k|      ftp_postquote_(nullptr),
  601|  9.91k|      upload_state_(scenario),
  602|  9.91k|      http_upload_trailer_state_(scenario),
  603|  9.91k|      mime_post_(nullptr),
  604|  9.91k|      upload_callbacks_installed_(false),
  605|  9.91k|      http_upload_trailer_callback_installed_(false),
  606|  9.91k|      resolve_entries_ready_(!apply_resolve_entries) {
  607|  9.91k|  if (easy_ == nullptr) {
  ------------------
  |  Branch (607:7): [True: 0, False: 9.91k]
  ------------------
  608|      0|    return;
  609|      0|  }
  610|       |
  611|       |  // Complete all allocating work before installing retained pointers. If a
  612|       |  // C++ allocation throws, scoped owners unwind without leaving the easy
  613|       |  // handle pointing into a partially constructed request-data object.
  614|  9.91k|  bool resolve_entries_built = false;
  615|  9.91k|  if (apply_resolve_entries) {
  ------------------
  |  Branch (615:7): [True: 0, False: 9.91k]
  ------------------
  616|      0|    resolve_entries_ = BuildStringList(scenario.resolve_entries(), scenario_limits::kMaxResolveEntries,
  617|      0|                                       scenario_limits::kMaxResolveEntryBytes, &stats_.resolve_entries);
  618|       |    // This mapping is deliberately last: preceding wildcard or removal
  619|       |    // mutations may exercise host-cache parsing, but cannot redirect the
  620|       |    // canonical resolver-lane origin away from the in-process mock.
  621|      0|    curl_slist* appended = curl_slist_append(resolve_entries_.get(), "resolve.test:80:127.0.0.1");
  622|      0|    if (appended != nullptr) {
  ------------------
  |  Branch (622:9): [True: 0, False: 0]
  ------------------
  623|      0|      (void)resolve_entries_.release();
  624|      0|      resolve_entries_.reset(appended);
  625|      0|      resolve_entries_built = true;
  626|      0|    }
  627|      0|  }
  628|       |
  629|       |  // HTTP headers/MIME and TELNET options are mutually exclusive because only
  630|       |  // the selected protocol can observe them. Avoid allocating protocol-inert
  631|       |  // lists and trees in compatibility inputs that bypass target policy.
  632|  9.91k|  if (scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET) {
  ------------------
  |  Branch (632:7): [True: 0, False: 9.91k]
  ------------------
  633|      0|    telnet_options_ = BuildStringList(scenario.telnet_options(), scenario_limits::kMaxTelnetOptions,
  634|      0|                                      scenario_limits::kMaxTelnetOptionBytes, &stats_.telnet_options);
  635|  9.91k|  } else {
  636|  9.91k|    request_headers_ = BuildStringList(scenario.request_headers(), scenario_limits::kMaxRequestHeaders,
  637|  9.91k|                                       scenario_limits::kMaxMetadataBytes, &stats_.request_headers);
  638|  9.91k|    if (scenario.has_mime_post()) {
  ------------------
  |  Branch (638:9): [True: 1.02k, False: 8.88k]
  ------------------
  639|  1.02k|      mime_post_ = BuildMimePost(easy_, scenario.mime_post(), &upload_state_, &stats_);
  640|  1.02k|    }
  641|  9.91k|  }
  642|       |
  643|  9.91k|  if (scenario.scheme() == curl::fuzzer::proto::SCHEME_SMTP || scenario.scheme() == curl::fuzzer::proto::SCHEME_SMTPS ||
  ------------------
  |  Branch (643:7): [True: 0, False: 9.91k]
  |  Branch (643:64): [True: 0, False: 9.91k]
  ------------------
  644|  9.91k|      !scenario.mail_rcpt().empty()) {
  ------------------
  |  Branch (644:7): [True: 0, False: 9.91k]
  ------------------
  645|       |    // Recipient list entries borrow protobuf-owned storage only for the
  646|       |    // duration of BuildStringList; curl_slist_append copies each address.
  647|      0|    mail_rcpt_ = BuildStringList(scenario.mail_rcpt(), scenario_limits::kMaxMailRecipients,
  648|      0|                                 scenario_limits::kMaxMailRecipientBytes, &stats_.mail_rcpt);
  649|      0|  }
  650|       |
  651|  9.91k|  if (scenario.scheme() == curl::fuzzer::proto::SCHEME_FTP || scenario.scheme() == curl::fuzzer::proto::SCHEME_FTPS) {
  ------------------
  |  Branch (651:7): [True: 0, False: 9.91k]
  |  Branch (651:63): [True: 0, False: 9.91k]
  ------------------
  652|       |    // The three lists share a work budget in their execution order. Runtime
  653|       |    // enforces the bound independently because compatibility inputs bypass
  654|       |    // fixed-target postprocessing.
  655|      0|    std::size_t remaining = scenario_limits::kMaxFtpQuoteCommands;
  656|      0|    ftp_quote_ =
  657|      0|        BuildStringList(scenario.ftp_quote(), remaining, scenario_limits::kMaxFtpQuoteCommandBytes, &stats_.ftp_quote);
  658|      0|    remaining -= stats_.ftp_quote;
  659|      0|    ftp_prequote_ = BuildStringList(scenario.ftp_prequote(), remaining, scenario_limits::kMaxFtpQuoteCommandBytes,
  660|      0|                                    &stats_.ftp_prequote);
  661|      0|    remaining -= stats_.ftp_prequote;
  662|      0|    ftp_postquote_ = BuildStringList(scenario.ftp_postquote(), remaining, scenario_limits::kMaxFtpQuoteCommandBytes,
  663|      0|                                     &stats_.ftp_postquote);
  664|      0|  }
  665|       |
  666|  9.91k|  if (resolve_entries_built) {
  ------------------
  |  Branch (666:7): [True: 0, False: 9.91k]
  ------------------
  667|      0|    resolve_entries_ready_ = curl_easy_setopt(easy_, CURLOPT_RESOLVE, resolve_entries_.get()) == CURLE_OK;
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  668|      0|  }
  669|       |
  670|  9.91k|  if (NeedsUploadCallbacks(scenario)) {
  ------------------
  |  Branch (670:7): [True: 576, False: 9.33k]
  ------------------
  671|       |    // Install a per-run memory source even when Scenario.upload is absent but
  672|       |    // CURLOPT_UPLOAD or TELNET may request caller input. Non-TELNET schemes
  673|       |    // retain the historical fallback bytes; TELNET returns EOF. Either result
  674|       |    // replaces stdin and cannot block OSS-Fuzz. The state remains scoped to
  675|       |    // the complete drive so retries cannot share a cursor across iterations.
  676|    576|    upload_callbacks_installed_ = true;
  677|    576|    (void)curl_easy_setopt(easy_, CURLOPT_READFUNCTION, &UploadScriptState::ReadCallback);
  ------------------
  |  | 3364|    576|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    576|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  678|    576|    (void)curl_easy_setopt(easy_, CURLOPT_READDATA, &upload_state_);
  ------------------
  |  | 3364|    576|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    576|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  679|    576|    (void)curl_easy_setopt(easy_, CURLOPT_SEEKFUNCTION, &UploadScriptState::SeekCallback);
  ------------------
  |  | 3364|    576|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    576|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  680|    576|    (void)curl_easy_setopt(easy_, CURLOPT_SEEKDATA, &upload_state_);
  ------------------
  |  | 3364|    576|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    576|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  681|    576|  }
  682|       |
  683|  9.91k|  if (http_upload_trailer_state_.enabled()) {
  ------------------
  |  Branch (683:7): [True: 0, False: 9.91k]
  ------------------
  684|      0|    stats_.http_upload_trailers = http_upload_trailer_state_.line_count();
  685|      0|    const CURLcode function_result =
  686|      0|        curl_easy_setopt(easy_, CURLOPT_TRAILERFUNCTION, &HttpUploadTrailerState::TrailerCallback);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  687|      0|    const CURLcode data_result = curl_easy_setopt(easy_, CURLOPT_TRAILERDATA, &http_upload_trailer_state_);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  688|      0|    http_upload_trailer_callback_installed_ = function_result == CURLE_OK && data_result == CURLE_OK;
  ------------------
  |  Branch (688:47): [True: 0, False: 0]
  |  Branch (688:78): [True: 0, False: 0]
  ------------------
  689|      0|    if (!http_upload_trailer_callback_installed_) {
  ------------------
  |  Branch (689:9): [True: 0, False: 0]
  ------------------
  690|      0|      (void)curl_easy_setopt(easy_, CURLOPT_TRAILERFUNCTION, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  691|      0|      (void)curl_easy_setopt(easy_, CURLOPT_TRAILERDATA, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  692|      0|    }
  693|      0|  }
  694|       |
  695|  9.91k|  if (telnet_options_ != nullptr) {
  ------------------
  |  Branch (695:7): [True: 0, False: 9.91k]
  ------------------
  696|      0|    (void)curl_easy_setopt(easy_, CURLOPT_TELNETOPTIONS, telnet_options_.get());
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  697|      0|  }
  698|  9.91k|  if (mail_rcpt_ != nullptr) {
  ------------------
  |  Branch (698:7): [True: 0, False: 9.91k]
  ------------------
  699|      0|    (void)curl_easy_setopt(easy_, CURLOPT_MAIL_RCPT, mail_rcpt_.get());
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  700|      0|  }
  701|  9.91k|  if (ftp_quote_ != nullptr) {
  ------------------
  |  Branch (701:7): [True: 0, False: 9.91k]
  ------------------
  702|      0|    (void)curl_easy_setopt(easy_, CURLOPT_QUOTE, ftp_quote_.get());
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  703|      0|  }
  704|  9.91k|  if (ftp_prequote_ != nullptr) {
  ------------------
  |  Branch (704:7): [True: 0, False: 9.91k]
  ------------------
  705|      0|    (void)curl_easy_setopt(easy_, CURLOPT_PREQUOTE, ftp_prequote_.get());
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  706|      0|  }
  707|  9.91k|  if (ftp_postquote_ != nullptr) {
  ------------------
  |  Branch (707:7): [True: 0, False: 9.91k]
  ------------------
  708|      0|    (void)curl_easy_setopt(easy_, CURLOPT_POSTQUOTE, ftp_postquote_.get());
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  709|      0|  }
  710|  9.91k|  if (request_headers_ != nullptr) {
  ------------------
  |  Branch (710:7): [True: 386, False: 9.52k]
  ------------------
  711|    386|    (void)curl_easy_setopt(easy_, CURLOPT_HTTPHEADER, request_headers_.get());
  ------------------
  |  | 3364|    386|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    386|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  712|    386|  }
  713|  9.91k|  if (mime_post_ != nullptr) {
  ------------------
  |  Branch (713:7): [True: 1.01k, False: 8.90k]
  ------------------
  714|  1.01k|    (void)curl_easy_setopt(easy_, CURLOPT_MIMEPOST, mime_post_.get());
  ------------------
  |  | 3364|  1.01k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  1.01k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  715|  1.01k|  }
  716|  9.91k|}
_ZN12proto_fuzzer19ScenarioRequestDataD2Ev:
  723|  9.91k|ScenarioRequestData::~ScenarioRequestData() {
  724|  9.91k|  if (easy_ != nullptr) {
  ------------------
  |  Branch (724:7): [True: 9.91k, False: 0]
  ------------------
  725|       |    // Clear callbacks before their userdata member is destroyed. There is no
  726|       |    // perform in this destructor, but making the handle non-dangling keeps the
  727|       |    // ownership rule robust if cleanup later gains diagnostics or getinfo.
  728|  9.91k|    if (upload_callbacks_installed_) {
  ------------------
  |  Branch (728:9): [True: 576, False: 9.33k]
  ------------------
  729|    576|      (void)curl_easy_setopt(easy_, CURLOPT_SEEKFUNCTION, nullptr);
  ------------------
  |  | 3364|    576|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    576|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  730|    576|      (void)curl_easy_setopt(easy_, CURLOPT_SEEKDATA, nullptr);
  ------------------
  |  | 3364|    576|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    576|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  731|    576|      (void)curl_easy_setopt(easy_, CURLOPT_READFUNCTION, nullptr);
  ------------------
  |  | 3364|    576|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    576|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  732|    576|      (void)curl_easy_setopt(easy_, CURLOPT_READDATA, nullptr);
  ------------------
  |  | 3364|    576|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    576|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  733|    576|    }
  734|  9.91k|    if (http_upload_trailer_callback_installed_) {
  ------------------
  |  Branch (734:9): [True: 0, False: 9.91k]
  ------------------
  735|      0|      (void)curl_easy_setopt(easy_, CURLOPT_TRAILERFUNCTION, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  736|      0|      (void)curl_easy_setopt(easy_, CURLOPT_TRAILERDATA, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  737|      0|    }
  738|  9.91k|    if (mime_post_ != nullptr) {
  ------------------
  |  Branch (738:9): [True: 1.01k, False: 8.90k]
  ------------------
  739|  1.01k|      (void)curl_easy_setopt(easy_, CURLOPT_MIMEPOST, nullptr);
  ------------------
  |  | 3364|  1.01k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  1.01k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  740|  1.01k|    }
  741|  9.91k|    if (request_headers_ != nullptr) {
  ------------------
  |  Branch (741:9): [True: 386, False: 9.52k]
  ------------------
  742|    386|      (void)curl_easy_setopt(easy_, CURLOPT_HTTPHEADER, nullptr);
  ------------------
  |  | 3364|    386|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|    386|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  743|    386|    }
  744|  9.91k|    if (resolve_entries_ != nullptr) {
  ------------------
  |  Branch (744:9): [True: 0, False: 9.91k]
  ------------------
  745|      0|      (void)curl_easy_setopt(easy_, CURLOPT_RESOLVE, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  746|      0|    }
  747|  9.91k|    if (telnet_options_ != nullptr) {
  ------------------
  |  Branch (747:9): [True: 0, False: 9.91k]
  ------------------
  748|      0|      (void)curl_easy_setopt(easy_, CURLOPT_TELNETOPTIONS, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  749|      0|    }
  750|  9.91k|    if (mail_rcpt_ != nullptr) {
  ------------------
  |  Branch (750:9): [True: 0, False: 9.91k]
  ------------------
  751|      0|      (void)curl_easy_setopt(easy_, CURLOPT_MAIL_RCPT, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  752|      0|    }
  753|  9.91k|    if (ftp_postquote_ != nullptr) {
  ------------------
  |  Branch (753:9): [True: 0, False: 9.91k]
  ------------------
  754|      0|      (void)curl_easy_setopt(easy_, CURLOPT_POSTQUOTE, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  755|      0|    }
  756|  9.91k|    if (ftp_prequote_ != nullptr) {
  ------------------
  |  Branch (756:9): [True: 0, False: 9.91k]
  ------------------
  757|      0|      (void)curl_easy_setopt(easy_, CURLOPT_PREQUOTE, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  758|      0|    }
  759|  9.91k|    if (ftp_quote_ != nullptr) {
  ------------------
  |  Branch (759:9): [True: 0, False: 9.91k]
  ------------------
  760|      0|      (void)curl_easy_setopt(easy_, CURLOPT_QUOTE, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  761|      0|    }
  762|  9.91k|  }
  763|       |  // Callback MIME parts retain upload_state_ as userdata. Release the root
  764|       |  // explicitly while that state is still live instead of relying only on
  765|       |  // reverse member destruction order.
  766|  9.91k|  mime_post_.reset();
  767|  9.91k|}
_ZNK12proto_fuzzer19ScenarioRequestData5statsEv:
  772|  9.91k|const RequestBuildStats& ScenarioRequestData::stats() const { return stats_; }
_ZNK12proto_fuzzer19ScenarioRequestData12upload_stateEv:
  777|  9.91k|const UploadScriptState& ScenarioRequestData::upload_state() const { return upload_state_; }
_ZNK12proto_fuzzer19ScenarioRequestData26upload_callbacks_installedEv:
  789|  9.91k|bool ScenarioRequestData::upload_callbacks_installed() const { return upload_callbacks_installed_; }
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_113BuildMimePostEPvRKN4curl6fuzzer5proto8MimePostEPNS_17UploadScriptStateEPNS_17RequestBuildStatsE:
  246|  1.02k|                          RequestBuildStats* stats) {
  247|  1.02k|  CurlMimePtr mime(curl_mime_init(easy));
  248|  1.02k|  if (mime == nullptr) {
  ------------------
  |  Branch (248:7): [True: 15, False: 1.01k]
  ------------------
  249|     15|    return nullptr;
  250|     15|  }
  251|       |
  252|  1.01k|  std::size_t remaining_parts = scenario_limits::kMaxTotalMimeParts;
  253|  1.01k|  std::size_t remaining_generated_bytes = scenario_limits::kMaxGeneratedMimeDataBytes;
  254|  1.01k|  const std::size_t count = std::min<std::size_t>(scenario_limits::kMaxTopLevelMimeParts, source.parts_size());
  255|  4.78k|  for (std::size_t i = 0; i < count && remaining_parts != 0; ++i) {
  ------------------
  |  Branch (255:27): [True: 3.79k, False: 991]
  |  Branch (255:40): [True: 3.79k, False: 0]
  ------------------
  256|  3.79k|    curl_mimepart* part = curl_mime_addpart(mime.get());
  257|  3.79k|    if (part == nullptr) {
  ------------------
  |  Branch (257:9): [True: 22, False: 3.77k]
  ------------------
  258|     22|      break;
  259|     22|    }
  260|  3.77k|    --remaining_parts;
  261|  3.77k|    ++stats->mime_parts;
  262|  3.77k|    const auto& proto_part = source.parts(static_cast<int>(i));
  263|  3.77k|    ApplyPartMetadata(part, proto_part, stats);
  264|       |
  265|  3.77k|    switch (proto_part.content_case()) {
  266|    217|      case curl::fuzzer::proto::MimePart::kData:
  ------------------
  |  Branch (266:7): [True: 217, False: 3.55k]
  ------------------
  267|    217|        ApplyPartData(part, proto_part.data());
  268|    217|        break;
  269|    421|      case curl::fuzzer::proto::MimePart::kGeneratedData:
  ------------------
  |  Branch (269:7): [True: 421, False: 3.35k]
  ------------------
  270|    421|        ApplyGeneratedPartData(part, proto_part.generated_data(), &remaining_generated_bytes, stats);
  271|    421|        break;
  272|    163|      case curl::fuzzer::proto::MimePart::kUploadCallback:
  ------------------
  |  Branch (272:7): [True: 163, False: 3.61k]
  ------------------
  273|    163|        if (upload_state != nullptr && upload_state->InstallAsMimePart(part) == CURLE_OK) {
  ------------------
  |  Branch (273:13): [True: 163, False: 0]
  |  Branch (273:40): [True: 163, False: 0]
  ------------------
  274|    163|          ++stats->mime_callback_parts;
  275|    163|        }
  276|    163|        break;
  277|  1.50k|      case curl::fuzzer::proto::MimePart::kSubparts: {
  ------------------
  |  Branch (277:7): [True: 1.50k, False: 2.26k]
  ------------------
  278|  1.50k|        CurlMimePtr subparts(curl_mime_init(easy));
  279|  1.50k|        if (subparts == nullptr) {
  ------------------
  |  Branch (279:13): [True: 2, False: 1.50k]
  ------------------
  280|      2|          break;
  281|      2|        }
  282|  1.50k|        PopulateSubparts(subparts.get(), proto_part.subparts(), &remaining_parts, &remaining_generated_bytes, stats);
  283|  1.50k|        if (curl_mime_subparts(part, subparts.get()) == CURLE_OK) {
  ------------------
  |  Branch (283:13): [True: 1.50k, False: 0]
  ------------------
  284|  1.50k|          (void)subparts.release();
  285|  1.50k|        }
  286|  1.50k|        break;
  287|  1.50k|      }
  288|  1.46k|      case curl::fuzzer::proto::MimePart::CONTENT_NOT_SET:
  ------------------
  |  Branch (288:7): [True: 1.46k, False: 2.30k]
  ------------------
  289|  1.46k|      default:
  ------------------
  |  Branch (289:7): [True: 0, False: 3.77k]
  ------------------
  290|  1.46k|        break;
  291|  3.77k|    }
  292|  3.77k|  }
  293|  1.01k|  return mime;
  294|  1.01k|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_117ApplyPartMetadataIN4curl6fuzzer5proto8MimePartEEEvP13curl_mimepartRKT_PNS_17RequestBuildStatsE:
  148|  3.77k|void ApplyPartMetadata(curl_mimepart* part, const ProtoPart& source, RequestBuildStats* stats) {
  149|       |  // Reuse the rare compatibility-path allocation across all three fields;
  150|       |  // ordinary postprocessed metadata never writes this scratch string.
  151|  3.77k|  std::string truncated;
  152|  3.77k|  if (!source.name().empty()) {
  ------------------
  |  Branch (152:7): [True: 321, False: 3.45k]
  ------------------
  153|    321|    (void)curl_mime_name(part, BoundedCString(source.name(), scenario_limits::kMaxMetadataBytes, &truncated));
  154|    321|  }
  155|  3.77k|  if (!source.filename().empty()) {
  ------------------
  |  Branch (155:7): [True: 339, False: 3.43k]
  ------------------
  156|    339|    (void)curl_mime_filename(part, BoundedCString(source.filename(), scenario_limits::kMaxMetadataBytes, &truncated));
  157|    339|  }
  158|  3.77k|  if (!source.content_type().empty()) {
  ------------------
  |  Branch (158:7): [True: 306, False: 3.46k]
  ------------------
  159|    306|    (void)curl_mime_type(part, BoundedCString(source.content_type(), scenario_limits::kMaxMetadataBytes, &truncated));
  160|    306|  }
  161|  3.77k|  if (const char* encoder = MimeEncoderName(source.encoder())) {
  ------------------
  |  Branch (161:19): [True: 498, False: 3.27k]
  ------------------
  162|    498|    (void)curl_mime_encoder(part, encoder);
  163|    498|  }
  164|       |
  165|  3.77k|  std::size_t header_count = 0;
  166|  3.77k|  CurlSlistPtr headers = BuildStringList(source.headers(), scenario_limits::kMaxMimeHeadersPerPart,
  167|  3.77k|                                         scenario_limits::kMaxMetadataBytes, &header_count);
  168|  3.77k|  if (headers != nullptr) {
  ------------------
  |  Branch (168:7): [True: 640, False: 3.13k]
  ------------------
  169|       |    // take_ownership=1 is crucial: unlike the strings above, MIME retains the
  170|       |    // list pointer. Once attached, the root curl_mime_free call recursively
  171|       |    // releases it, including lists on nested parts.
  172|    640|    const CURLcode result = curl_mime_headers(part, headers.get(), 1);
  173|    640|    if (result == CURLE_OK) {
  ------------------
  |  Branch (173:9): [True: 640, False: 0]
  ------------------
  174|    640|      (void)headers.release();
  175|    640|      stats->mime_headers += header_count;
  176|    640|    }
  177|    640|  }
  178|  3.77k|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_114BoundedCStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmPS7_:
   33|  9.89k|const char* BoundedCString(const std::string& value, std::size_t limit, std::string* truncated) {
   34|  9.89k|  if (value.size() <= limit) {
  ------------------
  |  Branch (34:7): [True: 9.89k, False: 0]
  ------------------
   35|  9.89k|    return value.c_str();
   36|  9.89k|  }
   37|      0|  truncated->assign(value.data(), limit);
   38|      0|  return truncated->c_str();
   39|  9.89k|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_115MimeEncoderNameEN4curl6fuzzer5proto11MimeEncoderE:
  101|  6.65k|const char* MimeEncoderName(curl::fuzzer::proto::MimeEncoder encoder) {
  102|  6.65k|  switch (encoder) {
  103|    230|    case curl::fuzzer::proto::MIME_ENCODER_BINARY:
  ------------------
  |  Branch (103:5): [True: 230, False: 6.42k]
  ------------------
  104|    230|      return "binary";
  105|    137|    case curl::fuzzer::proto::MIME_ENCODER_8BIT:
  ------------------
  |  Branch (105:5): [True: 137, False: 6.51k]
  ------------------
  106|    137|      return "8bit";
  107|    174|    case curl::fuzzer::proto::MIME_ENCODER_7BIT:
  ------------------
  |  Branch (107:5): [True: 174, False: 6.47k]
  ------------------
  108|    174|      return "7bit";
  109|    148|    case curl::fuzzer::proto::MIME_ENCODER_BASE64:
  ------------------
  |  Branch (109:5): [True: 148, False: 6.50k]
  ------------------
  110|    148|      return "base64";
  111|    324|    case curl::fuzzer::proto::MIME_ENCODER_QUOTED_PRINTABLE:
  ------------------
  |  Branch (111:5): [True: 324, False: 6.32k]
  ------------------
  112|    324|      return "quoted-printable";
  113|  5.63k|    case curl::fuzzer::proto::MIME_ENCODER_UNSPECIFIED:
  ------------------
  |  Branch (113:5): [True: 5.63k, False: 1.01k]
  ------------------
  114|  5.63k|    default:
  ------------------
  |  Branch (114:5): [True: 5, False: 6.64k]
  ------------------
  115|  5.63k|      return nullptr;
  116|  6.65k|  }
  117|  6.65k|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_113ApplyPartDataEP13curl_mimepartRKNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEE:
  183|  2.87k|void ApplyPartData(curl_mimepart* part, const std::string& data) {
  184|  2.87k|  const std::size_t size = std::min(data.size(), scenario_limits::kMaxMimeDataBytes);
  185|  2.87k|  const char* bytes = data.empty() ? "" : data.data();
  ------------------
  |  Branch (185:23): [True: 2.46k, False: 402]
  ------------------
  186|  2.87k|  (void)curl_mime_data(part, bytes, size);
  187|  2.87k|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_122ApplyGeneratedPartDataEP13curl_mimepartRKN4curl6fuzzer5proto14GeneratedBytesEPmPNS_17RequestBuildStatsE:
  194|    643|                            std::size_t* remaining_generated_bytes, RequestBuildStats* stats) {
  195|    643|  const std::size_t pattern_size = std::min(source.pattern().size(), scenario_limits::kMaxGeneratedMimePatternBytes);
  196|    643|  if (pattern_size == 0 || *remaining_generated_bytes == 0) {
  ------------------
  |  Branch (196:7): [True: 306, False: 337]
  |  Branch (196:28): [True: 35, False: 302]
  ------------------
  197|    341|    (void)curl_mime_data(part, "", 0);
  198|    341|    return;
  199|    341|  }
  200|       |
  201|    302|  const std::size_t max_repeat_count = *remaining_generated_bytes / pattern_size;
  202|    302|  const std::size_t repeat_count =
  203|    302|      std::min<std::size_t>(static_cast<std::size_t>(source.repeat_count()), max_repeat_count);
  204|    302|  const std::size_t materialized_size = repeat_count * pattern_size;
  205|       |
  206|    302|  std::string materialized(materialized_size, '\0');
  207|  1.77M|  for (std::size_t offset = 0; offset < materialized_size; offset += pattern_size) {
  ------------------
  |  Branch (207:32): [True: 1.77M, False: 302]
  ------------------
  208|  1.77M|    std::copy_n(source.pattern().data(), pattern_size, materialized.data() + offset);
  209|  1.77M|  }
  210|    302|  const char* bytes = materialized.empty() ? "" : materialized.data();
  ------------------
  |  Branch (210:23): [True: 104, False: 198]
  ------------------
  211|    302|  if (curl_mime_data(part, bytes, materialized.size()) == CURLE_OK) {
  ------------------
  |  Branch (211:7): [True: 302, False: 0]
  ------------------
  212|    302|    stats->generated_mime_bytes += materialized.size();
  213|    302|  }
  214|    302|  *remaining_generated_bytes -= materialized.size();
  215|    302|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_116PopulateSubpartsEP9curl_mimeRKN4curl6fuzzer5proto12MimeSubpartsEPmS9_PNS_17RequestBuildStatsE:
  221|  1.50k|                      std::size_t* remaining_generated_bytes, RequestBuildStats* stats) {
  222|  1.50k|  const std::size_t count = std::min<std::size_t>(scenario_limits::kMaxNestedMimeParts, source.parts_size());
  223|  4.38k|  for (std::size_t i = 0; i < count && *remaining_parts != 0; ++i) {
  ------------------
  |  Branch (223:27): [True: 2.88k, False: 1.49k]
  |  Branch (223:40): [True: 2.88k, False: 0]
  ------------------
  224|  2.88k|    curl_mimepart* part = curl_mime_addpart(mime);
  225|  2.88k|    if (part == nullptr) {
  ------------------
  |  Branch (225:9): [True: 10, False: 2.87k]
  ------------------
  226|     10|      break;
  227|     10|    }
  228|  2.87k|    --*remaining_parts;
  229|  2.87k|    ++stats->mime_parts;
  230|  2.87k|    const auto& proto_part = source.parts(static_cast<int>(i));
  231|  2.87k|    ApplyPartMetadata(part, proto_part, stats);
  232|  2.87k|    if (proto_part.content_case() == curl::fuzzer::proto::MimeDataPart::kGeneratedData) {
  ------------------
  |  Branch (232:9): [True: 222, False: 2.65k]
  ------------------
  233|    222|      ApplyGeneratedPartData(part, proto_part.generated_data(), remaining_generated_bytes, stats);
  234|  2.65k|    } else {
  235|       |      // Preserve the historical leaf behavior: an absent source is applied as
  236|       |      // empty data just like an explicitly empty field 2.
  237|  2.65k|      ApplyPartData(part, proto_part.data());
  238|  2.65k|    }
  239|  2.87k|  }
  240|  1.50k|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_117ApplyPartMetadataIN4curl6fuzzer5proto12MimeDataPartEEEvP13curl_mimepartRKT_PNS_17RequestBuildStatsE:
  148|  2.87k|void ApplyPartMetadata(curl_mimepart* part, const ProtoPart& source, RequestBuildStats* stats) {
  149|       |  // Reuse the rare compatibility-path allocation across all three fields;
  150|       |  // ordinary postprocessed metadata never writes this scratch string.
  151|  2.87k|  std::string truncated;
  152|  2.87k|  if (!source.name().empty()) {
  ------------------
  |  Branch (152:7): [True: 232, False: 2.64k]
  ------------------
  153|    232|    (void)curl_mime_name(part, BoundedCString(source.name(), scenario_limits::kMaxMetadataBytes, &truncated));
  154|    232|  }
  155|  2.87k|  if (!source.filename().empty()) {
  ------------------
  |  Branch (155:7): [True: 319, False: 2.55k]
  ------------------
  156|    319|    (void)curl_mime_filename(part, BoundedCString(source.filename(), scenario_limits::kMaxMetadataBytes, &truncated));
  157|    319|  }
  158|  2.87k|  if (!source.content_type().empty()) {
  ------------------
  |  Branch (158:7): [True: 205, False: 2.67k]
  ------------------
  159|    205|    (void)curl_mime_type(part, BoundedCString(source.content_type(), scenario_limits::kMaxMetadataBytes, &truncated));
  160|    205|  }
  161|  2.87k|  if (const char* encoder = MimeEncoderName(source.encoder())) {
  ------------------
  |  Branch (161:19): [True: 515, False: 2.36k]
  ------------------
  162|    515|    (void)curl_mime_encoder(part, encoder);
  163|    515|  }
  164|       |
  165|  2.87k|  std::size_t header_count = 0;
  166|  2.87k|  CurlSlistPtr headers = BuildStringList(source.headers(), scenario_limits::kMaxMimeHeadersPerPart,
  167|  2.87k|                                         scenario_limits::kMaxMetadataBytes, &header_count);
  168|  2.87k|  if (headers != nullptr) {
  ------------------
  |  Branch (168:7): [True: 964, False: 1.91k]
  ------------------
  169|       |    // take_ownership=1 is crucial: unlike the strings above, MIME retains the
  170|       |    // list pointer. Once attached, the root curl_mime_free call recursively
  171|       |    // releases it, including lists on nested parts.
  172|    964|    const CURLcode result = curl_mime_headers(part, headers.get(), 1);
  173|    964|    if (result == CURLE_OK) {
  ------------------
  |  Branch (173:9): [True: 964, False: 0]
  ------------------
  174|    964|      (void)headers.release();
  175|    964|      stats->mime_headers += header_count;
  176|    964|    }
  177|    964|  }
  178|  2.87k|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_120NeedsUploadCallbacksERKN4curl6fuzzer5proto8ScenarioE:
   47|  9.91k|bool NeedsUploadCallbacks(const curl::fuzzer::proto::Scenario& scenario) {
   48|       |  // curl's TELNET implementation polls stdin unless a READFUNCTION was
   49|       |  // explicitly installed. Always provide the bounded per-scenario source,
   50|       |  // even when there is no upload payload to send.
   51|  9.91k|  if (scenario.scheme() == curl::fuzzer::proto::SCHEME_TELNET || scenario.has_upload()) {
  ------------------
  |  Branch (51:7): [True: 0, False: 9.91k]
  |  Branch (51:66): [True: 470, False: 9.44k]
  ------------------
   52|    470|    return true;
   53|    470|  }
   54|  9.44k|  const std::size_t option_count = RuntimeOptionCount(scenario);
   55|  38.1k|  for (std::size_t index = 0; index < option_count; ++index) {
  ------------------
  |  Branch (55:31): [True: 28.8k, False: 9.33k]
  ------------------
   56|  28.8k|    const auto& option = scenario.options(static_cast<int>(index));
   57|  28.8k|    if (option.option_id() == curl::fuzzer::proto::CURLOPT_UPLOAD ||
  ------------------
  |  Branch (57:9): [True: 57, False: 28.7k]
  ------------------
   58|  28.7k|        option.option_id() == curl::fuzzer::proto::CURLOPT_POST) {
  ------------------
  |  Branch (58:9): [True: 49, False: 28.7k]
  ------------------
   59|    106|      return true;
   60|    106|    }
   61|  28.8k|  }
   62|  9.33k|  return false;
   63|  9.44k|}
request_data.cc:_ZN12proto_fuzzer12_GLOBAL__N_115BuildStringListIN6google8protobuf16RepeatedPtrFieldINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEEENS5_10unique_ptrI10curl_slistNS_16CurlSlistDeleterEEERKT_mmPm:
  125|  16.5k|                             std::size_t* applied) {
  126|  16.5k|  CurlSlistPtr list;
  127|  16.5k|  std::string truncated;
  128|  16.5k|  const std::size_t count = std::min<std::size_t>(count_limit, values.size());
  129|  24.7k|  for (std::size_t i = 0; i < count; ++i) {
  ------------------
  |  Branch (129:27): [True: 8.17k, False: 16.5k]
  ------------------
  130|  8.17k|    const std::string& value = values.Get(static_cast<int>(i));
  131|  8.17k|    curl_slist* appended = curl_slist_append(list.get(), BoundedCString(value, value_limit, &truncated));
  132|  8.17k|    if (appended == nullptr) {
  ------------------
  |  Branch (132:9): [True: 17, False: 8.15k]
  ------------------
  133|     17|      break;
  134|     17|    }
  135|       |    // append retains the existing nodes and may return the same head. Release
  136|       |    // before resetting so adopting the successful result cannot free them.
  137|  8.15k|    (void)list.release();
  138|  8.15k|    list.reset(appended);
  139|  8.15k|    ++*applied;
  140|  8.15k|  }
  141|  16.5k|  return list;
  142|  16.5k|}

_ZN12proto_fuzzer11RunScenarioERKN4curl6fuzzer5proto8ScenarioENS_15ScenarioRunModeE:
  653|  9.96k|int RunScenario(const curl::fuzzer::proto::Scenario& scenario, ScenarioRunMode mode) {
  654|       |  // Every input starts from a known off trace baseline (and returns to it when
  655|       |  // the scope exits), so one input's trace selection cannot leak into another.
  656|  9.96k|  proto_fuzzer::ScopedTraceReset trace_reset;
  657|  9.96k|  if (mode == ScenarioRunMode::kMultiTransfer) {
  ------------------
  |  Branch (657:7): [True: 0, False: 9.96k]
  ------------------
  658|      0|    (void)proto_fuzzer::RunMultiTransferScenario(scenario);
  659|      0|    return 0;
  660|      0|  }
  661|       |
  662|  9.96k|  const char* prefix = SchemePrefix(scenario.scheme());
  663|  9.96k|  if (prefix == nullptr) {
  ------------------
  |  Branch (663:7): [True: 0, False: 9.96k]
  ------------------
  664|      0|    return 0;
  665|      0|  }
  666|       |
  667|       |  // FILE is the one peerless lane. Gate it on the dedicated run mode so the
  668|       |  // compatibility target cannot reinterpret the append-only enum value as a
  669|       |  // local filesystem read from an accumulated corpus entry.
  670|  9.96k|  const bool file_lane =
  671|  9.96k|      mode == ScenarioRunMode::kFileCoverage && scenario.scheme() == curl::fuzzer::proto::SCHEME_FILE;
  ------------------
  |  Branch (671:7): [True: 0, False: 9.96k]
  |  Branch (671:49): [True: 0, False: 0]
  ------------------
  672|  9.96k|  if (scenario.scheme() == curl::fuzzer::proto::SCHEME_FILE && !file_lane) {
  ------------------
  |  Branch (672:7): [True: 0, False: 9.96k]
  |  Branch (672:64): [True: 0, False: 0]
  ------------------
  673|      0|    return 0;
  674|      0|  }
  675|  9.96k|  if (!file_lane && scenario.host_path().empty()) {
  ------------------
  |  Branch (675:7): [True: 9.96k, False: 0]
  |  Branch (675:21): [True: 0, False: 9.96k]
  ------------------
  676|      0|    return 0;
  677|      0|  }
  678|       |
  679|  9.96k|  std::unique_ptr<MockServerBase> mock = MakeMockServerForScenario(scenario, mode);
  680|  9.96k|  if (!mock && !file_lane) {
  ------------------
  |  Branch (680:7): [True: 0, False: 9.96k]
  |  Branch (680:16): [True: 0, False: 0]
  ------------------
  681|      0|    return 0;
  682|      0|  }
  683|       |
  684|       |  // The peer survives every easy option/callback, including cleanup of a
  685|       |  // bounded incomplete transfer. TransferSession owns the rest of that graph.
  686|  9.96k|  TransferSession transfer;
  687|  9.96k|  if (!transfer.PrepareInputFiles(scenario, mode)) {
  ------------------
  |  Branch (687:7): [True: 0, False: 9.96k]
  ------------------
  688|      0|    return 0;
  689|      0|  }
  690|  9.96k|  if (!transfer.Initialize()) {
  ------------------
  |  Branch (690:7): [True: 46, False: 9.91k]
  ------------------
  691|     46|    return 0;
  692|     46|  }
  693|  9.91k|  CURL* easy = transfer.easy();
  694|  9.91k|  std::string url;
  695|  9.91k|  if (file_lane) {
  ------------------
  |  Branch (695:7): [True: 0, False: 9.91k]
  ------------------
  696|      0|    const char* source_path = transfer.FileSourcePath();
  697|      0|    if (source_path == nullptr) {
  ------------------
  |  Branch (697:9): [True: 0, False: 0]
  ------------------
  698|      0|      return 0;
  699|      0|    }
  700|      0|    url = std::string("file://") + source_path;
  701|  9.91k|  } else {
  702|  9.91k|    url = ScenarioUrl(scenario, prefix);
  703|  9.91k|  }
  704|  9.91k|  const auto configure_easy = [&] {
  705|  9.91k|    transfer.ApplyBaseline(scenario);
  706|  9.91k|    (void)curl_easy_setopt(easy, CURLOPT_URL, url.c_str());
  707|  9.91k|    if (mock) {
  708|  9.91k|      mock->Install(easy);
  709|  9.91k|    }
  710|  9.91k|    transfer.ApplyInputFiles();
  711|       |    // Repeat the option-count bound for compatibility and direct callers.
  712|  9.91k|    (void)ApplyScenarioOptions(easy, scenario);
  713|       |    // A schema-native pin file is authoritative over the generic digest option.
  714|       |    // Its session-owned path remains valid until after easy cleanup.
  715|  9.91k|    transfer.ApplyPinnedPublicKeyFile();
  716|  9.91k|    if (auto* rtsp = dynamic_cast<RtspMockServer*>(mock.get())) {
  717|  9.91k|      rtsp->ConfigureClient(easy, scenario.rtsp_probe_mode());
  718|  9.91k|    }
  719|  9.91k|    if (auto* smtp = dynamic_cast<SmtpMockServer*>(mock.get())) {
  720|  9.91k|      smtp->ConfigureClient(easy);
  721|  9.91k|    }
  722|  9.91k|    if (mode == ScenarioRunMode::kGopherCoverage &&
  723|  9.91k|        scenario.gopher_probe_mode() == curl::fuzzer::proto::GOPHER_PROBE_TLS_SESSION_KEY_LIMIT) {
  724|  9.91k|      (void)curl_easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 0L);
  725|  9.91k|      (void)curl_easy_setopt(easy, CURLOPT_SSL_OPTIONS, static_cast<long>(CURLSSLOPT_ALLOW_BEAST));
  726|  9.91k|    }
  727|  9.91k|    if (ScenarioRequestsStartTls(scenario, mode)) {
  728|  9.91k|      (void)curl_easy_setopt(easy, CURLOPT_USE_SSL, static_cast<long>(CURLUSESSL_ALL));
  729|  9.91k|    }
  730|  9.91k|    if (mode == ScenarioRunMode::kResolverCoverage && !ApplyResolverMode(easy, scenario.resolver_mode())) {
  731|  9.91k|      return false;
  732|  9.91k|    }
  733|  9.91k|    if (mode == ScenarioRunMode::kTlsCoverage) {
  734|  9.91k|      (void)transfer.ApplyTlsClientCredentialProfile(scenario.tls_client_credential_profile());
  735|  9.91k|    }
  736|  9.91k|    return true;
  737|  9.91k|  };
  738|  9.91k|  if (!configure_easy()) {
  ------------------
  |  Branch (738:7): [True: 0, False: 9.91k]
  ------------------
  739|      0|    return 0;
  740|      0|  }
  741|  9.91k|  transfer.ConfigureAltSvcRouting(scenario.host_path());
  742|       |
  743|  9.91k|  if (file_lane) {
  ------------------
  |  Branch (743:7): [True: 0, False: 9.91k]
  ------------------
  744|       |    // The file:// handler reads or writes only the session-owned anonymous
  745|       |    // descriptor and never opens a socket. Install the bounded request-data
  746|       |    // owner before perform so retained upload options consume Scenario.upload
  747|       |    // through curl's read callback instead of falling back to stdin. The
  748|       |    // baseline's short timeout still bounds the transfer.
  749|      0|    ScenarioRequestData* request_data = transfer.InstallRequestData(scenario);
  750|      0|    assert(request_data != nullptr);
  ------------------
  |  Branch (750:5): [True: 0, False: 0]
  ------------------
  751|      0|    (void)request_data;
  752|      0|    const CURLcode transfer_result = curl_easy_perform(easy);
  753|      0|    (void)transfer_result;
  754|      0|    ProbeTransferResults(easy);
  755|      0|    return 0;
  756|      0|  }
  757|       |
  758|  9.91k|  if (mode == ScenarioRunMode::kResolverCoverage) {
  ------------------
  |  Branch (758:7): [True: 0, False: 9.91k]
  ------------------
  759|       |    // The normal CONNECT_TO baseline deliberately bypasses DNS. This lane
  760|       |    // removes only that override; OPENSOCKET still returns the in-process
  761|       |    // socketpair, so no resolved address can receive network traffic.
  762|      0|    (void)curl_easy_setopt(easy, CURLOPT_CONNECT_TO, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  763|      0|  }
  764|       |
  765|  9.91k|  const curl::fuzzer::proto::ApiPlan* api_plan =
  766|  9.91k|      mode == ScenarioRunMode::kApiLifecycle && scenario.has_api_plan() ? &scenario.api_plan() : nullptr;
  ------------------
  |  Branch (766:7): [True: 0, False: 9.91k]
  |  Branch (766:49): [True: 0, False: 0]
  ------------------
  767|  9.91k|  if (api_plan != nullptr && api_plan->reset_easy() && transfer.ResetConfiguration()) {
  ------------------
  |  Branch (767:7): [True: 0, False: 9.91k]
  |  Branch (767:30): [True: 0, False: 0]
  |  Branch (767:56): [True: 0, False: 0]
  ------------------
  768|      0|    configure_easy();
  769|      0|  }
  770|       |
  771|  9.91k|  ApiLifecycle* api_lifecycle = nullptr;
  772|  9.91k|  if (api_plan != nullptr) {
  ------------------
  |  Branch (772:7): [True: 0, False: 9.91k]
  ------------------
  773|      0|    api_lifecycle = transfer.InstallApiLifecycle(*api_plan, url);
  774|      0|    assert(api_lifecycle != nullptr);
  ------------------
  |  Branch (774:5): [True: 0, False: 0]
  ------------------
  775|      0|    mock->SetMultiObserver([api_lifecycle](CURLM* multi) { api_lifecycle->SetActiveMulti(multi); });
  776|      0|  }
  777|       |
  778|       |  // The DoH lane lets the loopback responder answer every lookup, including
  779|       |  // the address query, so it must not install the resolver lane's fixed
  780|       |  // CURLOPT_RESOLVE cache entries.
  781|  9.91k|  const bool apply_resolve_entries = mode == ScenarioRunMode::kResolverCoverage && !scenario.has_doh() &&
  ------------------
  |  Branch (781:38): [True: 0, False: 9.91k]
  |  Branch (781:84): [True: 0, False: 0]
  ------------------
  782|      0|                                     scenario.resolver_mode() == curl::fuzzer::proto::RESOLVER_MODE_DEFAULT;
  ------------------
  |  Branch (782:38): [True: 0, False: 0]
  ------------------
  783|  9.91k|  ScenarioRequestData* request_data = transfer.InstallRequestData(scenario, apply_resolve_entries);
  784|  9.91k|  assert(request_data != nullptr);
  ------------------
  |  Branch (784:3): [True: 9.91k, False: 0]
  ------------------
  785|  9.91k|  if (mode == ScenarioRunMode::kResolverCoverage && !request_data->resolve_entries_ready()) {
  ------------------
  |  Branch (785:7): [True: 0, False: 9.91k]
  |  Branch (785:53): [True: 0, False: 0]
  ------------------
  786|      0|    return 0;
  787|      0|  }
  788|  9.91k|  mock->ConfigureRequestData(request_data);
  789|  9.91k|  const auto drive_mode = api_plan == nullptr ? curl::fuzzer::proto::API_DRIVE_MULTI_PERFORM : api_plan->drive_mode();
  ------------------
  |  Branch (789:27): [True: 9.91k, False: 0]
  ------------------
  790|  9.91k|  CURLcode transfer_result = CURLE_FAILED_INIT;
  791|  9.91k|  if (mode == ScenarioRunMode::kResolverCoverage &&
  ------------------
  |  Branch (791:7): [True: 0, False: 9.91k]
  ------------------
  792|      0|      scenario.resolver_mode() == curl::fuzzer::proto::RESOLVER_MODE_THREADED_QUEUED_CANCEL) {
  ------------------
  |  Branch (792:7): [True: 0, False: 0]
  ------------------
  793|      0|    auto* resolver_mock = dynamic_cast<MockServer*>(mock.get());
  794|      0|    if (resolver_mock != nullptr) {
  ------------------
  |  Branch (794:9): [True: 0, False: 0]
  ------------------
  795|      0|      transfer_result = RunQueuedResolverCancellation(easy, resolver_mock, scenario);
  796|      0|    }
  797|  9.91k|  } else if (drive_mode == curl::fuzzer::proto::API_DRIVE_EASY_PERFORM) {
  ------------------
  |  Branch (797:14): [True: 0, False: 9.91k]
  ------------------
  798|      0|    transfer_result = mock->DriveEasyScenario(easy, scenario);
  799|  9.91k|  } else if (drive_mode == curl::fuzzer::proto::API_DRIVE_EASY_EVENTS) {
  ------------------
  |  Branch (799:14): [True: 0, False: 9.91k]
  ------------------
  800|      0|    transfer_result = mock->DriveEasyScenario(easy, scenario, true);
  801|  9.91k|  } else if (drive_mode == curl::fuzzer::proto::API_DRIVE_CONNECT_ONLY) {
  ------------------
  |  Branch (801:14): [True: 0, False: 9.91k]
  ------------------
  802|      0|    transfer_result = mock->DriveConnectOnlyScenario(easy, scenario).connect_result;
  803|  9.91k|  } else if (mode == ScenarioRunMode::kRtspCoverage &&
  ------------------
  |  Branch (803:14): [True: 0, False: 9.91k]
  ------------------
  804|      0|             scenario.rtsp_probe_mode() == curl::fuzzer::proto::RTSP_PROBE_CROSS_ORIGIN_REUSE) {
  ------------------
  |  Branch (804:14): [True: 0, False: 0]
  ------------------
  805|      0|    auto* rtsp = dynamic_cast<RtspMockServer*>(mock.get());
  806|      0|    if (rtsp != nullptr) {
  ------------------
  |  Branch (806:9): [True: 0, False: 0]
  ------------------
  807|      0|      transfer_result = rtsp->DriveCrossOriginReuseScenario(easy, scenario);
  808|      0|    }
  809|  9.91k|  } else {
  810|  9.91k|    transfer_result = mock->DriveScenario(easy, scenario);
  811|  9.91k|  }
  812|       |
  813|  9.91k|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  814|  9.91k|  if (mode == ScenarioRunMode::kTlsCoverage &&
  ------------------
  |  Branch (814:7): [True: 0, False: 9.91k]
  ------------------
  815|      0|      scenario.tls_session_cache_profile() != curl::fuzzer::proto::TLS_SESSION_CACHE_DEFAULT) {
  ------------------
  |  Branch (815:7): [True: 0, False: 0]
  ------------------
  816|      0|    ProbeTransferResults(easy);
  817|      0|    transfer.Close();
  818|      0|    auto* tls_server = dynamic_cast<TlsMockServer*>(mock.get());
  819|      0|    if (tls_server != nullptr) {
  ------------------
  |  Branch (819:9): [True: 0, False: 0]
  ------------------
  820|      0|      (void)ReplayTlsSession(scenario, url, tls_server);
  821|      0|    }
  822|      0|    return 0;
  823|      0|  }
  824|  9.91k|#endif
  825|  9.91k|  if (api_plan != nullptr && api_plan->repeat_mime_post() && transfer_result == CURLE_OK) {
  ------------------
  |  Branch (825:7): [True: 0, False: 9.91k]
  |  Branch (825:30): [True: 0, False: 0]
  |  Branch (825:62): [True: 0, False: 0]
  ------------------
  826|       |    // Re-enter the public transfer setup with the same easy handle, MIME root,
  827|       |    // and callback cursor. A completed first body leaves a non-rewindable
  828|       |    // callback at EOF; curl's second MIME reader setup must then report its
  829|       |    // normal public rewind failure and clean up the unattached reader before
  830|       |    // it can send another request.
  831|      0|    transfer_result = mock->DriveScenario(easy, scenario);
  832|      0|  }
  833|  9.91k|  if (api_lifecycle != nullptr) {
  ------------------
  |  Branch (833:7): [True: 0, False: 9.91k]
  ------------------
  834|      0|    const bool retains_internal_multi = drive_mode == curl::fuzzer::proto::API_DRIVE_EASY_PERFORM ||
  ------------------
  |  Branch (834:41): [True: 0, False: 0]
  ------------------
  835|      0|                                        drive_mode == curl::fuzzer::proto::API_DRIVE_EASY_EVENTS ||
  ------------------
  |  Branch (835:41): [True: 0, False: 0]
  ------------------
  836|      0|                                        drive_mode == curl::fuzzer::proto::API_DRIVE_CONNECT_ONLY;
  ------------------
  |  Branch (836:41): [True: 0, False: 0]
  ------------------
  837|       |    // An easy entrypoint can fail before attaching its private multi. The
  838|       |    // drive mode alone therefore cannot establish curl_easy_upkeep's state
  839|       |    // precondition. These are the two pre-attachment failure results.
  840|      0|    const bool probe_upkeep =
  841|      0|        retains_internal_multi && transfer_result != CURLE_OUT_OF_MEMORY && transfer_result != CURLE_FAILED_INIT;
  ------------------
  |  Branch (841:9): [True: 0, False: 0]
  |  Branch (841:35): [True: 0, False: 0]
  |  Branch (841:77): [True: 0, False: 0]
  ------------------
  842|      0|    api_lifecycle->ProbeTransferResults(probe_upkeep);
  843|      0|    api_lifecycle->ProbeEasyDuplication();
  844|      0|#if defined(PROTO_FUZZER_OBSERVE_STATE)
  845|      0|    const volatile std::size_t api_observation[] = {
  846|      0|        api_lifecycle->response_pause_returned(), api_lifecycle->response_bytes_received(),
  847|      0|        api_lifecycle->reentrant_probes_run(), api_lifecycle->reentrant_recursive_rejections()};
  848|      0|    (void)api_observation;
  849|      0|#endif
  850|  9.91k|  } else if (mode != ScenarioRunMode::kFastProtocol) {
  ------------------
  |  Branch (850:14): [True: 9.91k, False: 0]
  ------------------
  851|  9.91k|    ProbeTransferResults(easy);
  852|  9.91k|  }
  853|       |
  854|  9.91k|#if defined(PROTO_FUZZER_OBSERVE_STATE)
  855|       |  // TransferSession still owns these completed callback states. Local volatile
  856|       |  // stores retain their getter calls during profiling without adding work to
  857|       |  // ordinary fuzz builds or changing the transfer's callback configuration.
  858|  9.91k|  const RequestBuildStats& stats = request_data->stats();
  859|  9.91k|  const UploadScriptState& upload = request_data->upload_state();
  860|  9.91k|  const volatile std::size_t request_observation[] = {stats.request_headers,
  861|  9.91k|                                                      stats.resolve_entries,
  862|  9.91k|                                                      stats.telnet_options,
  863|  9.91k|                                                      stats.mime_parts,
  864|  9.91k|                                                      stats.mime_callback_parts,
  865|  9.91k|                                                      stats.mime_headers,
  866|  9.91k|                                                      stats.generated_mime_bytes,
  867|  9.91k|                                                      request_data->upload_callbacks_installed(),
  868|  9.91k|                                                      upload.data_size(),
  869|  9.91k|                                                      upload.read_step_count(),
  870|  9.91k|                                                      upload.offset(),
  871|  9.91k|                                                      upload.seek_calls(),
  872|  9.91k|                                                      upload.scripted()};
  873|  9.91k|  (void)request_observation;
  874|  9.91k|  mock->ObserveState();
  875|  9.91k|#endif
  876|  9.91k|  return 0;
  877|  9.91k|}
scenario_runner.cc:_ZN12proto_fuzzer12_GLOBAL__N_112SchemePrefixEN4curl6fuzzer5proto6SchemeE:
  297|  9.96k|const char* SchemePrefix(curl::fuzzer::proto::Scheme scheme) {
  298|  9.96k|  switch (scheme) {
  299|      0|    case curl::fuzzer::proto::SCHEME_HTTP:
  ------------------
  |  Branch (299:5): [True: 0, False: 9.96k]
  ------------------
  300|      0|      return "http";
  301|  9.96k|    case curl::fuzzer::proto::SCHEME_HTTPS:
  ------------------
  |  Branch (301:5): [True: 9.96k, False: 0]
  ------------------
  302|  9.96k|      return "https";
  303|      0|    case curl::fuzzer::proto::SCHEME_WS:
  ------------------
  |  Branch (303:5): [True: 0, False: 9.96k]
  ------------------
  304|      0|      return "ws";
  305|      0|    case curl::fuzzer::proto::SCHEME_WSS:
  ------------------
  |  Branch (305:5): [True: 0, False: 9.96k]
  ------------------
  306|      0|      return "wss";
  307|      0|    case curl::fuzzer::proto::SCHEME_TELNET:
  ------------------
  |  Branch (307:5): [True: 0, False: 9.96k]
  ------------------
  308|      0|      return "telnet";
  309|      0|    case curl::fuzzer::proto::SCHEME_FTP:
  ------------------
  |  Branch (309:5): [True: 0, False: 9.96k]
  ------------------
  310|      0|      return "ftp";
  311|      0|    case curl::fuzzer::proto::SCHEME_FTPS:
  ------------------
  |  Branch (311:5): [True: 0, False: 9.96k]
  ------------------
  312|      0|      return "ftps";
  313|      0|    case curl::fuzzer::proto::SCHEME_TFTP:
  ------------------
  |  Branch (313:5): [True: 0, False: 9.96k]
  ------------------
  314|      0|      return "tftp";
  315|      0|    case curl::fuzzer::proto::SCHEME_SMTP:
  ------------------
  |  Branch (315:5): [True: 0, False: 9.96k]
  ------------------
  316|      0|      return "smtp";
  317|      0|    case curl::fuzzer::proto::SCHEME_IMAP:
  ------------------
  |  Branch (317:5): [True: 0, False: 9.96k]
  ------------------
  318|      0|      return "imap";
  319|      0|    case curl::fuzzer::proto::SCHEME_IMAPS:
  ------------------
  |  Branch (319:5): [True: 0, False: 9.96k]
  ------------------
  320|      0|      return "imaps";
  321|      0|    case curl::fuzzer::proto::SCHEME_POP3:
  ------------------
  |  Branch (321:5): [True: 0, False: 9.96k]
  ------------------
  322|      0|      return "pop3";
  323|      0|    case curl::fuzzer::proto::SCHEME_POP3S:
  ------------------
  |  Branch (323:5): [True: 0, False: 9.96k]
  ------------------
  324|      0|      return "pop3s";
  325|      0|    case curl::fuzzer::proto::SCHEME_MQTT:
  ------------------
  |  Branch (325:5): [True: 0, False: 9.96k]
  ------------------
  326|      0|      return "mqtt";
  327|      0|    case curl::fuzzer::proto::SCHEME_MQTTS:
  ------------------
  |  Branch (327:5): [True: 0, False: 9.96k]
  ------------------
  328|      0|      return "mqtts";
  329|      0|    case curl::fuzzer::proto::SCHEME_LDAP:
  ------------------
  |  Branch (329:5): [True: 0, False: 9.96k]
  ------------------
  330|      0|      return "ldap";
  331|      0|    case curl::fuzzer::proto::SCHEME_LDAPS:
  ------------------
  |  Branch (331:5): [True: 0, False: 9.96k]
  ------------------
  332|      0|      return "ldaps";
  333|      0|    case curl::fuzzer::proto::SCHEME_RTSP:
  ------------------
  |  Branch (333:5): [True: 0, False: 9.96k]
  ------------------
  334|      0|      return "rtsp";
  335|      0|    case curl::fuzzer::proto::SCHEME_IPFS:
  ------------------
  |  Branch (335:5): [True: 0, False: 9.96k]
  ------------------
  336|      0|      return "ipfs";
  337|      0|    case curl::fuzzer::proto::SCHEME_IPNS:
  ------------------
  |  Branch (337:5): [True: 0, False: 9.96k]
  ------------------
  338|      0|      return "ipns";
  339|      0|    case curl::fuzzer::proto::SCHEME_SMTPS:
  ------------------
  |  Branch (339:5): [True: 0, False: 9.96k]
  ------------------
  340|      0|      return "smtps";
  341|      0|    case curl::fuzzer::proto::SCHEME_DICT:
  ------------------
  |  Branch (341:5): [True: 0, False: 9.96k]
  ------------------
  342|      0|      return "dict";
  343|      0|    case curl::fuzzer::proto::SCHEME_GOPHER:
  ------------------
  |  Branch (343:5): [True: 0, False: 9.96k]
  ------------------
  344|      0|      return "gopher";
  345|      0|    case curl::fuzzer::proto::SCHEME_GOPHERS:
  ------------------
  |  Branch (345:5): [True: 0, False: 9.96k]
  ------------------
  346|      0|      return "gophers";
  347|      0|    case curl::fuzzer::proto::SCHEME_FILE:
  ------------------
  |  Branch (347:5): [True: 0, False: 9.96k]
  ------------------
  348|      0|      return "file";
  349|      0|    case curl::fuzzer::proto::SCHEME_UNSPECIFIED:
  ------------------
  |  Branch (349:5): [True: 0, False: 9.96k]
  ------------------
  350|      0|    default:
  ------------------
  |  Branch (350:5): [True: 0, False: 9.96k]
  ------------------
  351|      0|      return nullptr;
  352|  9.96k|  }
  353|  9.96k|}
scenario_runner.cc:_ZN12proto_fuzzer12_GLOBAL__N_125MakeMockServerForScenarioERKN4curl6fuzzer5proto8ScenarioENS_15ScenarioRunModeE:
  375|  9.96k|                                                          ScenarioRunMode mode) {
  376|  9.96k|  if (mode == ScenarioRunMode::kHttp3Coverage) {
  ------------------
  |  Branch (376:7): [True: 9.96k, False: 0]
  ------------------
  377|  9.96k|#if defined(PROTO_FUZZER_HAS_HTTP3_MOCK_SERVER)
  378|  9.96k|    if (scenario.http3_plan().use_h1_connect_udp_proxy()) {
  ------------------
  |  Branch (378:9): [True: 7.67k, False: 2.28k]
  ------------------
  379|  7.67k|      return std::make_unique<ConnectUdpProxyMockServer>();
  380|  7.67k|    }
  381|  2.28k|    return std::make_unique<Http3MockServer>(scenario.tls_certificate_chain());
  382|       |#else
  383|       |    return nullptr;
  384|       |#endif
  385|  9.96k|  }
  386|       |
  387|      0|  if (mode == ScenarioRunMode::kH2ProxyCoverage) {
  ------------------
  |  Branch (387:7): [True: 0, False: 0]
  ------------------
  388|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  389|      0|    return std::make_unique<H2ProxyMockServer>(scenario);
  390|       |#else
  391|       |    // MemorySanitizer builds deliberately omit OpenSSL. Keep the target
  392|       |    // binary available to OSS-Fuzz, but do not pretend a plaintext mock can
  393|       |    // negotiate the ALPN gate required to enter cf-h2-proxy.
  394|       |    return nullptr;
  395|       |#endif
  396|      0|  }
  397|       |
  398|      0|  if (mode == ScenarioRunMode::kHttp2Coverage) {
  ------------------
  |  Branch (398:7): [True: 0, False: 0]
  ------------------
  399|      0|    return std::make_unique<H2CleartextMockServer>(scenario.http2_connect_flush_probe());
  400|      0|  }
  401|       |
  402|      0|  if (mode == ScenarioRunMode::kTlsHttp2Coverage) {
  ------------------
  |  Branch (402:7): [True: 0, False: 0]
  ------------------
  403|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  404|      0|    return std::make_unique<H2OriginMockServer>(scenario);
  405|       |#else
  406|       |    // This target remains buildable under MemorySanitizer, whose curl build
  407|       |    // omits the OpenSSL server dependency required for TLS/ALPN h2.
  408|       |    return nullptr;
  409|       |#endif
  410|      0|  }
  411|       |
  412|      0|  if (mode == ScenarioRunMode::kProxyTransportCoverage) {
  ------------------
  |  Branch (412:7): [True: 0, False: 0]
  ------------------
  413|      0|    return std::make_unique<ProxyTransportMockServer>(scenario.socks_proxy_mode(), scenario.haproxy_protocol());
  414|      0|  }
  415|       |
  416|      0|  if (mode == ScenarioRunMode::kDeepHttpCoverage) {
  ------------------
  |  Branch (416:7): [True: 0, False: 0]
  ------------------
  417|      0|    if (scenario.proxy_socket_option_mode() == curl::fuzzer::proto::PROXY_SOCKET_OPTION_LOOPBACK_INTERFACE_KEEPALIVE) {
  ------------------
  |  Branch (417:9): [True: 0, False: 0]
  ------------------
  418|      0|      return std::make_unique<InterfaceOptionMockServer>();
  419|      0|    }
  420|      0|    if (scenario.proxy_socket_option_mode() != curl::fuzzer::proto::PROXY_SOCKET_OPTION_DEFAULT) {
  ------------------
  |  Branch (420:9): [True: 0, False: 0]
  ------------------
  421|      0|      return std::make_unique<ProxyOptionMockServer>(scenario.proxy_socket_option_mode());
  422|      0|    }
  423|      0|    if (scenario.http_transport_mode() != curl::fuzzer::proto::HTTP_TRANSPORT_DIRECT) {
  ------------------
  |  Branch (423:9): [True: 0, False: 0]
  ------------------
  424|      0|      return std::make_unique<HttpTransportMockServer>(scenario.http_transport_mode(), scenario.haproxy_protocol());
  425|      0|    }
  426|      0|  }
  427|       |
  428|      0|  if (mode == ScenarioRunMode::kResolverCoverage && scenario.has_doh()) {
  ------------------
  |  Branch (428:7): [True: 0, False: 0]
  |  Branch (428:53): [True: 0, False: 0]
  ------------------
  429|       |    // The DoH responder answers both the address and HTTPS resource-record
  430|       |    // queries; its TLS/ALPN h2 carrier then completes the outer HTTPS
  431|       |    // transfer selected from the record.
  432|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  433|      0|    return std::make_unique<DohHttpsRrMockServer>(scenario);
  434|       |#else
  435|       |    // MemorySanitizer builds deliberately omit OpenSSL, so no verified TLS
  436|       |    // peer exists for the HTTPS-RR lane. Keep the target available while
  437|       |    // refusing to fall through to an unrelated transport.
  438|       |    return nullptr;
  439|       |#endif
  440|      0|  }
  441|       |
  442|      0|  if (mode == ScenarioRunMode::kResolverCoverage && scenario.happy_eyeballs()) {
  ------------------
  |  Branch (442:7): [True: 0, False: 0]
  |  Branch (442:53): [True: 0, False: 0]
  ------------------
  443|       |    // The loopback race peer returns real unconnected sockets, so curl's
  444|       |    // happy-eyeballs filter can keep several connect attempts in progress
  445|       |    // instead of accepting the first preconnected socketpair.
  446|      0|    return std::make_unique<HappyEyeballsMockServer>();
  447|      0|  }
  448|       |
  449|      0|  switch (scenario.scheme()) {
  450|      0|    case curl::fuzzer::proto::SCHEME_HTTP:
  ------------------
  |  Branch (450:5): [True: 0, False: 0]
  ------------------
  451|      0|      if (mode == ScenarioRunMode::kApiLifecycle) {
  ------------------
  |  Branch (451:11): [True: 0, False: 0]
  ------------------
  452|      0|        return std::make_unique<MockServer>(MultiDrivePolicy::kFromApiPlan);
  453|      0|      }
  454|      0|      return std::make_unique<MockServer>();
  455|      0|    case curl::fuzzer::proto::SCHEME_HTTPS:
  ------------------
  |  Branch (455:5): [True: 0, False: 0]
  ------------------
  456|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  457|      0|      if (mode == ScenarioRunMode::kTlsCoverage) {
  ------------------
  |  Branch (457:11): [True: 0, False: 0]
  ------------------
  458|      0|        return std::make_unique<TlsMockServer>(scenario);
  459|      0|      }
  460|       |#else
  461|       |      (void)mode;
  462|       |#endif
  463|      0|      return std::make_unique<MockServer>();
  464|      0|    case curl::fuzzer::proto::SCHEME_GOPHER:
  ------------------
  |  Branch (464:5): [True: 0, False: 0]
  ------------------
  465|      0|      return mode == ScenarioRunMode::kGopherCoverage ? std::make_unique<GopherMockServer>(scenario.gopher_probe_mode())
  ------------------
  |  Branch (465:14): [True: 0, False: 0]
  ------------------
  466|      0|                                                      : nullptr;
  467|      0|    case curl::fuzzer::proto::SCHEME_GOPHERS:
  ------------------
  |  Branch (467:5): [True: 0, False: 0]
  ------------------
  468|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  469|      0|      if (mode == ScenarioRunMode::kGopherCoverage) {
  ------------------
  |  Branch (469:11): [True: 0, False: 0]
  ------------------
  470|      0|        return std::make_unique<TlsMockServer>(scenario);
  471|      0|      }
  472|      0|      return nullptr;
  473|       |#else
  474|       |      return nullptr;
  475|       |#endif
  476|      0|    case curl::fuzzer::proto::SCHEME_WS:
  ------------------
  |  Branch (476:5): [True: 0, False: 0]
  ------------------
  477|      0|      return std::make_unique<WebSocketMockServer>();
  478|      0|    case curl::fuzzer::proto::SCHEME_WSS:
  ------------------
  |  Branch (478:5): [True: 0, False: 0]
  ------------------
  479|      0|      if (mode == ScenarioRunMode::kTlsWebSocketCoverage) {
  ------------------
  |  Branch (479:11): [True: 0, False: 0]
  ------------------
  480|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  481|      0|        return std::make_unique<TlsWebSocketMockServer>(scenario.tls_certificate_chain());
  482|       |#else
  483|       |        // MemorySanitizer builds deliberately omit OpenSSL. Keep the target
  484|       |        // available without pretending plaintext can carry a WSS exchange.
  485|       |        return nullptr;
  486|       |#endif
  487|      0|      }
  488|       |      // Preserve the compatibility target's historical interpretation of WSS
  489|       |      // inputs, which exposed TLS bytes directly to the plaintext WS peer.
  490|      0|      return std::make_unique<WebSocketMockServer>();
  491|      0|    case curl::fuzzer::proto::SCHEME_TELNET:
  ------------------
  |  Branch (491:5): [True: 0, False: 0]
  ------------------
  492|      0|      return std::make_unique<TelnetMockServer>();
  493|      0|    case curl::fuzzer::proto::SCHEME_FTP:
  ------------------
  |  Branch (493:5): [True: 0, False: 0]
  ------------------
  494|       |      // New numeric enum values may already occur in the historical mixed
  495|       |      // corpus as unknown fields. Only the fixed FTP profile may reinterpret
  496|       |      // one as a live two-channel protocol exchange.
  497|      0|      if (mode == ScenarioRunMode::kFtpCoverage) {
  ------------------
  |  Branch (497:11): [True: 0, False: 0]
  ------------------
  498|      0|        return std::make_unique<FtpMockServer>();
  499|      0|      }
  500|      0|      return nullptr;
  501|      0|    case curl::fuzzer::proto::SCHEME_FTPS:
  ------------------
  |  Branch (501:5): [True: 0, False: 0]
  ------------------
  502|       |      // Implicit TLS shares the FTP lane, parser, and bounded data-channel
  503|       |      // budget with the plaintext scheme; only the transport factory and the
  504|       |      // passive-only restriction differ. Keep it gated on the same run mode so
  505|       |      // no other target can turn an appended enum value into a TLS exchange.
  506|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  507|      0|      if (mode == ScenarioRunMode::kFtpCoverage) {
  ------------------
  |  Branch (507:11): [True: 0, False: 0]
  ------------------
  508|      0|        return std::make_unique<FtpsMockServer>();
  509|      0|      }
  510|      0|#endif
  511|      0|      return nullptr;
  512|      0|    case curl::fuzzer::proto::SCHEME_TFTP:
  ------------------
  |  Branch (512:5): [True: 0, False: 0]
  ------------------
  513|       |      // TFTP changes the callback transport from a preconnected stream to a
  514|       |      // real UDP endpoint, so compatibility inputs must not opt into it merely
  515|       |      // because this build learned a new enum value.
  516|      0|      if (mode == ScenarioRunMode::kTftpCoverage) {
  ------------------
  |  Branch (516:11): [True: 0, False: 0]
  ------------------
  517|      0|        return std::make_unique<TftpMockServer>();
  518|      0|      }
  519|      0|      return nullptr;
  520|      0|    case curl::fuzzer::proto::SCHEME_SMTP:
  ------------------
  |  Branch (520:5): [True: 0, False: 0]
  ------------------
  521|       |      // SMTP reuses the stream socketpair but needs command-aligned replies
  522|       |      // and a DATA body drain. Only the dedicated lane may reinterpret an
  523|       |      // append-only scheme value that historical corpus inputs could carry.
  524|      0|      if (mode == ScenarioRunMode::kSmtpCoverage) {
  ------------------
  |  Branch (524:11): [True: 0, False: 0]
  ------------------
  525|      0|        return std::make_unique<SmtpMockServer>(scenario.smtp_probe_mode());
  526|      0|      }
  527|      0|      return nullptr;
  528|      0|    case curl::fuzzer::proto::SCHEME_IMAP:
  ------------------
  |  Branch (528:5): [True: 0, False: 0]
  ------------------
  529|       |      // IMAP replies are tag-aligned. Only the dedicated lane may reinterpret
  530|       |      // an append-only scheme value that historical inputs could carry.
  531|      0|      if (mode == ScenarioRunMode::kImapCoverage) {
  ------------------
  |  Branch (531:11): [True: 0, False: 0]
  ------------------
  532|      0|        return std::make_unique<ImapMockServer>();
  533|      0|      }
  534|      0|      return nullptr;
  535|      0|    case curl::fuzzer::proto::SCHEME_POP3:
  ------------------
  |  Branch (535:5): [True: 0, False: 0]
  ------------------
  536|      0|      if (mode == ScenarioRunMode::kPop3Coverage) {
  ------------------
  |  Branch (536:11): [True: 0, False: 0]
  ------------------
  537|      0|        return std::make_unique<Pop3MockServer>();
  538|      0|      }
  539|      0|      return nullptr;
  540|      0|    case curl::fuzzer::proto::SCHEME_MQTT:
  ------------------
  |  Branch (540:5): [True: 0, False: 0]
  ------------------
  541|       |      // MQTT reuses the stream socketpair but speaks a binary packet grammar
  542|       |      // with server-initiated packets. Only the dedicated lane may
  543|       |      // reinterpret an append-only scheme value that historical corpus
  544|       |      // inputs could carry.
  545|      0|      if (mode == ScenarioRunMode::kMqttCoverage) {
  ------------------
  |  Branch (545:11): [True: 0, False: 0]
  ------------------
  546|      0|        return std::make_unique<MqttMockServer>(scenario.mqtt_probe_mode());
  547|      0|      }
  548|      0|      return nullptr;
  549|      0|    case curl::fuzzer::proto::SCHEME_DICT:
  ------------------
  |  Branch (549:5): [True: 0, False: 0]
  ------------------
  550|       |      // DICT sends its command sequence in one write and reads an EOF-framed
  551|       |      // text body. Only the dedicated lane may reinterpret an append-only
  552|       |      // scheme value that historical inputs could carry.
  553|      0|      if (mode == ScenarioRunMode::kDictCoverage) {
  ------------------
  |  Branch (553:11): [True: 0, False: 0]
  ------------------
  554|      0|        return std::make_unique<DictMockServer>();
  555|      0|      }
  556|      0|      return nullptr;
  557|      0|    case curl::fuzzer::proto::SCHEME_SMTPS:
  ------------------
  |  Branch (557:5): [True: 0, False: 0]
  ------------------
  558|       |      // Implicit TLS shares the SMTP lane, parser, and command budget with the
  559|       |      // plaintext scheme; only the transport factory differs. Keep it gated on
  560|       |      // the same fixed run mode so no other target can turn an appended enum
  561|       |      // value into a TLS exchange.
  562|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  563|      0|      if (mode == ScenarioRunMode::kSmtpCoverage) {
  ------------------
  |  Branch (563:11): [True: 0, False: 0]
  ------------------
  564|      0|        return std::make_unique<SmtpsMockServer>();
  565|      0|      }
  566|      0|#endif
  567|      0|      return nullptr;
  568|      0|    case curl::fuzzer::proto::SCHEME_IMAPS:
  ------------------
  |  Branch (568:5): [True: 0, False: 0]
  ------------------
  569|       |      // Implicit TLS reuses the IMAP lane and tag-aware parser; only the
  570|       |      // transport factory differs. Gate it on the same fixed run mode so no
  571|       |      // other target can turn the appended enum value into a TLS exchange.
  572|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  573|      0|      if (mode == ScenarioRunMode::kImapCoverage) {
  ------------------
  |  Branch (573:11): [True: 0, False: 0]
  ------------------
  574|      0|        return std::make_unique<ImapsMockServer>();
  575|      0|      }
  576|      0|#endif
  577|      0|      return nullptr;
  578|      0|    case curl::fuzzer::proto::SCHEME_POP3S:
  ------------------
  |  Branch (578:5): [True: 0, False: 0]
  ------------------
  579|       |      // Implicit TLS reuses the POP3 lane and status-line parser; only the
  580|       |      // transport factory differs. Gate it on the same fixed run mode so no
  581|       |      // other target can turn the appended enum value into a TLS exchange.
  582|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  583|      0|      if (mode == ScenarioRunMode::kPop3Coverage) {
  ------------------
  |  Branch (583:11): [True: 0, False: 0]
  ------------------
  584|      0|        return std::make_unique<Pop3sMockServer>();
  585|      0|      }
  586|      0|#endif
  587|      0|      return nullptr;
  588|      0|    case curl::fuzzer::proto::SCHEME_MQTTS:
  ------------------
  |  Branch (588:5): [True: 0, False: 0]
  ------------------
  589|       |      // Implicit TLS shares the MQTT lane, packet parser, and server-packet
  590|       |      // budget with the plaintext scheme; only the transport factory differs.
  591|       |      // Keep it gated on the same fixed run mode so no other target can turn
  592|       |      // an appended enum value into a TLS exchange.
  593|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  594|      0|      if (mode == ScenarioRunMode::kMqttCoverage) {
  ------------------
  |  Branch (594:11): [True: 0, False: 0]
  ------------------
  595|      0|        return std::make_unique<MqttsMockServer>();
  596|      0|      }
  597|      0|#endif
  598|      0|      return nullptr;
  599|      0|    case curl::fuzzer::proto::SCHEME_FILE:
  ------------------
  |  Branch (599:5): [True: 0, False: 0]
  ------------------
  600|       |      // FILE reads a session-owned anonymous descriptor directly, so there is
  601|       |      // no socket or scriptable peer to install.
  602|      0|      return nullptr;
  603|      0|    case curl::fuzzer::proto::SCHEME_LDAP:
  ------------------
  |  Branch (603:5): [True: 0, False: 0]
  ------------------
  604|       |      // LDAP is BER/ASN.1 rather than line-oriented and OpenLDAP performs its
  605|       |      // own reads on a duplicate of curl's socket. Only the dedicated lane
  606|       |      // may turn an appended scheme value into a live bind/search exchange.
  607|      0|      if (mode == ScenarioRunMode::kLdapCoverage) {
  ------------------
  |  Branch (607:11): [True: 0, False: 0]
  ------------------
  608|      0|        return std::make_unique<LdapMockServer>();
  609|      0|      }
  610|      0|      return nullptr;
  611|      0|    case curl::fuzzer::proto::SCHEME_LDAPS:
  ------------------
  |  Branch (611:5): [True: 0, False: 0]
  ------------------
  612|       |      // Implicit TLS shares the LDAP lane, BER parser, and scripted messages
  613|       |      // with the plaintext scheme; only the transport factory differs. Keep it
  614|       |      // gated on the same fixed run mode so no other target can turn an
  615|       |      // appended enum value into a TLS exchange.
  616|      0|#if defined(PROTO_FUZZER_HAS_TLS_MOCK_SERVER)
  617|      0|      if (mode == ScenarioRunMode::kLdapCoverage) {
  ------------------
  |  Branch (617:11): [True: 0, False: 0]
  ------------------
  618|      0|        return std::make_unique<LdapsMockServer>();
  619|      0|      }
  620|      0|#endif
  621|      0|      return nullptr;
  622|      0|    case curl::fuzzer::proto::SCHEME_RTSP:
  ------------------
  |  Branch (622:5): [True: 0, False: 0]
  ------------------
  623|       |      // RTSP is request-aligned rather than greeting-aligned, so the
  624|       |      // dedicated lane is required to select the peer that waits for the
  625|       |      // request terminator before releasing each scripted response.
  626|      0|      if (mode == ScenarioRunMode::kRtspCoverage) {
  ------------------
  |  Branch (626:11): [True: 0, False: 0]
  ------------------
  627|      0|        return std::make_unique<RtspMockServer>();
  628|      0|      }
  629|      0|      return nullptr;
  630|      0|    case curl::fuzzer::proto::SCHEME_IPFS:
  ------------------
  |  Branch (630:5): [True: 0, False: 0]
  ------------------
  631|      0|    case curl::fuzzer::proto::SCHEME_IPNS:
  ------------------
  |  Branch (631:5): [True: 0, False: 0]
  ------------------
  632|       |      // The rewrite above turns these into ordinary HTTP GETs. Only the
  633|       |      // dedicated fast lane may reinterpret an append-only scheme value, and
  634|       |      // its compatibility peer is the plaintext MockServer.
  635|      0|      if (mode == ScenarioRunMode::kFastProtocol) {
  ------------------
  |  Branch (635:11): [True: 0, False: 0]
  ------------------
  636|      0|        return std::make_unique<MockServer>();
  637|      0|      }
  638|      0|      return nullptr;
  639|      0|    case curl::fuzzer::proto::SCHEME_UNSPECIFIED:
  ------------------
  |  Branch (639:5): [True: 0, False: 0]
  ------------------
  640|      0|    default:
  ------------------
  |  Branch (640:5): [True: 0, False: 0]
  ------------------
  641|      0|      return nullptr;
  642|      0|  }
  643|      0|}
scenario_runner.cc:_ZN12proto_fuzzer12_GLOBAL__N_111ScenarioUrlERKN4curl6fuzzer5proto8ScenarioEPKc:
  362|  9.91k|std::string ScenarioUrl(const curl::fuzzer::proto::Scenario& scenario, const char* prefix) {
  363|  9.91k|  if (scenario.scheme() == curl::fuzzer::proto::SCHEME_IPFS || scenario.scheme() == curl::fuzzer::proto::SCHEME_IPNS) {
  ------------------
  |  Branch (363:7): [True: 0, False: 9.91k]
  |  Branch (363:64): [True: 0, False: 9.91k]
  ------------------
  364|      0|    return BuildIpfsGatewayUrl(scenario.scheme(), scenario.host_path());
  365|      0|  }
  366|  9.91k|  return std::string(prefix) + "://" + scenario.host_path();
  367|  9.91k|}
scenario_runner.cc:_ZZN12proto_fuzzer11RunScenarioERKN4curl6fuzzer5proto8ScenarioENS_15ScenarioRunModeEENK3$_1clEv:
  704|  9.91k|  const auto configure_easy = [&] {
  705|  9.91k|    transfer.ApplyBaseline(scenario);
  706|  9.91k|    (void)curl_easy_setopt(easy, CURLOPT_URL, url.c_str());
  ------------------
  |  | 3364|  9.91k|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  707|  9.91k|    if (mock) {
  ------------------
  |  Branch (707:9): [True: 9.91k, False: 0]
  ------------------
  708|  9.91k|      mock->Install(easy);
  709|  9.91k|    }
  710|  9.91k|    transfer.ApplyInputFiles();
  711|       |    // Repeat the option-count bound for compatibility and direct callers.
  712|  9.91k|    (void)ApplyScenarioOptions(easy, scenario);
  713|       |    // A schema-native pin file is authoritative over the generic digest option.
  714|       |    // Its session-owned path remains valid until after easy cleanup.
  715|  9.91k|    transfer.ApplyPinnedPublicKeyFile();
  716|  9.91k|    if (auto* rtsp = dynamic_cast<RtspMockServer*>(mock.get())) {
  ------------------
  |  Branch (716:15): [True: 0, False: 9.91k]
  ------------------
  717|      0|      rtsp->ConfigureClient(easy, scenario.rtsp_probe_mode());
  718|      0|    }
  719|  9.91k|    if (auto* smtp = dynamic_cast<SmtpMockServer*>(mock.get())) {
  ------------------
  |  Branch (719:15): [True: 0, False: 9.91k]
  ------------------
  720|      0|      smtp->ConfigureClient(easy);
  721|      0|    }
  722|  9.91k|    if (mode == ScenarioRunMode::kGopherCoverage &&
  ------------------
  |  Branch (722:9): [True: 0, False: 9.91k]
  ------------------
  723|      0|        scenario.gopher_probe_mode() == curl::fuzzer::proto::GOPHER_PROBE_TLS_SESSION_KEY_LIMIT) {
  ------------------
  |  Branch (723:9): [True: 0, False: 0]
  ------------------
  724|      0|      (void)curl_easy_setopt(easy, CURLOPT_SSL_VERIFYPEER, 0L);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  725|      0|      (void)curl_easy_setopt(easy, CURLOPT_SSL_OPTIONS, static_cast<long>(CURLSSLOPT_ALLOW_BEAST));
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  726|      0|    }
  727|  9.91k|    if (ScenarioRequestsStartTls(scenario, mode)) {
  ------------------
  |  Branch (727:9): [True: 0, False: 9.91k]
  ------------------
  728|      0|      (void)curl_easy_setopt(easy, CURLOPT_USE_SSL, static_cast<long>(CURLUSESSL_ALL));
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  729|      0|    }
  730|  9.91k|    if (mode == ScenarioRunMode::kResolverCoverage && !ApplyResolverMode(easy, scenario.resolver_mode())) {
  ------------------
  |  Branch (730:9): [True: 0, False: 9.91k]
  |  Branch (730:55): [True: 0, False: 0]
  ------------------
  731|      0|      return false;
  732|      0|    }
  733|  9.91k|    if (mode == ScenarioRunMode::kTlsCoverage) {
  ------------------
  |  Branch (733:9): [True: 0, False: 9.91k]
  ------------------
  734|      0|      (void)transfer.ApplyTlsClientCredentialProfile(scenario.tls_client_credential_profile());
  735|      0|    }
  736|  9.91k|    return true;
  737|  9.91k|  };
scenario_runner.cc:_ZN12proto_fuzzer12_GLOBAL__N_124ScenarioRequestsStartTlsERKN4curl6fuzzer5proto8ScenarioENS_15ScenarioRunModeE:
   83|  9.91k|bool ScenarioRequestsStartTls(const curl::fuzzer::proto::Scenario& scenario, ScenarioRunMode mode) {
   84|  9.91k|  switch (mode) {
   85|      0|    case ScenarioRunMode::kLdapCoverage:
  ------------------
  |  Branch (85:5): [True: 0, False: 9.91k]
  ------------------
   86|      0|      return scenario.scheme() == curl::fuzzer::proto::SCHEME_LDAP && scenario.ldap_starttls();
  ------------------
  |  Branch (86:14): [True: 0, False: 0]
  |  Branch (86:71): [True: 0, False: 0]
  ------------------
   87|      0|    case ScenarioRunMode::kFtpCoverage:
  ------------------
  |  Branch (87:5): [True: 0, False: 9.91k]
  ------------------
   88|      0|      return scenario.scheme() == curl::fuzzer::proto::SCHEME_FTP && scenario.ftp_auth_tls_filter_allocation_failure();
  ------------------
  |  Branch (88:14): [True: 0, False: 0]
  |  Branch (88:70): [True: 0, False: 0]
  ------------------
   89|      0|    case ScenarioRunMode::kPop3Coverage:
  ------------------
  |  Branch (89:5): [True: 0, False: 9.91k]
  ------------------
   90|      0|      return scenario.scheme() == curl::fuzzer::proto::SCHEME_POP3 &&
  ------------------
  |  Branch (90:14): [True: 0, False: 0]
  ------------------
   91|      0|             scenario.pop3_starttls_filter_allocation_failure();
  ------------------
  |  Branch (91:14): [True: 0, False: 0]
  ------------------
   92|  9.91k|    default:
  ------------------
  |  Branch (92:5): [True: 9.91k, False: 0]
  ------------------
   93|  9.91k|      return false;
   94|  9.91k|  }
   95|  9.91k|}
scenario_runner.cc:_ZN12proto_fuzzer12_GLOBAL__N_120ProbeTransferResultsEPv:
  270|  9.91k|void ProbeTransferResults(CURL* easy) {
  271|  9.91k|  char* string_result = nullptr;
  272|  9.91k|  long long_result = 0;
  273|  9.91k|  double double_result = 0;
  274|  9.91k|  curl_off_t offset_result = 0;
  275|  9.91k|  curl_socket_t socket_result = CURL_SOCKET_BAD;
  ------------------
  |  |  147|  9.91k|#define CURL_SOCKET_BAD (-1)
  ------------------
  276|  9.91k|  struct curl_certinfo* certinfo_result = nullptr;
  277|       |
  278|  9.91k|  (void)curl_easy_getinfo(easy, CURLINFO_EFFECTIVE_URL, &string_result);
  ------------------
  |  | 3366|  9.91k|  curl_easy_getinfo curl_exactly_three_arguments(handle, info, arg)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  279|  9.91k|  (void)curl_easy_getinfo(easy, CURLINFO_RESPONSE_CODE, &long_result);
  ------------------
  |  | 3366|  9.91k|  curl_easy_getinfo curl_exactly_three_arguments(handle, info, arg)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  280|  9.91k|  (void)curl_easy_getinfo(easy, CURLINFO_TOTAL_TIME, &double_result);
  ------------------
  |  | 3366|  9.91k|  curl_easy_getinfo curl_exactly_three_arguments(handle, info, arg)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  281|  9.91k|  (void)curl_easy_getinfo(easy, CURLINFO_SIZE_DOWNLOAD_T, &offset_result);
  ------------------
  |  | 3366|  9.91k|  curl_easy_getinfo curl_exactly_three_arguments(handle, info, arg)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  282|  9.91k|  (void)curl_easy_getinfo(easy, CURLINFO_ACTIVESOCKET, &socket_result);
  ------------------
  |  | 3366|  9.91k|  curl_easy_getinfo curl_exactly_three_arguments(handle, info, arg)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  283|  9.91k|  (void)curl_easy_getinfo(easy, CURLINFO_CERTINFO, &certinfo_result);
  ------------------
  |  | 3366|  9.91k|  curl_easy_getinfo curl_exactly_three_arguments(handle, info, arg)
  |  |  ------------------
  |  |  |  | 3362|  9.91k|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  284|       |
  285|  9.91k|  struct curl_header* header = nullptr;
  286|  9.91k|  (void)curl_easy_header(easy, "Content-Type", 0, kAllHeaderOrigins, -1, &header);
  287|  9.91k|  header = nullptr;
  288|  13.9k|  for (std::size_t index = 0; index < kMaxResultHeaders; ++index) {
  ------------------
  |  Branch (288:31): [True: 13.8k, False: 143]
  ------------------
  289|  13.8k|    header = curl_easy_nextheader(easy, kAllHeaderOrigins, -1, header);
  290|  13.8k|    if (header == nullptr) {
  ------------------
  |  Branch (290:9): [True: 9.77k, False: 4.07k]
  ------------------
  291|  9.77k|      break;
  292|  9.77k|    }
  293|  13.8k|  }
  294|  9.91k|}

_ZN12proto_fuzzer29NormalizeScenarioForExecutionEPN4curl6fuzzer5proto8ScenarioE:
 2785|  29.8k|void NormalizeScenarioForExecution(curl::fuzzer::proto::Scenario* scenario) {
 2786|  29.8k|  if (scenario == nullptr) {
  ------------------
  |  Branch (2786:7): [True: 0, False: 29.8k]
  ------------------
 2787|      0|    return;
 2788|      0|  }
 2789|  29.8k|  CanonicalizeAllocationFailures(scenario);
 2790|  29.8k|  CanonicalizeAllocationFailureDrive(scenario);
 2791|  29.8k|  CanonicalizeLocalPortRange(scenario);
 2792|  29.8k|}
_ZN12proto_fuzzer26NormalizeScenarioForTargetEPN4curl6fuzzer5proto8ScenarioENS_13TargetProfileEPFvS4_S5_E:
 2807|  19.9k|                                ConditionalEligibilityPruner prune_conditional_eligibility) {
 2808|       |  // Compatibility has no LPM postprocessor. Preserve the complete wire input,
 2809|       |  // including mismatched option oneofs and newly added, otherwise inert fields.
 2810|  19.9k|  if (scenario == nullptr || profile == TargetProfile::kCompatibility) {
  ------------------
  |  Branch (2810:7): [True: 0, False: 19.9k]
  |  Branch (2810:30): [True: 0, False: 19.9k]
  ------------------
 2811|      0|    return;
 2812|      0|  }
 2813|       |
 2814|  19.9k|  ApplyLanePolicy(scenario, profile, prune_conditional_eligibility);
 2815|  19.9k|  NormalizeScenarioForExecution(scenario);
 2816|  19.9k|  CanonicalizeOptionValueCases(scenario);
 2817|       |  // Canonicalization can materialize string values or prepend pin syntax.
 2818|       |  // Charge the final representation so normalization remains a fixed point.
 2819|  66.7k|  for (auto& option : *scenario->mutable_options()) {
  ------------------
  |  Branch (2819:21): [True: 66.7k, False: 19.9k]
  ------------------
 2820|  66.7k|    if (option.value_case() == curl::fuzzer::proto::SetOption::kStringValue) {
  ------------------
  |  Branch (2820:9): [True: 35.3k, False: 31.4k]
  ------------------
 2821|  35.3k|      TrimMetadata(option.mutable_string_value());
 2822|  35.3k|    }
 2823|  66.7k|  }
 2824|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_130CanonicalizeAllocationFailuresEPN4curl6fuzzer5proto8ScenarioE:
  775|  29.8k|void CanonicalizeAllocationFailures(curl::fuzzer::proto::Scenario* scenario) {
  776|  29.8k|  std::array<std::uint32_t, scenario_limits::kMaxAllocationFailures> retained{};
  777|  29.8k|  std::size_t retained_count = 0;
  778|  29.8k|  const std::uint32_t maximum = static_cast<std::uint32_t>(scenario_limits::kMaxAllocationOrdinal);
  779|       |
  780|  29.8k|  for (const std::uint32_t raw : scenario->fail_allocations()) {
  ------------------
  |  Branch (780:32): [True: 19.0k, False: 29.8k]
  ------------------
  781|  19.0k|    if (raw == 0) {
  ------------------
  |  Branch (781:9): [True: 1.46k, False: 17.5k]
  ------------------
  782|  1.46k|      continue;
  783|  1.46k|    }
  784|  17.5k|    const std::uint32_t ordinal = 1U + ((raw - 1U) % maximum);
  785|  17.5k|    const auto begin = retained.begin();
  786|  17.5k|    const auto end = begin + static_cast<std::ptrdiff_t>(retained_count);
  787|  17.5k|    const auto position = std::lower_bound(begin, end, ordinal);
  788|  17.5k|    if (position != end && *position == ordinal) {
  ------------------
  |  Branch (788:9): [True: 3.49k, False: 14.0k]
  |  Branch (788:28): [True: 2.94k, False: 548]
  ------------------
  789|  2.94k|      continue;
  790|  2.94k|    }
  791|  14.6k|    const std::size_t index = static_cast<std::size_t>(position - begin);
  792|  14.6k|    if (index >= retained.size()) {
  ------------------
  |  Branch (792:9): [True: 8.78k, False: 5.82k]
  ------------------
  793|  8.78k|      continue;
  794|  8.78k|    }
  795|  5.82k|    if (retained_count < retained.size()) {
  ------------------
  |  Branch (795:9): [True: 5.49k, False: 332]
  ------------------
  796|  5.49k|      ++retained_count;
  797|  5.49k|    }
  798|  6.66k|    for (std::size_t destination = retained_count - 1; destination > index; --destination) {
  ------------------
  |  Branch (798:56): [True: 840, False: 5.82k]
  ------------------
  799|    840|      retained[destination] = retained[destination - 1];
  800|    840|    }
  801|  5.82k|    retained[index] = ordinal;
  802|  5.82k|  }
  803|       |
  804|  29.8k|  auto* values = scenario->mutable_fail_allocations();
  805|  29.8k|  values->Clear();
  806|  35.3k|  for (std::size_t index = 0; index < retained_count; ++index) {
  ------------------
  |  Branch (806:31): [True: 5.49k, False: 29.8k]
  ------------------
  807|  5.49k|    values->Add(retained[index]);
  808|  5.49k|  }
  809|  29.8k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_134CanonicalizeAllocationFailureDriveEPN4curl6fuzzer5proto8ScenarioE:
  816|  29.8k|void CanonicalizeAllocationFailureDrive(curl::fuzzer::proto::Scenario* scenario) {
  817|  29.8k|  if (!scenario->fail_allocations().empty() && scenario->has_api_plan() &&
  ------------------
  |  Branch (817:7): [True: 2.84k, False: 27.0k]
  |  Branch (817:48): [True: 0, False: 2.84k]
  ------------------
  818|      0|      scenario->api_plan().drive_mode() == curl::fuzzer::proto::API_DRIVE_EASY_EVENTS) {
  ------------------
  |  Branch (818:7): [True: 0, False: 0]
  ------------------
  819|      0|    scenario->mutable_api_plan()->set_drive_mode(curl::fuzzer::proto::API_DRIVE_EASY_PERFORM);
  820|      0|  }
  821|  29.8k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_126CanonicalizeLocalPortRangeEPN4curl6fuzzer5proto8ScenarioE:
 1401|  29.8k|void CanonicalizeLocalPortRange(curl::fuzzer::proto::Scenario* scenario) {
 1402|   100k|  for (auto& option : *scenario->mutable_options()) {
  ------------------
  |  Branch (1402:21): [True: 100k, False: 29.8k]
  ------------------
 1403|   100k|    if (option.option_id() == curl::fuzzer::proto::CURLOPT_LOCALPORTRANGE) {
  ------------------
  |  Branch (1403:9): [True: 0, False: 100k]
  ------------------
 1404|      0|      option.set_uint_value(std::min<std::uint64_t>(IntegralMutationValue(option), kMaxLocalPortRange));
 1405|      0|    }
 1406|   100k|  }
 1407|  29.8k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_115ApplyLanePolicyEPN4curl6fuzzer5proto8ScenarioENS_13TargetProfileEPFvS5_S6_E:
 1863|  19.9k|                     ConditionalEligibilityPruner prune_conditional_eligibility) {
 1864|  19.9k|  if (scenario == nullptr) {
  ------------------
  |  Branch (1864:7): [True: 0, False: 19.9k]
  ------------------
 1865|      0|    return;
 1866|      0|  }
 1867|       |
 1868|  19.9k|  if (profile == TargetProfile::kCompatibility) {
  ------------------
  |  Branch (1868:7): [True: 0, False: 19.9k]
  ------------------
 1869|       |    // The original target's existing corpus predates profile splitting. A
 1870|       |    // no-op here makes the type safe to pass around while its binary continues
 1871|       |    // to omit postprocessor registration altogether. The append-only FTP/FTPS
 1872|       |    // and TFTP scheme values do not justify rewriting historical mixed-lane
 1873|       |    // inputs.
 1874|      0|    return;
 1875|      0|  }
 1876|       |
 1877|       |  // Only FastFile may turn protobuf bytes into a local descriptor. Generated
 1878|       |  // profiles already enforce this ownership; repeat it for direct callers of
 1879|       |  // the full runtime Scenario before any generic bounds inspect the field.
 1880|  19.9k|  if (profile != TargetProfile::kFastFile) {
  ------------------
  |  Branch (1880:7): [True: 19.9k, False: 0]
  ------------------
 1881|  19.9k|    scenario->clear_file_source();
 1882|  19.9k|  }
 1883|       |
 1884|       |  // Request trailers belong only to HTTP/1.1 upload lanes. The compatibility
 1885|       |  // target returned above and retains its append-only wire field, while every
 1886|       |  // HTTP/2, HTTP/3, proxy, WebSocket, and non-HTTP fixed lane drops it.
 1887|  19.9k|  if (profile != TargetProfile::kDeepHttp && profile != TargetProfile::kFastHttps) {
  ------------------
  |  Branch (1887:7): [True: 19.9k, False: 0]
  |  Branch (1887:46): [True: 19.9k, False: 0]
  ------------------
 1888|  19.9k|    scenario->clear_http_upload_trailers();
 1889|  19.9k|  }
 1890|       |
 1891|       |  // The nested selector belongs exclusively to the HTTPS CONNECT proxy lane.
 1892|       |  // Compatibility returned above and therefore preserves accumulated inputs;
 1893|       |  // every unrelated fixed lane drops work its peer cannot observe.
 1894|  19.9k|  if (profile != TargetProfile::kH2Proxy) {
  ------------------
  |  Branch (1894:7): [True: 19.9k, False: 0]
  ------------------
 1895|  19.9k|    scenario->mutable_connection()->clear_proxy_protocol();
 1896|  19.9k|    for (auto& connection : *scenario->mutable_subsequent_connections()) {
  ------------------
  |  Branch (1896:27): [True: 0, False: 19.9k]
  ------------------
 1897|      0|      connection.clear_proxy_protocol();
 1898|      0|    }
 1899|  19.9k|  }
 1900|       |
 1901|       |  // MQTT is append-only as well. No other fixed lane may reinterpret one of
 1902|       |  // its packet scripts, so clear the selector before the lane-specific early
 1903|       |  // paths install their own scheme. Compatibility returned above and keeps
 1904|       |  // historical unknown-field semantics.
 1905|  19.9k|  if (profile != TargetProfile::kFastMqtt && scenario->scheme() == curl::fuzzer::proto::SCHEME_MQTT) {
  ------------------
  |  Branch (1905:7): [True: 19.9k, False: 0]
  |  Branch (1905:46): [True: 0, False: 19.9k]
  ------------------
 1906|      0|    scenario->clear_scheme();
 1907|      0|  }
 1908|       |
 1909|       |  // DICT is append-only too. Only the dedicated lane may reinterpret a lookup
 1910|       |  // script; every other fixed lane clears the selector before installing its
 1911|       |  // own scheme.
 1912|  19.9k|  if (profile != TargetProfile::kFastDict && scenario->scheme() == curl::fuzzer::proto::SCHEME_DICT) {
  ------------------
  |  Branch (1912:7): [True: 19.9k, False: 0]
  |  Branch (1912:46): [True: 0, False: 19.9k]
  ------------------
 1913|      0|    scenario->clear_scheme();
 1914|      0|  }
 1915|       |
 1916|       |  // FILE is append-only as well. Other fixed lanes must not inherit a local
 1917|       |  // filesystem selector from a corpus input; only the dedicated lane may run
 1918|       |  // the peerless file:// path.
 1919|  19.9k|  if (profile != TargetProfile::kFastFile && scenario->scheme() == curl::fuzzer::proto::SCHEME_FILE) {
  ------------------
  |  Branch (1919:7): [True: 19.9k, False: 0]
  |  Branch (1919:46): [True: 0, False: 19.9k]
  ------------------
 1920|      0|    scenario->clear_scheme();
 1921|      0|  }
 1922|       |
 1923|       |  // LDAP and LDAPS are append-only too. Only the fixed BER lane may turn one
 1924|       |  // of their scripted bind/search exchanges into a live OpenLDAP session.
 1925|  19.9k|  if (profile != TargetProfile::kFastLdap && (scenario->scheme() == curl::fuzzer::proto::SCHEME_LDAP ||
  ------------------
  |  Branch (1925:7): [True: 19.9k, False: 0]
  |  Branch (1925:47): [True: 0, False: 19.9k]
  ------------------
 1926|  19.9k|                                              scenario->scheme() == curl::fuzzer::proto::SCHEME_LDAPS)) {
  ------------------
  |  Branch (1926:47): [True: 0, False: 19.9k]
  ------------------
 1927|      0|    scenario->clear_scheme();
 1928|      0|  }
 1929|       |
 1930|       |  // RTSP is append-only too. Keep its selector away from every fixed lane
 1931|       |  // that cannot service a request-aligned RTSP exchange. Static option
 1932|       |  // membership is carried by each generated profile descriptor.
 1933|  19.9k|  if (profile != TargetProfile::kFastRtsp && scenario->scheme() == curl::fuzzer::proto::SCHEME_RTSP) {
  ------------------
  |  Branch (1933:7): [True: 19.9k, False: 0]
  |  Branch (1933:46): [True: 0, False: 19.9k]
  ------------------
 1934|      0|    scenario->clear_scheme();
 1935|      0|  }
 1936|       |  // FTPS is append-only too. Only the fixed FTP lane may turn one of its
 1937|       |  // scenarios into a TLS-wrapped control/data exchange.
 1938|  19.9k|  if (profile != TargetProfile::kFastFtp && scenario->scheme() == curl::fuzzer::proto::SCHEME_FTPS) {
  ------------------
  |  Branch (1938:7): [True: 19.9k, False: 0]
  |  Branch (1938:45): [True: 0, False: 19.9k]
  ------------------
 1939|      0|    scenario->clear_scheme();
 1940|      0|  }
 1941|       |
 1942|       |  // IPFS/IPNS are append-only as well. Their identifiers and gateway paths
 1943|       |  // would be inert in every other fixed lane, so clear the selector before
 1944|       |  // the lane-specific early paths install their own scheme.
 1945|  19.9k|  if (profile != TargetProfile::kFastIpfs && (scenario->scheme() == curl::fuzzer::proto::SCHEME_IPFS ||
  ------------------
  |  Branch (1945:7): [True: 19.9k, False: 0]
  |  Branch (1945:47): [True: 0, False: 19.9k]
  ------------------
 1946|  19.9k|                                              scenario->scheme() == curl::fuzzer::proto::SCHEME_IPNS)) {
  ------------------
  |  Branch (1946:47): [True: 0, False: 19.9k]
  ------------------
 1947|      0|    scenario->clear_scheme();
 1948|      0|  }
 1949|       |
 1950|       |  // Accepted server push adds a harness-owned easy handle and therefore
 1951|       |  // belongs only in the fixed H2 origin lanes. Compatibility remains a no-op
 1952|       |  // above so accumulated mixed corpus entries keep their wire meaning.
 1953|  19.9k|  if (profile != TargetProfile::kHttpsH2 && profile != TargetProfile::kFastHttp2) {
  ------------------
  |  Branch (1953:7): [True: 19.9k, False: 0]
  |  Branch (1953:45): [True: 19.9k, False: 0]
  ------------------
 1954|  19.9k|    scenario->clear_accept_h2_push();
 1955|  19.9k|  }
 1956|       |
 1957|       |  // Only the dedicated TLS and QUIC peers consume a certificate-chain
 1958|       |  // selector. Remove it before protocol-specific early returns so other fixed
 1959|       |  // targets do not spend mutations on inert TLS server state.
 1960|  19.9k|  if (profile != TargetProfile::kFastHttps && profile != TargetProfile::kHttpsH2 &&
  ------------------
  |  Branch (1960:7): [True: 19.9k, False: 0]
  |  Branch (1960:47): [True: 19.9k, False: 0]
  ------------------
 1961|  19.9k|      profile != TargetProfile::kFastHttp3 && profile != TargetProfile::kFastSecureWebSocket) {
  ------------------
  |  Branch (1961:7): [True: 0, False: 19.9k]
  |  Branch (1961:47): [True: 0, False: 0]
  ------------------
 1962|      0|    scenario->clear_tls_certificate_chain();
 1963|      0|  }
 1964|       |
 1965|       |  // Only the dedicated TLS HTTP/2 origin consumes the group selector. The
 1966|       |  // compatibility profile returned above so unknown fields remain stable.
 1967|  19.9k|  if (profile != TargetProfile::kHttpsH2) {
  ------------------
  |  Branch (1967:7): [True: 19.9k, False: 0]
  ------------------
 1968|  19.9k|    scenario->clear_tls_group_profile();
 1969|  19.9k|  }
 1970|       |
 1971|       |  // Field 13 is append-only so the compatibility target can round-trip it,
 1972|       |  // but every other fixed lane must discard work its peer cannot consume.
 1973|  19.9k|  if (profile != TargetProfile::kFastHttp3) {
  ------------------
  |  Branch (1973:7): [True: 0, False: 19.9k]
  ------------------
 1974|      0|    scenario->clear_http3_plan();
 1975|      0|  }
 1976|       |
 1977|  19.9k|  const bool resolver_uses_doh = profile == TargetProfile::kResolver && scenario->has_doh();
  ------------------
  |  Branch (1977:34): [True: 0, False: 19.9k]
  |  Branch (1977:73): [True: 0, False: 0]
  ------------------
 1978|  19.9k|  if (profile != TargetProfile::kHttpsH2 && profile != TargetProfile::kFastHttp2 && !resolver_uses_doh) {
  ------------------
  |  Branch (1978:7): [True: 19.9k, False: 0]
  |  Branch (1978:45): [True: 19.9k, False: 0]
  |  Branch (1978:85): [True: 19.9k, False: 0]
  ------------------
 1979|  19.9k|    scenario->clear_http2_plan();
 1980|  19.9k|  }
 1981|       |
 1982|  19.9k|  const bool deep_http_haproxy = profile == TargetProfile::kDeepHttp &&
  ------------------
  |  Branch (1982:34): [True: 0, False: 19.9k]
  ------------------
 1983|      0|                                 scenario->http_transport_mode() == curl::fuzzer::proto::HTTP_TRANSPORT_CONNECT_PROXY;
  ------------------
  |  Branch (1983:34): [True: 0, False: 0]
  ------------------
 1984|  19.9k|  if (profile != TargetProfile::kProxyTransport) {
  ------------------
  |  Branch (1984:7): [True: 19.9k, False: 0]
  ------------------
 1985|  19.9k|    scenario->clear_socks_proxy_mode();
 1986|  19.9k|    if (!deep_http_haproxy) {
  ------------------
  |  Branch (1986:9): [True: 19.9k, False: 0]
  ------------------
 1987|  19.9k|      scenario->clear_haproxy_protocol();
 1988|  19.9k|    }
 1989|  19.9k|  }
 1990|       |
 1991|       |  // StartTLS is a correlated LDAP transport mode rather than a transferable
 1992|       |  // scalar option. Other fixed lanes discard it before their early returns.
 1993|  19.9k|  if (profile != TargetProfile::kFastLdap) {
  ------------------
  |  Branch (1993:7): [True: 19.9k, False: 0]
  ------------------
 1994|  19.9k|    scenario->clear_ldap_starttls();
 1995|  19.9k|  }
 1996|       |
 1997|  19.9k|  if (profile != TargetProfile::kFastPop3) {
  ------------------
  |  Branch (1997:7): [True: 19.9k, False: 0]
  ------------------
 1998|  19.9k|    scenario->clear_pop3_starttls_filter_allocation_failure();
 1999|  19.9k|  }
 2000|       |
 2001|  19.9k|  if (profile != TargetProfile::kFastFtp) {
  ------------------
  |  Branch (2001:7): [True: 19.9k, False: 0]
  ------------------
 2002|  19.9k|    scenario->clear_ftp_auth_tls_filter_allocation_failure();
 2003|  19.9k|    scenario->clear_ftp_quote();
 2004|  19.9k|    scenario->clear_ftp_prequote();
 2005|  19.9k|    scenario->clear_ftp_postquote();
 2006|  19.9k|  }
 2007|       |
 2008|  19.9k|  if (profile != TargetProfile::kFastGopher) {
  ------------------
  |  Branch (2008:7): [True: 19.9k, False: 0]
  ------------------
 2009|  19.9k|    scenario->clear_gopher_probe_mode();
 2010|  19.9k|  }
 2011|       |
 2012|  19.9k|  if (profile != TargetProfile::kFastRtsp) {
  ------------------
  |  Branch (2012:7): [True: 19.9k, False: 0]
  ------------------
 2013|  19.9k|    scenario->clear_rtsp_probe_mode();
 2014|  19.9k|  }
 2015|       |
 2016|  19.9k|  if (profile != TargetProfile::kFastMqtt) {
  ------------------
  |  Branch (2016:7): [True: 19.9k, False: 0]
  ------------------
 2017|  19.9k|    scenario->clear_mqtt_probe_mode();
 2018|  19.9k|  }
 2019|       |
 2020|  19.9k|  if (profile != TargetProfile::kFastSmtp) {
  ------------------
  |  Branch (2020:7): [True: 19.9k, False: 0]
  ------------------
 2021|  19.9k|    scenario->clear_smtp_probe_mode();
 2022|  19.9k|  }
 2023|       |
 2024|  19.9k|  if (profile != TargetProfile::kFastHttp2) {
  ------------------
  |  Branch (2024:7): [True: 19.9k, False: 0]
  ------------------
 2025|  19.9k|    scenario->clear_http2_connect_flush_probe();
 2026|  19.9k|  }
 2027|       |
 2028|  19.9k|  if (profile != TargetProfile::kDeepHttp) {
  ------------------
  |  Branch (2028:7): [True: 19.9k, False: 0]
  ------------------
 2029|  19.9k|    scenario->clear_http_transport_mode();
 2030|  19.9k|    scenario->clear_proxy_socket_option_mode();
 2031|  19.9k|  }
 2032|       |
 2033|  19.9k|  if (profile != TargetProfile::kResolver) {
  ------------------
  |  Branch (2033:7): [True: 19.9k, False: 0]
  ------------------
 2034|  19.9k|    scenario->clear_resolve_entries();
 2035|  19.9k|    scenario->clear_happy_eyeballs();
 2036|  19.9k|    scenario->clear_doh();
 2037|  19.9k|    scenario->clear_resolver_mode();
 2038|  19.9k|  }
 2039|       |
 2040|       |  // SMTP's schema-native recipient list has no meaning in another protocol's
 2041|       |  // exchange. Clearing it before early returns keeps other fixed lanes from
 2042|       |  // carrying inert envelope work.
 2043|  19.9k|  if (profile != TargetProfile::kFastSmtp) {
  ------------------
  |  Branch (2043:7): [True: 19.9k, False: 0]
  ------------------
 2044|  19.9k|    scenario->clear_mail_rcpt();
 2045|  19.9k|  }
 2046|       |
 2047|       |  // Only these protocol peers currently interleave zero-timeout public multi
 2048|       |  // polling with immediate service of their live connection.
 2049|       |  // Keep the opt-in out of fixed lanes whose driver cannot honor that timing
 2050|       |  // contract; compatibility returned above and preserves its wire input.
 2051|  19.9k|  if (profile != TargetProfile::kFastSmtp && profile != TargetProfile::kFastImap &&
  ------------------
  |  Branch (2051:7): [True: 19.9k, False: 0]
  |  Branch (2051:46): [True: 19.9k, False: 0]
  ------------------
 2052|  19.9k|      profile != TargetProfile::kFastPop3 && profile != TargetProfile::kFastFtp &&
  ------------------
  |  Branch (2052:7): [True: 19.9k, False: 0]
  |  Branch (2052:46): [True: 19.9k, False: 0]
  ------------------
 2053|  19.9k|      profile != TargetProfile::kFastMqtt && profile != TargetProfile::kProxyTransport &&
  ------------------
  |  Branch (2053:7): [True: 19.9k, False: 0]
  |  Branch (2053:46): [True: 19.9k, False: 0]
  ------------------
 2054|  19.9k|      profile != TargetProfile::kDeepHttp) {
  ------------------
  |  Branch (2054:7): [True: 19.9k, False: 0]
  ------------------
 2055|  19.9k|    scenario->clear_probe_multi_pollset();
 2056|  19.9k|  }
 2057|       |
 2058|       |  // Direct forwarding changes the H2 proxy stream from CONNECT authority-form
 2059|       |  // to an absolute-form origin request. No other peer implements that shape.
 2060|  19.9k|  if (profile != TargetProfile::kH2Proxy) {
  ------------------
  |  Branch (2060:7): [True: 19.9k, False: 0]
  ------------------
 2061|  19.9k|    scenario->clear_h2_forward_proxy();
 2062|  19.9k|  }
 2063|       |
 2064|       |  // Anonymous parser files add syscalls and line parsing that belong only in
 2065|       |  // the deep HTTP lane. Clear them before every protocol-specific early path
 2066|       |  // so fast targets never pay to normalize content they cannot consume.
 2067|  19.9k|  if (profile != TargetProfile::kDeepHttp) {
  ------------------
  |  Branch (2067:7): [True: 19.9k, False: 0]
  ------------------
 2068|  19.9k|    scenario->clear_cookie_file();
 2069|  19.9k|    scenario->clear_altsvc_file();
 2070|  19.9k|    scenario->clear_hsts_file();
 2071|  19.9k|    scenario->clear_netrc_file();
 2072|  19.9k|  }
 2073|       |
 2074|       |  // CRLs and public-key pin files are useful only when the target completes a
 2075|       |  // real origin TLS setup. Keep malformed or oversized inputs from turning
 2076|       |  // every other lane into an early TLS-option failure.
 2077|  19.9k|  if (profile != TargetProfile::kFastHttps) {
  ------------------
  |  Branch (2077:7): [True: 19.9k, False: 0]
  ------------------
 2078|  19.9k|    scenario->clear_crl_file();
 2079|  19.9k|    scenario->clear_pinned_public_key_file();
 2080|  19.9k|    scenario->clear_tls_client_credential_profile();
 2081|  19.9k|    scenario->clear_tls_handshake_profile();
 2082|  19.9k|    scenario->clear_tls_ocsp_staple_profile();
 2083|  19.9k|    scenario->clear_tls_session_cache_profile();
 2084|  19.9k|  }
 2085|       |
 2086|  19.9k|  if (profile == TargetProfile::kFastHttp3) {
  ------------------
  |  Branch (2086:7): [True: 19.9k, False: 0]
  ------------------
 2087|  19.9k|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTPS);
 2088|  19.9k|    RemoveIgnoredHttp3Shape(scenario);
 2089|  19.9k|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2090|  66.7k|    for (auto& option : *scenario->mutable_options()) {
  ------------------
  |  Branch (2090:23): [True: 66.7k, False: 19.9k]
  ------------------
 2091|  66.7k|      if (option.option_id() == curl::fuzzer::proto::CURLOPT_MAX_RECV_SPEED_LARGE) {
  ------------------
  |  Branch (2091:11): [True: 524, False: 66.2k]
  ------------------
 2092|       |        // A nonzero rate makes curl limit the receive credit it grants the
 2093|       |        // peer. Keep the rate high enough for this lane's short drive budget
 2094|       |        // and safely within curl_off_t's range. Zero disables the limiter.
 2095|    524|        const std::uint64_t rate = DecodeIntegralOptionValue(option);
 2096|    524|        if (rate != 0) {
  ------------------
  |  Branch (2096:13): [True: 410, False: 114]
  ------------------
 2097|    410|          option.set_uint_value(std::min<std::uint64_t>(std::max<std::uint64_t>(rate, 65536U), 1048576U));
 2098|    410|        }
 2099|    524|      }
 2100|  66.7k|    }
 2101|       |    // The ordinary QUIC peer consumes Http3Plan and has no use for a stream
 2102|       |    // response. CONNECT-UDP proxy mode instead feeds the retained Connection
 2103|       |    // bytes to curl's HTTP/1.1 proxy state machine and capsule filter.
 2104|  19.9k|    if (!scenario->http3_plan().use_h1_connect_udp_proxy()) {
  ------------------
  |  Branch (2104:9): [True: 4.57k, False: 15.3k]
  ------------------
 2105|  4.57k|      scenario->clear_connection();
 2106|  4.57k|    }
 2107|  19.9k|    BoundHttp3PlanShape(scenario->mutable_http3_plan());
 2108|       |    // The probe waits for a complete callback-backed PUT. Read the options in
 2109|       |    // the same order as libcurl receives them because later options can change
 2110|       |    // the request method or upload length.
 2111|  19.9k|    bool sends_upload = false;
 2112|       |    // An absent length and curl's -1 both mean the upload ends at callback EOF.
 2113|  19.9k|    std::uint64_t upload_size = std::numeric_limits<std::uint64_t>::max();
 2114|  66.7k|    for (const auto& option : scenario->options()) {
  ------------------
  |  Branch (2114:29): [True: 66.7k, False: 19.9k]
  ------------------
 2115|  66.7k|      if (option.option_id() == curl::fuzzer::proto::CURLOPT_UPLOAD) {
  ------------------
  |  Branch (2115:11): [True: 910, False: 65.8k]
  ------------------
 2116|       |        // UPLOAD selects PUT when true and GET when false.
 2117|    910|        sends_upload = DecodeIntegralOptionValue(option) != 0;
 2118|  65.8k|      } else if ((option.option_id() == curl::fuzzer::proto::CURLOPT_HTTPGET ||
  ------------------
  |  Branch (2118:19): [True: 1.08k, False: 64.7k]
  ------------------
 2119|  64.7k|                  option.option_id() == curl::fuzzer::proto::CURLOPT_NOBODY) &&
  ------------------
  |  Branch (2119:19): [True: 914, False: 63.8k]
  ------------------
 2120|  1.99k|                 DecodeIntegralOptionValue(option) != 0) {
  ------------------
  |  Branch (2120:18): [True: 1.47k, False: 522]
  ------------------
 2121|       |        // These flags displace an active PUT only when enabled.
 2122|  1.47k|        sends_upload = false;
 2123|  64.3k|      } else if (option.option_id() == curl::fuzzer::proto::CURLOPT_POST ||
  ------------------
  |  Branch (2123:18): [True: 538, False: 63.8k]
  ------------------
 2124|  63.8k|                 option.option_id() == curl::fuzzer::proto::CURLOPT_POSTFIELDS ||
  ------------------
  |  Branch (2124:18): [True: 1.73k, False: 62.1k]
  ------------------
 2125|  62.1k|                 option.option_id() == curl::fuzzer::proto::CURLOPT_COPYPOSTFIELDS) {
  ------------------
  |  Branch (2125:18): [True: 0, False: 62.1k]
  ------------------
 2126|       |        // POSTFIELDS and COPYPOSTFIELDS select POST. POST selects POST or GET,
 2127|       |        // so even a false POST flag displaces an earlier PUT.
 2128|  2.27k|        sends_upload = false;
 2129|  62.1k|      } else if (option.option_id() == curl::fuzzer::proto::CURLOPT_INFILESIZE_LARGE) {
  ------------------
  |  Branch (2129:18): [True: 1.08k, False: 61.0k]
  ------------------
 2130|  1.08k|        upload_size = DecodeIntegralOptionValue(option);
 2131|  1.08k|      }
 2132|  66.7k|    }
 2133|       |    // MIME supplies a separate body. For a scripted PUT, both the available
 2134|       |    // data and any declared length must exceed the initial credit. The script
 2135|       |    // must provide enough bytes for the declared length and finish normally.
 2136|  19.9k|    if (!sends_upload || scenario->has_mime_post() || !scenario->has_upload() ||
  ------------------
  |  Branch (2136:9): [True: 19.5k, False: 418]
  |  Branch (2136:26): [True: 8, False: 410]
  |  Branch (2136:55): [True: 68, False: 342]
  ------------------
 2137|    342|        scenario->upload().data().size() <= scenario_limits::kHttp3SmallUploadWindowBytes ||
  ------------------
  |  Branch (2137:9): [True: 10, False: 332]
  ------------------
 2138|    332|        upload_size <= scenario_limits::kHttp3SmallUploadWindowBytes ||
  ------------------
  |  Branch (2138:9): [True: 6, False: 326]
  ------------------
 2139|    326|        (upload_size != std::numeric_limits<std::uint64_t>::max() && upload_size > scenario->upload().data().size()) ||
  ------------------
  |  Branch (2139:10): [True: 322, False: 4]
  |  Branch (2139:70): [True: 320, False: 2]
  ------------------
 2140|  19.9k|        scenario->upload().terminal() != curl::fuzzer::proto::UPLOAD_TERMINAL_EOF) {
  ------------------
  |  Branch (2140:9): [True: 2, False: 4]
  ------------------
 2141|  19.9k|      scenario->mutable_http3_plan()->clear_small_upload_window();
 2142|  19.9k|    }
 2143|  19.9k|    CanonicalizeHttp3Authority(scenario);
 2144|  19.9k|    CanonicalizeTlsCertificateChain(scenario);
 2145|  19.9k|    return;
 2146|  19.9k|  }
 2147|       |
 2148|      0|  if (profile == TargetProfile::kFastTelnet) {
  ------------------
  |  Branch (2148:7): [True: 0, False: 0]
  ------------------
 2149|       |    // Set the scheme before general bounds so the TELNET-specific upload and
 2150|       |    // PAUSE budgets are selected rather than event-driven compatibility ones.
 2151|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_TELNET);
 2152|      0|    RemoveApiOnlyShape(scenario);
 2153|      0|    RemoveMultiOnlyShape(scenario);
 2154|      0|    RemoveNonTelnetShape(scenario);
 2155|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2156|      0|    BoundTelnetResponse(scenario->mutable_connection());
 2157|      0|    return;
 2158|      0|  }
 2159|       |
 2160|      0|  if (profile == TargetProfile::kFastHttp) {
  ------------------
  |  Branch (2160:7): [True: 0, False: 0]
  ------------------
 2161|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 2162|      0|    RemoveApiOnlyShape(scenario);
 2163|      0|    RemoveMultiOnlyShape(scenario);
 2164|      0|    RemoveTelnetOnlyShape(scenario);
 2165|      0|    RemoveDeepHttpShape(scenario);
 2166|      0|    CanonicalizeFastHttpVersion(scenario);
 2167|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2168|      0|    return;
 2169|      0|  }
 2170|       |
 2171|      0|  if (profile == TargetProfile::kH2Proxy) {
  ------------------
  |  Branch (2171:7): [True: 0, False: 0]
  ------------------
 2172|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 2173|      0|    RemoveApiOnlyShape(scenario);
 2174|      0|    RemoveMultiOnlyShape(scenario);
 2175|      0|    RemoveTelnetOnlyShape(scenario);
 2176|      0|    RemoveIgnoredH2ProxyShape(scenario);
 2177|      0|    switch (scenario->connection().proxy_protocol()) {
 2178|      0|      case curl::fuzzer::proto::PROXY_PROTOCOL_HTTP2:
  ------------------
  |  Branch (2178:7): [True: 0, False: 0]
  ------------------
 2179|      0|      case curl::fuzzer::proto::PROXY_PROTOCOL_HTTP1:
  ------------------
  |  Branch (2179:7): [True: 0, False: 0]
  ------------------
 2180|      0|        break;
 2181|      0|      default:
  ------------------
  |  Branch (2181:7): [True: 0, False: 0]
  ------------------
 2182|      0|        scenario->mutable_connection()->set_proxy_protocol(curl::fuzzer::proto::PROXY_PROTOCOL_HTTP2);
 2183|      0|        break;
 2184|      0|    }
 2185|      0|    if (scenario->connection().proxy_protocol() == curl::fuzzer::proto::PROXY_PROTOCOL_HTTP1) {
  ------------------
  |  Branch (2185:9): [True: 0, False: 0]
  ------------------
 2186|      0|      scenario->clear_h2_forward_proxy();
 2187|      0|    }
 2188|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2189|      0|    CanonicalizeH2ProxyOriginAuthority(scenario);
 2190|      0|    return;
 2191|      0|  }
 2192|       |
 2193|      0|  if (profile == TargetProfile::kHttpsH2 || profile == TargetProfile::kFastHttp2) {
  ------------------
  |  Branch (2193:7): [True: 0, False: 0]
  |  Branch (2193:45): [True: 0, False: 0]
  ------------------
 2194|      0|    scenario->set_scheme(profile == TargetProfile::kHttpsH2 ? curl::fuzzer::proto::SCHEME_HTTPS
  ------------------
  |  Branch (2194:26): [True: 0, False: 0]
  ------------------
 2195|      0|                                                            : curl::fuzzer::proto::SCHEME_HTTP);
 2196|      0|    RemoveApiOnlyShape(scenario);
 2197|      0|    RemoveMultiOnlyShape(scenario);
 2198|      0|    RemoveTelnetOnlyShape(scenario);
 2199|      0|    RemoveIgnoredH2ProxyShape(scenario);
 2200|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2201|      0|    if (scenario->http2_connect_flush_probe()) {
  ------------------
  |  Branch (2201:9): [True: 0, False: 0]
  ------------------
 2202|       |      // CONNECT_ONLY supplies no HTTP response plan. Clear competing peer
 2203|       |      // bytes so mutations stay focused on the connection-filter lifecycle.
 2204|      0|      scenario->clear_http2_plan();
 2205|      0|      scenario->clear_connection();
 2206|      0|      scenario->clear_subsequent_connections();
 2207|      0|    }
 2208|      0|    if (scenario->has_http2_plan()) {
  ------------------
  |  Branch (2208:9): [True: 0, False: 0]
  ------------------
 2209|      0|      auto* connection = scenario->mutable_connection();
 2210|      0|      connection->clear_initial_response();
 2211|      0|      connection->clear_on_readable();
 2212|      0|      connection->clear_server_frames();
 2213|      0|      BoundHttp2PlanShape(scenario->mutable_http2_plan());
 2214|      0|    }
 2215|      0|    CanonicalizeTlsAuthority(scenario);
 2216|      0|    if (profile == TargetProfile::kHttpsH2) {
  ------------------
  |  Branch (2216:9): [True: 0, False: 0]
  ------------------
 2217|      0|      CanonicalizeTlsCertificateChain(scenario);
 2218|      0|      CanonicalizeTlsGroupProfile(scenario);
 2219|      0|    }
 2220|      0|    return;
 2221|      0|  }
 2222|       |
 2223|      0|  if (profile == TargetProfile::kProxyTransport) {
  ------------------
  |  Branch (2223:7): [True: 0, False: 0]
  ------------------
 2224|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 2225|      0|    switch (scenario->socks_proxy_mode()) {
 2226|      0|      case curl::fuzzer::proto::SOCKS_PROXY_SOCKS4:
  ------------------
  |  Branch (2226:7): [True: 0, False: 0]
  ------------------
 2227|      0|      case curl::fuzzer::proto::SOCKS_PROXY_SOCKS4A:
  ------------------
  |  Branch (2227:7): [True: 0, False: 0]
  ------------------
 2228|      0|      case curl::fuzzer::proto::SOCKS_PROXY_SOCKS5:
  ------------------
  |  Branch (2228:7): [True: 0, False: 0]
  ------------------
 2229|      0|      case curl::fuzzer::proto::SOCKS_PROXY_SOCKS5_HOSTNAME:
  ------------------
  |  Branch (2229:7): [True: 0, False: 0]
  ------------------
 2230|      0|        break;
 2231|      0|      default:
  ------------------
  |  Branch (2231:7): [True: 0, False: 0]
  ------------------
 2232|      0|        scenario->set_socks_proxy_mode(curl::fuzzer::proto::SOCKS_PROXY_SOCKS4);
 2233|      0|        break;
 2234|      0|    }
 2235|      0|    RemoveApiOnlyShape(scenario);
 2236|      0|    RemoveMultiOnlyShape(scenario);
 2237|      0|    RemoveTelnetOnlyShape(scenario);
 2238|      0|    RemoveDeepHttpShape(scenario);
 2239|      0|    scenario->mutable_connection()->clear_initial_response();
 2240|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2241|      0|    CanonicalizeSocksAuthority(scenario);
 2242|      0|    return;
 2243|      0|  }
 2244|       |
 2245|      0|  if (profile == TargetProfile::kResolver) {
  ------------------
  |  Branch (2245:7): [True: 0, False: 0]
  ------------------
 2246|       |    // The DoH variant owns the outer HTTPS exchange through a verified
 2247|       |    // TLS/ALPN h2 peer, so its response is an Http2Plan rather than a raw
 2248|       |    // stream script. The ordinary resolver lanes keep plaintext HTTP.
 2249|      0|    switch (scenario->resolver_mode()) {
 2250|      0|      case curl::fuzzer::proto::RESOLVER_MODE_DEFAULT:
  ------------------
  |  Branch (2250:7): [True: 0, False: 0]
  ------------------
 2251|      0|      case curl::fuzzer::proto::RESOLVER_MODE_THREADED_POSITIVE:
  ------------------
  |  Branch (2251:7): [True: 0, False: 0]
  ------------------
 2252|      0|      case curl::fuzzer::proto::RESOLVER_MODE_THREADED_NEGATIVE:
  ------------------
  |  Branch (2252:7): [True: 0, False: 0]
  ------------------
 2253|      0|      case curl::fuzzer::proto::RESOLVER_MODE_THREADED_LINK_LOCAL:
  ------------------
  |  Branch (2253:7): [True: 0, False: 0]
  ------------------
 2254|      0|      case curl::fuzzer::proto::RESOLVER_MODE_UNIX_SOCKET:
  ------------------
  |  Branch (2254:7): [True: 0, False: 0]
  ------------------
 2255|      0|      case curl::fuzzer::proto::RESOLVER_MODE_THREADED_PARTIAL:
  ------------------
  |  Branch (2255:7): [True: 0, False: 0]
  ------------------
 2256|      0|      case curl::fuzzer::proto::RESOLVER_MODE_GLOBAL_LIFECYCLE:
  ------------------
  |  Branch (2256:7): [True: 0, False: 0]
  ------------------
 2257|      0|      case curl::fuzzer::proto::RESOLVER_MODE_THREADED_QUEUED_CANCEL:
  ------------------
  |  Branch (2257:7): [True: 0, False: 0]
  ------------------
 2258|      0|        break;
 2259|      0|      default:
  ------------------
  |  Branch (2259:7): [True: 0, False: 0]
  ------------------
 2260|      0|        scenario->clear_resolver_mode();
 2261|      0|        break;
 2262|      0|    }
 2263|      0|    if (scenario->has_doh()) {
  ------------------
  |  Branch (2263:9): [True: 0, False: 0]
  ------------------
 2264|      0|      if (!curl::fuzzer::proto::DohResponseMode_IsValid(scenario->doh().response_mode())) {
  ------------------
  |  Branch (2264:11): [True: 0, False: 0]
  ------------------
 2265|      0|        scenario->mutable_doh()->set_response_mode(curl::fuzzer::proto::DOH_RESPONSE_MODE_NORMAL);
 2266|      0|      }
 2267|      0|      if (!curl::fuzzer::proto::DohTransportMode_IsValid(scenario->doh().transport_mode())) {
  ------------------
  |  Branch (2267:11): [True: 0, False: 0]
  ------------------
 2268|      0|        scenario->mutable_doh()->set_transport_mode(curl::fuzzer::proto::DOH_TRANSPORT_HTTP);
 2269|      0|      }
 2270|      0|      if (!curl::fuzzer::proto::DohOptionProbeMode_IsValid(scenario->doh().option_probe_mode())) {
  ------------------
  |  Branch (2270:11): [True: 0, False: 0]
  ------------------
 2271|      0|        scenario->mutable_doh()->set_option_probe_mode(curl::fuzzer::proto::DOH_OPTION_PROBE_DEFAULT);
 2272|      0|      }
 2273|      0|      if (scenario->doh().option_probe_mode() != curl::fuzzer::proto::DOH_OPTION_PROBE_DEFAULT) {
  ------------------
  |  Branch (2273:11): [True: 0, False: 0]
  ------------------
 2274|      0|        scenario->mutable_doh()->set_transport_mode(curl::fuzzer::proto::DOH_TRANSPORT_HTTPS);
 2275|      0|      }
 2276|      0|    }
 2277|      0|    const bool fixed_resolver_mode = scenario->resolver_mode() != curl::fuzzer::proto::RESOLVER_MODE_DEFAULT;
 2278|      0|    if (fixed_resolver_mode) {
  ------------------
  |  Branch (2278:9): [True: 0, False: 0]
  ------------------
 2279|      0|      scenario->clear_resolve_entries();
 2280|      0|      scenario->clear_happy_eyeballs();
 2281|      0|      scenario->clear_doh();
 2282|      0|    }
 2283|      0|    const bool uses_doh = scenario->has_doh();
 2284|      0|    scenario->set_scheme(uses_doh ? curl::fuzzer::proto::SCHEME_HTTPS : curl::fuzzer::proto::SCHEME_HTTP);
  ------------------
  |  Branch (2284:26): [True: 0, False: 0]
  ------------------
 2285|      0|    RemoveApiOnlyShape(scenario);
 2286|      0|    RemoveMultiOnlyShape(scenario);
 2287|      0|    RemoveTelnetOnlyShape(scenario);
 2288|      0|    RemoveDeepHttpShape(scenario);
 2289|       |    // The generic fast-lane pruning above removes fuzz-controlled timing
 2290|       |    // knobs. Threaded resolver modes add back one fixed marker so their
 2291|       |    // bounded drive performs a pollset probe and short fdset waits while the
 2292|       |    // target-local resolver work is outstanding.
 2293|      0|    if (IsThreadedResolverMode(scenario->resolver_mode())) {
  ------------------
  |  Branch (2293:9): [True: 0, False: 0]
  ------------------
 2294|      0|      scenario->mutable_connection()->mutable_backpressure()->set_drain_limit(1);
 2295|      0|    }
 2296|      0|    if (scenario->resolver_mode() == curl::fuzzer::proto::RESOLVER_MODE_THREADED_QUEUED_CANCEL) {
  ------------------
  |  Branch (2296:9): [True: 0, False: 0]
  ------------------
 2297|       |      // The runner observes the pool's public THREADS trace after releasing
 2298|       |      // its lookup gate. Seeing an idle worker proves it entered the configured
 2299|       |      // timed condition wait; mutated trace controls must not remove that
 2300|       |      // lifecycle contract.
 2301|      0|      scenario->set_trace_config("+THREADS");
 2302|      0|    }
 2303|      0|    if (uses_doh) {
  ------------------
  |  Branch (2303:9): [True: 0, False: 0]
  ------------------
 2304|       |      // CURLOPT_RESOLVE cannot carry an HTTPS record, and the responder owns
 2305|       |      // both the address and HTTPS answers. Clearing the address entries keeps
 2306|       |      // the DoH query on the only path that can reach the ALPN selector.
 2307|      0|      scenario->clear_resolve_entries();
 2308|      0|      scenario->clear_happy_eyeballs();
 2309|      0|      if (scenario->has_http2_plan()) {
  ------------------
  |  Branch (2309:11): [True: 0, False: 0]
  ------------------
 2310|      0|        auto* connection = scenario->mutable_connection();
 2311|      0|        connection->clear_initial_response();
 2312|      0|        connection->clear_on_readable();
 2313|      0|        connection->clear_server_frames();
 2314|      0|        BoundHttp2PlanShape(scenario->mutable_http2_plan());
 2315|      0|      }
 2316|      0|    } else {
 2317|      0|      scenario->clear_http2_plan();
 2318|      0|      BoundStringValues(scenario->mutable_resolve_entries(), scenario_limits::kMaxResolveEntries,
 2319|      0|                        scenario_limits::kMaxResolveEntryBytes);
 2320|      0|    }
 2321|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2322|      0|    CanonicalizeResolverAuthority(scenario);
 2323|      0|    return;
 2324|      0|  }
 2325|       |
 2326|      0|  if (profile == TargetProfile::kFastFtp) {
  ------------------
  |  Branch (2326:7): [True: 0, False: 0]
  ------------------
 2327|       |    // The same lane services plaintext FTP and implicit-TLS FTPS through one
 2328|       |    // command/data parser. Preserve an explicitly supplied FTPS scheme so the
 2329|       |    // seed and mutations can select the TLS peer; every other scheme falls
 2330|       |    // back to the historical plaintext lane.
 2331|      0|    const auto scheme = scenario->scheme();
 2332|      0|    const bool implicit_tls = scheme == curl::fuzzer::proto::SCHEME_FTPS;
 2333|      0|    scenario->set_scheme(implicit_tls ? curl::fuzzer::proto::SCHEME_FTPS : curl::fuzzer::proto::SCHEME_FTP);
  ------------------
  |  Branch (2333:26): [True: 0, False: 0]
  ------------------
 2334|      0|    if (implicit_tls) {
  ------------------
  |  Branch (2334:9): [True: 0, False: 0]
  ------------------
 2335|      0|      scenario->clear_ftp_auth_tls_filter_allocation_failure();
 2336|      0|    }
 2337|      0|    if (scenario->ftp_auth_tls_filter_allocation_failure()) {
  ------------------
  |  Branch (2337:9): [True: 0, False: 0]
  ------------------
 2338|      0|      scenario->clear_fail_allocations();
 2339|      0|    }
 2340|      0|    RemoveIgnoredFtpShape(scenario);
 2341|      0|    CanonicalizeFtpOptionModes(scenario);
 2342|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2343|      0|    CanonicalizeFtpAuthority(scenario);
 2344|      0|    return;
 2345|      0|  }
 2346|       |
 2347|      0|  if (profile == TargetProfile::kFastTftp) {
  ------------------
  |  Branch (2347:7): [True: 0, False: 0]
  ------------------
 2348|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_TFTP);
 2349|      0|    RemoveIgnoredTftpShape(scenario);
 2350|      0|    CanonicalizeTftpOptionModes(scenario);
 2351|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2352|      0|    CanonicalizeTftpAuthority(scenario);
 2353|      0|    return;
 2354|      0|  }
 2355|       |
 2356|      0|  if (profile == TargetProfile::kFastSmtp) {
  ------------------
  |  Branch (2356:7): [True: 0, False: 0]
  ------------------
 2357|       |    // One command/reply parser services plaintext SMTP and implicit-TLS SMTPS.
 2358|       |    // Preserve an explicitly supplied SMTPS scheme so the seed and mutations
 2359|       |    // can select the TLS peer; every other scheme falls back to the historical
 2360|       |    // plaintext lane.
 2361|      0|    const auto scheme = scenario->scheme();
 2362|      0|    scenario->set_scheme(scheme == curl::fuzzer::proto::SCHEME_SMTPS ? curl::fuzzer::proto::SCHEME_SMTPS
  ------------------
  |  Branch (2362:26): [True: 0, False: 0]
  ------------------
 2363|      0|                                                                     : curl::fuzzer::proto::SCHEME_SMTP);
 2364|      0|    CanonicalizeSmtpProbeMode(scenario);
 2365|      0|    if (scenario->scheme() == curl::fuzzer::proto::SCHEME_SMTPS) {
  ------------------
  |  Branch (2365:9): [True: 0, False: 0]
  ------------------
 2366|      0|      scenario->clear_smtp_probe_mode();
 2367|      0|    }
 2368|      0|    if (scenario->smtp_probe_mode() == curl::fuzzer::proto::SMTP_PROBE_STARTTLS_FILTER_ALLOCATION_FAILURE) {
  ------------------
  |  Branch (2368:9): [True: 0, False: 0]
  ------------------
 2369|      0|      scenario->clear_fail_allocations();
 2370|      0|    }
 2371|      0|    if (scenario->smtp_probe_mode() == curl::fuzzer::proto::SMTP_PROBE_SEND_BACKPRESSURE) {
  ------------------
  |  Branch (2371:9): [True: 0, False: 0]
  ------------------
 2372|      0|      scenario->clear_mail_rcpt();
 2373|      0|      scenario->clear_upload();
 2374|      0|      scenario->clear_mime_post();
 2375|      0|    }
 2376|      0|    RemoveIgnoredSmtpShape(scenario);
 2377|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2378|      0|    if (scenario->smtp_probe_mode() == curl::fuzzer::proto::SMTP_PROBE_SEND_BACKPRESSURE) {
  ------------------
  |  Branch (2378:9): [True: 0, False: 0]
  ------------------
 2379|      0|      scenario->set_probe_multi_pollset(true);
 2380|      0|      auto* backpressure = scenario->mutable_connection()->mutable_backpressure();
 2381|      0|      backpressure->set_recv_buf_bytes(kSmtpProbeBufferBytes);
 2382|      0|      backpressure->set_drain_limit(kSmtpProbeDrainBytes);
 2383|      0|    }
 2384|      0|    CanonicalizeSmtpAuthority(scenario);
 2385|      0|    return;
 2386|      0|  }
 2387|       |
 2388|      0|  if (profile == TargetProfile::kFastImap) {
  ------------------
  |  Branch (2388:7): [True: 0, False: 0]
  ------------------
 2389|       |    // Preserve an explicitly supplied IMAPS scheme so seeds and mutations can
 2390|       |    // select the implicit-TLS peer; every other scheme falls back to the
 2391|       |    // historical plaintext lane. Both values reuse this tag-aware parser.
 2392|      0|    const auto scheme = scenario->scheme();
 2393|      0|    scenario->set_scheme(scheme == curl::fuzzer::proto::SCHEME_IMAPS ? curl::fuzzer::proto::SCHEME_IMAPS
  ------------------
  |  Branch (2393:26): [True: 0, False: 0]
  ------------------
 2394|      0|                                                                     : curl::fuzzer::proto::SCHEME_IMAP);
 2395|      0|    RemoveIgnoredImapShape(scenario);
 2396|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2397|      0|    CanonicalizeMailBackpressure(scenario->mutable_connection());
 2398|      0|    CanonicalizeImapAuthority(scenario);
 2399|      0|    return;
 2400|      0|  }
 2401|       |
 2402|      0|  if (profile == TargetProfile::kFastPop3) {
  ------------------
  |  Branch (2402:7): [True: 0, False: 0]
  ------------------
 2403|       |    // Preserve an explicitly supplied POP3S scheme so seeds and mutations can
 2404|       |    // select the implicit-TLS peer; every other scheme falls back to the
 2405|       |    // historical plaintext lane. Both values reuse this status-line parser.
 2406|      0|    const auto scheme = scenario->scheme();
 2407|      0|    scenario->set_scheme(scheme == curl::fuzzer::proto::SCHEME_POP3S ? curl::fuzzer::proto::SCHEME_POP3S
  ------------------
  |  Branch (2407:26): [True: 0, False: 0]
  ------------------
 2408|      0|                                                                     : curl::fuzzer::proto::SCHEME_POP3);
 2409|      0|    if (scenario->scheme() == curl::fuzzer::proto::SCHEME_POP3S) {
  ------------------
  |  Branch (2409:9): [True: 0, False: 0]
  ------------------
 2410|      0|      scenario->clear_pop3_starttls_filter_allocation_failure();
 2411|      0|    }
 2412|      0|    if (scenario->pop3_starttls_filter_allocation_failure()) {
  ------------------
  |  Branch (2412:9): [True: 0, False: 0]
  ------------------
 2413|      0|      scenario->clear_fail_allocations();
 2414|      0|    }
 2415|      0|    RemoveIgnoredPop3Shape(scenario);
 2416|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2417|      0|    CanonicalizeMailBackpressure(scenario->mutable_connection());
 2418|      0|    CanonicalizePop3Authority(scenario);
 2419|      0|    return;
 2420|      0|  }
 2421|       |
 2422|      0|  if (profile == TargetProfile::kFastMqtt) {
  ------------------
  |  Branch (2422:7): [True: 0, False: 0]
  ------------------
 2423|       |    // The dedicated MQTT lane services both the plaintext and implicit-TLS
 2424|       |    // variants through one packet-aware parser. Preserve an explicitly
 2425|       |    // supplied MQTTS scheme so the seed and mutations can select the TLS peer;
 2426|       |    // every other scheme falls back to the historical plaintext lane.
 2427|      0|    CanonicalizeMqttProbeMode(scenario);
 2428|      0|    const auto probe = scenario->mqtt_probe_mode();
 2429|      0|    const auto scheme = scenario->scheme();
 2430|      0|    scenario->set_scheme(probe == curl::fuzzer::proto::MQTT_PROBE_DEFAULT && scheme == curl::fuzzer::proto::SCHEME_MQTTS
  ------------------
  |  Branch (2430:26): [True: 0, False: 0]
  |  Branch (2430:78): [True: 0, False: 0]
  ------------------
 2431|      0|                             ? curl::fuzzer::proto::SCHEME_MQTTS
 2432|      0|                             : curl::fuzzer::proto::SCHEME_MQTT);
 2433|      0|    RemoveIgnoredMqttShape(scenario);
 2434|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2435|      0|    if (probe == curl::fuzzer::proto::MQTT_PROBE_SEND_BACKPRESSURE) {
  ------------------
  |  Branch (2435:9): [True: 0, False: 0]
  ------------------
 2436|      0|      auto* backpressure = scenario->mutable_connection()->mutable_backpressure();
 2437|      0|      backpressure->set_recv_buf_bytes(kMqttProbeBufferBytes);
 2438|      0|      backpressure->set_drain_limit(kMqttProbeDrainBytes);
 2439|      0|      scenario->set_probe_multi_pollset(true);
 2440|      0|    }
 2441|      0|    CanonicalizeMqttAuthority(scenario);
 2442|      0|    return;
 2443|      0|  }
 2444|       |
 2445|      0|  if (profile == TargetProfile::kFastDict) {
  ------------------
  |  Branch (2445:7): [True: 0, False: 0]
  ------------------
 2446|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_DICT);
 2447|      0|    RemoveIgnoredDictShape(scenario);
 2448|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2449|      0|    CanonicalizeDictAuthority(scenario);
 2450|      0|    return;
 2451|      0|  }
 2452|       |
 2453|      0|  if (profile == TargetProfile::kFastGopher) {
  ------------------
  |  Branch (2453:7): [True: 0, False: 0]
  ------------------
 2454|      0|    CanonicalizeGopherProbeMode(scenario);
 2455|      0|    const auto probe = scenario->gopher_probe_mode();
 2456|      0|    if (probe == curl::fuzzer::proto::GOPHER_PROBE_TLS_SESSION_KEY_LIMIT) {
  ------------------
  |  Branch (2456:9): [True: 0, False: 0]
  ------------------
 2457|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_GOPHERS);
 2458|      0|    } else if (probe != curl::fuzzer::proto::GOPHER_PROBE_DEFAULT) {
  ------------------
  |  Branch (2458:16): [True: 0, False: 0]
  ------------------
 2459|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_GOPHER);
 2460|      0|    } else {
 2461|      0|      scenario->set_scheme(scenario->scheme() == curl::fuzzer::proto::SCHEME_GOPHERS
  ------------------
  |  Branch (2461:28): [True: 0, False: 0]
  ------------------
 2462|      0|                               ? curl::fuzzer::proto::SCHEME_GOPHERS
 2463|      0|                               : curl::fuzzer::proto::SCHEME_GOPHER);
 2464|      0|    }
 2465|      0|    RemoveIgnoredGopherShape(scenario);
 2466|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2467|      0|    if (probe == curl::fuzzer::proto::GOPHER_PROBE_TLS_SESSION_KEY_LIMIT) {
  ------------------
  |  Branch (2467:9): [True: 0, False: 0]
  ------------------
 2468|      0|      scenario->set_host_path(std::string(kGopherTlsPeerKeyHostBytes, 'g') + "/1/session-key-limit");
 2469|      0|    } else {
 2470|      0|      CanonicalizeTlsAuthority(scenario);
 2471|      0|    }
 2472|      0|    return;
 2473|      0|  }
 2474|       |
 2475|      0|  if (profile == TargetProfile::kFastFile) {
  ------------------
  |  Branch (2475:7): [True: 0, False: 0]
  ------------------
 2476|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_FILE);
 2477|      0|    scenario->clear_host_path();
 2478|      0|    RemoveIgnoredFileShape(scenario);
 2479|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2480|      0|    if (scenario->file_source().size() > scenario_limits::kMaxFileInputBytes) {
  ------------------
  |  Branch (2480:9): [True: 0, False: 0]
  ------------------
 2481|      0|      scenario->mutable_file_source()->resize(scenario_limits::kMaxFileInputBytes);
 2482|      0|    }
 2483|      0|    return;
 2484|      0|  }
 2485|       |
 2486|      0|  if (profile == TargetProfile::kFastLdap) {
  ------------------
  |  Branch (2486:7): [True: 0, False: 0]
  ------------------
 2487|       |    // The single LDAP target services plaintext LDAP and implicit-TLS LDAPS
 2488|       |    // through one BER parser. Preserve an explicitly supplied LDAPS scheme so
 2489|       |    // the seed and mutations can select the TLS peer; every other scheme falls
 2490|       |    // back to the historical plaintext lane.
 2491|      0|    const auto scheme = scenario->scheme();
 2492|      0|    scenario->set_scheme(scheme == curl::fuzzer::proto::SCHEME_LDAPS ? curl::fuzzer::proto::SCHEME_LDAPS
  ------------------
  |  Branch (2492:26): [True: 0, False: 0]
  ------------------
 2493|      0|                                                                     : curl::fuzzer::proto::SCHEME_LDAP);
 2494|      0|    if (scenario->scheme() == curl::fuzzer::proto::SCHEME_LDAPS) {
  ------------------
  |  Branch (2494:9): [True: 0, False: 0]
  ------------------
 2495|      0|      scenario->clear_ldap_starttls();
 2496|      0|    }
 2497|      0|    RemoveIgnoredLdapShape(scenario);
 2498|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2499|      0|    CanonicalizeLdapAuthority(scenario);
 2500|      0|    return;
 2501|      0|  }
 2502|       |
 2503|      0|  if (profile == TargetProfile::kFastRtsp) {
  ------------------
  |  Branch (2503:7): [True: 0, False: 0]
  ------------------
 2504|      0|    scenario->set_scheme(curl::fuzzer::proto::SCHEME_RTSP);
 2505|      0|    RemoveIgnoredRtspShape(scenario);
 2506|      0|    CanonicalizeRtspOptionModes(scenario);
 2507|      0|    CanonicalizeRtspProbeMode(scenario);
 2508|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2509|      0|    CanonicalizeRtspAuthority(scenario);
 2510|      0|    return;
 2511|      0|  }
 2512|       |
 2513|      0|  if (profile == TargetProfile::kFastIpfs) {
  ------------------
  |  Branch (2513:7): [True: 0, False: 0]
  ------------------
 2514|       |    // Preserve an explicitly selected IPNS name; every other pre-policy value
 2515|       |    // falls back to the historical IPFS lane so one binary covers both.
 2516|      0|    scenario->set_scheme(scenario->scheme() == curl::fuzzer::proto::SCHEME_IPNS ? curl::fuzzer::proto::SCHEME_IPNS
  ------------------
  |  Branch (2516:26): [True: 0, False: 0]
  ------------------
 2517|      0|                                                                                : curl::fuzzer::proto::SCHEME_IPFS);
 2518|      0|    RemoveIgnoredIpfsShape(scenario);
 2519|      0|    CanonicalizeFastHttpVersion(scenario);
 2520|      0|    PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2521|      0|    CanonicalizeIpfsAuthority(scenario);
 2522|      0|    return;
 2523|      0|  }
 2524|       |
 2525|       |  // Select the lane's scheme before applying scheme-sensitive upload bounds.
 2526|       |  // The scheme field is itself mutable, so bounding first could accidentally
 2527|       |  // give an HTTP/WS case TELNET's smaller payload budget merely because that
 2528|       |  // was the input's pre-policy value.
 2529|      0|  switch (profile) {
  ------------------
  |  Branch (2529:11): [True: 0, False: 0]
  ------------------
 2530|      0|    case TargetProfile::kCompatibility:
  ------------------
  |  Branch (2530:5): [True: 0, False: 0]
  ------------------
 2531|      0|      return;
 2532|      0|    case TargetProfile::kDeepHttp:
  ------------------
  |  Branch (2532:5): [True: 0, False: 0]
  ------------------
 2533|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 2534|      0|      break;
 2535|      0|    case TargetProfile::kApi:
  ------------------
  |  Branch (2535:5): [True: 0, False: 0]
  ------------------
 2536|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 2537|      0|      break;
 2538|      0|    case TargetProfile::kMulti:
  ------------------
  |  Branch (2538:5): [True: 0, False: 0]
  ------------------
 2539|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 2540|      0|      break;
 2541|      0|    case TargetProfile::kFastHttps:
  ------------------
  |  Branch (2541:5): [True: 0, False: 0]
  ------------------
 2542|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTPS);
 2543|      0|      break;
 2544|      0|    case TargetProfile::kHttpsH2:
  ------------------
  |  Branch (2544:5): [True: 0, False: 0]
  ------------------
 2545|       |      // The protocol-specific early path fixes ALPN and prunes incompatible
 2546|       |      // response shapes while retaining the raw frame script.
 2547|      0|      return;
 2548|      0|    case TargetProfile::kFastHttp2:
  ------------------
  |  Branch (2548:5): [True: 0, False: 0]
  ------------------
 2549|       |      // The protocol-specific early path fixes prior-knowledge H2 and prunes
 2550|       |      // incompatible response shapes while retaining its frame script.
 2551|      0|      return;
 2552|      0|    case TargetProfile::kFastHttp3:
  ------------------
  |  Branch (2552:5): [True: 0, False: 0]
  ------------------
 2553|       |      // The protocol-specific early path owns the QUIC response plan.
 2554|      0|      return;
 2555|      0|    case TargetProfile::kH2Proxy:
  ------------------
  |  Branch (2555:5): [True: 0, False: 0]
  ------------------
 2556|       |      // The early path removes proxy-incompatible fields before general
 2557|       |      // bounds, keeping raw frame mutation dense.
 2558|      0|      return;
 2559|      0|    case TargetProfile::kProxyTransport:
  ------------------
  |  Branch (2559:5): [True: 0, False: 0]
  ------------------
 2560|       |      // The early path fixes proxy routing and request-triggered replies.
 2561|      0|      return;
 2562|      0|    case TargetProfile::kResolver:
  ------------------
  |  Branch (2562:5): [True: 0, False: 0]
  ------------------
 2563|       |      // The early path fixes safe DNS/cache routing and bounds its slist.
 2564|      0|      return;
 2565|      0|    case TargetProfile::kFastWebSocket:
  ------------------
  |  Branch (2565:5): [True: 0, False: 0]
  ------------------
 2566|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_WS);
 2567|      0|      break;
 2568|      0|    case TargetProfile::kFastSecureWebSocket:
  ------------------
  |  Branch (2568:5): [True: 0, False: 0]
  ------------------
 2569|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_WSS);
 2570|      0|      break;
 2571|      0|    case TargetProfile::kTiming:
  ------------------
  |  Branch (2571:5): [True: 0, False: 0]
  ------------------
 2572|      0|      scenario->set_scheme(PlaintextScheme(scenario->scheme()));
 2573|      0|      break;
 2574|      0|    case TargetProfile::kFastHttp:
  ------------------
  |  Branch (2574:5): [True: 0, False: 0]
  ------------------
 2575|      0|    case TargetProfile::kFastTelnet:
  ------------------
  |  Branch (2575:5): [True: 0, False: 0]
  ------------------
 2576|      0|    case TargetProfile::kFastFtp:
  ------------------
  |  Branch (2576:5): [True: 0, False: 0]
  ------------------
 2577|      0|    case TargetProfile::kFastTftp:
  ------------------
  |  Branch (2577:5): [True: 0, False: 0]
  ------------------
 2578|      0|    case TargetProfile::kFastSmtp:
  ------------------
  |  Branch (2578:5): [True: 0, False: 0]
  ------------------
 2579|      0|    case TargetProfile::kFastImap:
  ------------------
  |  Branch (2579:5): [True: 0, False: 0]
  ------------------
 2580|      0|    case TargetProfile::kFastPop3:
  ------------------
  |  Branch (2580:5): [True: 0, False: 0]
  ------------------
 2581|      0|    case TargetProfile::kFastMqtt:
  ------------------
  |  Branch (2581:5): [True: 0, False: 0]
  ------------------
 2582|      0|    case TargetProfile::kFastDict:
  ------------------
  |  Branch (2582:5): [True: 0, False: 0]
  ------------------
 2583|      0|    case TargetProfile::kFastGopher:
  ------------------
  |  Branch (2583:5): [True: 0, False: 0]
  ------------------
 2584|      0|    case TargetProfile::kFastFile:
  ------------------
  |  Branch (2584:5): [True: 0, False: 0]
  ------------------
 2585|      0|    case TargetProfile::kFastLdap:
  ------------------
  |  Branch (2585:5): [True: 0, False: 0]
  ------------------
 2586|      0|    case TargetProfile::kFastRtsp:
  ------------------
  |  Branch (2586:5): [True: 0, False: 0]
  ------------------
 2587|      0|    case TargetProfile::kFastIpfs:
  ------------------
  |  Branch (2587:5): [True: 0, False: 0]
  ------------------
 2588|       |      // Protocol-specific early-return paths selected their scheme above.
 2589|      0|      return;
 2590|      0|  }
 2591|       |
 2592|       |  // TELNET's retained slist and synchronous pause have no observable, safe
 2593|       |  // meaning in the fixed event-driven lanes. Clear them before walking the
 2594|       |  // general shape so only the compatibility and TELNET targets can retain
 2595|       |  // those values.
 2596|      0|  RemoveTelnetOnlyShape(scenario);
 2597|      0|  if (profile != TargetProfile::kApi) {
  ------------------
  |  Branch (2597:7): [True: 0, False: 0]
  ------------------
 2598|      0|    RemoveApiOnlyShape(scenario);
 2599|      0|  }
 2600|      0|  if (profile != TargetProfile::kMulti) {
  ------------------
  |  Branch (2600:7): [True: 0, False: 0]
  ------------------
 2601|      0|    RemoveMultiOnlyShape(scenario);
 2602|      0|  }
 2603|      0|  if (profile == TargetProfile::kDeepHttp) {
  ------------------
  |  Branch (2603:7): [True: 0, False: 0]
  ------------------
 2604|      0|    CanonicalizeDeepHttpSelectors(scenario);
 2605|      0|    if (UsesDeepHttpProxyRoute(*scenario)) {
  ------------------
  |  Branch (2605:9): [True: 0, False: 0]
  ------------------
 2606|      0|      scenario->clear_http_upload_trailers();
 2607|      0|    }
 2608|      0|  }
 2609|      0|  if (profile == TargetProfile::kApi && scenario->has_api_plan()) {
  ------------------
  |  Branch (2609:7): [True: 0, False: 0]
  |  Branch (2609:41): [True: 0, False: 0]
  ------------------
 2610|      0|    CanonicalizeApiDriveMode(scenario->mutable_api_plan());
 2611|      0|  }
 2612|      0|  PruneAndBoundScenarioShape(scenario, profile, prune_conditional_eligibility);
 2613|       |
 2614|      0|  switch (profile) {
  ------------------
  |  Branch (2614:11): [True: 0, False: 0]
  ------------------
 2615|      0|    case TargetProfile::kCompatibility:
  ------------------
  |  Branch (2615:5): [True: 0, False: 0]
  ------------------
 2616|      0|      return;
 2617|      0|    case TargetProfile::kFastHttp:
  ------------------
  |  Branch (2617:5): [True: 0, False: 0]
  ------------------
 2618|       |      // Handled before the general bounds so discarded deep shapes are never
 2619|       |      // traversed on the fast path.
 2620|      0|      return;
 2621|       |
 2622|      0|    case TargetProfile::kDeepHttp:
  ------------------
  |  Branch (2622:5): [True: 0, False: 0]
  ------------------
 2623|      0|      if (scenario->proxy_socket_option_mode() != curl::fuzzer::proto::PROXY_SOCKET_OPTION_DEFAULT) {
  ------------------
  |  Branch (2623:11): [True: 0, False: 0]
  ------------------
 2624|       |        // A scenario describes one owned route. Prefer the closed socket-option
 2625|       |        // profile when a mutation selects both independent fields.
 2626|      0|        scenario->clear_http_transport_mode();
 2627|      0|        CanonicalizeProxySocketOptionAuthority(scenario);
 2628|       |        // Alt-Svc or HSTS can replace this mode's fixed plaintext authority
 2629|       |        // before its option path runs. Keep the focused route authoritative.
 2630|      0|        scenario->clear_altsvc_file();
 2631|      0|        scenario->clear_hsts_file();
 2632|      0|      } else if (scenario->http_transport_mode() != curl::fuzzer::proto::HTTP_TRANSPORT_DIRECT) {
  ------------------
  |  Branch (2632:18): [True: 0, False: 0]
  ------------------
 2633|      0|        CanonicalizeHttpTransportAuthority(scenario);
 2634|       |        // The selected transport owns the route. Alt-Svc and HSTS can rewrite
 2635|       |        // its fixed plaintext authority into a different proxy or TLS path,
 2636|       |        // defeating the mode the scenario is meant to exercise.
 2637|      0|        scenario->clear_altsvc_file();
 2638|      0|        scenario->clear_hsts_file();
 2639|      0|      } else if (!scenario->altsvc_file().empty()) {
  ------------------
  |  Branch (2639:18): [True: 0, False: 0]
  ------------------
 2640|      0|        CanonicalizeAltSvcAuthority(scenario);
 2641|      0|      }
 2642|      0|      if (scenario->http_transport_mode() == curl::fuzzer::proto::HTTP_TRANSPORT_CONNECT_PROXY &&
  ------------------
  |  Branch (2642:11): [True: 0, False: 0]
  ------------------
 2643|      0|          scenario->haproxy_protocol()) {
  ------------------
  |  Branch (2643:11): [True: 0, False: 0]
  ------------------
 2644|       |        // This closed combination makes the pending HAProxy setup state
 2645|       |        // reachable after CONNECT. A large checked-in request fills the
 2646|       |        // tightened socket, while bounded peer drains and repeated public
 2647|       |        // multi polling expose the filter's write-only pollset.
 2648|      0|        auto* backpressure = scenario->mutable_connection()->mutable_backpressure();
 2649|      0|        backpressure->set_recv_buf_bytes(kHaproxyConnectBufferBytes);
 2650|      0|        backpressure->set_drain_limit(kHaproxyConnectDrainBytes);
 2651|      0|        for (auto& connection : *scenario->mutable_subsequent_connections()) {
  ------------------
  |  Branch (2651:31): [True: 0, False: 0]
  ------------------
 2652|      0|          connection.clear_backpressure();
 2653|      0|        }
 2654|      0|      } else {
 2655|      0|        scenario->clear_haproxy_protocol();
 2656|      0|        ClearAllBackpressure(scenario);
 2657|      0|      }
 2658|      0|      if (scenario->http_transport_mode() != curl::fuzzer::proto::HTTP_TRANSPORT_CONNECT_PROXY) {
  ------------------
  |  Branch (2658:11): [True: 0, False: 0]
  ------------------
 2659|      0|        scenario->clear_probe_multi_pollset();
 2660|      0|      }
 2661|      0|      return;
 2662|       |
 2663|      0|    case TargetProfile::kApi:
  ------------------
  |  Branch (2663:5): [True: 0, False: 0]
  ------------------
 2664|      0|      ClearAllBackpressure(scenario);
 2665|      0|      if (scenario->host_path().size() > scenario_limits::kMaxApiStringBytes) {
  ------------------
  |  Branch (2665:11): [True: 0, False: 0]
  ------------------
 2666|      0|        scenario->mutable_host_path()->resize(scenario_limits::kMaxApiStringBytes);
 2667|      0|      }
 2668|      0|      if (scenario->has_api_plan()) {
  ------------------
  |  Branch (2668:11): [True: 0, False: 0]
  ------------------
 2669|      0|        BoundApiPlanShape(scenario->mutable_api_plan());
 2670|      0|        CanonicalizeApiMimeRepeat(scenario);
 2671|      0|      }
 2672|      0|      return;
 2673|       |
 2674|      0|    case TargetProfile::kMulti: {
  ------------------
  |  Branch (2674:5): [True: 0, False: 0]
  ------------------
 2675|      0|      ClearAllBackpressure(scenario);
 2676|      0|      CanonicalizeMultiAuthority(scenario);
 2677|       |      // The multi runner is HTTP-only (it drives every handle through one
 2678|       |      // plaintext HTTP peer), so pin the scheme instead of letting a mutation
 2679|       |      // select a protocol the runner cannot service.
 2680|      0|      scenario->set_scheme(curl::fuzzer::proto::SCHEME_HTTP);
 2681|      0|      auto* plan = scenario->mutable_multi_plan();
 2682|      0|      BoundMultiPlanShape(plan);
 2683|      0|      TrimRepeated(scenario->mutable_subsequent_connections(), plan->transfer_count() - 1U);
 2684|      0|      return;
 2685|      0|    }
 2686|       |
 2687|      0|    case TargetProfile::kFastHttps:
  ------------------
  |  Branch (2687:5): [True: 0, False: 0]
  ------------------
 2688|      0|      ClearAllBackpressure(scenario);
 2689|      0|      CanonicalizeTlsAuthority(scenario);
 2690|      0|      CanonicalizeTlsCertificateChain(scenario);
 2691|      0|      CanonicalizeTlsClientCredentialProfile(scenario);
 2692|      0|      CanonicalizeTlsHandshakeProfile(scenario);
 2693|      0|      CanonicalizeTlsOcspStapleProfile(scenario);
 2694|      0|      CanonicalizeTlsSessionCacheProfile(scenario);
 2695|      0|      return;
 2696|       |
 2697|      0|    case TargetProfile::kHttpsH2:
  ------------------
  |  Branch (2697:5): [True: 0, False: 0]
  ------------------
 2698|       |      // Handled by the raw HTTP/2 protocol-specific early path above.
 2699|      0|      return;
 2700|       |
 2701|      0|    case TargetProfile::kFastHttp2:
  ------------------
  |  Branch (2701:5): [True: 0, False: 0]
  ------------------
 2702|       |      // Handled by the plaintext HTTP/2 protocol-specific early path above.
 2703|      0|      return;
 2704|       |
 2705|      0|    case TargetProfile::kFastHttp3:
  ------------------
  |  Branch (2705:5): [True: 0, False: 0]
  ------------------
 2706|       |      // Handled before generic connection bounding because Http3Plan replaces
 2707|       |      // the stream-socket response script.
 2708|      0|      return;
 2709|       |
 2710|      0|    case TargetProfile::kH2Proxy:
  ------------------
  |  Branch (2710:5): [True: 0, False: 0]
  ------------------
 2711|       |      // Handled by the protocol-specific early path above.
 2712|      0|      return;
 2713|       |
 2714|      0|    case TargetProfile::kProxyTransport:
  ------------------
  |  Branch (2714:5): [True: 0, False: 0]
  ------------------
 2715|       |      // Handled by the protocol-specific early path above.
 2716|      0|      return;
 2717|       |
 2718|      0|    case TargetProfile::kResolver:
  ------------------
  |  Branch (2718:5): [True: 0, False: 0]
  ------------------
 2719|       |      // Handled by the resolver-specific early path above.
 2720|      0|      return;
 2721|       |
 2722|      0|    case TargetProfile::kFastWebSocket:
  ------------------
  |  Branch (2722:5): [True: 0, False: 0]
  ------------------
 2723|      0|      ClearAllBackpressure(scenario);
 2724|      0|      RemoveIgnoredWebSocketShape(scenario);
 2725|      0|      return;
 2726|       |
 2727|      0|    case TargetProfile::kFastSecureWebSocket:
  ------------------
  |  Branch (2727:5): [True: 0, False: 0]
  ------------------
 2728|      0|      ClearAllBackpressure(scenario);
 2729|      0|      RemoveIgnoredWebSocketShape(scenario);
 2730|      0|      CanonicalizeTlsAuthority(scenario);
 2731|      0|      CanonicalizeTlsCertificateChain(scenario);
 2732|      0|      return;
 2733|       |
 2734|      0|    case TargetProfile::kFastTelnet:
  ------------------
  |  Branch (2734:5): [True: 0, False: 0]
  ------------------
 2735|       |      // Handled before the general bounds so its protocol-specific limits are
 2736|       |      // selected from the start.
 2737|      0|      return;
 2738|       |
 2739|      0|    case TargetProfile::kFastFtp:
  ------------------
  |  Branch (2739:5): [True: 0, False: 0]
  ------------------
 2740|      0|    case TargetProfile::kFastTftp:
  ------------------
  |  Branch (2740:5): [True: 0, False: 0]
  ------------------
 2741|      0|    case TargetProfile::kFastSmtp:
  ------------------
  |  Branch (2741:5): [True: 0, False: 0]
  ------------------
 2742|      0|    case TargetProfile::kFastImap:
  ------------------
  |  Branch (2742:5): [True: 0, False: 0]
  ------------------
 2743|      0|    case TargetProfile::kFastPop3:
  ------------------
  |  Branch (2743:5): [True: 0, False: 0]
  ------------------
 2744|      0|    case TargetProfile::kFastMqtt:
  ------------------
  |  Branch (2744:5): [True: 0, False: 0]
  ------------------
 2745|      0|    case TargetProfile::kFastDict:
  ------------------
  |  Branch (2745:5): [True: 0, False: 0]
  ------------------
 2746|      0|    case TargetProfile::kFastGopher:
  ------------------
  |  Branch (2746:5): [True: 0, False: 0]
  ------------------
 2747|      0|    case TargetProfile::kFastFile:
  ------------------
  |  Branch (2747:5): [True: 0, False: 0]
  ------------------
 2748|      0|    case TargetProfile::kFastLdap:
  ------------------
  |  Branch (2748:5): [True: 0, False: 0]
  ------------------
 2749|      0|    case TargetProfile::kFastRtsp:
  ------------------
  |  Branch (2749:5): [True: 0, False: 0]
  ------------------
 2750|      0|    case TargetProfile::kFastIpfs:
  ------------------
  |  Branch (2750:5): [True: 0, False: 0]
  ------------------
 2751|       |      // Their peers consume narrower raw-script shapes, pruned before general
 2752|       |      // bounds so ignored fields never tax these fast paths.
 2753|      0|      return;
 2754|       |
 2755|      0|    case TargetProfile::kTiming: {
  ------------------
  |  Branch (2755:5): [True: 0, False: 0]
  ------------------
 2756|      0|      if (scenario->scheme() == curl::fuzzer::proto::SCHEME_WS) {
  ------------------
  |  Branch (2756:11): [True: 0, False: 0]
  ------------------
 2757|      0|        RemoveIgnoredWebSocketShape(scenario);
 2758|      0|      }
 2759|      0|      auto* backpressure = scenario->mutable_connection()->mutable_backpressure();
 2760|      0|      if (backpressure->recv_buf_bytes() == 0) {
  ------------------
  |  Branch (2760:11): [True: 0, False: 0]
  ------------------
 2761|       |        // A drain limit alone cannot fill the default AF_UNIX buffer with the
 2762|       |        // harness's bounded upload. Always tighten the socket so this lane
 2763|       |        // represents real pressure, not merely selection of the timed loop.
 2764|      0|        backpressure->set_recv_buf_bytes(kDefaultBackpressureBufferBytes);
 2765|      0|      } else {
 2766|      0|        backpressure->set_recv_buf_bytes(CanonicalizeNonZero(backpressure->recv_buf_bytes(),
 2767|      0|                                                             kMinBackpressureBufferBytes, kMaxBackpressureBufferBytes));
 2768|      0|      }
 2769|      0|      backpressure->set_drain_limit(CanonicalizeNonZero(backpressure->drain_limit(), 1, kMaxDrainBytesPerIteration));
 2770|      0|      for (auto& connection : *scenario->mutable_subsequent_connections()) {
  ------------------
  |  Branch (2770:29): [True: 0, False: 0]
  ------------------
 2771|      0|        CanonicalizeOptionalBackpressure(&connection);
 2772|      0|      }
 2773|      0|      return;
 2774|      0|    }
 2775|      0|  }
 2776|      0|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_123RemoveIgnoredHttp3ShapeEPN4curl6fuzzer5proto8ScenarioE:
 1575|  19.9k|void RemoveIgnoredHttp3Shape(curl::fuzzer::proto::Scenario* scenario) {
 1576|  19.9k|  if (!scenario->http3_plan().use_h1_connect_udp_proxy()) {
  ------------------
  |  Branch (1576:7): [True: 4.57k, False: 15.3k]
  ------------------
 1577|  4.57k|    scenario->clear_connection();
 1578|  4.57k|  }
 1579|  19.9k|  scenario->clear_subsequent_connections();
 1580|  19.9k|  RemoveTelnetOnlyShape(scenario);
 1581|  19.9k|  RemoveApiOnlyShape(scenario);
 1582|  19.9k|  RemoveMultiOnlyShape(scenario);
 1583|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_126PruneAndBoundScenarioShapeEPN4curl6fuzzer5proto8ScenarioENS_13TargetProfileEPFvS5_S6_E:
 1338|  19.9k|                                ConditionalEligibilityPruner prune_conditional_eligibility) {
 1339|  19.9k|  if (prune_conditional_eligibility != nullptr) {
  ------------------
  |  Branch (1339:7): [True: 19.9k, False: 0]
  ------------------
 1340|  19.9k|    prune_conditional_eligibility(scenario, profile);
 1341|  19.9k|  }
 1342|  19.9k|  BoundScenarioShape(scenario);
 1343|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_118BoundScenarioShapeEPN4curl6fuzzer5proto8ScenarioE:
 1293|  19.9k|void BoundScenarioShape(curl::fuzzer::proto::Scenario* scenario) {
 1294|  19.9k|  TrimRepeated(scenario->mutable_options(), scenario_limits::kMaxOptions);
 1295|       |
 1296|  19.9k|  BoundHeaderValues(scenario->mutable_request_headers(), scenario_limits::kMaxRequestHeaders);
 1297|  19.9k|  BoundStringValues(scenario->mutable_telnet_options(), scenario_limits::kMaxTelnetOptions,
 1298|  19.9k|                    scenario_limits::kMaxTelnetOptionBytes);
 1299|  19.9k|  if (scenario->has_mime_post()) {
  ------------------
  |  Branch (1299:7): [True: 2.06k, False: 17.8k]
  ------------------
 1300|  2.06k|    BoundMimeShape(scenario->mutable_mime_post());
 1301|  2.06k|  }
 1302|  19.9k|  if (scenario->has_upload()) {
  ------------------
  |  Branch (1302:7): [True: 954, False: 18.9k]
  ------------------
 1303|    954|    const bool telnet = scenario->scheme() == curl::fuzzer::proto::SCHEME_TELNET;
 1304|    954|    const std::size_t data_limit = telnet ? scenario_limits::kMaxTelnetUploadBytes : scenario_limits::kMaxUploadBytes;
  ------------------
  |  Branch (1304:36): [True: 0, False: 954]
  ------------------
 1305|    954|    const std::size_t read_step_limit =
 1306|    954|        telnet ? scenario_limits::kMaxTelnetUploadReadSteps : scenario_limits::kMaxUploadReadSteps;
  ------------------
  |  Branch (1306:9): [True: 0, False: 954]
  ------------------
 1307|    954|    const std::size_t read_size_limit =
 1308|    954|        telnet ? scenario_limits::kMaxTelnetUploadReadSize : scenario_limits::kMaxUploadReadSize;
  ------------------
  |  Branch (1308:9): [True: 0, False: 954]
  ------------------
 1309|    954|    BoundUploadShape(scenario->mutable_upload(), data_limit, read_step_limit, read_size_limit);
 1310|    954|  }
 1311|  19.9k|  if (scenario->has_http_upload_trailers()) {
  ------------------
  |  Branch (1311:7): [True: 0, False: 19.9k]
  ------------------
 1312|      0|    BoundHttpUploadTrailers(scenario->mutable_http_upload_trailers());
 1313|      0|  }
 1314|       |
 1315|  19.9k|  BoundConnectionShape(scenario->mutable_connection());
 1316|  19.9k|  TrimRepeated(scenario->mutable_subsequent_connections(), scenario_limits::kMaxConnections - 1);
 1317|  19.9k|  for (auto& connection : *scenario->mutable_subsequent_connections()) {
  ------------------
  |  Branch (1317:25): [True: 0, False: 19.9k]
  ------------------
 1318|      0|    BoundConnectionShape(&connection);
 1319|      0|  }
 1320|  19.9k|  BoundStringValues(scenario->mutable_mail_rcpt(), scenario_limits::kMaxMailRecipients,
 1321|  19.9k|                    scenario_limits::kMaxMailRecipientBytes);
 1322|  19.9k|  std::size_t remaining_ftp_quote_commands = scenario_limits::kMaxFtpQuoteCommands;
 1323|  19.9k|  const auto bound_ftp_quote_list = [&remaining_ftp_quote_commands](auto* commands) {
 1324|  19.9k|    const std::size_t retained = std::min<std::size_t>(remaining_ftp_quote_commands, commands->size());
 1325|  19.9k|    BoundStringValues(commands, retained, scenario_limits::kMaxFtpQuoteCommandBytes);
 1326|  19.9k|    remaining_ftp_quote_commands -= retained;
 1327|  19.9k|  };
 1328|  19.9k|  bound_ftp_quote_list(scenario->mutable_ftp_quote());
 1329|  19.9k|  bound_ftp_quote_list(scenario->mutable_ftp_prequote());
 1330|  19.9k|  bound_ftp_quote_list(scenario->mutable_ftp_postquote());
 1331|  19.9k|  BoundFileInputs(scenario);
 1332|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto9SetOptionEEEEEvPT_m:
   62|  19.9k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   63|  19.9k|  const std::size_t size = static_cast<std::size_t>(field->size());
   64|  19.9k|  if (size > limit) {
  ------------------
  |  Branch (64:7): [True: 134, False: 19.7k]
  ------------------
   65|    134|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   66|    134|  }
   67|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_117BoundHeaderValuesIN6google8protobuf16RepeatedPtrFieldINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEEEvPT_m:
  612|  33.6k|void BoundHeaderValues(RepeatedBytes* headers, std::size_t limit) {
  613|  33.6k|  BoundStringValues(headers, limit, scenario_limits::kMaxMetadataBytes);
  614|  33.6k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_114BoundMimeShapeEPN4curl6fuzzer5proto8MimePostE:
  703|  2.06k|void BoundMimeShape(curl::fuzzer::proto::MimePost* post) {
  704|  2.06k|  TrimRepeated(post->mutable_parts(), scenario_limits::kMaxTopLevelMimeParts);
  705|  2.06k|  std::size_t remaining = scenario_limits::kMaxTotalMimeParts;
  706|  2.06k|  std::size_t remaining_generated_bytes = scenario_limits::kMaxGeneratedMimeDataBytes;
  707|  2.06k|  std::size_t retained_top_parts = 0;
  708|       |
  709|  9.95k|  while (retained_top_parts < static_cast<std::size_t>(post->parts_size()) && remaining != 0) {
  ------------------
  |  Branch (709:10): [True: 7.90k, False: 2.05k]
  |  Branch (709:79): [True: 7.89k, False: 11]
  ------------------
  710|  7.89k|    auto* part = post->mutable_parts(static_cast<int>(retained_top_parts));
  711|  7.89k|    ++retained_top_parts;
  712|  7.89k|    --remaining;
  713|  7.89k|    BoundMimePartMetadata(part);
  714|       |
  715|  7.89k|    if (part->content_case() == curl::fuzzer::proto::MimePart::kData) {
  ------------------
  |  Branch (715:9): [True: 438, False: 7.45k]
  ------------------
  716|    438|      if (part->data().size() > scenario_limits::kMaxMimeDataBytes) {
  ------------------
  |  Branch (716:11): [True: 1, False: 437]
  ------------------
  717|      1|        part->mutable_data()->resize(scenario_limits::kMaxMimeDataBytes);
  718|      1|      }
  719|    438|      continue;
  720|    438|    }
  721|  7.45k|    if (part->content_case() == curl::fuzzer::proto::MimePart::kGeneratedData) {
  ------------------
  |  Branch (721:9): [True: 856, False: 6.59k]
  ------------------
  722|    856|      BoundGeneratedMimeData(part->mutable_generated_data(), &remaining_generated_bytes);
  723|    856|      continue;
  724|    856|    }
  725|  6.59k|    if (part->content_case() != curl::fuzzer::proto::MimePart::kSubparts) {
  ------------------
  |  Branch (725:9): [True: 3.45k, False: 3.14k]
  ------------------
  726|  3.45k|      continue;
  727|  3.45k|    }
  728|       |
  729|  3.14k|    auto* children = part->mutable_subparts()->mutable_parts();
  730|  3.14k|    TrimRepeated(children, std::min(scenario_limits::kMaxNestedMimeParts, remaining));
  731|  5.78k|    for (auto& child : *children) {
  ------------------
  |  Branch (731:22): [True: 5.78k, False: 3.14k]
  ------------------
  732|  5.78k|      BoundMimeLeaf(&child, &remaining_generated_bytes);
  733|  5.78k|      --remaining;
  734|  5.78k|    }
  735|  3.14k|  }
  736|       |
  737|  2.06k|  TrimRepeated(post->mutable_parts(), retained_top_parts);
  738|  2.06k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto8MimePartEEEEEvPT_m:
   62|  4.13k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   63|  4.13k|  const std::size_t size = static_cast<std::size_t>(field->size());
   64|  4.13k|  if (size > limit) {
  ------------------
  |  Branch (64:7): [True: 75, False: 4.06k]
  ------------------
   65|     75|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   66|     75|  }
   67|  4.13k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_121BoundMimePartMetadataIN4curl6fuzzer5proto8MimePartEEEvPT_:
  663|  7.89k|void BoundMimePartMetadata(Part* part) {
  664|  7.89k|  TrimMetadata(part->mutable_name());
  665|  7.89k|  TrimMetadata(part->mutable_filename());
  666|  7.89k|  TrimMetadata(part->mutable_content_type());
  667|  7.89k|  BoundHeaderValues(part->mutable_headers(), scenario_limits::kMaxMimeHeadersPerPart);
  668|  7.89k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_122BoundGeneratedMimeDataEPN4curl6fuzzer5proto14GeneratedBytesEPm:
  670|  1.30k|void BoundGeneratedMimeData(curl::fuzzer::proto::GeneratedBytes* generated, std::size_t* remaining_bytes) {
  671|  1.30k|  if (generated->pattern().size() > scenario_limits::kMaxGeneratedMimePatternBytes) {
  ------------------
  |  Branch (671:7): [True: 11, False: 1.29k]
  ------------------
  672|     11|    generated->mutable_pattern()->resize(scenario_limits::kMaxGeneratedMimePatternBytes);
  673|     11|  }
  674|       |
  675|  1.30k|  const std::size_t pattern_size = generated->pattern().size();
  676|  1.30k|  if (pattern_size == 0 || *remaining_bytes == 0) {
  ------------------
  |  Branch (676:7): [True: 616, False: 686]
  |  Branch (676:28): [True: 70, False: 616]
  ------------------
  677|    686|    generated->clear_repeat_count();
  678|    686|    return;
  679|    686|  }
  680|       |
  681|       |  // Keep every exact in-range size, including 16/32/64 KiB and their +/-1
  682|       |  // neighborhoods. Counts beyond the shared budget all have identical runtime
  683|       |  // behavior, so fold them onto the largest observable repetition count.
  684|    616|  const std::size_t max_repeat_count = *remaining_bytes / pattern_size;
  685|    616|  const std::size_t repeat_count =
  686|    616|      std::min<std::size_t>(static_cast<std::size_t>(generated->repeat_count()), max_repeat_count);
  687|    616|  generated->set_repeat_count(static_cast<std::uint32_t>(repeat_count));
  688|    616|  *remaining_bytes -= repeat_count * pattern_size;
  689|    616|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto12MimeDataPartEEEEEvPT_m:
   62|  3.14k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   63|  3.14k|  const std::size_t size = static_cast<std::size_t>(field->size());
   64|  3.14k|  if (size > limit) {
  ------------------
  |  Branch (64:7): [True: 24, False: 3.11k]
  ------------------
   65|     24|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   66|     24|  }
   67|  3.14k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_113BoundMimeLeafEPN4curl6fuzzer5proto12MimeDataPartEPm:
  691|  5.78k|void BoundMimeLeaf(curl::fuzzer::proto::MimeDataPart* part, std::size_t* remaining_generated_bytes) {
  692|  5.78k|  BoundMimePartMetadata(part);
  693|  5.78k|  if (part->content_case() == curl::fuzzer::proto::MimeDataPart::kGeneratedData) {
  ------------------
  |  Branch (693:7): [True: 446, False: 5.34k]
  ------------------
  694|    446|    BoundGeneratedMimeData(part->mutable_generated_data(), remaining_generated_bytes);
  695|  5.34k|  } else if (part->data().size() > scenario_limits::kMaxMimeDataBytes) {
  ------------------
  |  Branch (695:14): [True: 0, False: 5.34k]
  ------------------
  696|      0|    part->mutable_data()->resize(scenario_limits::kMaxMimeDataBytes);
  697|      0|  }
  698|  5.78k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_121BoundMimePartMetadataIN4curl6fuzzer5proto12MimeDataPartEEEvPT_:
  663|  5.78k|void BoundMimePartMetadata(Part* part) {
  664|  5.78k|  TrimMetadata(part->mutable_name());
  665|  5.78k|  TrimMetadata(part->mutable_filename());
  666|  5.78k|  TrimMetadata(part->mutable_content_type());
  667|  5.78k|  BoundHeaderValues(part->mutable_headers(), scenario_limits::kMaxMimeHeadersPerPart);
  668|  5.78k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_116BoundUploadShapeEPN4curl6fuzzer5proto12UploadScriptEmmm:
  744|    954|                      std::size_t read_size_limit) {
  745|    954|  if (upload->data().size() > data_limit) {
  ------------------
  |  Branch (745:7): [True: 1, False: 953]
  ------------------
  746|      1|    upload->mutable_data()->resize(data_limit);
  747|      1|  }
  748|       |  // RepeatedField<uint32_t> lacks RepeatedPtrField's DeleteSubrange helper;
  749|       |  // removing the ignored suffix from the end is constant-time per element and
  750|       |  // preserves the mutation-significant prefix exactly.
  751|  33.7k|  while (static_cast<std::size_t>(upload->read_sizes_size()) > read_step_limit) {
  ------------------
  |  Branch (751:10): [True: 32.8k, False: 954]
  ------------------
  752|  32.8k|    upload->mutable_read_sizes()->RemoveLast();
  753|  32.8k|  }
  754|  3.85k|  for (int i = 0; i < upload->read_sizes_size(); ++i) {
  ------------------
  |  Branch (754:19): [True: 2.90k, False: 954]
  ------------------
  755|  2.90k|    if (upload->read_sizes(i) > read_size_limit) {
  ------------------
  |  Branch (755:9): [True: 90, False: 2.81k]
  ------------------
  756|     90|      upload->set_read_sizes(i, static_cast<std::uint32_t>(read_size_limit));
  757|     90|    }
  758|  2.90k|  }
  759|    954|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_120BoundConnectionShapeEPN4curl6fuzzer5proto10ConnectionE:
  635|  19.9k|void BoundConnectionShape(curl::fuzzer::proto::Connection* connection) {
  636|  19.9k|  TrimRepeated(connection->mutable_on_readable(), scenario_limits::kMaxResponseChunks);
  637|  19.9k|  const std::size_t raw_count = static_cast<std::size_t>(connection->on_readable_size());
  638|  19.9k|  TrimRepeated(connection->mutable_server_frames(), scenario_limits::kMaxResponseChunks - raw_count);
  639|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEEEvPT_m:
   62|   157k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   63|   157k|  const std::size_t size = static_cast<std::size_t>(field->size());
   64|   157k|  if (size > limit) {
  ------------------
  |  Branch (64:7): [True: 85, False: 156k]
  ------------------
   65|     85|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   66|     85|  }
   67|   157k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto14WebSocketFrameEEEEEvPT_m:
   62|  19.9k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   63|  19.9k|  const std::size_t size = static_cast<std::size_t>(field->size());
   64|  19.9k|  if (size > limit) {
  ------------------
  |  Branch (64:7): [True: 16, False: 19.9k]
  ------------------
   65|     16|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   66|     16|  }
   67|  19.9k|}
target_policy.cc:_ZZN12proto_fuzzer12_GLOBAL__N_118BoundScenarioShapeEPN4curl6fuzzer5proto8ScenarioEENK3$_0clIN6google8protobuf16RepeatedPtrFieldINSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEEEEEEDaPT_:
 1323|  59.7k|  const auto bound_ftp_quote_list = [&remaining_ftp_quote_commands](auto* commands) {
 1324|  59.7k|    const std::size_t retained = std::min<std::size_t>(remaining_ftp_quote_commands, commands->size());
 1325|  59.7k|    BoundStringValues(commands, retained, scenario_limits::kMaxFtpQuoteCommandBytes);
 1326|  59.7k|    remaining_ftp_quote_commands -= retained;
 1327|  59.7k|  };
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_115BoundFileInputsEPN4curl6fuzzer5proto8ScenarioE:
  651|  19.9k|void BoundFileInputs(curl::fuzzer::proto::Scenario* scenario) {
  652|  19.9k|  std::size_t remaining_bytes = scenario_limits::kMaxFileInputTotalBytes;
  653|  19.9k|  BoundFileInput(scenario->mutable_cookie_file(), &remaining_bytes);
  654|  19.9k|  BoundFileInput(scenario->mutable_altsvc_file(), &remaining_bytes);
  655|  19.9k|  BoundFileInput(scenario->mutable_hsts_file(), &remaining_bytes);
  656|  19.9k|  BoundFileInput(scenario->mutable_netrc_file(), &remaining_bytes);
  657|  19.9k|  BoundFileInput(scenario->mutable_crl_file(), &remaining_bytes);
  658|  19.9k|  BoundFileInput(scenario->mutable_pinned_public_key_file(), &remaining_bytes);
  659|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_114BoundFileInputEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPm:
  643|   119k|void BoundFileInput(std::string* input, std::size_t* remaining_bytes) {
  644|   119k|  const std::size_t limit = std::min(scenario_limits::kMaxFileInputBytes, *remaining_bytes);
  645|   119k|  if (input->size() > limit) {
  ------------------
  |  Branch (645:7): [True: 0, False: 119k]
  ------------------
  646|      0|    input->resize(limit);
  647|      0|  }
  648|   119k|  *remaining_bytes -= input->size();
  649|   119k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_119BoundHttp3PlanShapeEPN4curl6fuzzer5proto9Http3PlanE:
 1200|  19.9k|void BoundHttp3PlanShape(curl::fuzzer::proto::Http3Plan* plan) {
 1201|  19.9k|  if (plan->use_h1_connect_udp_proxy()) {
  ------------------
  |  Branch (1201:7): [True: 15.3k, False: 4.57k]
  ------------------
 1202|  15.3k|    plan->clear_actions();
 1203|  15.3k|    plan->clear_small_upload_window();
 1204|  15.3k|    return;
 1205|  15.3k|  }
 1206|  4.57k|  TrimRepeated(plan->mutable_actions(), scenario_limits::kMaxHttp3Actions);
 1207|  4.57k|  if (plan->actions().empty()) {
  ------------------
  |  Branch (1207:7): [True: 613, False: 3.96k]
  ------------------
 1208|    613|    auto* response = plan->add_actions()->mutable_structured_response();
 1209|    613|    response->set_status_code(200);
 1210|    613|    response->set_finish_stream(true);
 1211|    613|  }
 1212|       |
 1213|  4.57k|  std::size_t remaining_header_bytes = scenario_limits::kMaxHttp3HeaderBytes;
 1214|  4.57k|  std::size_t remaining_body_bytes = scenario_limits::kMaxHttp3BodyBytes;
 1215|  4.57k|  std::size_t remaining_raw_bytes = scenario_limits::kMaxHttp3RawBytes;
 1216|  4.57k|  std::size_t retained_actions = 0;
 1217|  4.57k|  bool connection_closed = false;
 1218|  8.59k|  for (auto& action : *plan->mutable_actions()) {
  ------------------
  |  Branch (1218:21): [True: 8.59k, False: 4.52k]
  ------------------
 1219|  8.59k|    if (connection_closed) {
  ------------------
  |  Branch (1219:9): [True: 49, False: 8.54k]
  ------------------
 1220|     49|      break;
 1221|     49|    }
 1222|  8.54k|    ++retained_actions;
 1223|  8.54k|    switch (action.action_case()) {
  ------------------
  |  Branch (1223:13): [True: 8.54k, False: 0]
  ------------------
 1224|  3.84k|      case curl::fuzzer::proto::Http3Action::kStructuredResponse: {
  ------------------
  |  Branch (1224:7): [True: 3.84k, False: 4.69k]
  ------------------
 1225|  3.84k|        auto* response = action.mutable_structured_response();
 1226|  3.84k|        if (response->status_code() == 0U) {
  ------------------
  |  Branch (1226:13): [True: 173, False: 3.67k]
  ------------------
 1227|    173|          response->set_status_code(200U);
 1228|  3.67k|        } else if (response->status_code() < 100U || response->status_code() > 599U) {
  ------------------
  |  Branch (1228:20): [True: 38, False: 3.63k]
  |  Branch (1228:54): [True: 83, False: 3.55k]
  ------------------
 1229|    121|          response->set_status_code(100U + response->status_code() % 500U);
 1230|    121|        }
 1231|  3.84k|        BoundHttp3Headers(response->mutable_response_headers(), scenario_limits::kMaxHttp3Headers,
 1232|  3.84k|                          &remaining_header_bytes);
 1233|  3.84k|        BoundHttp3Headers(response->mutable_response_trailers(), scenario_limits::kMaxHttp3Trailers,
 1234|  3.84k|                          &remaining_header_bytes);
 1235|  3.84k|        TrimRepeated(response->mutable_body_chunks(), scenario_limits::kMaxHttp3BodyChunks);
 1236|  3.84k|        for (std::string& chunk : *response->mutable_body_chunks()) {
  ------------------
  |  Branch (1236:33): [True: 3.35k, False: 3.84k]
  ------------------
 1237|  3.35k|          if (chunk.size() > remaining_body_bytes) {
  ------------------
  |  Branch (1237:15): [True: 20, False: 3.33k]
  ------------------
 1238|     20|            chunk.resize(remaining_body_bytes);
 1239|     20|          }
 1240|  3.35k|          remaining_body_bytes -= chunk.size();
 1241|  3.35k|        }
 1242|  3.84k|        break;
 1243|      0|      }
 1244|       |
 1245|    908|      case curl::fuzzer::proto::Http3Action::kStreamWrite: {
  ------------------
  |  Branch (1245:7): [True: 908, False: 7.63k]
  ------------------
 1246|    908|        auto* write = action.mutable_stream_write();
 1247|    908|        auto role = write->role();
 1248|    908|        CanonicalizeHttp3StreamRole(&role);
 1249|    908|        write->set_role(role);
 1250|    908|        BoundHttp3RawData(write->mutable_data(), &remaining_raw_bytes);
 1251|    908|        break;
 1252|      0|      }
 1253|       |
 1254|  1.03k|      case curl::fuzzer::proto::Http3Action::kOpenUnidirectionalStream: {
  ------------------
  |  Branch (1254:7): [True: 1.03k, False: 7.50k]
  ------------------
 1255|  1.03k|        auto* stream = action.mutable_open_unidirectional_stream();
 1256|  1.03k|        BoundHttp3RawData(stream->mutable_data(), &remaining_raw_bytes);
 1257|  1.03k|        break;
 1258|      0|      }
 1259|       |
 1260|    812|      case curl::fuzzer::proto::Http3Action::kStreamReset: {
  ------------------
  |  Branch (1260:7): [True: 812, False: 7.72k]
  ------------------
 1261|    812|        auto* reset = action.mutable_stream_reset();
 1262|    812|        auto role = reset->role();
 1263|    812|        CanonicalizeHttp3StreamRole(&role);
 1264|    812|        reset->set_role(role);
 1265|    812|        reset->set_application_error_code(reset->application_error_code() & scenario_limits::kMaxQuicVarint);
 1266|    812|        break;
 1267|      0|      }
 1268|       |
 1269|    968|      case curl::fuzzer::proto::Http3Action::kGoaway:
  ------------------
  |  Branch (1269:7): [True: 968, False: 7.57k]
  ------------------
 1270|    968|        action.mutable_goaway()->set_id(action.goaway().id() & scenario_limits::kMaxQuicVarint & ~std::uint64_t{3});
 1271|    968|        break;
 1272|       |
 1273|    760|      case curl::fuzzer::proto::Http3Action::kConnectionClose:
  ------------------
  |  Branch (1273:7): [True: 760, False: 7.78k]
  ------------------
 1274|    760|        action.mutable_connection_close()->set_application_error_code(
 1275|    760|            action.connection_close().application_error_code() & scenario_limits::kMaxQuicVarint);
 1276|    760|        connection_closed = true;
 1277|    760|        break;
 1278|       |
 1279|    208|      case curl::fuzzer::proto::Http3Action::ACTION_NOT_SET: {
  ------------------
  |  Branch (1279:7): [True: 208, False: 8.33k]
  ------------------
 1280|    208|        auto* response = action.mutable_structured_response();
 1281|    208|        response->set_status_code(200);
 1282|    208|        response->set_finish_stream(true);
 1283|    208|        break;
 1284|      0|      }
 1285|  8.54k|    }
 1286|  8.54k|  }
 1287|  4.57k|  TrimRepeated(plan->mutable_actions(), retained_actions);
 1288|  4.57k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto11Http3ActionEEEEEvPT_m:
   62|  9.14k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   63|  9.14k|  const std::size_t size = static_cast<std::size_t>(field->size());
   64|  9.14k|  if (size > limit) {
  ------------------
  |  Branch (64:7): [True: 101, False: 9.04k]
  ------------------
   65|    101|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   66|    101|  }
   67|  9.14k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_117BoundHttp3HeadersIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto11Http3HeaderEEEEEvPT_mPm:
  997|  7.69k|void BoundHttp3Headers(RepeatedHeaders* headers, std::size_t count_limit, std::size_t* remaining_bytes) {
  998|  7.69k|  TrimRepeated(headers, count_limit);
  999|  7.69k|  std::size_t retained = 0;
 1000|  13.5k|  while (retained < static_cast<std::size_t>(headers->size()) && *remaining_bytes != 0) {
  ------------------
  |  Branch (1000:10): [True: 5.87k, False: 7.67k]
  |  Branch (1000:66): [True: 5.85k, False: 18]
  ------------------
 1001|  5.85k|    auto* header = headers->Mutable(static_cast<int>(retained));
 1002|  5.85k|    CanonicalizeHttp3HeaderName(header->mutable_name());
 1003|  5.85k|    CanonicalizeHttp3HeaderValue(header->mutable_value());
 1004|       |
 1005|  5.85k|    if (header->name().size() > *remaining_bytes) {
  ------------------
  |  Branch (1005:9): [True: 15, False: 5.84k]
  ------------------
 1006|     15|      header->mutable_name()->resize(*remaining_bytes);
 1007|     15|      header->clear_value();
 1008|  5.84k|    } else if (header->value().size() > *remaining_bytes - header->name().size()) {
  ------------------
  |  Branch (1008:16): [True: 3, False: 5.84k]
  ------------------
 1009|      3|      header->mutable_value()->resize(*remaining_bytes - header->name().size());
 1010|      3|    }
 1011|  5.85k|    *remaining_bytes -= header->name().size() + header->value().size();
 1012|  5.85k|    ++retained;
 1013|  5.85k|  }
 1014|  7.69k|  TrimRepeated(headers, retained);
 1015|  7.69k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto11Http3HeaderEEEEEvPT_m:
   62|  15.3k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   63|  15.3k|  const std::size_t size = static_cast<std::size_t>(field->size());
   64|  15.3k|  if (size > limit) {
  ------------------
  |  Branch (64:7): [True: 65, False: 15.3k]
  ------------------
   65|     65|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   66|     65|  }
   67|  15.3k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_127CanonicalizeHttp3HeaderNameEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  954|  5.85k|void CanonicalizeHttp3HeaderName(std::string* name) {
  955|  5.85k|  if (name->size() > scenario_limits::kMaxHttp3HeaderNameBytes) {
  ------------------
  |  Branch (955:7): [True: 22, False: 5.83k]
  ------------------
  956|     22|    name->resize(scenario_limits::kMaxHttp3HeaderNameBytes);
  957|     22|  }
  958|  5.85k|  if (name->empty()) {
  ------------------
  |  Branch (958:7): [True: 360, False: 5.49k]
  ------------------
  959|    360|    *name = "x-fuzz";
  960|    360|    return;
  961|    360|  }
  962|       |
  963|  63.3k|  for (char& byte : *name) {
  ------------------
  |  Branch (963:19): [True: 63.3k, False: 5.49k]
  ------------------
  964|  63.3k|    const unsigned char value = static_cast<unsigned char>(byte);
  965|  63.3k|    const bool alpha = (value >= 'A' && value <= 'Z') || (value >= 'a' && value <= 'z');
  ------------------
  |  Branch (965:25): [True: 24.5k, False: 38.8k]
  |  Branch (965:41): [True: 397, False: 24.1k]
  |  Branch (965:59): [True: 21.3k, False: 41.6k]
  |  Branch (965:75): [True: 19.5k, False: 1.75k]
  ------------------
  966|  63.3k|    const bool digit = value >= '0' && value <= '9';
  ------------------
  |  Branch (966:24): [True: 28.7k, False: 34.5k]
  |  Branch (966:40): [True: 4.21k, False: 24.5k]
  ------------------
  967|  63.3k|    const bool punctuation = value == '!' || value == '#' || value == '$' || value == '%' || value == '&' ||
  ------------------
  |  Branch (967:30): [True: 560, False: 62.8k]
  |  Branch (967:46): [True: 864, False: 61.9k]
  |  Branch (967:62): [True: 852, False: 61.0k]
  |  Branch (967:78): [True: 3.48k, False: 57.6k]
  |  Branch (967:94): [True: 628, False: 56.9k]
  ------------------
  968|  56.9k|                             value == '\'' || value == '*' || value == '+' || value == '-' || value == '.' ||
  ------------------
  |  Branch (968:30): [True: 574, False: 56.4k]
  |  Branch (968:47): [True: 992, False: 55.4k]
  |  Branch (968:63): [True: 320, False: 55.0k]
  |  Branch (968:79): [True: 25.1k, False: 29.9k]
  |  Branch (968:95): [True: 404, False: 29.5k]
  ------------------
  969|  29.5k|                             value == '^' || value == '_' || value == '`' || value == '|' || value == '~';
  ------------------
  |  Branch (969:30): [True: 344, False: 29.1k]
  |  Branch (969:46): [True: 554, False: 28.6k]
  |  Branch (969:62): [True: 1.88k, False: 26.7k]
  |  Branch (969:78): [True: 322, False: 26.4k]
  |  Branch (969:94): [True: 1.01k, False: 25.4k]
  ------------------
  970|  63.3k|    if (value >= 'A' && value <= 'Z') {
  ------------------
  |  Branch (970:9): [True: 24.5k, False: 38.8k]
  |  Branch (970:25): [True: 397, False: 24.1k]
  ------------------
  971|    397|      byte = static_cast<char>(value - 'A' + 'a');
  972|  62.9k|    } else if (!alpha && !digit && !punctuation) {
  ------------------
  |  Branch (972:16): [True: 43.4k, False: 19.5k]
  |  Branch (972:26): [True: 39.1k, False: 4.21k]
  |  Branch (972:36): [True: 1.23k, False: 37.9k]
  ------------------
  973|  1.23k|      byte = '-';
  974|  1.23k|    }
  975|  63.3k|  }
  976|  5.49k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_128CanonicalizeHttp3HeaderValueEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  981|  5.85k|void CanonicalizeHttp3HeaderValue(std::string* value) {
  982|  5.85k|  if (value->size() > scenario_limits::kMaxHttp3HeaderValueBytes) {
  ------------------
  |  Branch (982:7): [True: 0, False: 5.85k]
  ------------------
  983|      0|    value->resize(scenario_limits::kMaxHttp3HeaderValueBytes);
  984|      0|  }
  985|   691k|  for (char& byte : *value) {
  ------------------
  |  Branch (985:19): [True: 691k, False: 5.85k]
  ------------------
  986|   691k|    const unsigned char character = static_cast<unsigned char>(byte);
  987|   691k|    if ((character < 0x20U && character != '\t') || character == 0x7fU) {
  ------------------
  |  Branch (987:10): [True: 4.10k, False: 686k]
  |  Branch (987:31): [True: 1.06k, False: 3.04k]
  |  Branch (987:53): [True: 385, False: 689k]
  ------------------
  988|  1.44k|      byte = ' ';
  989|  1.44k|    }
  990|   691k|  }
  991|  5.85k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_127CanonicalizeHttp3StreamRoleEPN4curl6fuzzer5proto15Http3StreamRoleE:
 1017|  1.72k|void CanonicalizeHttp3StreamRole(curl::fuzzer::proto::Http3StreamRole* role) {
 1018|  1.72k|  switch (*role) {
 1019|  1.58k|    case curl::fuzzer::proto::HTTP3_STREAM_RESPONSE:
  ------------------
  |  Branch (1019:5): [True: 1.58k, False: 138]
  ------------------
 1020|  1.60k|    case curl::fuzzer::proto::HTTP3_STREAM_CONTROL:
  ------------------
  |  Branch (1020:5): [True: 20, False: 1.70k]
  ------------------
 1021|  1.61k|    case curl::fuzzer::proto::HTTP3_STREAM_QPACK_ENCODER:
  ------------------
  |  Branch (1021:5): [True: 12, False: 1.70k]
  ------------------
 1022|  1.63k|    case curl::fuzzer::proto::HTTP3_STREAM_QPACK_DECODER:
  ------------------
  |  Branch (1022:5): [True: 20, False: 1.70k]
  ------------------
 1023|  1.63k|      return;
 1024|     86|    default:
  ------------------
  |  Branch (1024:5): [True: 86, False: 1.63k]
  ------------------
 1025|     86|      *role = curl::fuzzer::proto::HTTP3_STREAM_RESPONSE;
 1026|     86|      return;
 1027|  1.72k|  }
 1028|  1.72k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_117BoundHttp3RawDataEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPm:
 1030|  1.94k|void BoundHttp3RawData(std::string* data, std::size_t* remaining_raw_bytes) {
 1031|  1.94k|  const std::size_t limit = std::min(scenario_limits::kMaxHttp3RawWriteBytes, *remaining_raw_bytes);
 1032|  1.94k|  if (data->size() > limit) {
  ------------------
  |  Branch (1032:7): [True: 10, False: 1.93k]
  ------------------
 1033|     10|    data->resize(limit);
 1034|     10|  }
 1035|  1.94k|  *remaining_raw_bytes -= data->size();
 1036|  1.94k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_126CanonicalizeHttp3AuthorityEPN4curl6fuzzer5proto8ScenarioE:
   95|  19.9k|void CanonicalizeHttp3Authority(curl::fuzzer::proto::Scenario* scenario) {
   96|  19.9k|  const std::string& host_path = scenario->host_path();
   97|  19.9k|  if (!scenario->http3_plan().use_h1_connect_udp_proxy() || host_path.empty() || host_path.front() != '[') {
  ------------------
  |  Branch (97:7): [True: 4.57k, False: 15.3k]
  |  Branch (97:61): [True: 115, False: 15.2k]
  |  Branch (97:82): [True: 3.43k, False: 11.7k]
  ------------------
   98|  8.12k|    CanonicalizeTlsAuthority(scenario);
   99|  8.12k|    return;
  100|  8.12k|  }
  101|  11.7k|  const std::size_t suffix_start = host_path.find_first_of("/?#");
  102|  11.7k|  scenario->set_host_path(std::string("[::1]") +
  103|  11.7k|                          (suffix_start == std::string::npos ? "/" : host_path.substr(suffix_start)));
  ------------------
  |  Branch (103:28): [True: 18, False: 11.7k]
  ------------------
  104|  11.7k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_131CanonicalizeTlsCertificateChainEPN4curl6fuzzer5proto8ScenarioE:
  122|  19.9k|void CanonicalizeTlsCertificateChain(curl::fuzzer::proto::Scenario* scenario) {
  123|  19.9k|  switch (scenario->tls_certificate_chain()) {
  124|  19.6k|    case curl::fuzzer::proto::TLS_CERTIFICATE_CHAIN_DEFAULT_EC:
  ------------------
  |  Branch (124:5): [True: 19.6k, False: 315]
  ------------------
  125|  19.8k|    case curl::fuzzer::proto::TLS_CERTIFICATE_CHAIN_ALL_KEY_TYPES:
  ------------------
  |  Branch (125:5): [True: 282, False: 19.6k]
  ------------------
  126|  19.8k|      return;
  127|     33|    default:
  ------------------
  |  Branch (127:5): [True: 33, False: 19.8k]
  ------------------
  128|     33|      scenario->clear_tls_certificate_chain();
  129|     33|      return;
  130|  19.9k|  }
  131|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_118RemoveApiOnlyShapeEPN4curl6fuzzer5proto8ScenarioE:
 1566|  19.9k|void RemoveApiOnlyShape(curl::fuzzer::proto::Scenario* scenario) { scenario->clear_api_plan(); }
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_120RemoveMultiOnlyShapeEPN4curl6fuzzer5proto8ScenarioE:
 1570|  19.9k|void RemoveMultiOnlyShape(curl::fuzzer::proto::Scenario* scenario) { scenario->clear_multi_plan(); }
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_121RemoveTelnetOnlyShapeEPN4curl6fuzzer5proto8ScenarioE:
 1556|  19.9k|void RemoveTelnetOnlyShape(curl::fuzzer::proto::Scenario* scenario) {
 1557|  19.9k|  scenario->clear_telnet_options();
 1558|  19.9k|  if (scenario->has_upload() && scenario->upload().terminal() == curl::fuzzer::proto::UPLOAD_TERMINAL_PAUSE) {
  ------------------
  |  Branch (1558:7): [True: 954, False: 18.9k]
  |  Branch (1558:33): [True: 1, False: 953]
  ------------------
 1559|      1|    scenario->mutable_upload()->set_terminal(curl::fuzzer::proto::UPLOAD_TERMINAL_EOF);
 1560|      1|  }
 1561|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_124CanonicalizeTlsAuthorityEPN4curl6fuzzer5proto8ScenarioE:
   82|  8.12k|void CanonicalizeTlsAuthority(curl::fuzzer::proto::Scenario* scenario) {
   83|  8.12k|  const std::string& host_path = scenario->host_path();
   84|  8.12k|  const std::size_t suffix_start = host_path.find_first_of("/?#");
   85|  8.12k|  if (suffix_start == std::string::npos) {
  ------------------
  |  Branch (85:7): [True: 659, False: 7.46k]
  ------------------
   86|    659|    scenario->set_host_path("tls.test/");
   87|    659|    return;
   88|    659|  }
   89|  7.46k|  scenario->set_host_path("tls.test" + host_path.substr(suffix_start));
   90|  7.46k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_117BoundStringValuesIN6google8protobuf16RepeatedPtrFieldINSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEEEEvPT_mm:
  602|   133k|void BoundStringValues(RepeatedBytes* values, std::size_t count_limit, std::size_t value_limit) {
  603|   133k|  TrimRepeated(values, count_limit);
  604|   133k|  for (std::string& value : *values) {
  ------------------
  |  Branch (604:27): [True: 16.5k, False: 133k]
  ------------------
  605|  16.5k|    if (value.size() > value_limit) {
  ------------------
  |  Branch (605:9): [True: 17, False: 16.4k]
  ------------------
  606|     17|      value.resize(value_limit);
  607|     17|    }
  608|  16.5k|  }
  609|   133k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimRepeatedIN6google8protobuf16RepeatedPtrFieldIN4curl6fuzzer5proto10ConnectionEEEEEvPT_m:
   62|  19.9k|void TrimRepeated(RepeatedField* field, std::size_t limit) {
   63|  19.9k|  const std::size_t size = static_cast<std::size_t>(field->size());
   64|  19.9k|  if (size > limit) {
  ------------------
  |  Branch (64:7): [True: 0, False: 19.9k]
  ------------------
   65|      0|    field->DeleteSubrange(static_cast<int>(limit), static_cast<int>(size - limit));
   66|      0|  }
   67|  19.9k|}
target_policy.cc:_ZN12proto_fuzzer12_GLOBAL__N_112TrimMetadataEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   71|  76.3k|void TrimMetadata(std::string* value) {
   72|  76.3k|  if (value->size() > scenario_limits::kMaxMetadataBytes) {
  ------------------
  |  Branch (72:7): [True: 24, False: 76.3k]
  ------------------
   73|     24|    value->resize(scenario_limits::kMaxMetadataBytes);
   74|     24|  }
   75|  76.3k|}

_ZN12proto_fuzzer10RunModeForENS_13TargetProfileE:
  146|  9.96k|constexpr ScenarioRunMode RunModeFor(TargetProfile profile) {
  147|  9.96k|  switch (profile) {
  ------------------
  |  Branch (147:11): [True: 9.96k, False: 0]
  ------------------
  148|      0|    case TargetProfile::kFastHttp:
  ------------------
  |  Branch (148:5): [True: 0, False: 9.96k]
  ------------------
  149|      0|    case TargetProfile::kFastTelnet:
  ------------------
  |  Branch (149:5): [True: 0, False: 9.96k]
  ------------------
  150|      0|    case TargetProfile::kFastIpfs:
  ------------------
  |  Branch (150:5): [True: 0, False: 9.96k]
  ------------------
  151|      0|      return ScenarioRunMode::kFastProtocol;
  152|       |
  153|      0|    case TargetProfile::kApi:
  ------------------
  |  Branch (153:5): [True: 0, False: 9.96k]
  ------------------
  154|      0|      return ScenarioRunMode::kApiLifecycle;
  155|       |
  156|      0|    case TargetProfile::kMulti:
  ------------------
  |  Branch (156:5): [True: 0, False: 9.96k]
  ------------------
  157|      0|      return ScenarioRunMode::kMultiTransfer;
  158|       |
  159|      0|    case TargetProfile::kFastHttps:
  ------------------
  |  Branch (159:5): [True: 0, False: 9.96k]
  ------------------
  160|      0|      return ScenarioRunMode::kTlsCoverage;
  161|       |
  162|      0|    case TargetProfile::kFastSecureWebSocket:
  ------------------
  |  Branch (162:5): [True: 0, False: 9.96k]
  ------------------
  163|      0|      return ScenarioRunMode::kTlsWebSocketCoverage;
  164|       |
  165|      0|    case TargetProfile::kHttpsH2:
  ------------------
  |  Branch (165:5): [True: 0, False: 9.96k]
  ------------------
  166|      0|      return ScenarioRunMode::kTlsHttp2Coverage;
  167|       |
  168|      0|    case TargetProfile::kFastHttp2:
  ------------------
  |  Branch (168:5): [True: 0, False: 9.96k]
  ------------------
  169|      0|      return ScenarioRunMode::kHttp2Coverage;
  170|       |
  171|  9.96k|    case TargetProfile::kFastHttp3:
  ------------------
  |  Branch (171:5): [True: 9.96k, False: 0]
  ------------------
  172|  9.96k|      return ScenarioRunMode::kHttp3Coverage;
  173|       |
  174|      0|    case TargetProfile::kH2Proxy:
  ------------------
  |  Branch (174:5): [True: 0, False: 9.96k]
  ------------------
  175|      0|      return ScenarioRunMode::kH2ProxyCoverage;
  176|       |
  177|      0|    case TargetProfile::kProxyTransport:
  ------------------
  |  Branch (177:5): [True: 0, False: 9.96k]
  ------------------
  178|      0|      return ScenarioRunMode::kProxyTransportCoverage;
  179|       |
  180|      0|    case TargetProfile::kResolver:
  ------------------
  |  Branch (180:5): [True: 0, False: 9.96k]
  ------------------
  181|      0|      return ScenarioRunMode::kResolverCoverage;
  182|       |
  183|      0|    case TargetProfile::kFastFtp:
  ------------------
  |  Branch (183:5): [True: 0, False: 9.96k]
  ------------------
  184|      0|      return ScenarioRunMode::kFtpCoverage;
  185|       |
  186|      0|    case TargetProfile::kFastTftp:
  ------------------
  |  Branch (186:5): [True: 0, False: 9.96k]
  ------------------
  187|      0|      return ScenarioRunMode::kTftpCoverage;
  188|       |
  189|      0|    case TargetProfile::kFastSmtp:
  ------------------
  |  Branch (189:5): [True: 0, False: 9.96k]
  ------------------
  190|      0|      return ScenarioRunMode::kSmtpCoverage;
  191|       |
  192|      0|    case TargetProfile::kFastImap:
  ------------------
  |  Branch (192:5): [True: 0, False: 9.96k]
  ------------------
  193|      0|      return ScenarioRunMode::kImapCoverage;
  194|       |
  195|      0|    case TargetProfile::kFastPop3:
  ------------------
  |  Branch (195:5): [True: 0, False: 9.96k]
  ------------------
  196|      0|      return ScenarioRunMode::kPop3Coverage;
  197|       |
  198|      0|    case TargetProfile::kFastMqtt:
  ------------------
  |  Branch (198:5): [True: 0, False: 9.96k]
  ------------------
  199|      0|      return ScenarioRunMode::kMqttCoverage;
  200|       |
  201|      0|    case TargetProfile::kFastDict:
  ------------------
  |  Branch (201:5): [True: 0, False: 9.96k]
  ------------------
  202|      0|      return ScenarioRunMode::kDictCoverage;
  203|       |
  204|      0|    case TargetProfile::kFastGopher:
  ------------------
  |  Branch (204:5): [True: 0, False: 9.96k]
  ------------------
  205|      0|      return ScenarioRunMode::kGopherCoverage;
  206|       |
  207|      0|    case TargetProfile::kFastFile:
  ------------------
  |  Branch (207:5): [True: 0, False: 9.96k]
  ------------------
  208|      0|      return ScenarioRunMode::kFileCoverage;
  209|       |
  210|      0|    case TargetProfile::kFastLdap:
  ------------------
  |  Branch (210:5): [True: 0, False: 9.96k]
  ------------------
  211|      0|      return ScenarioRunMode::kLdapCoverage;
  212|       |
  213|      0|    case TargetProfile::kFastRtsp:
  ------------------
  |  Branch (213:5): [True: 0, False: 9.96k]
  ------------------
  214|      0|      return ScenarioRunMode::kRtspCoverage;
  215|       |
  216|      0|    case TargetProfile::kCompatibility:
  ------------------
  |  Branch (216:5): [True: 0, False: 9.96k]
  ------------------
  217|      0|    case TargetProfile::kFastWebSocket:
  ------------------
  |  Branch (217:5): [True: 0, False: 9.96k]
  ------------------
  218|      0|    case TargetProfile::kTiming:
  ------------------
  |  Branch (218:5): [True: 0, False: 9.96k]
  ------------------
  219|      0|      return ScenarioRunMode::kProtocolCoverage;
  220|       |
  221|      0|    case TargetProfile::kDeepHttp:
  ------------------
  |  Branch (221:5): [True: 0, False: 9.96k]
  ------------------
  222|      0|      return ScenarioRunMode::kDeepHttpCoverage;
  223|  9.96k|  }
  224|      0|  return ScenarioRunMode::kProtocolCoverage;
  225|  9.96k|}

_ZN12proto_fuzzer15TransferSessionC2Ev:
   77|  9.96k|TransferSession::TransferSession() = default;
_ZN12proto_fuzzer15TransferSessionD2Ev:
   78|  9.96k|TransferSession::~TransferSession() { Close(); }
_ZN12proto_fuzzer15TransferSession10InitializeEv:
   82|  9.96k|bool TransferSession::Initialize() {
   83|  9.96k|  if (!easy_) {
  ------------------
  |  Branch (83:7): [True: 9.96k, False: 0]
  ------------------
   84|  9.96k|    easy_.reset(curl_easy_init());
   85|  9.96k|  }
   86|  9.96k|  return easy_ != nullptr;
   87|  9.96k|}
_ZNK12proto_fuzzer15TransferSession4easyEv:
   91|  9.91k|CURL* TransferSession::easy() const { return easy_.get(); }
_ZN12proto_fuzzer15TransferSession13ApplyBaselineERKN4curl6fuzzer5proto8ScenarioE:
   96|  9.91k|void TransferSession::ApplyBaseline(const curl::fuzzer::proto::Scenario& scenario) {
   97|  9.91k|  if (easy_) {
  ------------------
  |  Branch (97:7): [True: 9.91k, False: 0]
  ------------------
   98|       |    // Apply the new pointer before releasing the previous list.
   99|  9.91k|    connect_to_ = ApplyBaselineOptions(easy_.get(), scenario.scheme(), scenario.trace_ids(), scenario.trace_config());
  100|  9.91k|  }
  101|  9.91k|}
_ZN12proto_fuzzer15TransferSession17PrepareInputFilesERKN4curl6fuzzer5proto8ScenarioENS_15ScenarioRunModeE:
  119|  9.96k|bool TransferSession::PrepareInputFiles(const curl::fuzzer::proto::Scenario& scenario, ScenarioRunMode mode) {
  120|  9.96k|  if (easy_) {
  ------------------
  |  Branch (120:7): [True: 0, False: 9.96k]
  ------------------
  121|      0|    return false;
  122|      0|  }
  123|  9.96k|  if (mode != ScenarioRunMode::kFileCoverage && mode != ScenarioRunMode::kDeepHttpCoverage &&
  ------------------
  |  Branch (123:7): [True: 9.96k, False: 0]
  |  Branch (123:49): [True: 9.96k, False: 0]
  ------------------
  124|  9.96k|      mode != ScenarioRunMode::kTlsCoverage) {
  ------------------
  |  Branch (124:7): [True: 9.96k, False: 0]
  ------------------
  125|  9.96k|    return true;
  126|  9.96k|  }
  127|      0|  parser_inputs_ = std::make_unique<ParserInputs>();
  128|      0|  if (mode == ScenarioRunMode::kFileCoverage) {
  ------------------
  |  Branch (128:7): [True: 0, False: 0]
  ------------------
  129|      0|    const std::size_t size = std::min(scenario.file_source().size(), scenario_limits::kMaxFileInputBytes);
  130|      0|    return parser_inputs_->file_source.Write(reinterpret_cast<const std::uint8_t*>(scenario.file_source().data()),
  131|      0|                                             size);
  132|      0|  }
  133|      0|  std::size_t remaining_bytes = scenario_limits::kMaxFileInputTotalBytes;
  134|      0|  if (mode == ScenarioRunMode::kDeepHttpCoverage) {
  ------------------
  |  Branch (134:7): [True: 0, False: 0]
  ------------------
  135|      0|    PrepareInputFile(scenario.cookie_file(), &remaining_bytes, &parser_inputs_->cookie);
  136|      0|    PrepareInputFile(scenario.altsvc_file(), &remaining_bytes, &parser_inputs_->altsvc);
  137|      0|    PrepareInputFile(scenario.hsts_file(), &remaining_bytes, &parser_inputs_->hsts);
  138|      0|    PrepareInputFile(scenario.netrc_file(), &remaining_bytes, &parser_inputs_->netrc, true);
  139|      0|  } else {
  140|      0|    PrepareInputFile(scenario.crl_file(), &remaining_bytes, &parser_inputs_->crl);
  141|      0|    PrepareInputFile(scenario.pinned_public_key_file(), &remaining_bytes, &parser_inputs_->pinned_public_key);
  142|      0|    if (scenario.tls_client_credential_profile() == curl::fuzzer::proto::TLS_CLIENT_CREDENTIAL_VALID_PEM &&
  ------------------
  |  Branch (142:9): [True: 0, False: 0]
  ------------------
  143|      0|        TlsClientCredentialFilesRequired()) {
  ------------------
  |  Branch (143:9): [True: 0, False: 0]
  ------------------
  144|      0|      const bool certificate_ready = parser_inputs_->client_certificate.Write(
  145|      0|          reinterpret_cast<const std::uint8_t*>(tls_test_credentials::kCertificatePem),
  146|      0|          sizeof(tls_test_credentials::kCertificatePem) - 1);
  147|      0|      const bool key_ready = parser_inputs_->client_private_key.Write(
  148|      0|          reinterpret_cast<const std::uint8_t*>(tls_test_credentials::kPrivateKeyPem),
  149|      0|          sizeof(tls_test_credentials::kPrivateKeyPem) - 1);
  150|      0|      if (!certificate_ready || !key_ready) {
  ------------------
  |  Branch (150:11): [True: 0, False: 0]
  |  Branch (150:33): [True: 0, False: 0]
  ------------------
  151|      0|        return false;
  152|      0|      }
  153|      0|    }
  154|      0|  }
  155|      0|  return true;
  156|      0|}
_ZN12proto_fuzzer15TransferSession15ApplyInputFilesEv:
  166|  9.91k|void TransferSession::ApplyInputFiles() {
  167|  9.91k|  if (!easy_ || !parser_inputs_) {
  ------------------
  |  Branch (167:7): [True: 0, False: 9.91k]
  |  Branch (167:17): [True: 9.91k, False: 0]
  ------------------
  168|  9.91k|    return;
  169|  9.91k|  }
  170|      0|  if (const char* path = parser_inputs_->cookie.path()) {
  ------------------
  |  Branch (170:19): [True: 0, False: 0]
  ------------------
  171|      0|    (void)curl_easy_setopt(easy_.get(), CURLOPT_COOKIEFILE, path);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  172|      0|  }
  173|       |  // Alt-Svc/HSTS use one option for input and cleanup output. Load first,
  174|       |  // then restore the fixed sink; both loaders retain earlier file entries.
  175|      0|  if (const char* path = parser_inputs_->altsvc.path()) {
  ------------------
  |  Branch (175:19): [True: 0, False: 0]
  ------------------
  176|      0|    (void)curl_easy_setopt(easy_.get(), CURLOPT_ALTSVC, path);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  177|      0|    (void)curl_easy_setopt(easy_.get(), CURLOPT_ALTSVC, kDevNullPath);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  178|      0|  }
  179|      0|  if (const char* path = parser_inputs_->hsts.path()) {
  ------------------
  |  Branch (179:19): [True: 0, False: 0]
  ------------------
  180|      0|    (void)curl_easy_setopt(easy_.get(), CURLOPT_HSTS, path);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  181|      0|    (void)curl_easy_setopt(easy_.get(), CURLOPT_HSTS, kDevNullPath);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  182|      0|  }
  183|      0|  if (const char* path = parser_inputs_->netrc.path()) {
  ------------------
  |  Branch (183:19): [True: 0, False: 0]
  ------------------
  184|      0|    (void)curl_easy_setopt(easy_.get(), CURLOPT_NETRC_FILE, path);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  185|      0|    (void)curl_easy_setopt(easy_.get(), CURLOPT_NETRC, CURL_NETRC_REQUIRED);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  186|      0|  }
  187|      0|  if (const char* path = parser_inputs_->crl.path()) {
  ------------------
  |  Branch (187:19): [True: 0, False: 0]
  ------------------
  188|      0|    (void)curl_easy_setopt(easy_.get(), CURLOPT_CRLFILE, path);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  189|      0|  }
  190|      0|}
_ZN12proto_fuzzer15TransferSession24ApplyPinnedPublicKeyFileEv:
  195|  9.91k|void TransferSession::ApplyPinnedPublicKeyFile() {
  196|  9.91k|  if (!easy_ || !parser_inputs_) {
  ------------------
  |  Branch (196:7): [True: 0, False: 9.91k]
  |  Branch (196:17): [True: 9.91k, False: 0]
  ------------------
  197|  9.91k|    return;
  198|  9.91k|  }
  199|      0|  if (const char* path = parser_inputs_->pinned_public_key.path()) {
  ------------------
  |  Branch (199:19): [True: 0, False: 0]
  ------------------
  200|      0|    (void)curl_easy_setopt(easy_.get(), CURLOPT_PINNEDPUBLICKEY, path);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  201|      0|  }
  202|      0|}
_ZN12proto_fuzzer15TransferSession22ConfigureAltSvcRoutingERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
  219|  9.91k|void TransferSession::ConfigureAltSvcRouting(const std::string& host_path) {
  220|  9.91k|  if (!easy_ || !parser_inputs_ || parser_inputs_->altsvc.path() == nullptr ||
  ------------------
  |  Branch (220:7): [True: 0, False: 9.91k]
  |  Branch (220:17): [True: 9.91k, False: 0]
  |  Branch (220:36): [True: 0, False: 0]
  ------------------
  221|  9.91k|      !HasCanonicalAltSvcAuthority(host_path)) {
  ------------------
  |  Branch (221:7): [True: 0, False: 0]
  ------------------
  222|  9.91k|    return;
  223|  9.91k|  }
  224|      0|  CurlSlistPtr resolve(curl_slist_append(nullptr, kAltSvcLoopbackResolve));
  225|      0|  if (!resolve || curl_easy_setopt(easy_.get(), CURLOPT_RESOLVE, resolve.get()) != CURLE_OK) {
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  |  Branch (225:7): [True: 0, False: 0]
  |  Branch (225:19): [True: 0, False: 0]
  ------------------
  226|      0|    return;
  227|      0|  }
  228|       |  // Adopt only after installation; failures leave the previous list alive.
  229|      0|  altsvc_resolve_ = std::move(resolve);
  230|      0|  if (curl_easy_setopt(easy_.get(), CURLOPT_RESOLVER_START_FUNCTION, &AbortUnexpectedAltSvcResolve) == CURLE_OK) {
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  |  Branch (230:7): [True: 0, False: 0]
  ------------------
  231|       |    // CONNECT_TO takes precedence over Alt-Svc. Only detach it when the
  232|       |    // wildcard host cache and fail-closed resolver callback are installed.
  233|      0|    (void)curl_easy_setopt(easy_.get(), CURLOPT_CONNECT_TO, nullptr);
  ------------------
  |  | 3364|      0|  curl_easy_setopt curl_exactly_three_arguments(handle, opt, param)
  |  |  ------------------
  |  |  |  | 3362|      0|#define curl_exactly_three_arguments(a, b, c) (a, b, c)
  |  |  ------------------
  ------------------
  234|      0|  }
  235|      0|}
_ZN12proto_fuzzer15TransferSession18InstallRequestDataERKN4curl6fuzzer5proto8ScenarioEb:
  242|  9.91k|                                                         bool apply_resolve_entries) {
  243|  9.91k|  if (!easy_ || request_data_) {
  ------------------
  |  Branch (243:7): [True: 0, False: 9.91k]
  |  Branch (243:17): [True: 0, False: 9.91k]
  ------------------
  244|      0|    return nullptr;
  245|      0|  }
  246|  9.91k|  request_data_.emplace(easy_.get(), scenario, apply_resolve_entries);
  247|  9.91k|  return &*request_data_;
  248|  9.91k|}
_ZN12proto_fuzzer15TransferSession5CloseEv:
  263|  9.96k|void TransferSession::Close() {
  264|  9.96k|  request_data_.reset();
  265|  9.96k|  easy_.reset();
  266|  9.96k|  api_lifecycle_.reset();
  267|  9.96k|  altsvc_resolve_.reset();
  268|  9.96k|  connect_to_.reset();
  269|  9.96k|  parser_inputs_.reset();
  270|  9.96k|}

_ZN12proto_fuzzer23SerializeWebSocketFrameERKN4curl6fuzzer5proto14WebSocketFrameE:
   59|  3.84k|std::string SerializeWebSocketFrame(const curl::fuzzer::proto::WebSocketFrame& frame) {
   60|  3.84k|  std::string out;
   61|  3.84k|  const std::string& payload = frame.payload();
   62|  3.84k|  const std::size_t payload_len = payload.size();
   63|       |
   64|       |  // Byte 0: FIN | RSV1 | RSV2 | RSV3 | opcode(4 bits).
   65|  3.84k|  std::uint8_t byte0 = 0;
   66|  3.84k|  if (frame.fin()) byte0 |= 0x80;
  ------------------
  |  Branch (66:7): [True: 210, False: 3.63k]
  ------------------
   67|  3.84k|  if (frame.rsv1()) byte0 |= 0x40;
  ------------------
  |  Branch (67:7): [True: 213, False: 3.63k]
  ------------------
   68|  3.84k|  if (frame.rsv2()) byte0 |= 0x20;
  ------------------
  |  Branch (68:7): [True: 154, False: 3.69k]
  ------------------
   69|  3.84k|  if (frame.rsv3()) byte0 |= 0x10;
  ------------------
  |  Branch (69:7): [True: 166, False: 3.68k]
  ------------------
   70|  3.84k|  byte0 |= static_cast<std::uint8_t>(frame.opcode() & 0x0F);
   71|  3.84k|  out.push_back(static_cast<char>(byte0));
   72|       |
   73|       |  // Byte 1: MASK bit | payload-length indicator (7 bits).
   74|  3.84k|  const std::uint32_t length_form = ResolveLengthForm(frame.length_form(), payload_len);
   75|  3.84k|  std::uint8_t byte1 = frame.masked() ? 0x80 : 0x00;
  ------------------
  |  Branch (75:24): [True: 601, False: 3.24k]
  ------------------
   76|  3.84k|  switch (length_form) {
   77|  2.99k|    case kLenForm7:
  ------------------
  |  Branch (77:5): [True: 2.99k, False: 856]
  ------------------
   78|       |      // Clamp the 7-bit length to the payload's actual size. If the payload
   79|       |      // is > 125 bytes and the caller forced 7-bit form, low 7 bits of size
   80|       |      // are what the decoder sees — which is exactly the malformed-frame
   81|       |      // path we want to reach.
   82|  2.99k|      byte1 |= static_cast<std::uint8_t>(payload_len & 0x7F);
   83|  2.99k|      out.push_back(static_cast<char>(byte1));
   84|  2.99k|      break;
   85|    268|    case kLenForm16:
  ------------------
  |  Branch (85:5): [True: 268, False: 3.57k]
  ------------------
   86|    268|      byte1 |= 126;
   87|    268|      out.push_back(static_cast<char>(byte1));
   88|    268|      AppendBigEndian(&out, static_cast<std::uint64_t>(payload_len & 0xFFFF), 2);
   89|    268|      break;
   90|    588|    case kLenForm64:
  ------------------
  |  Branch (90:5): [True: 588, False: 3.25k]
  ------------------
   91|    588|    default:
  ------------------
  |  Branch (91:5): [True: 0, False: 3.84k]
  ------------------
   92|    588|      byte1 |= 127;
   93|    588|      out.push_back(static_cast<char>(byte1));
   94|    588|      AppendBigEndian(&out, static_cast<std::uint64_t>(payload_len), 8);
   95|    588|      break;
   96|  3.84k|  }
   97|       |
   98|       |  // Masking key (4 bytes) and XORed payload. Client-to-server frames must be
   99|       |  // masked per spec; server-to-client frames must NOT — but we emit whatever
  100|       |  // the scenario says, so the decoder's "masked server frame" error path is
  101|       |  // reachable.
  102|  3.84k|  if (frame.masked()) {
  ------------------
  |  Branch (102:7): [True: 601, False: 3.24k]
  ------------------
  103|    601|    const std::uint32_t key = frame.mask_key();
  104|    601|    std::uint8_t key_bytes[4] = {
  105|    601|        static_cast<std::uint8_t>((key >> 24) & 0xFF),
  106|    601|        static_cast<std::uint8_t>((key >> 16) & 0xFF),
  107|    601|        static_cast<std::uint8_t>((key >> 8) & 0xFF),
  108|    601|        static_cast<std::uint8_t>(key & 0xFF),
  109|    601|    };
  110|  2.40k|    for (unsigned char b : key_bytes) {
  ------------------
  |  Branch (110:26): [True: 2.40k, False: 601]
  ------------------
  111|  2.40k|      out.push_back(static_cast<char>(b));
  112|  2.40k|    }
  113|    601|    out.reserve(out.size() + payload_len);
  114|   447k|    for (std::size_t i = 0; i < payload_len; ++i) {
  ------------------
  |  Branch (114:29): [True: 447k, False: 601]
  ------------------
  115|   447k|      out.push_back(static_cast<char>(static_cast<std::uint8_t>(payload[i]) ^ key_bytes[i & 0x3]));
  116|   447k|    }
  117|  3.24k|  } else {
  118|  3.24k|    out.append(payload);
  119|  3.24k|  }
  120|       |
  121|  3.84k|  return out;
  122|  3.84k|}
ws_frame.cc:_ZN12proto_fuzzer12_GLOBAL__N_117ResolveLengthFormEjm:
   30|  3.84k|std::uint32_t ResolveLengthForm(std::uint32_t form, std::size_t payload_len) {
   31|  3.84k|  if (form == kLenForm7 || form == kLenForm16 || form == kLenForm64) {
  ------------------
  |  Branch (31:7): [True: 48, False: 3.79k]
  |  Branch (31:28): [True: 71, False: 3.72k]
  |  Branch (31:50): [True: 588, False: 3.14k]
  ------------------
   32|    707|    return form;
   33|    707|  }
   34|  3.14k|  if (payload_len < 126) {
  ------------------
  |  Branch (34:7): [True: 2.94k, False: 197]
  ------------------
   35|  2.94k|    return kLenForm7;
   36|  2.94k|  }
   37|    197|  if (payload_len <= 0xFFFF) {
  ------------------
  |  Branch (37:7): [True: 197, False: 0]
  ------------------
   38|    197|    return kLenForm16;
   39|    197|  }
   40|      0|  return kLenForm64;
   41|    197|}
ws_frame.cc:_ZN12proto_fuzzer12_GLOBAL__N_115AppendBigEndianEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEmm:
   44|    856|void AppendBigEndian(std::string* out, std::uint64_t value, std::size_t width) {
   45|  6.09k|  for (std::size_t i = 0; i < width; ++i) {
  ------------------
  |  Branch (45:27): [True: 5.24k, False: 856]
  ------------------
   46|  5.24k|    std::size_t shift = (width - 1 - i) * 8;
   47|  5.24k|    out->push_back(static_cast<char>((value >> shift) & 0xFF));
   48|  5.24k|  }
   49|    856|}

